Shopping cart empty!

This topic contains 21 replies, has 9 voices, and was last updated by  fsureau 1 year, 4 months ago.

  • Author
    Posts
  • #547

    Joy
    Participant

    I thought it was the beta 1.0.9, but it’s working on my local test site.
    I add a product to the cart and the amount and number of items shows in the sidebar shopping cart summary widget. But when I go to the shopping cart page or the checkout page, they say the cart is empty — and the widget shows 0 like it’s empty.

    This is only happening on my real site, not my local test site. There is a slight PHP version difference between the two. The database contains the same products (imported SQL to load the site).
    What can I look for to see why the numbers are not remembered in the cart?

  • #3210

    Inigo
    Participant

    Hi @joyously

    I have changes the session_start function to the constructor….and I think this is not ok…..

    Please could you move the sentence if ( ! session_id() ) session_start(); from line 60 to 54.

    Best regards

  • #3211

    Joy
    Participant

    No, because it works just fine on my local machine.
    I reverted the real site to version 1.0.8 last night and it still did not work. (although I didn’t close my browser, so I don’t know about session stuff). I put the beta 1.0.9 back on.

    http://gourmetpopcornshop.com/wp/

  • #3212

    Joy
    Participant

    Could it be related to this error? I don’t get this on my local machine, although I have the states plugin activated there too. Well, I tried it with the states deactivated and the shopping cart is still empty.

    Error: jQuery is not defined
    Source File: http://gourmetpopcornshop.com/wp/wp-content/plugins/thecartpress-states/js/tcp_state_scripts.js?ver=6514
    Line: 43

  • #3213

    Joy
    Participant

    I just found this in my error log (had a hard time finding the log on the new server):

    [warn] mod_fcgid: stderr: PHP Warning: session_start() [function.session-start]: open(/var/lib/php/session/sess_64ihpf0a0q0o0rbiot54onjvb5, O_RDWR) failed: Permission denied (13) in /usr/local/plesk/apache/vhosts/gourmetpopcornshop.com/httpdocs/wp/wp-content/plugins/thecartpress/TheCartPress.class.php on line 60

    I can get this fixed but is there something you could warn about if that call fails so the user will know?

  • #3214

    Sam
    Member

    Joy, I have a similar problem with an item added to the cart but when going to the cart it is empty. In fact, any page change showed an empty cart. This happens on IE7 but not IE9 so I’m assuming, at least to some extent, part of the problem is with IE7, or perhaps even lower versions. The problem there is that a lot of people still use IE7 so a shopping cart always emptying itself is not good.

    Thanks,
    Sam

  • #3215

    Inigo
    Participant

    Hi @joyously

    Thanks @books, but I have the same trouble in the Joy’s site and I’m using FireFox. WordPress is stateless, but TheCartPress uses the Session to save the order, so the server doesn’t support Session.

    I think the problem is the mod_fcgid. The Apache Server doesn’t store the session between pages. I’m going to study this issue a little.

    Talk soon

  • #3216

    Inigo
    Participant

    Hi @joyously

    Could you deactivate the mod_fcgid? I think this server property could be deactivate from the plesk.

    Talk soon

  • #3217

    Joy
    Participant

    Sensei,
    I don’t think I can affect much of anything from Plesk. I can’t even find out what versions of PHP or MySQL or Apache are running. I asked them to fix the permissions problem and they said I need to store the session data in a different directory. I think it is a PHP setting though because the code is not specifying where to store it.
    It does seem like a good idea to check that the session stuff works on activation, so you could tell the admin that the setup is OK.

    My host says there is a function called session_save_path() that tells PHP where to save the session data. So I will add this to my theme functions file. But I just read the details of that function and it is supposed to be called before session_start().

  • #3218

    Inigo
    Participant

    Hi @joyousley,

    Could you modify your php.ini file? There are a configuration setting called session.save_path.
    Another option is to modify the wp-config.php file with the function session_save_path().

    Best regards

  • #3219

    Joy
    Participant

    I don’t know if I could get a php.ini working in the Plesk environment. But I was able to get the support guy to change it for the whole domain (2 actually) so all session variables are saved in a private directory above the web root.
    He wanted me to modify the software instead, but I searched the source and several other plugins use session variables too, so that seemed like a bad choice for sustainability.
    It works now!

  • #3220

    Inigo
    Participant

    Hi @joyously

    Great news!!

    Talk soon

  • #3221

    For me, it was a case of uploading the custom php.ini I had on my dev box, to the production server… duh…

  • #3222

    Steve
    Member

    Hi TCP Team

    Yes, I had my site moved to a server where I have successful TCP installations working, eg, capethomaswines.com.au is on the same server as colinandy.com.au but Colin’s site is not functioning, ie, has the empty cart issue.

    So, from my perspective, TCP is the logical variable.

    Is there a way to test whether the TCP installation was complete?

    Anyway, here is some server info (webcity.com.au is the host)

    Apache version 2.2.17
    PHP version 5.2.16
    MySQL version 5.0.92-community-log
    Architecture i686
    Operating system linux

    Regarding error logs, I have never had to look for them before, is there a common place I can find them? Or would it help if I offered you a temporary user access code to the site/host?

    Steve

  • #3223

    okapi
    Member

    Hi everyone,

    I have the same problem as Sam describes it.
    If there is no way to correct that, I’d loose many customers, since they can’t buy anything at my page…

    Regards
    Okapi

  • #3224

    Inigo
    Participant

    Hi Okapi,

    If you loses the session, you have to take a look to your server configuration, about php sessions.

    Best regards

  • #3225

    jfriesen
    Member
  • #3226

    automation
    Member

    TCP – Is this where i leave a question or request help? i have added and configured the tcp, but each time a customer tries to view thier cart after adding an item, it says the cart is empty?

    http://www.bubbablazehayesbikes.com

    can someone help me here?

  • #3227

    fsureau
    Member

    Hi,

    I have another strange behavior.

    When I’m connected as Admin in WordPress, I can put products in my cart. But when a client (not logged in) tries to add a product, the cart is always empty…

    Any idea ? Thanks!

    Florian.

    Thecartepress version: 1.2.4,
    Wordpress version: 3.4.2

  • #3228

    fsureau
    Member

    I have desactivated and reactivated the plugin and that’s fine…

    Is there somebidy to tell me why I have to do this ??

    Thanks.

  • #3229

    Joy
    Participant

    There is some code that only runs on activation, which is standard for upgrading (deativate, delete, install new version, reactivate). Perhaps the session variables are involved in that code.

  • #3230

    fsureau
    Member

    But I have to do this every day!

    Please team I need your help…

You must be logged in to reply to this topic.