Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › load order problems
- This topic has 4 replies, 2 voices, and was last updated 6 years ago by
Ernest Marcinko.
-
AuthorPosts
-
December 2, 2019 at 7:47 pm #24862
skempenaar
ParticipantHi when i type in my searchbar “reflect leven” alot of other results load before the product that i try to find.
order is set to
relevance
date descit looks like
1: grouping is static on alphabet
2: product content load weight is higher than title.ive allready set the order to this value which imo should load the title that i enter popup first.
any idea what might be the cause of this?December 3, 2019 at 11:02 am #24873Ernest Marcinko
KeymasterHi,
Thank you for all the details, it helps a lot!
Okay, the issue here is the results grouping. The “Reflect Leven” would be very likely returned first, but there is a taxonomy grouping enabled. The taxonomy “Binnenkort” alphabetically is above the “Boeken”, as you already suggested.
There was a similar issue about a month ago. I am plannig to add an option to the grouping panel, that allows automatically re-ordering the groups by the most relevant items per each group. It should be available within the next upcoming release.
December 3, 2019 at 11:04 am #24874skempenaar
ParticipantHi Ernest,
thx ill disable grouping untill next release then.
May 29, 2020 at 2:32 pm #27651skempenaar
ParticipantHi Ernest,
Im unable to reply on your call in other topic. but on our live server it works correct Im receiving a 0.
https://www.royaljongbloed.com/wp-admin/admin-ajax.php
also on
http://rjvps.development.bladewp.com/wp-admin/admin-ajax.phpI believe I know where my problem agenda 2021 was part of. We have products that are on backorder and ajax search pro sees that as sold out.
So I like 2 use this code. But there is somehting that needs to be changed to it. Now when a product is on backorder it is put below other products
Not related to the search simple because they are instock. Could you please change it that.If in stock and if backorder than put on top. If out of stock put to bottum.
code
// —- Ajax SEARCH PRO -put to bottom —-
add_filter(‘asp_results’, ‘asp_order_out_of_scock’, 10, 1);
function asp_order_out_of_scock($results) {
$first = array();
$last = array();
foreach ( $results as $k => &$r ) {
if ( get_post_meta($r->id, ‘_stock_status’, true) == ‘instock’ ) {
$first[] = $r;
} else {
$last[] = $r;
}
}
return array_merge($first, $last);
}June 1, 2020 at 8:24 am #27655Ernest Marcinko
KeymasterHi,
I checked the 403 error body response, and it contains something about Sucuri Firewall – possibly an IP block, or IP range block. We are behind a VPN and sucuri probably blocks it.
Your tickets are automatically closing, because your support period was expired over 30 days ago.
You can try the variation below, but I don’t know how exactly WooCommerce handles the back-order statuses, so this may not work:
add_filter('asp_results', 'asp_order_out_of_scock', 10, 1); function asp_order_out_of_scock($results) { $first = array(); $last = array(); foreach ( $results as $k => &$r ) { if ( in_array( get_post_meta($r->id, '_stock_status', true), array('instock', 'backorder', 'onbackorder', 'onrequest') ) ) { $first[] = $r; } else { $last[] = $r; } } return array_merge($first, $last); } -
AuthorPosts
- The topic ‘load order problems’ is closed to new replies.