Question: Can I not show brand or category with 0 quanty

Can I not show brand or category with 0 quanty

Can I not show brand or category with 0 quantity on SHOP? I don't want the customer to experience the brand or category that has product but no qty. by default I set the products to load on

PV

Prom Vongchann

Asked

Can I not show brand or category with 0 quantity on SHOP? I don’t want the customer to experience the brand or category that has product but no qty.

by default I set the products to load only the items those are not 0 qty but on the menu of category or brand still show up, but some of them when we click it just show nothing because those brands or categories contain products but 0 QTY.

is there anyway to fix that?

  • MS

    Mian Saleem

    Answered

    Hello,

    You can try to run following query after selecting your database

    UPDATE `sma_shop_settings` SET `hide0` = '1' WHERE `shop_id` = '1';
    

    Thank you

  • PV

    Prom Vongchann

    Answered

    could you be more specific? where is the controller file should I go to edit and which line? I mean is there any indicator to get to it?

  • MS

    Mian Saleem

    Answered

    The code I given is not for controller. It’s SQL query to run at your database by command line or any gui phpmyadmin or workbench or tableplus etc.

  • PV

    Prom Vongchann

    Answered

    oh, but I want to run this on my shop.

    I want only products with > 0 qty and for brands or category those are have products with 0 qty I don’t want them to show.

  • PV

    Prom Vongchann

    Answered

    I have already run but there is nothing change on the shop. that is why I want to know which controller can I modify to show only the products with > 0 qty and hide brand and category those are not have products > 0 qty?

    see my attachment

  • MS

    Mian Saleem

    Answered

    Hello,

    Yes, query looks fine. If it’s didn’t hide the categories/brands then you will need to edit app/core/MY_Shop_Controller.php and app/models/shop/Shop_model.php

    Thank you

  • PV

    Prom Vongchann

    Answered

    is there any coding snippets ? I mean which id or line or indicator?

  • MS

    Mian Saleem

    Answered

    Hello,

    I am sorry as I can’t provide snippets. You can modify any file as per your requirements.

    Thank you

  • PV

    Prom Vongchann

    Answered

    I see this one, but it seems like I dont see anywhere to change to match my requirement. could you help?

  • PV

    Prom Vongchann

    Answered

    Mian Saleem Hello support,

    I just realized that I have asked this question last 2 years, and I now updated to the latest version but still the brands and categories with no products still appears on Shop page.

    would you guide a bit about where to adjust or kind of query?

    Thank you

  • Login to Reply