Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search box width not looks good
This topic contains 23 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 4 months ago.
- AuthorPosts
- December 5, 2021 at 10:29 am #35874
Thank you!
It looks like the meta name is simply “image”. I have put it here, and I am seeing some images.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 5, 2021 at 10:53 am #35875thanks. is there any to change size image height and width to specific attribute or taxonomy?
For example my brand attribute not looking good. also the brand or category title is short. so i need to set it properly to look good.
I saw global option for all Image width/height. cant find any specific option for taxonomies
December 5, 2021 at 1:08 pm #35876Unfortunaly there is no separate option for them.
You can use however custom CSS to align the titles to center, and to change the image sizes:
Best,.item.asp_r_term .asp_image { width: 80px !important; } .item.asp_r_term .asp_content { display: flex; align-items: center; justify-content: left; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 7, 2021 at 3:00 am #35885Thank you
I have selected Post Type image source options for my woocommerce product. but in variation search it dont show up the product default image if the variation image not available.
Can you please tell me what is the Custom field containing the image for the woocommerce product?December 7, 2021 at 10:57 am #35898There is no option for that, however you can try a custom code:
Best,add_filter( 'asp_results', 'asp_get_main_prod_img', 10, 1 ); function asp_get_main_prod_img($results) { foreach ( $results as $k => &$r ) { if ( isset($r->post_type) && $r->post_type == 'product_variation' && empty($r->image) ) { $wc_prod_var_o = wc_get_product( $r->id ); $img = wp_get_attachment_image_src( get_post_thumbnail_id($wc_prod_var_o->get_parent_id()), 'single-post-thumbnail' ); if (isset($img, $img[0]) && !is_wp_error($img)) { $r->image = $img[0]; } } } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 7, 2021 at 12:16 pm #35904applied that in function php.
not working. can you please recheck your code.December 7, 2021 at 1:47 pm #35906You can try this variation, but even the previous one worked just fine on our ends:
Best,add_filter( 'asp_results', 'asp_get_main_prod_img', 10, 1 ); function asp_get_main_prod_img($results) { foreach ( $results as $k => &$r ) { if ( isset($r->post_type) && $r->post_type == 'product_variation' && empty($r->image) ) { $wc_prod_var_o = wc_get_product( $r->id ); $img = wp_get_attachment_image_src( get_post_thumbnail_id($wc_prod_var_o->get_parent_id()) ); if (isset($img, $img[0]) && !is_wp_error($img)) { $r->image = $img[0]; } } } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 7, 2021 at 2:36 pm #35907now its working. both one is fine. sorry it was my Post Type image source options problem. I set different of each alternative and thats why it was not working.
I gave u five star for awesome support.
December 7, 2021 at 2:50 pm #35908You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.