[Resolved] WooCommerce items shown in the product catalogue

Home Forums Support [Resolved] WooCommerce items shown in the product catalogue

Home Forums Support WooCommerce items shown in the product catalogue

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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ílvia

    #1641927
    David
    Staff
    Customer Support

    Hi 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"]

    #1641949
    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.

    #1642808
    David
    Staff
    Customer Support

    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.

    #1645212
    Sílvia

    Done!
    Thank you!

    #1645213
    Sílvia

    It works.

    #1645273
    David
    Staff
    Customer Support

    Glad to hear that!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.