Skip to main content

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

More
14 years 2 months ago #57824 by gootty3
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!

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #57834 by Xavier
Hi gootty3,

To automatically disable a product not for sale anymore, simply go in HikaShop > Configuration > 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 > Products, and unpublish the product by clicking on the published icon:
The following user(s) said Thank You: gootty3

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #57860 by gootty3
hi!
thanks for your quick answer!
But i need it with de "end date" of the product.



you know?
any idea?

Thanks again!

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #57911 by Xavier
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 > '.time().') '.$order;
The following user(s) said Thank You: gootty3

Please Log in or Create an account to join the conversation.

Time to create page: 0.237 seconds
Powered by Kunena Forum