Home Forums WoodMart support forum Show brand logo on brand archive page?

Show brand logo on brand archive page?

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #557671

    waynep16
    Participant

    How can we put the brand logo on the brand archive page? There is no “brand” image element on archive layout, only single page layout

    #557848

    Hello,

    You can show the brand as a label on the product image in the grid. Please navigate to Products > Attributes > enter the attribute and enable “Show attribute label on products”.

    If you have any questions please feel free to contact us.

    Best Regards.

    #557938

    waynep16
    Participant

    You did not read my question. I want to show brand logo on the brand archive template

    #558077

    Hello,

    Yes, you can add the brand attribute in the product and enable the option “Show attribute label on products”. It will show the brand label both archive and single product page.

    If the issue remains, share the wp logins details so i will check and give you a possible solution.

    Best Regards.

    #559442

    waynep16
    Participant

    Hi, I dont want to show it on my product i want to show it at the top of the single brand archive page

    #559523

    Hello,

    You can use WooCommerce builder of WoodMart allowing you to create custom templates for Product, Product Categories pages and other functional pages that are not editable by default. WooCommerce builder is the inbuilt functionality widget included in the builder you use on the site. You can create a custom layout for brands attributes.
    https://ibb.co/hdpc8mq

    https://xtemos.com/forums/search/woodmart-woocommerce-layout-builder/

    Best Regards.

    #559528

    waynep16
    Participant

    yes i have done this, i have made my custom layout for brands but how do i put the single brand attribute logo on my brand layout page?

    On single product you can use the brand logo element but this is not available on archive pages

    #559708

    Hello,

    You need to use the brand widget in the layout and choose the specific brand.
    See Screenshot:
    https://ibb.co/mSqpz3h

    Best Regards.

    #559911

    waynep16
    Participant

    We have 5,000 brands, I am not going to build 5,000 templates one per brand ! That is stupid idea. we just need a shortcode or VC element to show pa_brand_attribute image on the brands layout so it applies to all brands – Hope it makes sense

    #560127

    Hello,

    If you do not want to create a custom layout. Try to create a HTML Block and add the brand image.
    https://xtemos.com/docs-topic/html-blocks-usage/

    Then, Navigate to Product > Attributes > Configure terms > Edit it and add the HTML Blocks shortcode in the description area.
    https://ibb.co/fX5vKqj

    These are the possible ways in the theme settings to be available for that. If you have any questions feel free to contact us.

    Best Regards.

    #560633

    waynep16
    Participant

    I dont think you understand the question 🙁

    On my brand attribute page , let’s call it Apple, or DELL, or HP, we want to show the brand logo same as you can with single page element

    https://snipboard.io/vDCZoz.jpg

    See screenshot, on the single product layout we can use this “product brand information” item to put single brand logo there but on the single brand ARCHIVE page this is not an option. If customer goes to see ALL dell brand items we want to show logo .

    Hope it is clear? we want this to be a dynamic option not make one brand layout per brand

    #560699

    Hello,

    You can try to enable attribute labels for your brand attribute in Dashboard -> Products -> Attributes. Unfortunately, our theme doesn’t have a quick option as you want.

    Best Regards

    #681661

    fb.com/only0nce
    Participant

    waynep16, hello my boy. I’m looking for the same solution, I totally understand you as I am selling with woodmart theme myself. Finally figure out how to do it by modifying /hook the file functions.php of your child theme via cpanel (file manager), put it at the end of the file if you want the logo to be right after category’s description:

    add_action( 'woocommerce_archive_description', 'display_brand_image_on_archive' );
    
    function display_brand_image_on_archive() {
        if ( is_tax( 'product_brand' ) ) {
            $queried_object = get_queried_object();
            if ( $queried_object && property_exists( $queried_object, 'term_id' ) ) {
                $brand_id = $queried_object->term_id;
                $brand_image_id = get_term_meta( $brand_id, 'thumbnail_id', true );
                if ( $brand_image_id ) {
                    $brand_image_url = wp_get_attachment_url( $brand_image_id );
                    echo '<img src="' . esc_url( $brand_image_url ) . '" alt="' . esc_attr( $queried_object->name ) . ' logo" class="brand-logo-archive" />';
                }
            }
        }
    } 

    Or if you want the logo to be the first thing:

    function display_brand_logo_on_archive() {
        // Kiểm tra xem đây có phải là trang lưu trữ thuật ngữ (taxonomy) của WooCommerce hay không
        if ( is_product_taxonomy() ) {
            $queried_object = get_queried_object();
            
            // Kiểm tra xem đối tượng có tồn tại và là một thuật ngữ có 'product_brand' không
            if ( $queried_object && isset( $queried_object->taxonomy ) && $queried_object->taxonomy === 'product_brand' ) {
                $brand_id = $queried_object->term_id;
                
                // Lấy ID hình ảnh logo của thương hiệu từ metadata
                $thumbnail_id = get_term_meta( $brand_id, 'thumbnail_id', true );
                
                if ( $thumbnail_id ) {
                    // Lấy URL hình ảnh
                    $image_url = wp_get_attachment_url( $thumbnail_id );
                    
                    // Hiển thị logo trong một thẻ div riêng biệt hoặc ngay trước mô tả
                    if ( $image_url ) {
                        echo '<div class="brand-logo-container">';
                        echo '<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $queried_object->name ) . ' Logo" class="brand-logo">';
                        echo '</div>';
                    }
                }
            }
        }
    }
    // Móc hàm vào hành động trước mô tả lưu trữ WooCommerce
    add_action( 'woocommerce_archive_description', 'display_brand_logo_on_archive', 5 ); 

    Then you can manage/style the logo by using custom css (Use Custom PRESET in woodmart theme setting to target only the shop archive and category archive, the css be like (modify to your heart content):
    .brand-logo {margin-left: 26px;max-width: 266px;max-height: 80px;}

    #681682

    Hello @fb.com/only0nce,

    Thanks for sharing the solution—it’ll be helpful for others too.

    Best Regards

Viewing 14 posts - 1 through 14 (of 14 total)