- Posts: 157
- Thank you received: 8
Out of stock notification Plugin
13 years 2 weeks ago #123072
by vanboke
Out of stock notification Plugin was created by vanboke
I was wondering if there was a way to change the Out of Stock Notification Plugin, so that it only triggers on published products. At the moment it is triggering on both published and unpublished products.
I assume it would be done by changing this line:
$query='SELECT * FROM '.hikashop_table('product').' WHERE product_quantity<'.(int)$this->stock_limit.' AND product_quantity!=-1';
Any ideas would be appreciated.
Thanks,
Eric
-- url of the page with the problem -- : N/A
-- HikaShop version -- : 2.2.1
-- Joomla version -- : 1.5.26
-- PHP version -- : 5.3.17
-- Browser(s) name and version -- : N/A
-- Error-message(debug-mod must be tuned on) -- : N/A
I assume it would be done by changing this line:
$query='SELECT * FROM '.hikashop_table('product').' WHERE product_quantity<'.(int)$this->stock_limit.' AND product_quantity!=-1';
Any ideas would be appreciated.
Thanks,
Eric
-- url of the page with the problem -- : N/A
-- HikaShop version -- : 2.2.1
-- Joomla version -- : 1.5.26
-- PHP version -- : 5.3.17
-- Browser(s) name and version -- : N/A
-- Error-message(debug-mod must be tuned on) -- : N/A
Please Log in or Create an account to join the conversation.
13 years 2 weeks ago #123097
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Out of stock notification Plugin
Hi,
Right, you can edit the plugin directly and use this query
So only the published products and the products which are currently sold will be checked.
I will submit this patch and see with Nicolas if it's good for him. But I think that we will include it in the official plugin.
Regards,
Right, you can edit the plugin directly and use this query
Code:
$query = 'SELECT * FROM '.hikashop_table('product').' WHERE '.
' product_quantity < '.(int)$this->stock_limit.' AND product_published = 1 AND product_quantity != -1 '.
' AND (product_sale_start = 0 OR product_sale_start < '.time().') AND (product_sale_end = 0 OR product_sale_end > '.time().')';
I will submit this patch and see with Nicolas if it's good for him. But I think that we will include it in the official plugin.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
13 years 2 weeks ago #123240
by vanboke
Replied by vanboke on topic Out of stock notification Plugin
Thank you for that. I thought of the "product_published = 1" but not the check to see if the item is scheduled to be for sale. That was a great addition, and covers all bases. I am glad to hear that that change will be included in the official plugin going forward.
Thanks for everything.
Thanks for everything.
Please Log in or Create an account to join the conversation.
Time to create page: 0.151 seconds