Home Forums WoodMart – Premium Template Brand image on product archive

This topic contains 30 replies, has 2 voices, and was last updated by Artem Temos Artem Temos 8 months, 1 week ago.

Viewing 30 posts - 1 through 30 (of 31 total)
  • Author
    Posts
  • #38225
    iRiDiuM
    iRiDiuM
    Customer

    Hi

    Im using this plugin https://wordpress.org/plugins/perfect-woocommerce-brands/

    But is not fully compatible.

    http://clon.vainsmon.es/tienda/acs/termos-electricos/termo-electrico-baxiroca-v510-100-litros-vertical/

    IS only Yith brands plugin compatible? Im force to use it?

    Thanks!

    Private Content Hidden
    #38263

    Hi,

    We didn’t integrate any 3rd party plugins for brands since our theme includes our own functionality for this.

    Kind Regards

    #38310
    iRiDiuM
    iRiDiuM
    Customer

    ah, is not needed Yith Brands plugin?

    Also, if i disable my plugin, how to import all my existing brands and use your functionality?

    I already have created 250 products on my shop and them have assigned a brand.

    Some idea to how fix this?

    Thanks

    Private Content Hidden
    #38313

    Here is an article from our documentation that demonstrates how to use our brands https://xtemos.com/docs/woodmart/faq-guides/how-to-setup-brands/

    #38652
    iRiDiuM
    iRiDiuM
    Customer

    Ok, i created a new attribute for Brand. Ugg!..

    Well, any info for show a logo image on product loop archive?

    Like my old web:
    https://screenshots.firefox.com/sCBEbRKwL7uQmTo0/www.vainsmon.es
    https://www.vainsmon.es/categoria-producto/acs/termos-electricos/

    Thanks ♥

    #38714

    You can try to enable attribute label for your brand attribute in Dashboard -> Products -> Attributes. Unfortunately, our theme doesn’t have an option as per your example.

    #38862
    iRiDiuM
    iRiDiuM
    Customer

    ok!

    i find a function and customized it, but, cant find the correct term id for image:

    pa_marca-image

    function brands_in_loop(){
        global $product;
        $product_id = $product->id;
        $product_brands =  wp_get_post_terms($product_id, 'pa_marca');
        if(!empty($product_brands)){
            echo '<div class="custom-loop-brands">';
            foreach ($product_brands as $brand) {           
                      $attachment_id = get_term_meta( $brand->term_id, 'pa_marca-image', 1 );
    
                      $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']);
    
                      if(!empty($attachment_html)){
                        echo '<span class="marca-archivos">'.$attachment_html.'</span>';
                      }else{
                        echo '<span class="marca-archivos">'.$brand->name.'</span>';
                      }
                  
            }
            echo '</div>';
        }
    }
    add_action('woocommerce_before_shop_loop_item_title', 'brands_in_loop');

    And the position is on top before image, i want to hook before tittle or above, not before image.

    woocommerce_before_shop_loop_item_title

    Some helps?

    Thanks a lot

    Private Content Hidden
    #38897
    iRiDiuM
    iRiDiuM
    Customer

    Some one know wich term meta is used for images attributes, in my case pa_brand ?

    $attachment_id = get_term_meta( $brand->term_id, 'pa_marca-image', 1 );

    How can i check it?

    Thanks a lot! ♥

    #38917

    Try to use this code

    function brands_in_loop(){
    	global $product;
    	$attributes = $product->get_attributes();
    	$output = array();
    	foreach ( $attributes as $attribute ) {
    		if ( !isset( $attribute['name'] ) ) continue;
    		$show_attr_on_product = woodmart_wc_get_attribute_term( $attribute['name'], 'show_on_product' );
    		if ( $show_attr_on_product == 'on' ) {
    			$terms = wc_get_product_terms( $product->get_id(), $attribute['name'], array( 'fields' => 'all' ) );
    			foreach ( $terms as $term ) {
    				$content = esc_attr( $term->name );
    				
    				$image = get_term_meta( $term->term_id, 'image', true );
    				if ( $image ) {
    					echo '<span class="marca-archivos"><img src="' . esc_url( $image ) . '" title="' . esc_attr( $term->slug ) . '" alt="' . esc_attr( $term->slug ) . '" /></span>';
    				}else{
    					echo '<span class="marca-archivos">' . $term->name . '</span>';
    				}
    			}
    		}
    	}
    }
    add_action( 'woocommerce_shop_loop_item_title', 'brands_in_loop', 5 );
    #39194
    iRiDiuM
    iRiDiuM
    Customer

    Hi

    Works but is taking the img from another attribute. Must take img from brand

    My old code worked, but missing $brand->term_id.

    Any solution?

    Thanks ♥

    #39207

    Try to replace the previous code with this one

    function brands_in_loop(){
    	global $product;
    	$output = array();
    	$product_brands = wp_get_post_terms( $product->get_id(), 'pa_brand' );
    	echo '<div class="custom-loop-brands">';
    		foreach ( $product_brands as $brands ) {
    			$image = get_term_meta( $brands->term_id, 'image', true );
    			if ( $image ) {
    				echo '<span class="marca-archivos"><img src="' . esc_url( $image ) . '" title="' . esc_attr( $brands->slug ) . '" alt="' . esc_attr( $brands->slug ) . '" /></span>';
    			}else{
    				echo '<span class="marca-archivos">' . $brands->name . '</span>';
    			}
    		}
    	echo '</div>';
    }
    add_action( 'woocommerce_shop_loop_item_title', 'brands_in_loop', 5 );
    #39286
    iRiDiuM
    iRiDiuM
    Customer

    Sorry but is not working

    Im unable to find the correct term img.

    🙁 ♥

    #39287
    iRiDiuM
    iRiDiuM
    Customer

    Here you have credentials to my site if want to enter to my admin.

    Private Content Hidden
    #39380

    Try to replace this line

    $product_brands = wp_get_post_terms( $product->get_id(), 'pa_brand' );

    to this one

    $product_brands = wp_get_post_terms( $product->get_id(), woodmart_get_opt( 'brands_attribute' ) );

    #39422
    iRiDiuM
    iRiDiuM
    Customer

    Hi

    Now is showing only text string! But not image 🙁

    #39423

    In this case, please, provide us your FTP access so we can check it. And send us a link where we should see product with brands.

    #39439
    iRiDiuM
    iRiDiuM
    Customer

    Sure!

    Private Content Hidden
    #39440
    iRiDiuM
    iRiDiuM
    Customer

    Wich country are you connecting? I have to add country exclusion to my server. Maybe you will cant conect.

    #39457

    We are from Ukraine.

    #39531
    iRiDiuM
    iRiDiuM
    Customer

    Added to my server

    #39533

    We can’t connect http://prntscr.com/ie7a6y

    #39578
    iRiDiuM
    iRiDiuM
    Customer

    i tested your credentials and worked.

    Additionally i can add your IP to my whitelist.

    Anyways i will contact to my server.

    Sorry about that

    #39580
    iRiDiuM
    iRiDiuM
    Customer

    I think with IP will works. Anyways please, check no spaces on pw or login.

    See my server sonfiguration

    Sorry and thanks ♥

    Private Content Hidden
    #39581
    iRiDiuM
    iRiDiuM
    Customer

    Sorry, i think i dont need IP.

    Try now ♥

    #39621

    Sorry, but we still can’t connect with the data you sent.

    #39626
    iRiDiuM
    iRiDiuM
    Customer

    The data is correct, the problem is the same. My host provider dont let connect.
    Can you give your IP?

    Also my hosting says, you must can connect.

    #39628

    Here is my IP 176.98.70.114

    #39687
    iRiDiuM
    iRiDiuM
    Customer

    Yes, your IP was bloqued, now you can login.

    #39690

    We see that you have modified the code. Please, use the one we send you

    function brands_in_loop(){
    	global $product;
    	$output = array();
    	$product_brands = wp_get_post_terms( $product->get_id(), woodmart_get_opt( 'brands_attribute' ) );
    		echo '<div class="custom-loop-brands">';
    		foreach ( $product_brands as $brands ) {
    			$image = get_term_meta( $brands->term_id, 'image', true );      
    			if ( $image ) {
    				echo '<span class="marca-archivos"><img src="' . esc_url( $image ) . '" title="' . esc_attr( $brands->slug ) . '" alt="' . esc_attr( $brands->slug ) . '" /></span>';
    			}else{
    				echo '<span class="marca-archivos">' . $brands->name . '</span>';
    		}
    	}
    	echo '</div>';
    }
    add_action( 'woocommerce_shop_loop_item_title', 'brands_in_loop', 5 );
    #39745
    iRiDiuM
    iRiDiuM
    Customer

    Is the same? I used your code, but cause doest worked last time, i modifyed to test.

    Now is working, thanks a lot and thanks for your patientce.

    Sorry for my english

Viewing 30 posts - 1 through 30 (of 31 total)

You must be logged in to reply to this topic.