Cart empty after adding product (51 posts)

Topic tags: cart, empty cart, loop
  • Profile picture of Seer Zoltan Seer Zoltan said 1 year, 4 months ago:

    Hey guys, I can’t add products to cart, I’ve printed the $_POST variables on the cart page and it contains all information (post_id, tcp_count, etc), but the cart remains empty. I use a custom loop and I call the tcp_the_buy_button() function. Can this be a problem?

    P.S.: The page is on a local server, all the apache settings are on default.

    Regards,
    Zoltan

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 1 year, 4 months ago:

    Hi Zoltan,

    Have you take a look to the session? Your PHP installation must allow sessions, and your Internet browser must allow cookies.

    Best regards

  • Profile picture of Seer Zoltan Seer Zoltan said 1 year, 4 months ago:

    Hi Sensei,
    Thanks for your answer, but I think elsewhere is the problem. I’ve checked the php_info, it says the Session Support is enabled; the cookies are allowed by the browser. I’ve reinstalled with a clean wordpress install to another server, I still have the problem.
    http://bit.ly/wZElus – you can take a look.
    I’ve printed the $_SESSION variable, the ShoppingCart Object is there with the fields, but all of these are empty.
    What do you recommend?

    Zoltan

  • Profile picture of Joy Joy said 1 year, 4 months ago:

    It sounds like the problem I had. It was the session directory that was not writable.

    http://community.thecartpress.com/groups/development/forum/topic/shopping-cart-empty/

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 1 year, 4 months ago:

    Cool site!!!

  • Profile picture of Seer Zoltan Seer Zoltan said 1 year, 4 months ago:

    Hi Joy,
    I don’t think that is the problem because:
    1. The session are created when the getShoppingCart() method is called in the TheCartPress.class (in the session directory will be a new file when a new session is started). I’ve tested it making a new session, put some values in it, and it’s working. That’s why I don’t understand the cart session why remains empty.
    2. I think the default option is writable for the session directory.

    First, if I put something in the cart, $this->shopping_cart_items[$shopping_cart_id] = $sci; (ShoppingCart.class line 59) sets the details in the shopping_cart_items array… But I don’t find when this array gets into the session. Could you help me in this please, maybe with this I can find the problem.

    Regards,
    Zoltan

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 1 year, 4 months ago:

    Hi Seer,

    In TheCartPress.class.php we execute “$shoppingCart = TheCartPress::getShoppingCart();”
    So, all the modifications applied to this variable ($shoppingCart) will be saved in the session.

    Be sure to use the latest version of PHP.

    Best regards

  • Profile picture of Seer Zoltan Seer Zoltan said 1 year, 4 months ago:

    Hi Sensei,
    Thanks. I noticed that the wp_head() method is not running. The script never reach this method, but I don’t know where is called. I’ve made a call from the ShoppingCartPage.class in the constructor, now the cart is working. Adding products to the cart, modifying, deleting, everything. What do you think, it is good solution?

    Thanks,
    Zoltan

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 1 year, 4 months ago:

    Hi Zoltan,

    I don’t know….but perhaps your theme is not 100% compatible , or a plugin is not compatible…
    I prefer to test TheCartPress on a cleaned wordpress and activate, one by one, the theme and the rest of the plugins.

    Best regards

  • Profile picture of TCP Team / Luis TCP Team / Luis said 1 year, 4 months ago:

    Hi Zoltan,
    Does your theme have “wp_head()” in the header?

    http://josephscott.org/archives/2009/04/wordpress-theme-authors-dont-forget-the-wp_head-function/

    http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

    Best Regards

  • Profile picture of Seer Zoltan Seer Zoltan said 1 year, 4 months ago:

    TCP_team,
    Thank you, I’ve forgot about the wp_head in the header. At least now I know the whole TCP system :)
    It’s a great, smartly built plugin.
    Thanks again!

    Regards,
    Zoltan Seer

  • Profile picture of Steve P. Steve P. said 1 year ago:

    NEED HELP ASAP – Just installed the recent update to TheCartPress and now items are not going into the cart… site is http://www.testdrivetech.net I have not changed ANYTHING in the default files.. Please help!

  • Profile picture of Inigo (aka Sensei) Inigo (aka Sensei) said 1 year ago:

    Hi Steve,

    I think your server doesn’t support session. Our extend site has the last version (1.0.9.1) and it’s running.

    Perhaps any change in your server configuration…

    Best regards

  • Profile picture of TCP Team / Luis TCP Team / Luis said 1 year ago:

    Hi Steve,
    I see your site.. It seems to be having a problem with session on your site.
    We have not detected this error in any of our installations or those of our customers..
    Could you disable other plugins to test for conflicts between plugins?
    Please let us know

  • Profile picture of labuenapipa labuenapipa said 1 year ago:

    Hi Sensei.
    I got the same problem. After including one item in the cart and trying to make checkout the message of “your car is empty” appears. Just if it is helpful for fixing purposes I have the following plugins : :Qtranslate, Simple lightbox and Theme my login. I have tried to disable anyone of the three but the problem still exists. http://www.labuenapipa.com/delta/
    Regards
    Luis

Running WordPress & TheCartPress eCommerce Plugin.