luismfbsilva061980 Posted November 4 Share Posted November 4 Good morning, I use PS 8.1.7 as follows: I can put the minimum sales value on the product sheet, e.g. 5, but then when added as a client it goes to 6 and not 10... Is there a way to increase the multiples? Ex. Min 2, 4, 6, 8, etc...? Link to comment Share on other sites More sharing options...
endriu107 Posted November 4 Share Posted November 4 Not by default. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted November 5 Share Posted November 5 Hi, To enforce a minimum quantity that increases in specific multiples (e.g., 2, 4, 6) in PrestaShop, you will likely need to adjust the logic in the cart and product controllers, as PrestaShop doesn't support quantity increments natively. You can try modifying the multiple by overriding the cart class. In your custom Cart.php override, add this function to check if the quantity matches the required multiple before it’s added to the cart. public function updateQty($quantity, $id_product, $id_product_attribute = null, $id_customization = null, $operator = 'up', $id_address_delivery = 0, $shop = null, $auto_add_cart_rule = true) { $multiple = 5; if ($quantity % $multiple != 0) { $quantity = ceil($quantity / $multiple) * $multiple; } return parent::updateQty($quantity, $id_product, $id_product_attribute, $id_customization, $operator, $id_address_delivery, $shop, $auto_add_cart_rule); } Please modify the above code according to your needs as it might require some modifications. Regards. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now