Hide out of stock items on latest product page

ThemeBurn SupportForumsOpenCart ThemesPavilion OpenCart ThemeHide out of stock items on latest product page

This topic has been marked as not a support question.

Hi

I am using open cart v 1.5.6.4 and Pavilion theme; how do I hide out of stock items from showing on the latest product page. I have use the following modification Hide out 0f stock , Forum but on the latest product page its still showing

 Dirash
February 27, 2015 at 4:07 am #38744

Figure a simple way to solve the issue of hiding out of stock without doing any modification to the opencart source file. Using a trigger that checks the status of the order, if its status changes to Complete(status_id =5) it disables the product by setting the product status to 0

CREATE TRIGGER `trigger_name` AFTER UPDATE ON `oc_order`
FOR EACH ROW if NEW.order_status_id = 5 then
update oc_product
set status = 0
where product_id = (select product_id from oc_order_product where order_id = NEW.order_id)
and quantity = 0;
end if

Execute this sql statement on the table oc_order and change the name tigger_name to your preferred name.

 Dirash
March 6, 2015 at 3:24 am #39000

Hi,

Thanks for sharing this trick. We’ve will add this feature as an option for the next theme update.

BR,
ThemeBurn team

March 6, 2015 at 11:51 am #39010
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.