I thing a good feature is that if there only available 10 units of product our customer can't add 11 or more to the cart. I know that is checked on the Checkout process, but I think it will be better to check available units just when the customer press the add to cart button.
After read the thread http://forum.opencart.com/viewtopic.php ... 0&p=244632 I tried to make this changes on version 1.5.4.1 and edit the /catalog/controller/checkout/cart.php as follows
What I get?
Well, the product is not added to the cart if quantity is greater than stock, but no warning message are showing up.
I think I'm near to the solution but I'm not an expert so Can anybody give me a clue?
Code: Select all
if ($product_info) {
if (isset($this->request->post['quantity'])) {
$quantity = $this->request->post['quantity'];
} else {
$quantity = 1;
}
// lpccoder mod - check stock before add to cart
if ($product_info['quantity'] < $quantity) {
$json['error']['warning'] = sprintf($this->language->get('error_understock'), $product_info['quantity']);
}
// End lpccoder mod
Well, the product is not added to the cart if quantity is greater than stock, but no warning message are showing up.
I think I'm near to the solution but I'm not an expert so Can anybody give me a clue?
Who is online
Users browsing this forum: No registered users and 1 guest