Your account expired support, please renew to get your support.

HomePage Forums Themes Support Audib – Audio Store WooCommerce Theme I want to change the design of product search results

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35831
    emancci
    Support Expired

    When you search for a product, the image of the product appears in a large size.
    I want to make this small and change the layout, but what should I do?

    https://i.postimg.cc/jdCWC9PP/Screenshot-2023-06-23-at-00-31-10.jpg

    #35901

    Please add this function to the file functions.php( child-theme):

    function audib_header_search_popup() {
            ?>
            <div class="site-search-popup">
                <div class="site-search-popup-wrap">
                    <div class="site-search">
                         <?php
                    if (audib_is_woocommerce_activated()) {
                        audib_product_search();
                    } else {
                        ?>
                        <div class="site-search">
                            <?php get_search_form(); ?>
                        </div>
                        <?php
                    }
                    ?>
                    </div>
                    <a href="#" class="site-search-popup-close">
                        <svg class="close-icon" xmlns="http://www.w3.org/2000/svg" width="23.691" height="22.723" viewBox="0 0 23.691 22.723"><g transform="translate(-126.154 -143.139)"><line x2="23" y2="22" transform="translate(126.5 143.5)" fill="none" stroke="CurrentColor" stroke-width="1"></line><path d="M0,22,23,0" transform="translate(126.5 143.5)" fill="none" stroke="CurrentColor" stroke-width="1"></path></g></svg>
                    </a>
                </div>
            </div>
            <?php
        }
    
    function audib_product_search() {
            if (audib_is_woocommerce_activated()) {
                static $index = 0;
                $index++;
                ?>
                <div class="site-search ajax-search">
                    <div class="widget woocommerce widget_product_search">
                        <div class="ajax-search-result d-none"></div>
                        <form role="search" method="get" class="woocommerce-product-search" action="<?php echo esc_url(home_url('/')); ?>">
                            <label class="screen-reader-text" for="woocommerce-product-search-field-<?php echo isset($index) ? absint($index) : 0; ?>"><?php esc_html_e('Search for:', 'audib'); ?></label>
                            <input type="search" id="woocommerce-product-search-field-<?php echo isset($index) ? absint($index) : 0; ?>" class="search-field" placeholder="<?php echo esc_attr__('Search products&hellip;', 'audib'); ?>" autocomplete="off" value="<?php echo get_search_query(); ?>" name="s"/>
                            <button type="submit" value="<?php echo esc_attr_x('Search', 'submit button', 'audib'); ?>">
                                <i class="audib-icon-arrow-right"></i><?php echo esc_html_x('Search', 'submit button', 'audib'); ?>
                            </button>
                            <input type="hidden" name="post_type" value="product"/>
                        </form>
                    </div>
                </div>
                <?php
            }
        }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.