Post by danfan12 » Wed Apr 17, 2019 10:27 pm

Hello
I want to be able to add a warning or pop up when someone places an order for more quantity than we have on hand. We make our products so when we are out of stock, our product page availability changes to "pre-order" with a lead time that we designate per item.
So, if I person buys all our inventory, the next buyer sees that the item is pre-order with a 2 week lead time, for example.

However, if the first buyer purchases more than we have available, I want them to see a warning get a warning message stating that they are buying more than we have and the lead time will now be xxx.

How would I go about adding this? Any ideas?

Thanks

Newbie

Posts

Joined
Thu Apr 04, 2019 3:19 am

Post by D3MO » Thu Apr 18, 2019 4:32 am

when you want a notice to show up? once adding to cart or once added to cart in cart /checkout page?

Opencart Expert | voldemaras@gmail.com
Skype - programanija | Gtalk - voldemaras@gmail.com
Extensions for Opencart @ https://www.opencartextensions.eu / or Opencart Marketplace

Need Custom Module? debug third party module or simply have any question related to Opencart? feel free to contact directly for a live chat session:) - INSTANT LIVE CHAT


User avatar
Active Member

Posts

Joined
Mon Apr 04, 2011 6:57 am

Post by thekrotek » Thu Apr 18, 2019 5:19 am

There IS already such warning by default. But to actually make it work, the order should be placed and have Processing status. You can not and actually SHOULD NOT add this option live. I mean, if several customers added a particular product and their total quantity exceeds your stock, none of them should see any warnings. The right logic is already there don't change it.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by letxobnav » Thu Apr 18, 2019 4:08 pm

Currently a message is shown if the order quantity > stock quantity and you set "stock checkout" to NO and you want a warning.
in controller/checkout/cart.php

Code: Select all

			if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {
				$data['error_warning'] = $this->language->get('error_stock');
			} elseif (isset($this->session->data['error'])) {
				$data['error_warning'] = $this->session->data['error'];

				unset($this->session->data['error']);
			} else {
				$data['error_warning'] = '';
			}
You would have to show your message when the order quantity > stock quantity and you have set "stock checkout" to YES and you want a warning like.

Code: Select all

if (!$this->cart->hasStock() && ($this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {

 etc....
don't mind thekrotek, his english is not so good.

Crystal Light Centrum Taiwan


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm

Post by paulfeakins » Thu Apr 18, 2019 6:56 pm

danfan12 wrote:
Wed Apr 17, 2019 10:27 pm
However, if the first buyer purchases more than we have available, I want them to see a warning get a warning message stating that they are buying more than we have and the lead time will now be xxx.
Are you not concerned that your competitors could work out how much stock you have this way?

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by danfan12 » Fri Apr 19, 2019 12:35 am

thekrotek wrote:
Thu Apr 18, 2019 5:19 am
There IS already such warning by default. But to actually make it work, the order should be placed and have Processing status. You can not and actually SHOULD NOT add this option live. I mean, if several customers added a particular product and their total quantity exceeds your stock, none of them should see any warnings. The right logic is already there don't change it.
Hi, I am not sure why I wouldn't want a customer to know they are buying more than we have. It would extend the lead time from 2 days to maybe a month. Most sites I shop give some kind of warning if I try to order more than they have available - either by not allowing me to place the order or by letting me know the order will take longer to process.
I understand the quantity in my admin inventory not reducing until after the order has been processed; I wouldn't want that. Just a pop up or note with the advice.

Newbie

Posts

Joined
Thu Apr 04, 2019 3:19 am

Post by danfan12 » Fri Apr 19, 2019 12:44 am

paulfeakins wrote:
Thu Apr 18, 2019 6:56 pm
danfan12 wrote:
Wed Apr 17, 2019 10:27 pm
However, if the first buyer purchases more than we have available, I want them to see a warning get a warning message stating that they are buying more than we have and the lead time will now be xxx.
Are you not concerned that your competitors could work out how much stock you have this way?
Not at all. We've been doing this 15 years & have quite a niche market, and we are manufacturers so we're always making new inventory. Upset customers are more of a concern to me.

Newbie

Posts

Joined
Thu Apr 04, 2019 3:19 am

Post by danfan12 » Fri Apr 19, 2019 12:53 am

I'll add that a lot of our clients are contractors and are ordering for their own deadlines. Accurate lead times are important to them. If the warning tells them we don't have enough, they can make a decision whether or not to buy.
With the current option, unless we never run out (unlikely during busy seasons), someone is always going to be the one that gets inaccurate lead times and I am trying to limit that. Managing expectations of clients is much easier than managing disappointed ones.

Newbie

Posts

Joined
Thu Apr 04, 2019 3:19 am

Post by danfan12 » Fri Apr 19, 2019 12:57 am

letxobnav wrote:
Thu Apr 18, 2019 4:08 pm
Currently a message is shown if the order quantity > stock quantity and you set "stock checkout" to NO and you want a warning.
in controller/checkout/cart.php

Code: Select all

			if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {
				$data['error_warning'] = $this->language->get('error_stock');
			} elseif (isset($this->session->data['error'])) {
				$data['error_warning'] = $this->session->data['error'];

				unset($this->session->data['error']);
			} else {
				$data['error_warning'] = '';
			}
You would have to show your message when the order quantity > stock quantity and you have set "stock checkout" to YES and you want a warning like.

Code: Select all

if (!$this->cart->hasStock() && ($this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {

 etc....
don't mind thekrotek, his english is not so good.
Thanks so much! I will try that out.

Newbie

Posts

Joined
Thu Apr 04, 2019 3:19 am
Who is online

Users browsing this forum: No registered users and 29 guests