Gary
Forum Replies Created
-
Yes that exactly that, here is from the first comment up just to be sure :
// Woocommerce - Exclude hidden and catalog
if ( class_exists('WooCommerce') && ( $sd['exclude_woo_hidden'] || $sd['exclude_woo_catalog'] ) ) {
// Check if this is version > 3.0
if ( asl_woo_version_check('3.0') ) {
$exclude = array();
if ( $sd['exclude_woo_hidden'] == 1 )
$exclude[] = 'exclude-from-search';
if ( $sd['exclude_woo_catalog'] == 1 )
$exclude[] = 'exclude-from-catalog';
if ( !empty($exclude) ) {
$_t = get_terms(array(
'taxonomy' => 'product_visibility',
'slug' => $exclude,
'hide_empty' => 0,
'fields' => 'ids'
));
if ( !is_wp_error($_t) && count($_t) > 0) {
$ret[] = array(
'taxonomy' => 'product_visibility',
'exclude' => $_t,
'allow_empty' => true
);
}
}
}
}
return $ret;
}
}
}The first code works really well. I’m not really good in php so I don’t know the reason why too as an empty array is indeed not null, but the searchbar works properly without commenting the “Exclude hidden and catalog” part of the code now.
I’m using wordpress 6.8.2 with WooCommerce 10.1.1, and I don’t know if it’s relevant, but I have 2 plugin that “YITH WooCommerce Catalog Mode” that disables features such as prices cart, and checkout, and “Disable Cart Fragments” that removes the script for the cart.
Thank you for your fast reply and your help!
Hii,
The bug is still here on 4.13.2, forcing to comment the last function of class-asl_helpers.php at each update of the plugin or completely disable the updates. Is it possible to add a null check to avoid this issue in the future please ?Have a nice day!
Hello Ernest,
Thank you for coming back to me this fast and going through the recent commits to pinpoint the issue, however after following these steps I still have a pretty similar issue, however now II have an additional line number inside the error logs :
[proxy_fcgi:error [pid 1563191:tid 1563275 [client :0 AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /............class-asl_helpers.php(873): get_terms()\n#5 /home/.../public_html/wp-content/plugins/ajax-search-lite/includes/classes/etc/class-asl_helpers.php(756): ASL_Helpers::toQueryArgs_Taxonom...', referer: https://atc-fr.com/I also forgot to mention in my initial post that I upgraded recently to PHP 8, maybe it is related, but I don’t have a good understanding of PHP. However, as the issue seems to be within line 873 (maybe the method get_terms() does a call to in_array() ?) I just commented the whole if condition after the comment “Woocommerce – Exclude hidden and catalog”, as I have no exclusion. This fixes the issue
EDIT : now that the plugin is fixed on my end, I just realized the live result list “Highlight whole words only?” feature doesn’t seems to work anymore when set to false
- This reply was modified 10 months, 1 week ago by Gary.
Forum: Plugins
In reply to: [Ajax Search Lite - Live Search & Filter] The request failed. Status:403Oh thank you I didn’t know that I needed a script from wp-admin ! I removed captcha for this specific file in the folder and it now works perfeclty !