Site logo

Archived topic

WooCommerce items shown in the product catalogue

6 replies · Started by Sílvia on February 1, 2021

Viewing posts 1–7 of 7

Hello!
I'm working in a WooCommerce shop and I would like to be shown in the product catalogue only 12 of the newest items added (all in the same page) as I want the rest of products be found through their categories. Does it make sense?
Is it possible to do it and how?
Thanks,
Sílvia

Hmm...
In GeneratePress I ordered the builder to show only the products in the shop, so then, I could put some images I created for the different categories with a shortcode at the top of the page and a tiny text. Correct me if I'm wrong but, I think I must tick the product, the categories or both in the appearance section, isn't it? So, as I need to separate categories and products and I want the categories at the top of the page, I decided to do it this way. Does it make sense? I've tried to add the short code you mention but then there are some products that are there twice.

So this is my approach:

1. Go to Woocommerce > Settings > Products and in Shop page remove the page - so its an empty field.

2. Create a Static Page for your Shop page.
Now you can build whatever layout you want.

To display the Category grid use this shortcode:

[product_categories]

Your product list:

[recent_products limit="12"]

You can add whatever else you want to that page.

3. One thing you will need to do is add the following PHP Snippet to your site:

function return_to_static_shop_page() {
    return 'http://yourdomain.com/your-page/';
}
add_filter( 'woocommerce_return_to_shop_redirect', 'return_to_static_shop_page' );

And change the URL http://yourdomain.com/your-shop-page/ to your new static shop page. This will ensure any Return to Shop links that Woo generates will take you to your static page.

Done!
Thank you!

It works.

Glad to hear that!

This archived topic is closed to new replies.