Banners in Brand - by aamit - on WordPress WooCommerce support

This topic has 9 replies, 3 voices, and was last updated 7 years, 10 months ago ago by Jack Richardson

  • Avatar: aamit
    aamit
    Participant
    June 1, 2016 at 12:00

    Hi,

    What is the best way to go and implement a Banner in the Brand type, same as you have for the Category? I want it to be showing before the products.

    I am willing to edit the code of the theme, but I need some guidelines where to start.

    Example Category: Link
    Example Brand (without the banner): Link

    All the best,
    Bojan

    8 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    June 1, 2016 at 13:46

    Hello,

    In order to display a thumbnail on a brand page you need add this code in wp-content/themes/legenda/woocommerce/archive-product.php after the line (line 38):

    `get_queried_object();
    $image = ”;
    if(empty($cat->term_id) && !is_search()){
    $image = etheme_get_option(‘product_bage_banner’);
    }else{
    $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, ‘thumbnail_id’, true );
    $image = wp_get_attachment_url( $thumbnail_id );
    }
    if($image && $image !=”){
    ?>

    #127919 Copied
    Avatar: aamit
    aamit
    Participant
    June 1, 2016 at 13:51

    Thank you for the quick reply. I have few more questions before I implement this.

    How will I manage which image shows in the header for a specific Brand? Will I have the same interface as for Category?

    Avatar: aamit
    aamit
    Participant
    June 1, 2016 at 14:47

    Also the code that you pasted is not displayed properly. The last part of the code is shown as broken img.
    Please use the CODE tag.

    Avatar: Eva
    Eva Kemp
    Support staff
    June 1, 2016 at 16:45

    Hello,

    I used the CODE tag, but still it’s not working.
    Please provide us with wp-admin panel and FTP credentials in Private Content.

    Regards,
    Eva Kemp.

    Avatar: aamit
    aamit
    Participant
    June 2, 2016 at 02:29

    Please insert comment /* 8theme */ around the code so I can find it.
    This is a staging server and I will need to replace code on live later.

    Thank you

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Support staff
    June 2, 2016 at 08:38

    Hello,

    I’ve added the file in your child theme directory wp-content/themes/legenda-child/woocommerce/archive-product.php and added the code in line 60.
    Now thumbnails that you added for your brands are displayed on brand pages.

    Please check, for example the brand “Boss”.

    Regards,
    Eva Kemp.

    Avatar: aamit
    aamit
    Participant
    June 2, 2016 at 14:14

    Thank you Eva. However, this displays the Brand thumbnail for Header Banner.
    I would like to accomplish the exact thing that is implemented in the Category.

    To be able to choose Header Image and display it before product list for a brand.

    In my situation, the brand thumbnails and the header images are completely different.

    Is this possible?

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 2, 2016 at 16:56

    Hello,

    Please take our apologies but unfortunately there is no such possibility.

    Best regards,
    Jack Richardson.

  • Viewing 9 results - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.