Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.
    #1335158

    Hey 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,
    Ismael

    #1335559

    Hi 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 search

    Can be inserted with:
    <?php aws_get_search_form( true ); ?>

    BR Pete

    #1335722

    Hi,
    Thank you for your patience, try this code in your functions.php

    
    add_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,
    Mike

    #1335748

    Thank 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

    #1335754

    Hi,
    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,
    Mike

    #1336016

    Hi Mike,

    Thanks a lot, it all works perfectly now.

    You can close this thread.

    Best regards,
    Pete

    #1336025

    Hi,

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Page search on tags’ is closed to new replies.