- This topic has 6 replies, 2 voices, and was last updated 1 year, 6 months ago by
David.
-
AuthorPosts
-
February 1, 2021 at 9:16 am #1641839
Sílvia
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ílviaFebruary 1, 2021 at 10:23 am #1641927David
StaffCustomer SupportHi there,
Woo comes with several built in shortcodes which you can add to a static page.
Link here to the Products shortcodes:
https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-9
You will need
[recent_products]
shortcode with a limit of 12 eg.[recent_products limit="12"]
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 1, 2021 at 10:46 am #1641949Sí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.February 2, 2021 at 5:38 am #1642808David
StaffCustomer SupportSo 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 4, 2021 at 1:50 am #1645212Sílvia
Done!
Thank you!February 4, 2021 at 1:51 am #1645213Sílvia
It works.
February 4, 2021 at 2:41 am #1645273David
StaffCustomer SupportGlad to hear that!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.