Shopping cart empty! (22 posts)

  • Profile picture of Joy Joy said 2 years ago:

    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?

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 2 years ago:

    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

  • Profile picture of Joy Joy said 2 years ago:

    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/

  • Profile picture of Joy Joy said 2 years ago:

    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

  • Profile picture of Joy Joy said 2 years ago:

    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?

  • Profile picture of Sam Sam said 2 years ago:

    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

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 2 years ago:

    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

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 2 years ago:

    Hi @joyously

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

    Talk soon

  • Profile picture of Joy Joy said 2 years ago:

    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().

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 2 years ago:

    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

  • Profile picture of Joy Joy said 2 years ago:

    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!

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 2 years ago:

    Hi @joyously

    Great news!!

    Talk soon

  • Profile picture of Jean-Francois Arseneault Jean-Francois Arseneault said 1 year, 11 months ago:

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

  • Profile picture of Steve Steve said 1 year, 10 months ago:

    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

  • Profile picture of okapi okapi said 1 year, 5 months ago:

    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

Running WordPress & TheCartPress eCommerce Plugin.