Results 1 to 4 of 4
  1. #1

    Default Problem with Product Qty Maximum not working

    Hello Folks:

    I am migrating to Zencart+beanstream from eSellerate. I've purchased the manual (and read it), and used this forum to solve many challenges so far... thank you to all for the excellent help!

    But... I've run into an odd problem, to which I've not found the answer yet:

    - I have a product for which I want the maximum # of items in the cart to be 1 (in this case, a downloadable product, implemented as recommended as an attribute)

    - I've set the Product Qty min/max/unit to 1.

    - I've set Products Quantity Box Shows to no.

    - Product is not virtual.

    - Using latest Zencart: 1.3.9h

    The problem is that when you add the product to the cart, then continue shopping and return to the product page, then add it again to the cart, I do not get the "The quantity added to your cart has been adjusted..." message for the cart, and the quantity is increased by one. One can keep doing this and the quantity keeps going up.

    I debugged shopping_cart.php, around line 1611, and found that $cart_qty is 0! $new_qty is 1, and $add_max is 1, as expected. The product id is correct too (I echoed them from line 1611 as a test to make sure.) As $cart_qty is coming back as 0 ($this->in_cart_mixed($_POST['products_id']), indeed the code below line 1611 will not trigger and will not restrict the addition as expected.

    I'm not familiar with the code enough to understand why this would be the case, but I have seen this work properly in other Zencart implementations, including the actual Zencart e-book store:

    My store, that demonstrates this is:

    Although I'm actively developing it, so it could change.

    I thought at some point early on that I had this working, but maybe I am mistaken. I've made NO code changes at all to the project (other than to debug this case.)

    I'm hoping some other setting change I've made related to this may be causing this problem. I've also tested it in a new browser session, even a different browser... no luck.

    Any guidance would be appreciated!


    Dan Pronovost

  2. #2

    Default Re: Problem with Product Qty Maximum not working

    Some additional observations on this bug:

    - I do have an attribute for this product, as it is a downloadable product (software)

    - If I remove this one attribute on the product, then the bug goes away: the quantity checking code seems to work fine then.

    - As soon as I add back the attribute (with defaults for that attribute's one value), then the bug comes back.

    - The "Product Priced by Attributes" field for the product is Off, as the guide recommends. I've tried it ON... no difference in behaviour.

    The code in shopping_cart.php, line 1394, 'in_cart_mixed' seems to relate to this problem. Debugging, I can see that it is executing line 1408, and then returning zero for the product count in the cart, no matter how many are in the cart.

    Any help would be appreciated!

    Dan Pronovost

  3. #3

    Default Re: Problem with Product Qty Maximum not working

    Well... a night's sleep and I was able to figure out what caused this bug (which I consider a Zencart bug).

    - The attribute I had for the download actually had two values: download, and CD. For some of my software, it can also be ordered by CD. I implemented this as a radio button option (download, or CD). For products (like the one in question demonstrating this bug) that are not available by CD, I figured I could just NOT add an attribute value setting for the CD option value, and only the first value.

    - In the Attribute Manager, I had only added the 'download' attribute value to the product in question. Not the 'CD' value.

    - Looking at the URL in the shopping cart, I can see that the product id was a big garbled long string in this case.

    - So, I removed the second attribute value 'CD', and the problem went away.

    I'll have to think of a different way to properly represent this concept of download/CD, with the 2nd value only available on some products.

    Dan Pronovost

  4. #4

    Default Re: Problem with Product Qty Maximum not working

    Well, it turns out that my last post on this issue was mistaken: the problem is caused NOT by having an option with two values, and a product that only sets one of them.

    The problem is if the product has the "Product Qty Min/Unit Mix" setting set to 'No'. It must be set to Yes, or this problem occurs.

    The Zencart e-book/docs are certainly not clear on this... in fact, they say the opposite for setting this setting to 'No': "...If Product Qty Min/Unit Mix is No. Besides adhering to the above quantity settings, customers are also limited to ordering tuna packed in one of the flavors only."



Similar Threads

  1. Product Qty Maximum Bulk Edit
    By townsend2009 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Sep 2011, 09:54 PM
  2. Set Product Qty Maximum for 1500 products?
    By GTrotter in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 15 Apr 2009, 03:19 AM
  3. How do I disable displaying the Product Qty Maximum?
    By jottoleivi in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Feb 2008, 07:13 PM
  4. Product Qty Maximum set to 1 but...
    By KTNaturals in forum General Questions
    Replies: 1
    Last Post: 19 Oct 2007, 02:18 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
Zen-Cart, Internet Selling Services, Klamath Falls, OR