Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    help question Add To Cart abnormal behaviour

    Hi,

    I am suddenly having some weird behaviour.

    I haven't installed any new plugins, or changed anything for that matter in the files.

    When I add to cart, the default setting is to add the product to the cart, and redirect back to the product info page that you were on.

    After this, the add to cart sidebox is populated as well.

    Now all of a sudden, the sidebox remains as if the cart is empty. If I was to visit another link on the site, then suddenly, the add to cart sidebox is populated.

    I go back to the product page, add to cart again, and the quantity stays on 1. I visit another page, the quantity then shows 2 as it should.

    Any ideas I'm lost. I don't see any errors in my logs or any such thing.

  2. #2
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Add To Cart abnormal behaviour

    Okay, so upon further inspection, I've noticed this:

    The shopping cart sidebox, and the shopping cart page, do not update the contents of the cart, or the quantities of the cart.

    If the About Us page was loaded with 1x ProductA inside the cart, it will always show that. Even if you add another 1x ProductA, or add 1x ProductB - it will only show 1x ProductA.

    If however I visit the..Contact Us page, it will then show the additional 1x ProductA and 1x ProductB that was added.

    I don't get this issue. At first I thought browser cache and so on, but a few customers have complained already.

    This is really weird.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,956
    Plugin Contributions
    96

    Default Re: Add To Cart abnormal behaviour

    A link to your site (which really, really needs to be upgraded) would help us help you.

  4. #4
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Add To Cart abnormal behaviour

    Lol i'm so sorry - that's the reason I didn't want to post a link.

    I've already got my 1.5.4 rebuild and just waiting for a few things to me rectified.

    But I think I've figured out the issue lat9!

    Here is a brand new install of 1.5.4 on my host:
    http://fatcats.co.za/July2015/

    Right, now go to the only product there is, and add to cart.

    Once done, you will be redirected to the shopping cart page.

    Easiest way to replicate the problem is, while you're on the shopping cart page, adjust the quantity. So change it from 1, to 2, and then click the little blue arrows.

    Watch what happens to the quantity after you click the blue arrows. It reverts back to 1.

    This is a server issue no?

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,956
    Plugin Contributions
    96

    Default Re: Add To Cart abnormal behaviour

    How is that product defined? What is the product's quantity? What are its min/max/units settings?

    What are your settings for Configuration->Stock?

  6. #6
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Add To Cart abnormal behaviour

    Hi lat9,

    1000 quantity.

    Max: 0, Min 1, Qty Units 1.

    This is a basic straightforward install of Zen-Cart 1.5.4.

    All I did was add one normal product, and put the quantity of that product to 1000. Nothing else was changed or done.

    The same issue occurring on this new install, and happening on my actual site, doesn't this suggest that the problem has nothing to do with my configuration, and nothing to do with how my products are set up, but instead, this seems to be some sort of issue with my host.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,956
    Plugin Contributions
    96

    Default Re: Add To Cart abnormal behaviour

    Make a backup copy of /includes/classes/shopping_cart.php and then edit that file. Locate this section (towards the top):
    Code:
      /**
       * set to TRUE to see debug messages for developer use when troubleshooting add/update cart
       * Then, Logout/Login to reset cart for change
       * @var string
       */
      var $display_debug_messages = FALSE;
      var $flag_duplicate_msgs_set = FALSE;
    and change that to:
    Code:
      /**
       * set to TRUE to see debug messages for developer use when troubleshooting add/update cart
       * Then, Logout/Login to reset cart for change
       * @var string
       */
      var $display_debug_messages = true;
      var $flag_duplicate_msgs_set = FALSE;
    That will cause shopping-cart debug messages to be displayed in the "messageStack".

  8. #8
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Add To Cart abnormal behaviour

    Quote Originally Posted by lat9 View Post
    Make a backup copy of /includes/classes/shopping_cart.php and then edit that file. Locate this section (towards the top):
    Code:
      /**
       * set to TRUE to see debug messages for developer use when troubleshooting add/update cart
       * Then, Logout/Login to reset cart for change
       * @var string
       */
      var $display_debug_messages = FALSE;
      var $flag_duplicate_msgs_set = FALSE;
    and change that to:
    Code:
      /**
       * set to TRUE to see debug messages for developer use when troubleshooting add/update cart
       * Then, Logout/Login to reset cart for change
       * @var string
       */
      var $display_debug_messages = true;
      var $flag_duplicate_msgs_set = FALSE;
    That will cause shopping-cart debug messages to be displayed in the "messageStack".

    Tried this out, doesn't show any errors in the message stack.

    The thing is, it is adding the additional products (or updated quantities) to the cart, but this isn't reflecting on pages that have already been visited.

    So if you update the quantity, in the shopping cart page, it will show as 1. But if you were to visit another page, other than the shopping cart page, or the product info page of the product you updated the quantity for, and scroll down to look at the sidebox shopping cart, then you will see the actual quantities you updated to. Also, if for example, you updated quantity to 2, and visit the Conditions of Use page, you will see 2 in the shopping cart sidebox.

    But if you go back to shopping cart page, and update quantity to 3 for example, and go back to conditions of use, you will see the 2 only. Then you have to visit a completely different page, to see the actual 3. If that makes sense.

    I noticed something else quite funny as well.

    If I continue to the checkout process, and put the following in the special instructions box: "hello" and 'hello' and `hello` <---exactly like this with those exact punctuation marks and all of the "and"'s in their place - it throws a 403 forbidden error when you try to continue checkout.

    This is very odd stuff - but it's most definitely my hosting. I've already informed them and asked them to check what's going on.

    Also, they did reply, saying they think its a mod_security issue related to AJAX. But i've told them there's no ajax being used in the problems that are occurring.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Add To Cart abnormal behaviour

    Your host is caching the output generated by PHP, so things are not showing up in real-time.

    Get your host to disable whatever caching service is interrupting normal operation.

    Specs: www.eli teho st.co.za/hosting#2
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Add To Cart abnormal behaviour

    Thanks DrByte!

    I was googling my entire life away before you replied.

    I read something about hosts setting up something called Varnish Cache incorrectly - which could cause this issue.

    I will inform my host of your solution.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Change add to cart button behaviour
    By wilorc in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Sep 2009, 06:55 AM
  2. Erratic behaviour - cart has a mind of its own!
    By blind1 in forum General Questions
    Replies: 2
    Last Post: 31 Jul 2009, 05:05 AM
  3. Add to Cart - Change Behaviour
    By noisebug in forum General Questions
    Replies: 2
    Last Post: 11 Feb 2008, 06:10 PM
  4. Shopping cart went abnormal
    By Black-Wolf in forum General Questions
    Replies: 3
    Last Post: 16 Sep 2006, 02:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg