• Resolved Jesin A

    (@jesin)


    Is there a shortcode to display the brand name inside a product loop without specifying the brand ID?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor titodevera

    (@titodevera)

    Hi Jesin!

    Add this code to your functions.php:

    
    add_action('woocommerce_after_shop_loop_item_title', function(){
      echo do_shortcode('[pwb-brand product_id="'.get_the_ID().'" as_link="true"]');
    });
    

    You can use other action hooks if you want…

    ??

    Thread Starter Jesin A

    (@jesin)

    Hi Alberto,

    Thanks for the quick response.

    Looking at this file (line 15) it looks like the plugin is already using the ID from the loop if the product_id attribute is present?

    • This reply was modified 5 years, 1 month ago by Jesin A.
    Plugin Contributor titodevera

    (@titodevera)

    Hi Jesin!

    Yes, but only for the single product pages. I will consider change it for next releases…

    ??

    Thread Starter Jesin A

    (@jesin)

    Thank you I wanted to use it on the single product pages only ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode to display brand name inside the loop’ is closed to new replies.