1

We have products as pack. Lets say 8 coke canes. So users can add any quantity as multiple of 8.

For doing this we enabled Enable Qty Increments and entered Qty Increments as 8. And this functionality works fine.

What we need is user enter any quantity which is not a multiple of 8, quantity should be updated as next nearest 8 multiples.

I checked with any observers available before updating it. But no luck.

0

You can use the event

sales_quote_product_add_after 

which is triggered before the new items are saved, so that you can use

$item->getOrigData('qty') to get the original quantity.

The event has one parameter, items which is an array

and you can update it accordingly your inventory.

hope this will work for you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.