Home Forums WoodMart support forum Products (Grid or carousel) – Hide out of stock products

Products (Grid or carousel) – Hide out of stock products

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #127889

    Juca
    Participant

    Hi there,

    I’m looking to hide all products marked as out of stock in just the products element for page builder, not from the whole shop, as stock changes quite often for my store. Is there any parameter I could use to hide these?

    I know woocommerce has the option to hide out of stock items but this will affect the whole store, not just the elements.

    I’ve added a screenshot as an example.

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #127896

    newsprince
    Participant

    @[email protected]

    It can be done but you have to manually edit the widget of the grid shortcode.

    Navigate to your ftp directory and go to

    /wp-content/themes/woodmart/inc/shortcodes/

    Edit the products.php file

    Go to line 48

    After this code 'ignore_sticky_posts' => 1,

    Add the following line of code

    'meta_value' => 'instock',

    It will look something like that.

    https://gyazo.com/6271b2d6b88fc425c9a27d1cf1ce52ad

    Now the grid carousel shortcode will only bring products that are instock.

    P.S. You have to do this again in every theme update because it will override the file.

    #127918

    Hello,

    Yes, that is right. The default Woocommerce does not provide the option to differentiate and out theme does not have the option either. You can follow the suggestion, however, we do not guarantee any safety or smooth working as we have not tested the solution.

    Best Regards

    #127980

    Juca
    Participant

    Hi Newsprince,

    Thank you so much for the suggestion. Works perfectly, and have made a note of updating each time the theme updates.

    Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Products (Grid or carousel) – Hide out of stock products’ is closed to new replies.