Post by lpccoder » Wed Dec 05, 2012 10:44 pm

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.

Newbie

Posts

Joined
Fri Mar 12, 2010 5:06 pm

Post by lpccoder » Fri Jan 04, 2013 12:46 am

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

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
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?

Newbie

Posts

Joined
Fri Mar 12, 2010 5:06 pm

Post by valicuinfo » Fri Feb 01, 2013 4:55 pm

Hello,
I'm having the same problem. How did you solved it?

Newbie

Posts

Joined
Fri Feb 01, 2013 4:53 pm

Post by valicuinfo » Fri Feb 01, 2013 5:42 pm

I have the same problem. Did you solved it?

Newbie

Posts

Joined
Fri Feb 01, 2013 4:53 pm
Who is online

Users browsing this forum: No registered users and 3 guests