it would be nice to add a function that checks product quantity when adding product to cart... opencart 1.5.1.3 does not have this function... you can easily add ie.100 units of a product into cart regardless of product availibility in stock... to be specific: there's 5 units of a product in stock but it doesn't prevetn user to insert greater value than that in quantity field on product page... i think you see my point here...
(1.5.x)
1. EDIT: catalog/controller/checkout/cart.php
2. FIND:
3. BEFORE, ADD:
4. EDIT: catalog/language/english/checkout/cart.php
5. FIND:
6. AFTER, ADD:
1. EDIT: catalog/controller/checkout/cart.php
2. FIND:
Code: Select all
if ($product_info['minimum'] > ($product_total + $quantity)) {
Code: Select all
if ($product_info['quantity'] < $quantity) {
$json['error']['warning'] = sprintf($this->language->get('error_understock'), $product_info['quantity']);
}
5. FIND:
Code: Select all
$_['error_minimum'] = 'Minimum order amount for %s is %s!';
Code: Select all
$_['error_understock'] = 'Requested quantity greater than stock quantity: %s!';
Hi
I was wondering the same thing.
on the product page, i can enter 0 qty and message comes up:
Success: You have added ''product'' to your shopping cart!
I was wondering the same thing.
on the product page, i can enter 0 qty and message comes up:
Success: You have added ''product'' to your shopping cart!
Hi ,
Just realised that I had a problem with this code. When I have options in products, I need to check for the quantity from the options.
How do I modify the code to check the quantity from options when I have at least one option for a product.
Tried few variations, based on my measly knowledge of OC and php...but nothing is working.
Please help.
Regards,
FM
Just realised that I had a problem with this code. When I have options in products, I need to check for the quantity from the options.
How do I modify the code to check the quantity from options when I have at least one option for a product.
Tried few variations, based on my measly knowledge of OC and php...but nothing is working.
Please help.
Regards,
FM
This is exactly what I am looking for, however, the code above does not work for me.
in catalog/controller/checkout/cart.php
I do not have the line:
if ($product_info['minimum'] > ($product_total + $quantity)) {
instead, I have:
if ($product['minimum'] > $product_total) {
when I place the edited code above by Qphoria, nothing happens. I'm sure it is just a simple fix and I just need to change a couple of words. If anyone could help, that would be great.
Thanks
ritaylo3
in catalog/controller/checkout/cart.php
I do not have the line:
if ($product_info['minimum'] > ($product_total + $quantity)) {
instead, I have:
if ($product['minimum'] > $product_total) {
when I place the edited code above by Qphoria, nothing happens. I'm sure it is just a simple fix and I just need to change a couple of words. If anyone could help, that would be great.
Thanks
ritaylo3
I have the same problenritaylo3 wrote:This is exactly what I am looking for, however, the code above does not work for me.
in catalog/controller/checkout/cart.php
I do not have the line:
if ($product_info['minimum'] > ($product_total + $quantity)) {
instead, I have:
if ($product['minimum'] > $product_total) {
when I place the edited code above by Qphoria, nothing happens. I'm sure it is just a simple fix and I just need to change a couple of words. If anyone could help, that would be great.
Thanks
ritaylo3
anyone ?
Hmm i checked it but i cant still find it....jdunneirl wrote:Look down further around line 369ish
Can someone please help me to add an alert message on the product page.
If the product quantity entered is 0, an error message "Quantity entered is 0, no products have been added to the cart!"
At the moment, when the product quantity is 0, nothing is added to the cart but there is no notification.
Thank you for you any assistance.
(OC v1.5.5.1)
If the product quantity entered is 0, an error message "Quantity entered is 0, no products have been added to the cart!"
At the moment, when the product quantity is 0, nothing is added to the cart but there is no notification.
Thank you for you any assistance.
(OC v1.5.5.1)
I have already dealt with this by way of a new extension that builds on top of my max quantity one.
Currently, the new extension deals with preventing adding to cart of too few products, too many products or more products than are in stock by way of the following:
Not released yet, still testing and tweaking but should be ready this week sometime.
Currently, the new extension deals with preventing adding to cart of too few products, too many products or more products than are in stock by way of the following:
- - Minimum order quantity validation / warning message on product page and cart;
- Maximum order quantity validation / warning message on product page and cart;
- Stock quantity validation / warning message on product page;
- Options Stock validation / warning message (displays warning for option with lowest available stock) on product page;
Not released yet, still testing and tweaking but should be ready this week sometime.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
It's nearly done, some more testing to do yet but very close.lyochum1 wrote:Can you let me know when you have this ready?
Quantity check on minimum input field on product page
I have it working at the moment on a test site, have a play with the following products:
http://vger.co.uk/two/index.php?route=p ... duct_id=44
http://vger.co.uk/two/index.php?route=p ... duct_id=30
http://vger.co.uk/two/index.php?route=p ... duct_id=48
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
Now available here: http://www.opencart.com/index.php?route ... n_id=13703
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
Who is online
Users browsing this forum: No registered users and 3 guests