• Resolved iamahmedq

    (@iamahmedq)


    Hi,

    Could you please help me with this? I tried the following code to echo this shortcode in order to display the brands before product title. But it didn’t work.

    add_action( 'woocommerce_before_shop_loop_item_title', 'aq_display_brand_before_title', 10, 0 );
    function aq_display_brand_before_title() {
    	echo do_shortcode('[pwb-brand]');
    }

    If you can add an option in backend this will allow users to display it according to their needs. But I guess brand name should go first in loop before the product title. On single product options are great.

    Overall this plugin is great. However the documentation needs to be improved a little.

    Thanks

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

Viewing 3 replies - 61 through 63 (of 63 total)
  • Please, any help?

    My template is using custom woocommerce template file and not exist the hook woocommerce_before_shop_loop_item_title

    I want to display before my thumbnail on the shop page and the template is using woocommerce_template_loop_product_thumbnail

    So i change the code in this way:

    // add brand name before title wine
    add_action( ‘woocommerce_template_loop_product_thumbnail’, ‘aq_display_brand_before_title , 10, 0’ );
    function aq_display_brand_before_title(){
    global $product;
    $product_id = $product->get_id();
    $brands = wp_get_post_terms( $product_id, ‘pwb-brand’ );
    foreach( $brands as $brand ) echo ‘<p class=”alexbrand”>’.$brand->name.'</p>’;
    }

    Somebody can help me?

    • This reply was modified 3 years, 6 months ago by alexdex.

    Hey guys, so I have been following this thread closely. Toying around with the snippet in function.php to get it to work. On my side it works fine, but it’s displayed below the title. See image below:
    https://pasteboard.co/Kb8Xgx6.jpg

    I want it to move above the title.

    Any help is appreciated.

    {I believe a lot of people has contributed to this plugin I wish to say thanks}

Viewing 3 replies - 61 through 63 (of 63 total)
  • The topic ‘Display brand link/name before product title in loop’ is closed to new replies.