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

#   How to disable a product when it is not for sale?

##

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

Less More

- Posts: 5
- Thank you received: 0
-
-

14 years 4 months ago [\#57824](#57824) by [gootty3](/forum/user/8017-gootty3 "View gootty3's Profile")  *[How to disable a product when it is not for sale?](/forum/4-how-to/57824-how-to-disable-a-product-when-it-is-not-for-sale#57824 "Hi all!:) Im new here. now my question:  how I can disable automatically when a product is not for sale more?  i need modify the php code no? but i dont get it.. so if someone can help me..I would be grateful! Bye! and Thanks!")* was created by *[gootty3](/forum/user/8017-gootty3 "View gootty3's Profile")*

Hi all!![:)](/media/kunena/emoticons/3.png ":)")
Im new here.
now my question:

how I can disable automatically when a product is not for sale more?

i need modify the php code no? but i dont get it.. so if someone can help me..I would be grateful!
Bye! and Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzU3ODI0LWhvdy10by1kaXNhYmxlLWEtcHJvZHVjdC13aGVuLWl0LWlzLW5vdC1mb3Itc2FsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 4 months ago [\#57834](#57834) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: How to disable a product when it is not for sale?](/forum/4-how-to/57824-how-to-disable-a-product-when-it-is-not-for-sale#57834 "Hi all!:) Im new here. now my question:  how I can disable automatically when a product is not for sale more?  i need modify the php code no? but i dont get it.. so if someone can help me..I would be grateful! Bye! and Thanks!")*

Hi gootty3,

To automatically disable a product not for sale anymore, simply go in HikaShop &gt; Configuration &gt; Display, and under the "Default parameters for products" tab, check no for the option: "Display out of stock products".

You can too disable produts manually in HikaShop &gt; Products, and unpublish the product by clicking on the published icon:
[ ![tmp&#95;2012-07-17-2.png](/forum/attachment/4827) ](/forum/attachment/4827 "...12-07-17-2.png")

- [ ![tmp&#95;2012-07-17-2.png](/forum/attachment/4827) ](/forum/attachment/4827 "...12-07-17-2.png") [ ](/forum/attachment/4827?download=1 "...12-07-17-2.png")

The following user(s) said Thank You: [gootty3](/forum/user/8017-gootty3 "View gootty3's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzU3ODI0LWhvdy10by1kaXNhYmxlLWEtcHJvZHVjdC13aGVuLWl0LWlzLW5vdC1mb3Itc2FsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 5
- Thank you received: 0
-
-

14 years 4 months ago [\#57860](#57860) by [gootty3](/forum/user/8017-gootty3 "View gootty3's Profile")  Replied by *[gootty3](/forum/user/8017-gootty3 "View gootty3's Profile")* on topic *[Re: How to disable a product when it is not for sale?](/forum/4-how-to/57824-how-to-disable-a-product-when-it-is-not-for-sale#57860 "Hi all!:) Im new here. now my question:  how I can disable automatically when a product is not for sale more?  i need modify the php code no? but i dont get it.. so if someone can help me..I would be grateful! Bye! and Thanks!")*

hi!
thanks for your quick answer!
But i need it with de "end date" of the product.

[ ![Captura.PNG](/forum/attachment/4834) ](/forum/attachment/4834 "Captura.PNG")

you know?
any idea?

Thanks again!

- [ ![Captura.PNG](/forum/attachment/4834) ](/forum/attachment/4834 "Captura.PNG") [ ](/forum/attachment/4834?download=1 "Captura.PNG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzU3ODI0LWhvdy10by1kaXNhYmxlLWEtcHJvZHVjdC13aGVuLWl0LWlzLW5vdC1mb3Itc2FsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 4 months ago [\#57911](#57911) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: How to disable a product when it is not for sale?](/forum/4-how-to/57824-how-to-disable-a-product-when-it-is-not-for-sale#57911 "Hi all!:) Im new here. now my question:  how I can disable automatically when a product is not for sale more?  i need modify the php code no? but i dont get it.. so if someone can help me..I would be grateful! Bye! and Thanks!")*

Hi,

You can do it by editing the SQL request in the file: YourSite/components/com_hikashop/views/product/view.html.php
In the listing function replace the line: Code:

$query = $select2.' FROM '.$b.$a.$on.' WHERE '.implode(' AND ',$filters).$order;

By: Code:

$query = $select2.' FROM '.$b.$a.$on.' WHERE '.implode(' AND ',$filters).' AND (b.product_sale_end = 0 OR b.product_sale_end &gt; '.time().') '.$order;

The following user(s) said Thank You: [gootty3](/forum/user/8017-gootty3 "View gootty3's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzU3ODI0LWhvdy10by1kaXNhYmxlLWEtcHJvZHVjdC13aGVuLWl0LWlzLW5vdC1mb3Itc2FsZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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.059 seconds

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