jacksfregio Posted July 10, 2017 Share Posted July 10, 2017 (edited) Hi, my website allow backorder, but I want to add (I think in Cartcontroller.php) a control to check if a customer order more than in stock of a product and warn it of the delay. At this time, if someone write directly the product quantity in the box and click to Add to Cart button, no message appears, and order proceed. Only in the e-mail thereis notification about the delay. I wrote this override, but it does not work: class CartController extends CartControllerCore { $warning_qty = 0; $prod_qty = StockAvailable::getQuantityAvailableByProduct($this->id_product); // Check product quantity availability if ( $prod_qty < $qty_to_check ) { $warning_qty = Tools::displayErrors('There isn\'t enough product in stock.', !Tools::getValue('ajax')); } } Thanks for the help Edited July 13, 2017 by jacksfregio (see edit history) 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