This topic has 3 replies, 2 voices, and was last updated 9 years by sharmstr.

  • Author
  • #55397
     Meshup
    Participant

    I found this in woocommerce support

    https://support.woothemes.com/hc/en-us/articles/203618875-Print-the-product-s-vendor-name-in-the-shop

    But the name is showed in the link tag after the image tag.

    How i can put right after the product’s title?

    This is the code:

    COPY CODE
    /**
     * Print the product's vendor name before the product title in the loop.
     *
     * @return void
     */
    function wc_vendors_name_loop() {
    	$vendors = get_the_terms( get_the_ID(), 'shop_vendor' );
    
    	if ( $vendors && ! is_wp_error( $vendors ) ) {
    		foreach ( $vendors as $vendor ) {
    			$all_vendors[] = $vendor->name;
    		}
    
    		$vendors = join( ", ", $all_vendors );
    
    		echo '<span class="shop_vendors">' . $vendors . '</span>';
    	}
    }
    add_action( 'woocommerce_before_shop_loop_item_title', 'wc_vendors_name_loop', 20 );

    Could you help me?

    #55401
     sharmstr
    Moderator

    This is touching Kleo code, so I havent tried this. But you can see this part “woocommerce_before_shop_loop_item_title”. Try changing it to “woocommerce_after_shop_loop_item_title”

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #55403
     Meshup
    Participant

    Done. The name now appears after the price.

    http://stage.meshup.it/shop/

    Is it possible to place between title and price?

    #55408
     sharmstr
    Moderator

    The only other hook is woocommerce_after_shop_loop_item.

    If you need to put it somewhere else beside the hooks woo gives you, you need to ask them or you need to edit /kleo/woocommerce/content-product.php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?