Jump to content

Can't add to cart products with two combinations with diferent minimal quantity


oriol@sbss.es

Recommended Posts

Hi,

We think that there's a bug in Prestashop 1.7.x.

We have a product with several combinations (supouse red and yellow). The mínimum order quantity for red variant is 100 units, and only 1 unit for yellow variant.

When you select red variant, order quantity changes to 100, then select yellow variant. Order quantity doesn't change, changed manually to 1 unit.

Then add to cart. The button does nothing but is enabled.

If we change again to red variant, order quantity changes and the button works.

 

We've tested this behaviour in PS 1.7.3.0 (customized with theme and modules) and in a new installation of PS 1.7.4.0 without any customization.

 

Does anyone found this problem?

Any workaround?

Any idea that what code we change?

 

Thanks

Link to comment
Share on other sites

OK, after three days we've found it.

 

In Themes/core.js, near line 2640 look for this code:

if (!isNaN(minimalProductQuantity) && quantity_wanted < minimalProductQuantity && eventType !== 'updatedProductQuantity') {
         quantityInput.attr('min', minimalProductQuantity);
         quantityInput.val(minimalProductQuantity);
          }

 

Then add this line after closing brackets:
          quantityInput.attr('min', minimalProductQuantity);

 

Clean cache.

 

Tested in PS 1.7.4

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...