imloic
Forum Replies Created
-
Ok problem with this snippet
/** * resultat recherche par prix decroissant */ add_filter( 'aws_search_results_products', 'my_aws_search_results_products' ); function my_aws_search_results_products( $products ) { usort($products, function ($item1, $item2) { $a = intval( $item1['f_price'] * 100 ); $b = intval( $item2['f_price'] * 100 ); if ($a == $b) { return 0; } return ($a > $b) ? -1 : 1; }); return $products; }I would like to show Highest price first and I’m not sure of this. But this work for
return ($a > $b) ? -1 : 1; }); return $products; }- This reply was modified 3 years, 2 months ago by imloic.
EDIT: OK. The problem is from a snippet. Error when I hit “enter” when I search PLT PRO. So I remove all snippets and it’s WORK! No error on this REF
Please check these 2 captures, it’s very strange,Second capture, I see stock and I don’t see the brand (so my snippet doesn’t work ??)
Do you have more info please ?
Perfect! I just adapted the code for WPML. Work well. I hope I don’t make errors.
add_filter('aws_search_pre_filter_single_product', 'my_aws_search_pre_filter_single_product', 10, 3); function my_aws_search_pre_filter_single_product( $new_result, $post_id, $product ) { if ( $new_result['stock_status']['status'] ) { $new_result['stock_status'] = ''; } else { if(ICL_LANGUAGE_CODE == 'en'){ $new_result['stock_status']['text'] = 'Discontinued product'; } if(ICL_LANGUAGE_CODE == 'fr'){ $new_result['stock_status']['text'] = 'Produit arrêté'; } } return $new_result; }You’re right! It was on “HIDE”. It’s OK but it’s possible to show “Discontinued product” instead of “Out of Stock”?
Thanks
The search wheel doesn’t work and when I hit enter I got this message :
https://kinsta.com/wp-content/uploads/2021/05/wordpress-critical-error.png
Fucntion.php. Correctly edited when I press UPDATE.
Hello, file (function.php)was edited successfully but this doesn’t work. WordPress says: “There was a critical error on this site”.I can’t search for a product.
- This reply was modified 3 years, 3 months ago by imloic.
I tried all snippets. TRIO 290 is a child.
Yes ! I try all snippets. TRIO 290 is a child
Hello ! The search for products is done via the category names
You can try on HITMUSIC.EU
TRIO290 -> NOTHING
TRIO 290 -> the categories appear.I would like to see the category TRIO 290 when I type TRIO290.
Thx. Otherwise the plugin is great. Congratulations for your work!
Just to be precise, I want it to work for a category name and not just the product name. For the product name the code works fine!
Hi ! This code don’t work too. Sorry
Forum: Plugins
In reply to: [Advanced Woo Search - Product Search for WooCommerce] Critical error + WPMLIt seems to work. Thx
Yes sir ! and I even reindexed the table