Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Problem with filters when redirect to result page.
This topic contains 14 replies, has 2 voices, and was last updated by awaistufail02 3 years, 5 months ago.
- AuthorPosts
- November 26, 2019 at 4:39 pm #24752
Hi There!
I have used range slider for selecting a range of product price and a button (with name Let’s Go) to redirect to a custom results page on my homepage. But when I click on Let’s Go button the products displayed on the result page are not between the selected price range. The same problem with other search filters too.
I also want to tell you that I’m using the same result page for my main menu search and when I type anything in the search field of main menu search and press enter it takes me to result page and shows the correct results. So result page should not be the problem. Please help me fix this problem.
If you need access to my admin panel or ftp server to solve this problem please let me now. ThanksAttachments:
You must be logged in to view attached files.November 27, 2019 at 11:26 am #24768Hi!
I think the issuse is, that the results override is not working properly. I see the plugin does send the search results to the results page, but those are not the correct ones displayed. This could happen, if:
– There is another search plugin active, that will override the results sent by ajax search pro
– ..or there is a custom built-in search query within the theme functions or template filesFirst I recommend checking if there are any custom search solutions active, and turning them off. If that does nothing, well in that case I can take a look at the theme source files directly, to see if there is any custom query running – and deactivate it programatically if possible. For that, please add temporary FTP and back-end details, as I will have to edit the files.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 27, 2019 at 4:44 pm #24777You cannot access this content.November 28, 2019 at 2:00 pm #24794Hi,
I may have found solutions to both issues. The search override was a bit complicated. In both cases I had to make direct changes to the search plugin itself – please do not re-install it for now.
Best,
I will make sure to include these changes in the upcoming release.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 28, 2019 at 9:08 pm #24809Thanks a lot Sir!
I really appreciate your work.
I have one more issue which is little different. Should I tell you here or should I open a new ticket?November 29, 2019 at 8:50 am #24810You cannot access this content.November 29, 2019 at 9:03 am #24812You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 29, 2019 at 9:47 am #24815You cannot access this content.November 29, 2019 at 10:41 am #24817Hi,
Thank you!
The issue must have been something else, because it works completely fine on my end at the moment. I also made the change to fix the search, and it still works without issues:
Best,
– Search page: https://i.imgur.com/g2n6Rx1.png
– Product pages: https://i.imgur.com/KjTTAGe.png
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 29, 2019 at 10:41 am #24818Hi,
Thank you!
The issue must have been something else, because it works completely fine on my end at the moment. I also made the change to fix the search, and it still works without issues:
Best,
– Search page: https://i.imgur.com/g2n6Rx1.png
– Product pages: https://i.imgur.com/KjTTAGe.png
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 29, 2019 at 11:17 am #24823Thank You!
It’s working fine on my end too but in case if it went wrong again then I’ll let you know.November 29, 2019 at 11:26 am #24824I know the support will be offline for Saturday and Sunday so can you please guide me little bit about what to do if something went wrong again?
Thank You!November 29, 2019 at 11:34 am #24825And also I want to ask that on the following page:
https://pkmobilereviews.com/best-samsung-phones/
I have displayed product’s name, price and rating
how can I display some main features of my product like Camera, RAM, Battery too?
I know I can display these things by custom fields but I am not able to find custom fields for these things. I’ll be very thankful if you help me out.Attachments:
You must be logged in to view attached files.December 2, 2019 at 2:13 pm #24846Hi!
I honestly don’t know what exactly went wrong there. I suppose it was caching or something?
The product features seems to be stored within the ‘aps-product-features’ custom field. I am not sure about how it is stored, but I am guessing it stores all the features as an array(?).
For that, you will need a custom code to print to the results list.I have constructed a custom code, that may help you start with it.
Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
Best,add_filter( 'asp_results', 'asp_custom_field_to_results', 10, 1 ); function asp_custom_field_to_results( $results ) { $custom_field = 'aps-product-features'; // Enter the custom field name $field = 'content'; // 'title' or 'content' $position = 'after'; // 'before' or 'after' $delimiter = ' '; // character between the field value and the field foreach ($results as $k=>&$r) { if ($r->content_type != 'pagepost') continue; if ( function_exists('get_field') ) $meta_value = get_field( $r->id, $custom_field, true ); // ACF support else $meta_value = get_post_meta( $r->id, $custom_field, true ); // Modify the post title to add the meta value if ( !empty($meta_value) ) { if ( is_array($meta_value) ) { $s = ''; foreach ( $meta_value as $v ) { if ( is_array($v) && isset($v['name'], $v['value']) ) { $s .= "<p>".$v['name'].": ".$v['value']."</p>"; } } $meta_value = $s; } if ( $field == 'title' ) { if ( $position == 'before' ) $r->title = $meta_value . $delimiter . $r->title; else $r->title .= $delimiter . $meta_value; } else { if ( $position == 'before' ) $r->content = $meta_value . $delimiter . $r->content; else $r->content .= $delimiter . $meta_value; } } } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 3, 2019 at 6:34 pm #24884Thanks a lot…!
- AuthorPosts
You must be logged in to reply to this topic.