Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Connect ASP to Woocommerce Shop Page
- This topic has 13 replies, 2 voices, and was last updated 7 years, 11 months ago by
Kolizo.
-
AuthorPosts
-
June 5, 2018 at 12:58 am #18118
Kolizo
ParticipantHi,
Please, how do I redirect ASP plugin to display only the woocommerce shop page result and not the single product page?
Best,
Kola.
June 5, 2018 at 12:09 pm #18125Ernest Marcinko
KeymasterHi Kola,
If you refer to the return and magnifier button actions (redirection to the results page), then this should help you out: Documentation – Magnifier and Return button actions
June 5, 2018 at 4:53 pm #18133Kolizo
ParticipantHi Ernest,
Thanks for your reply.
I did try using the custom url “?s={phrase}&post_type=shop” but not redirected to the shop page.I’m still been redirected to the single page product when I search and click on a product. https://www.scipromar.com/product/acetone-2/
So the idea is when a customer searches for a product on the home page or any page with ASP: https://www.scipromar.com/, It should take them to the SHOP PAGE showing the products been searched for in the product table format as shown on the shop page: https://www.scipromar.com/shop/
You get?Thanks.
Kola
June 6, 2018 at 12:36 pm #18145Ernest Marcinko
KeymasterHi Kola,
I understand what you need now, but unfortunately there is no option for that. Clicking on a result will redirect to the result as expected.
This could be however possible using a specific configuration and a custom code:
1. Make sure to change the configuration like this: https://i.imgur.com/aGsieEk.png
2. Now, the custom code. Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!3. Clear all layers of cache. Now clickin on a result should redirect to the shop results page.
June 7, 2018 at 2:57 am #18147Kolizo
ParticipantHi Ernest,
Thanks for your reply.
I followed your instruction and also added the custom code. It seems to be working when I type the product name in the search box and press ENTER. However, when I search for a product, and the dropdown list comes up, when I click on the product in the dropdown list, it’s inactive and I’m not been redirected to any page which I think that’s what the code is doing right?
Please, what setting do I need to change to redirect the dropdown list product result to the Shop page when I click on it?
Please let me know if you need more clarification.Thanks again,
Kola.
June 7, 2018 at 1:05 pm #18148Ernest Marcinko
KeymasterHi Kola,
Sorry about that, there was a minor error in the code, I have corrected it via the back-end editor. If you clear the cache, then it should be all right now.
For future reference, this is the corrected code:
June 7, 2018 at 7:14 pm #18159Kolizo
ParticipantHi Ernest,
Thanks again. Now I can click on the dropdown list, and it takes me to the shop page.
However, we still have one more last hurdle to cross, please. So when I click on a product such as “Acetone” in the dropdown list, it takes me to the Shop page but shows all the products instead of showing “Acetone” products alone.
How do I resolve this?
Thanks a lot.Best,
Kola.
June 8, 2018 at 12:44 pm #18166Ernest Marcinko
KeymasterHi Kola,
It is hard to tell, but make sure that the Product Variations are not selected to be returned under the General Options -> Sources panel, under the post types box.
If not, then something else is changing the final results list or the query to add the variations to the results. My guess is the theme, if you have a custom WooCommerce theme, or possibly another WooCommerce search plugin, if you have any enabled.
June 10, 2018 at 4:03 pm #18186Kolizo
ParticipantHi Ernest,
Trust you had a great weekend!
I have checked the General option settings, and I only have the Product option selected, also checked my WooCommerce theme settings. However, the problem still persists.
Please, help check the code one more time. I guess maybe I didn’t explain clearly the issue I was having which is the search returning ALL PRODUCTS and not just variations for the Product been searched for.
I have attached a flow diagram for better clarity.Thanks!
Kola.
June 11, 2018 at 1:46 pm #18193Ernest Marcinko
KeymasterHi Kola,
You are right, I was testing it incorrectly – there was still an error in the code, I have corrected it, now it should be okay. Please clear the cache, and let me know.
For future reference, this is the corrected code:
June 11, 2018 at 7:13 pm #18207Kolizo
ParticipantHi Ernest,
It’s working perfectly now.
Thanks a lot for your quick response and support.Best,
Kola
June 11, 2018 at 7:14 pm #18208Kolizo
ParticipantYou cannot access this content.
June 11, 2018 at 7:18 pm #18209Ernest Marcinko
KeymasterYou cannot access this content.
June 11, 2018 at 7:45 pm #18210Kolizo
ParticipantYou cannot access this content.
-
AuthorPosts
- The topic ‘Connect ASP to Woocommerce Shop Page’ is closed to new replies.