• Hello everyone.
    I’m trying to add the brand of product in page next price, so I’m using Woocommerce Brands plugin: https://docs.woothemes.com/document/wc-brands/
    So, I’m trying to add the brand in my child theme in ../woocommerce/single-product/price.php file next to price. with this code:
    <div id="product-brand-logo"> <php echo do_shortcode('[product_brand width="64" height="64" class="alignright"]'); ?> </a> </div>
    Unfortunately the php code is not executing and i don’t know why, because this is the given code on WC Brands plugin documentation.
    I’m waiting for your responses. Thank you in advance!

Viewing 1 replies (of 1 total)
  • had the same problem. did not find the reason why it doesn’t work.
    fix this problem by custom code:

    add_action( 'content_single_product_show_this_brand', 'show_this_brand' );
    function show_this_brand() {
    global $post;
    if ( is_product_category() || is_singular( 'product' )  ) {
    $taxonomy = get_taxonomy( 'product_brand' );
    $labels   = $taxonomy->labels;
    echo get_brands( $post->ID, ', ', ' <span class="posted_in">' . $labels->name . ': ', '.</span>' );
    
    /* if you want to show brand images
    $t = wp_get_post_terms( $post->ID, 'product_brand' );
    foreach($t as $tid){
    echo get_brand_thumbnail_url( $tid->term_id, 'full' );
    }
    */
    }      }

    *put this into the functions.php
    now I can do this action everywhere I want (within archive-page or single-product-page)
    do_action('content_single_product_show_this_brand');

Viewing 1 replies (of 1 total)
  • The topic ‘Addig element to woocommerce product page’ is closed to new replies.