Forum Replies Created
-
AuthorPosts
-
skempenaar
Participantnevermind i found that problem is caused by this line being disabled. this is really powerfull feuture.
Override the default WordPress search results with results from this search instance?
skempenaar
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);
}skempenaar
ParticipantHi,
i cant find my product “max lucado agenda 2021”.
ive checked if it has something to do with exclude products but thats not the case
rerun the index did not fix it.skempenaar
ParticipantHi ernst,
quick question about the following code. we have products in backorder that
load below the products that are instock. i would like it to function only if it is out of stock.// —- 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);
}skempenaar
Participantdone!
skempenaar
Participantyet again! works like a charm:D
skempenaar
Participantallright one last question:) are woocommerce star reviews even possible?
skempenaar
Participantim sorry did look that up in the docs. thx!!!!
skempenaar
ParticipantThx works like a charm!. what if i want to have a separator between it but only displayed when there is content.
skempenaar
Participantabsolutly love you!!!! this works like a charm!
my solution did not work on “max lucado” since the title was provided with max lucado
skempenaar
ParticipantHi Ernst,
found a solution. we add a tag (name of the author) of the book author if the product is in stock. our books are being imported overnight so with the following code our in stock products get reordered in ajax search pro. simply because the tag is present.
function set_author_to_tag($ProductAvailability, $value) {
if($ProductAvailability == ’21’ )
print_r($value);
if($ProductAvailability == ’22’ )
print_r($value);
if($ProductAvailability == ’23’ )
print_r($value);
if($ProductAvailability == ’10’ )
print_r($value);
if($ProductAvailability == ’30’ )
print_r($value);
if($ProductAvailability == ’32’ )
print_r($value);
}
function author_select($ProductAvailability, $type, $data){
$roles = [‘auteur’ => ‘A01′,’illustrator’ => ‘A12′,’vertaler’ => ‘B06′,’redacteur’ => ‘B01’,];
$currentRole = $roles[$type];
$contributors = [];foreach ($data as $key => $contributor) {
$role = $contributor[0];
$first_name = $contributor[1];
$prefix = $contributor[2];
$last_name = $contributor[3];if ($role === $currentRole) {
$prefix = ($prefix) ? $prefix . ‘ ‘ : ”;// We have a winner
$contributors[$first_name . ‘ ‘ . $prefix . $last_name . ‘; ‘] = $key;
}
}
$value = implode(array_flip($contributors));
set_author_to_tag($ProductAvailability, $value);
}skempenaar
ParticipantYou cannot access this content.
skempenaar
ParticipantYou cannot access this content.
skempenaar
ParticipantHi ernst,
yes that’s it indeed. relevance must be primairy and that does fits our needs for the most. stock status as secondary doesn’t do the trick.
its not possible to lower the relevance if a product is out of stock?cheers.
skempenaar
ParticipantHi Ernst,
great. this indeed fixed that. sadly, id does create new one. check image.
the book title isn’t populating with this setting.
-
AuthorPosts