Jump to content

Increase quantity in cart 6 by 6, or 12 by 12 (sells by units, boxes of 6 and 12)


Recommended Posts

I hope someone can guide me or tell me which code I should modify. My shop sells products by units, and also boxes of 6 units and boxes of 12. Therefore I created the products and then I added for each product combinations for 1 unit, 6 units and 12 units. Each one of them with minimum quantity of 1, 6 and 12 respectively.

 

I want that if someone, for example, add to the cart a box of 6 (6 units), that in attempting to increase the quantity, it does not increase by one but by 6. This means that if I try to increase the amount instead of moving into 7, it would move into 12. Same for the case of 12.

 

Another alternative would be that if a box of 6 units is added to the cart, if you increase the quantity, it would move into 7 units, charging the price for a box of 6 plus the price of a single unit (the unit is cheaper the more units you have in the box). And while increasing the quantity one by one, when this move into 12, the price of the box of 12 would be charged (not the price of a box of 6 and 6 single units).

Link to comment
Share on other sites

Attributes would be a pretty "Dirty" solution for this, as you add an unnecessary feature to your products.

 

The "Cleaner" solution would be to modify (override) the Cart->updateQty() function and force the quantity to behave the way you want.

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