Dealing with multiple out of stock products



  • Hi,

    I am currently creating a shop that has thousands of used books. Some of these only have one or two copies and will be in and out of stock regularly.

    I know you can disable products using MYSQL triggers or thirty-party modules. However, is there a way to simply hide the product from the category listing? That way, users won’t see the out of stock products but they will still display in the search engines to attract traffic.

    If not, how do other people deal with this issue. Any help is greatly appreciated.

    Kind regards,

    Luke



  • I don’t think if some product is hidden from the store google will crawl it and if it does I doubt it will be shown in the results…



  • You can set visibility to none, so the products will not show on categories or search. But you can access it using direct url or from search engine



  • Thanks very much for your help. I tried adapting a MYSQL trigger based on dosbiner’s suggestion for use with combinations:

    BEGIN
    UPDATE tb_product_shop SET visibility=“search” WHERE id_product IN (SELECT id_product FROM tb_stock_available WHERE 1 GROUP BY id_product HAVING SUM(quantity)=0);
    UPDATE tb_product_shop SET visibility=“both” WHERE id_product IN (SELECT id_product FROM tb_stock_available WHERE 1 GROUP BY id_product HAVING SUM(quantity)>0)
    END

    At the moment it doesn’t seem to be working. I will post again if I manage to make it work.

    Thanks again.





  • Thanks so much dosbiner, I couldn’t get it to work for a while. What worked for me was changing double to quotes to single quotes for the trigger. In case anyone else has the same problem, this worked for me:

    BEGIN
    UPDATE tb_product_shop SET visibility=‘search’ WHERE id_product IN (SELECT id_product FROM tb_stock_available WHERE quantity=0);
    UPDATE tb_product_shop SET visibility=‘both’ WHERE id_product IN (SELECT id_product FROM tb_stock_available WHERE quantity>0);
    END



  • @lukewood actually that is exactly, what I did some weeks ago for our store. You should change the behaviour of product listings and internal search results… The files are classes:

    • Category.php -> getProducts()
    • Search.php -> find()

 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.