Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
How can i add thumbnails to search results in the Add Product modal (Woocommerce Admin)?

enter image description here

I'm trying to update the functionality of the search in the Add Products modal (when creating a new order in the WooCommerce Admin area) so that the thumbnail for each product in the search results is also displayed.

How would I go about doing this ? Is there an existing function I can hook into ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the following snippet, but you'd need to add some styling

add_filter('woocommerce_json_search_found_products', 'test_function_products_image');

function test_function_products_image($products){
    foreach($products as $key => $name){
        $product = wc_get_product($key);
        $src = wp_get_attachment_image_src( $product->get_image_id(), 'thumbnail' )[0];
        if($src){
            $image = '<img class="list-image" src="'. $src . '">';
            $products[$key] = $image . $products[$key];
        }
    }
    return $products;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!