Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #703035

    Hi, currently when using the search, results are formatted as a simple list with no images shown for WooCommerce products that match the search.
    Search URLs look like this :

    http://www.shop.com/?s=whaisearched

    If i manually change it to this :
    http://www.shop.com/?s=whaisearched&post_type=product

    Results are formatted nicely in a grid layout with product images shown.

    Question is : how can i force this layout to be used whenever a search is performed ? (especially from menu search icon)

    #704149

    Hey radugidei,

    Thank you for using Enfold.

    This is possible but the search form will be limited to products. It won’t be able to fetch other post types. Please add this in the functions.php file:

    // add post type product
    add_action('ava_frontend_search_form','ava_frontend_search_form_mod');
    function ava_frontend_search_form_mod()
    {
    	echo '<input type="hidden" name="post_type" value="product">';
    }

    Best regards,
    Ismael

    #706948

    Thank you Ismael, that works perfectly – topic can be closed now !

    #707521

    Hi,

    Glad we could help :)

    Best regards,
    Nikko

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘WooCommerce search results formatting’ is closed to new replies.