[Skip to main content](#vessel-content)

#   Out of stock notification Plugin

##

- **[vanboke](/forum/user/4873-vanboke "View vanboke's Profile")**
- [![vanboke's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4873-vanboke "View vanboke's Profile") Topic Author
- [ Offline](/forum/user/4873-vanboke)

Less More

- Posts: 157
- Thank you received: 8
-
-

13 years 1 month ago [\#123072](#123072) by [vanboke](/forum/user/4873-vanboke "View vanboke's Profile")  *[Out of stock notification Plugin](/forum/2-general-talk-about-hikashop/861907-out-of-stock-notification-plugin#123072 "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 &#42; FROM '.hikashop&#95;table('product').' WHERE product&#95;quantitystock&#95;limit.' AND product&#95;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")* was created by *[vanboke](/forum/user/4873-vanboke "View vanboke's Profile")*

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&lt;'.(int)$this-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg2MTkwNy1vdXQtb2Ytc3RvY2stbm90aWZpY2F0aW9uLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 1 month ago [\#123097](#123097) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Out of stock notification Plugin](/forum/2-general-talk-about-hikashop/861907-out-of-stock-notification-plugin#123097 "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 &#42; FROM '.hikashop&#95;table('product').' WHERE product&#95;quantitystock&#95;limit.' AND product&#95;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")*

Hi,

Right, you can edit the plugin directly and use this query Code:

$query = 'SELECT * FROM '.hikashop_table('product').' WHERE '. ' product_quantity &lt; '.(int)$this-&gt;stock_limit.' AND product_published = 1 AND product_quantity != -1 '. ' AND (product_sale_start = 0 OR product_sale_start &lt; '.time().') AND (product_sale_end = 0 OR product_sale_end &gt; '.time().')';

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,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg2MTkwNy1vdXQtb2Ytc3RvY2stbm90aWZpY2F0aW9uLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[vanboke](/forum/user/4873-vanboke "View vanboke's Profile")**
- [![vanboke's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4873-vanboke "View vanboke's Profile") Topic Author
- [ Offline](/forum/user/4873-vanboke)

Less More

- Posts: 157
- Thank you received: 8
-
-

13 years 1 month ago [\#123240](#123240) by [vanboke](/forum/user/4873-vanboke "View vanboke's Profile")  Replied by *[vanboke](/forum/user/4873-vanboke "View vanboke's Profile")* on topic *[Out of stock notification Plugin](/forum/2-general-talk-about-hikashop/861907-out-of-stock-notification-plugin#123240 "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 &#42; FROM '.hikashop&#95;table('product').' WHERE product&#95;quantitystock&#95;limit.' AND product&#95;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")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg2MTkwNy1vdXQtb2Ytc3RvY2stbm90aWZpY2F0aW9uLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.058 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
