Product images are not displayed

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Product images are not displayed

This topic contains 16 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 5 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #29850
    marekmuzika15
    marekmuzika15
    Participant

    Good day,

    I bought your plugin, but I can’t set it to load images when searching.

    I use multisite and woocommerce. Images are stored on Google Cloud using the WP-Stateless plugin.

    I looked at all the instructions and tried everything, but the pictures are still not in search.

    Could you please help me with that?

    I still have a question about the number of products displayed in the search. Can I set 120 products to be displayed per page?

    #29855
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much for the details, it was very helpful to us.

    I actually found a bug within the code via FTP, where the live results list was not properly switching the blogs to parse the images. I made a direct change to the code, it should be all right now: https://i.imgur.com/7KMqI7Z.png

    I will make sure to incorporate this change to the upcoming plugin release.

    Best,
    Ernest Marcinko

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


    #29856
    marekmuzika15
    marekmuzika15
    Participant

    Good day,

    Thanks, but I still don’t see the images in the web search.

    I would also like to see 120 products per results page.

    How can I do that?

    Thanks for help.

    Attachments:
    You must be logged in to view attached files.
    #29858
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    The plugin cannot affect the images/layout of the results page unfortunately, it is not possible. That is handled by the theme excplicitly (or theme builder plugin if you are using any).

    Best,
    Ernest Marcinko

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


    #29859
    marekmuzika15
    marekmuzika15
    Participant

    Good day,

    there must be a problem with the plugin. Everything is fine without the plugin. When I turn on plugin, the search does not work and the images are not displayed.

    I’m also sending an example with and without a plugin.

    Attachments:
    You must be logged in to view attached files.
    #29863
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    On the main site, if I search star wars with the plugin disabled, I get no results: https://i.imgur.com/o4lKFJV.png
    That is, because cross-multisite results are not possible to search in default WooCommerce. With the search enabled, the results will appear, but the images cannot be fetched by the theme, as they exits on a different multisite blog and the theme cannot recognize that.

    If you search on the same blog, as the results are from, the images will work all right. For example searching on blog “/filmy-knihy-hry/” phrase “plagueis” will yield results with the images correctly: https://i.imgur.com/t2H4vS6.png

    You can access the search images via the search plugin API theme functions, via the the_asp_result_field('image'); function.

    You can try a custom code solution to automatically hook into the search result images and try a replacement, but this may cause other issues, so please make sure to carefully test it. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    // ASP
    add_filter('wp_get_attachment_image_src', 'asp_wp_get_attachment_image_src', 10, 1);
    function asp_wp_get_attachment_image_src($image) {
    	//var_dump($image);
    	if ( !empty(get_asp_result_field('image')) )
    		return array(get_asp_result_field('image'), 300, 300, true);
    	else 
    		return $image;
    }

    Once again, if this does not work, then the only solution is to edit the theme to fetch the images cross network.

    Best,
    Ernest Marcinko

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


    #29865
    marekmuzika15
    marekmuzika15
    Participant

    Good day,

    perfect. This works. Well thank you.

    I have one last question. How do I change the number of products in my search results? Now showing 10 products on 5 pages.

    Can we adjust this so that I see 120 search results per page?

    #29867
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    It is atuomatically fetched from WordPress, but you can manually change it here: https://i.imgur.com/gQrorkg.png
    If your theme has an option to adjust the posts per page, use the same values for both options, otherwise there will be mismatching page numbers. If not, then WooCommerce needs to be adjusted as well.

    Best,
    Ernest Marcinko

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


    #29873
    marekmuzika15
    marekmuzika15
    Participant

    Thanks for help. I still have one more question.

    I use external links on the website and the code is used by the visitor to click on an external page directly from the catalog.

    For example: https://www.bedy.sk/elektro/kategoria-produktu/inteligentne-hodinky/

    However, when I search within multisite, external links stop working and replace them with links to products on the web.

    As for products from the same blog, it works.

    However, if the product is from another blog, an original link to my site will appear.

    For example, when I search from the main page, all external product links are replaced with internal ones.

    https://www.bedy.sk/?s=xiaomi&post_type=product

    I’m not sure if I explained it correctly. However, I’m sending code that ensures that the user gets to an external page when they click on the product.

    echo apply_filters( ‘kapee_template_loop_product_thumbnail’, $html );
    }
    function woocommerce_template_loop_product_title() {

    if( ! kapee_get_loop_prop( ‘products-title’) ) return;
    global $product;
    $link = apply_filters( ‘woocommerce_loop_product_link’, get_the_permalink(), $product );
    $target = ‘_self’;
    if( kapee_get_option( ‘open-product-page-new-tab’, 0 ) ){
    $target = ‘_blank’;
    }
    if( $product->is_type( ‘external’ ) ) {
    $target = ‘_blank’;
    $link = apply_filters( ‘woocommerce_loop_product_link’, $product->get_product_url(), $product );
    }

    echo ‘<h3 class=”product-title”>‘ . get_the_title() . ‘</h3>’;
    }

    #29874
    marekmuzika15
    marekmuzika15
    Participant

    The search also doesn’t show prices. Could this be resolved, please?

    I want to thank you for your fantastic support.

    Example of search from the multisite main page:

    https://www.bedy.sk/?s=mandalorian&post_type=product

    #29890
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The problem with using custom codes in this context is, that the products are not actually available on the main site or cross site (WordPress does not support that) – these are non-existent there. So the custom codes may not be able to execute correctly on them.
    Product details, including the price is therefore not avialable in this context. It might be possible to fetch via switching the blogs – but it has to be custom coded within the theme. You can fetch the product blog IDs in the main loop via the get_asp_result_field('blogid'); function call, more details about this here.
    Unfortunately this is theme dependent, I cannot suggest custom codes for this, it needs to be integrated to the theme.

    Best,
    Ernest Marcinko

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


    #29899
    marekmuzika15
    marekmuzika15
    Participant

    Thanks, but I can’t do this.

    Can I pay for your programming services?

    #29904
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Unfortunately we are not available for custom jobs. I usually recommend envato studio if you are looking for developers: https://studio.envato.com/

    Best,
    Ernest Marcinko

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


    #29905
    marekmuzika15
    marekmuzika15
    Participant

    Thank you for your response.

    Could you at least help me with the price in the search results?

    That would help me a lot.

    #29907
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I would love to help you with that, but I don’t exactly know how either. It probably requires direct theme modifications, and I am not familiar with that.

    Best,
    Ernest Marcinko

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


Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.