Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1233983

    Hi support

    Is it possible to add a tag or a text below the title displayed in the Enfold product slider like this :

    [Image]
    Title of the product
    Extra text line (like tag list for instance)
    Price

    Is it possible by modifying the template or adding a function ?

    Many thanks !

    #1234609

    Hey Ikyo,

    We apologize for the delayed response.
    Yes, it’s possible by using woocommerce hook: woocommerce_after_shop_loop_item_title
    The slider just fetches the format woocommerce provides and put it in the slider.
    Let us know if you need further assistance :)

    Best regards,
    Nikko

    #1234772

    Many thanks Nikko

    I’ve tried to applicate such a hook in a code like

    //function add tag in WooCommerce product
    add_action( 'woocommerce_after_shop_loop_item_title', 'show_tags', 20 );
    function show_tags() {
      global $product;
      // get the product_tags of the current product
      $current_tags = get_the_terms( get_the_ID(), 'product_tag' );
      // only start if we have some tags
      if ( $current_tags && ! is_wp_error( $current_tags ) ) { 
        //create a list to hold our tags
        echo '<div class="auteurs_tags">';
    	echo 'par :';
        // for each tag we create a list item
        foreach ( $current_tags as $tag ) {
          $tag_title = $tag->name; // tag name
          $tag_link = get_term_link( $tag ); // tag archive link
          echo '<a href="'.$tag_link.'">'.$tag_title.'</a>';
        }
        echo '</div>';
      }
    }

    The problem is each product is presented as follows :
    [Image]
    Title of the product
    Price
    Extra text line (like tag list for instance)

    While I will desire :
    [Image]
    Title of the product
    Extra text line (like tag list for instance)
    Price

    Many thanks for your kindful help

    • This reply was modified 4 years, 4 months ago by Ikyo.
    #1235122

    Hi Ikyo,

    Thanks for posting your code for review.
    Please replace this part of the code:

    add_action( 'woocommerce_after_shop_loop_item_title', 'show_tags', 20 );

    to:

    add_action( 'woocommerce_after_shop_loop_item_title', 'show_tags', 7 );

    Best regards,
    Nikko

    #1235130

    Ah, really fantastic.!
    Many thanks Nikko

    Kinds regards

    #1235132

    Hi Ikyo,

    We’re glad that we could help :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add text below Title in Woocommerce slider’ is closed to new replies.