• Resolved Brian

    (@bwold)


    My client is not in love with the options for the default store page (and I’m not either). We’d like to display products by category, as in: “Category 1”, then the products in that category, then “Category 2” and the products in that category, etc. In fact, I can do that in the page editor with shortcodes or the Products by Category blocks (since her categories are set and not likely to change).

    But if I edit the shop page to display products by category, I still get all the products/categories/both below my content. Because WooCommerce just REALLY wants to run that loop on that page.

    So is there an easy way to tell WooCommerce not to show any products or categories on the shop page?

    I suppose I can copy the shop page template to my theme, then hack out the products loop, and maybe that’s what I have to do. Or, I suppose I can Choose Categories only, then use CSS to set their display to none. But either option seems less than ideal, so I keep thinking I’m missing an option somewhere.

    FYI, I’ve looked into several plugins on this, and am happy to hear if any of y’all are happy with something particular. But in general, I’d like to avoid additional plugins if possible.

    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • MayKato

    (@maykato)

    Hello,

    You can change the shop page setting – select a different (or unused) page in the general setting. That way, the current shop page only shows products via shortcodes or blocks.

    Alternatively, you can apply this snippet to hide default products. I would recommend using a plugin like?Code Snippets?to add the snippet to your site.

    Thread Starter Brian

    (@bwold)

    If I understand correctly, your suggestion is to create a Store #2 page and set that as the shop page. But in places where there is a link back to the store, like an empty cart or in breadcrumbs, wouldn’t those links be to Store #2 and not my actual shop page?

    Hello,

    Good point. The back to shop button after emptying cart leads you to the assigned shop page automatically – in which case, the second option (adding this snippet) may work better. The code should be added to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.

    Thread Starter Brian

    (@bwold)

    Understood. For now, I set the value to Categories only, then used CSS to hide them. Clunky, but it works, and I’ll probably add the snippet before we launch.

    Might I gently suggest that a future version of WC add a fourth option for the display of the store, like “None (shortcodes and blocks only)”?

    https://imgur.com/u2mQmW9

    Hello,

    Might I gently suggest that a future version of WC add a fourth option for the display of the store, like “None (shortcodes and blocks only)”?

    Thank you for your reply. There’s no guarantee on when/if this will be developed into core WooCommerce, but you can add the idea to our Ideas Board.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shop Page Custom View: Products by Category’ is closed to new replies.