• Resolved OC WordPress Web Designer

    (@oc-wordpress-web-designer)


    I added text to products in the shop page based on a specific product category filter with:

    function show_bottoms () {
    if ( has_term( ‘bestselling-bikini-bottoms’, ‘product_cat’ ) ) {
    echo ‘<p class=”showbottoms”>Available in Cheeky or Full Coverage</p>’; }}

    add_action(‘woocommerce_shop_loop_item_title’,’show_bottoms’, 20);

    My question is how to do the same thing but by filtering if the product has a specific attribute (with the slug: yellow)?

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add Text To Product In Shop By Attribute’ is closed to new replies.