• WordPress uses query_var post_type=product to load WooCommerce’s search results template (archive-product.php)- if not present, the standard blog template (search.php) is loaded which is not acceptable for a product overview.

    That means that the search form should have

    <input type=”hidden” name=”post_type” value=”product”>

    I didn’t found a way how to correct this behaviour except hacking the final search.php.

    Please add a hook called from asl.shortcode.php:46 as you do before (41) and after the form (52).

    <?php do_action(‘asl_layout_in_form’, $id); ?>

    It will be possible then to add some custom elements, i.e.

    <?php

    if (is_woommerce() { ?>

    <input type=”hidden” name=”post_type” value=”product”>

    <?php } ?>

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Enh] Add a hook to modify search form input’ is closed to new replies.