Hi all,
I have been searching high and low for a solution to this.
Problem:
I would like to display a warning to the users of the website if they enter a quantity which exceeds the available stock. This is similar to the warning shown when you are in the checkout, however I do not want them to get as far as adding to the cart if they are trying to order too many items.
Solution:
I am looking for something which will display 1) a error message and 2) not add the item to the shopping cart if Product total is greater than the available quantity.
Any suggestions would be appreciated, apologies if it has been asked before - I did do a search.
Cheers
V1.5.2 (With Vqmod installed)
[Edit: I do have this Vqmod installed - http://www.opencart.com/index.php?route ... order=DESC
which works perfectly for fixed maximum quantity limits, however if there is a way to change this so that it also reads the quantity figure from the product table that would be good too]
To get you going...
Edit ../catalog/controller/checkout/cart.php.
Find
Directly below ADD:
You'll need to change the warning message though.
Seems to work.
Edit ../catalog/controller/checkout/cart.php.
Find
Code: Select all
if ($product_info['minimum'] > ($product_total + $quantity)) {
$json['error']['warning'] = sprintf($this->language->get('error_minimum'), $product_info['name'], $product_info['minimum']);
}
Code: Select all
if ($product_info['quantity'] < ($product_total + $quantity)) {
$json['error']['warning'] = sprintf($this->language->get('error_minimum'), $product_info['name'], $product_info['minimum']);
}
Seems to work.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
try this free extension https://karimzi.blogspot.com/2021/06/op ... ntity.html
I hope you will get solution.
I hope you will get solution.
Who is online
Users browsing this forum: No registered users and 121 guests