Home › Forums › WoodMart support forum › Brand image on product archive
Brand image on product archive
- This topic has 32 replies, 1 voice, and was last updated 2 years, 4 months ago by
kinigakos.
-
AuthorPosts
-
February 7, 2018 at 9:26 pm #38225
iRiDiuMParticipantHi
Im using this plugin https://wordpress.org/plugins/perfect-woocommerce-brands/
But is not fully compatible.
IS only Yith brands plugin compatible? Im force to use it?
Thanks!
February 8, 2018 at 7:24 am #38263
Artem TemosKeymasterHi,
We didn’t integrate any 3rd party plugins for brands since our theme includes our own functionality for this.
Kind Regards
February 8, 2018 at 9:10 am #38310
iRiDiuMParticipantah, 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
February 8, 2018 at 9:14 am #38313
Artem TemosKeymasterHere is an article from our documentation that demonstrates how to use our brands https://xtemos.com/docs/woodmart/faq-guides/how-to-setup-brands/
February 9, 2018 at 2:40 pm #38652
iRiDiuMParticipantOk, 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 ♥
February 9, 2018 at 9:02 pm #38714
Artem TemosKeymasterYou 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.
February 10, 2018 at 1:43 pm #38862
iRiDiuMParticipantok!
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
February 10, 2018 at 6:59 pm #38897
iRiDiuMParticipantSome 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! ♥
February 10, 2018 at 8:33 pm #38917
Artem TemosKeymasterTry 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 );
February 12, 2018 at 1:43 pm #39194
iRiDiuMParticipantHi
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 ♥
February 12, 2018 at 1:58 pm #39207
Artem TemosKeymasterTry 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 );
February 12, 2018 at 4:31 pm #39286
iRiDiuMParticipantSorry but is not working
Im unable to find the correct term img.
🙁 ♥
February 12, 2018 at 4:36 pm #39287
iRiDiuMParticipantHere you have credentials to my site if want to enter to my admin.
February 13, 2018 at 7:14 am #39380
Artem TemosKeymasterTry 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' ) );
February 13, 2018 at 9:53 am #39422
iRiDiuMParticipantHi
Now is showing only text string! But not image 🙁
♥
February 13, 2018 at 9:55 am #39423
Artem TemosKeymasterIn 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.
February 13, 2018 at 11:22 am #39439
iRiDiuMParticipantSure!
February 13, 2018 at 11:25 am #39440
iRiDiuMParticipantWich country are you connecting? I have to add country exclusion to my server. Maybe you will cant conect.
♥
February 13, 2018 at 12:27 pm #39457
Artem TemosKeymasterWe are from
February 13, 2018 at 4:10 pm #39531
iRiDiuMParticipantAdded to my server
February 13, 2018 at 4:14 pm #39533
Artem TemosKeymasterWe can’t connect http://prntscr.com/ie7a6y
February 13, 2018 at 8:01 pm #39578
iRiDiuMParticipanti tested your credentials and worked.
Additionally i can add your IP to my whitelist.
Anyways i will contact to my server.
Sorry about that
♥
February 13, 2018 at 8:14 pm #39580
iRiDiuMParticipantI think with IP will works. Anyways please, check no spaces on pw or login.
See my server sonfiguration
Sorry and thanks ♥
February 13, 2018 at 8:25 pm #39581
iRiDiuMParticipantSorry, i think i dont need IP.
Try now ♥
February 14, 2018 at 7:10 am #39621
Artem TemosKeymasterSorry, but we still can’t connect with the data you sent.
February 14, 2018 at 7:20 am #39626
iRiDiuMParticipantThe 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.
February 14, 2018 at 7:22 am #39628
Artem TemosKeymasterHere is my
February 14, 2018 at 8:42 am #39687
iRiDiuMParticipantYes, your IP was bloqued, now you can login.
♥
February 14, 2018 at 8:50 am #39690
Artem TemosKeymasterWe 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 );
February 14, 2018 at 9:11 am #39745
iRiDiuMParticipantIs 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
♥
-
AuthorPosts
- You must be logged in to create new topics. Login / Register