• Resolved silenx

    (@silenx)


    Hello,
    is it possible to create a shop page with all single product, but with Category Title on top of them as separator.
    Example:

    CATEGORY 1
    Product1-1, product1-2, product1-3,product1-4,
    product-1-5 etc..

    CATEGORY 2
    Product 2-1. product2-2, etc

    and so on ..

    Custom code or a plugin that do that is also ok.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    Hi @silenx,

    You’d most likely need to customise the template responsible for displaying your Shop page by writing custom code to alter it in the way you’re looking for.

    The documentation here covers the WooCommerce template hierarchy and how to override a template in a manner that is safe for updates – https://docs.woocommerce.com/document/template-structure/

    Thread Starter silenx

    (@silenx)

    Thank you.
    I coded the things i want.
    I put a piece of code here if someone want the same things.
    file is archive-product.php copied from wordpress plugin directory to the child theme /wordpress dir ( as described in the above link )

    
    ....
    	do_action( 'woocommerce_before_shop_loop' );
    if ( is_shop() ) {
    echo ('<h3 style="color:#ff6b35;text-align:center;">CAT1</h3>');
    echo do_shortcode ('[product_category category="cat1"]');
    echo ('<hr>');
    // .. and so on for all the category that i want to display
    else {
    	woocommerce_product_loop_start();
    
    	if ( wc_get_loop_prop( 'total' ) ) {
    		while ( have_posts() ) {
    			the_post();
    		/**
    		 * Hook: woocommerce_shop_loop.
    		*/
    			do_action( 'woocommerce_shop_loop' );
    		wc_get_template_part( 'content', 'product' );
    	}
    	} 
    
     woocommerce_product_loop_end();
    
    }  // else end
    
    ...
    
    
    • This reply was modified 4 years, 1 month ago by silenx.
    • This reply was modified 4 years, 1 month ago by silenx.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Shop Page’ is closed to new replies.