Search box width not looks good

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 Ernest Marcinko 2 years, 4 months ago.

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #35874
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    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 :)


    #35875
    rifatspir96
    rifatspir96
    Participant

    thanks. 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

    #35876
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Unfortunaly 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:

    .item.asp_r_term .asp_image {
        width: 80px !important;
    }
    
    .item.asp_r_term .asp_content {
      display: flex;
      align-items: center;
      justify-content: left;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #35885
    rifatspir96
    rifatspir96
    Participant

    Thank 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?

    #35898
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    There is no option for that, however you can try a custom code:

    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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #35904
    rifatspir96
    rifatspir96
    Participant

    applied that in function php.
    not working. can you please recheck your code.

    #35906
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You can try this variation, but even the previous one worked just fine on our ends:

    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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #35907
    rifatspir96
    rifatspir96
    Participant

    now 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.

    #35908
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 9 posts - 16 through 24 (of 24 total)

You must be logged in to reply to this topic.