• Resolved vpedrozo

    (@vpedrozo)


    Hi! Is there any way to adjust the product sorting in archives pages to show my “featured products” first and then just default the other remaining products to “sort by latest”?

Viewing 1 replies (of 1 total)
  • Hi @vpedrozo

    You can add the following piece of code on your site to show featured products before the default list of products on archive pages:

    // show featured products before products on archive pages 
    // www.ads-software.com/support/?p=15807139
    add_action( 'woocommerce_before_shop_loop', 'custom_code_archive', 10 );
    function custom_code_archive() {
        $shortcode  = '[products visibility="featured"]';
        echo do_shortcode($shortcode);
    }

    You can either add it to your theme’s function.php file, or use a plugin such as Code Snippets:
    https://br.www.ads-software.com/plugins/code-snippets/

    (Check this guide to change the shortcode on the code above if you want to customize the list of featured products)

    As for the remaining products on the archive page, in order to sort them by latest, you can navigate to Appearance → Customize → WooCommerce → Product Catalog and select “Sort by most recent” under “Default product sorting”.

    Best

Viewing 1 replies (of 1 total)
  • The topic ‘Product Sorting: Featured products first, followed by “sort by latest”’ is closed to new replies.