-
AuthorPosts
-
January 10, 2022 at 4:17 pm #1334958
Hi,
I want to create a single search page on woocommerce tags – the result page should show the products items as I have made it from the standard search in the header.
The search was created via the code below:
[avia_sc_search placeholder='Drue...' label_text='Find' icon_display='' icon='ue800' font='entypo-fontello' post_types='custom' post_types_custom='product' numberposts='40' display='ajax' ajax_location='form_absolute' ajax_container='#my_container' custom_input_size='' custom_button_size='' custom_height='' radius='' radius_sync='true' border_width='' border_color='' custom_border_color='' input_color='' custom_input_color='' input_bg='' custom_input_bg='' button_color='' custom_button_color='' button_bg='' custom_button_bg='' results_padding='' results_padding_sync='true' results_margin='' results_margin_sync='true' results_color='' custom_results_color='' custom_results_content='' custom_results_icon='' results_bg='' custom_results_bg='' id='' custom_class='' template_class='' av_uid='av-ky8o7bzm' sc_version='1.0' admin_preview_bg='']
See demo page under private content
Hope you can help
Best Regards, Pete
- This topic was modified 2 years, 10 months ago by 2funky.
January 12, 2022 at 5:09 am #1335158Hey Peter,
Thank you for the inquiry.
For some reason, the post_type parameter in the URL contains encoded opening and closing brackets so it doesn’t return or display the product grid. Please edit the themes/enfold/config-templatebuilder/avia-shortcodes/search/search.php file and look for this code around line 1023.
$hidden_post_types_input .= "<input type='hidden' name='post_type[]' value='{$ptc}' />";
Replace it with:
$hidden_post_types_input .= "<input type='hidden' name='post_type' value='{$ptc}' />";
Best regards,
IsmaelJanuary 14, 2022 at 12:11 pm #1335559Hi Ismael,
Thanks, I have created search from the front page with the plugin called: Advanced Woo Search
Is it possible to insert the search function via child theme or functions.php at the top of the search page result (see private content)
– so the user can enter a new searchCan be inserted with:
<?php aws_get_search_form( true ); ?>
BR Pete
January 15, 2022 at 11:25 pm #1335722Hi,
Thank you for your patience, try this code in your functions.phpadd_action('woocommerce_before_shop_loop', 'search_before_shop_loop'); function search_before_shop_loop() { if(is_search() && is_shop()) { echo do_shortcode( '[aws_search_form]' ); } }
Best regards,
MikeJanuary 16, 2022 at 3:00 pm #1335748Thank you so much Mike, it works.
One last thing, tags categories are also displayed in the search, how do I get the same search at the top of tags – see example in private
Best regards Pete
January 16, 2022 at 3:52 pm #1335754Hi,
The product tag page you linked to is not a search results page, but you can add the search shortcode to the product tag page and category page with this additional function:add_action('woocommerce_before_shop_loop', 'before_product_tag_category_loop'); function before_product_tag_category_loop() { if(is_product_tag() || is_product_category()) { echo do_shortcode( '[aws_search_form]' ); } }
Best regards,
MikeJanuary 18, 2022 at 12:18 pm #1336016Hi Mike,
Thanks a lot, it all works perfectly now.
You can close this thread.
Best regards,
PeteJanuary 18, 2022 at 12:42 pm #1336025Hi,
Great, I’m glad that Mike could help you out. I’ll go ahead and close this thread for now then, please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘Page search on tags’ is closed to new replies.