• Resolved jkoffers

    (@jkoffers)


    Hello World,

    I am creating a website for a client who wants, parent categories to be displayed just below the price in products archives within each category.

    Actually Client created the brand names as category and put all the products into that brand category, Now he wants the in product showcase the brand category should come so the customers know this prodcut belong to that brand.

    I really hope I am making you understand what the client is trying to achieve. Theme is Avada and Fusion building with default woocommerce layout.

    Regards

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there!

    Thank you for contacting us.

    I understand you are looking to display parent category names under the product’s price on any product archive page.

    You can hook a custom function on WooCommerce Archives: https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/

    
    add_action('woocommerce_after_shop_loop_item','category_as_brand');
    function category_as_brand(){
    			global $product;
    	        $terms = get_the_terms( $product->get_id(), 'product_cat' );
     			if($terms[0]->parent == 0){
    				echo $terms[0]->name;
    			}
    			else{
    				$termsparent = get_term_by('id', $terms[0]->parent, 'product_cat');
    				echo $termsparent->name;
    			}	
    }
    

    You can also check out WooCommerce Brands – This extension lets you mark products with Brands and logos, you can then add the brand logo via shortcodes in WooCommerce archive pages with custom code similar to the above.

    I hope this helps! ??

    Thread Starter jkoffers

    (@jkoffers)

    Thank you very much for your help.

    How to add Brands. I checked the Brands plugin and it can work but again the problem is same that brands are not visible in the achives.

    I am not a coder, I can drag drop the items to make the website working. Also I only want to display the name of the brand for each prodcut and not the logo. Just below the Product name

    Could you please help a little more here. I shall be very gratful to you.

    Regards

    • This reply was modified 2 years, 7 months ago by jkoffers.
    Plugin Support Chris Moreira – a11n

    (@chrism245)

    Hello!

    We highly recommend contacting one of the services on our Customizations page. https://woocommerce.com/experts/ as that will require custom coding to archive that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Parent Category name on Woocommerce Product Archives’ is closed to new replies.