seb776 Posted February 27, 2015 Share Posted February 27, 2015 Heey, That's a nonsense to have multiple quantities of a virtual product (in most cases). Is there a trick/configuration to do this ? a small module ? Link to comment Share on other sites More sharing options...
NemoPS Posted February 27, 2015 Share Posted February 27, 2015 You mean you only want people to download the product once? Or just don't use quantities for it?If the latter, I'd honestly set an insane number like 9999999999 or simply disable stock management if you're only selling virtual products Link to comment Share on other sites More sharing options...
seb776 Posted March 17, 2015 Author Share Posted March 17, 2015 oops, sorry I missed your answer. Or just don't use quantities for it? That's it. It's not related to stocks quantities, Stock management is disable. It's related to the fact that a customer may add twice the same virtual product in it's cart. So he will it twice for the same product. But now I've just made a small free module ( http://prestashop.seb7.fr/shop/en/modules/2-limit-virtual-products-quantity.html ) 1 Link to comment Share on other sites More sharing options...
NemoPS Posted March 18, 2015 Share Posted March 18, 2015 oh, good job! Link to comment Share on other sites More sharing options...
xxMAGRAOxx Posted January 15, 2016 Share Posted January 15, 2016 Can you provide me access to code of your module? I'm in this situation at this time. I override the front controller CartController and listen the function processChangeProductInCart, but if i can see you code i will save many time. I'm not lazy man. My time is very, very short. THANKS!! Link to comment Share on other sites More sharing options...
xxMAGRAOxx Posted January 17, 2016 Share Posted January 17, 2016 Forget it. If you want to listen on add or update cart, use the hook actionCartSave and then $this->context->controller->errors[] = Tools::displayError('Max quantity is 1 for this product.', !Tools::getValue('ajax')); for show errors to the front. Is better than override, if you need to distribute your module. Link to comment Share on other sites More sharing options...
xxMAGRAOxx Posted January 17, 2016 Share Posted January 17, 2016 One simple contribution. There are one hook that is not listed on documentation and is exactly what i need at this moment. It is actionBeforeCartUpdateQty that is called (as the name says) BEFORE add or update product in cart. Oppose the actionCartSave that is called AFTER. 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