Home Forums Basel support forum Hide Prices in search

Hide Prices in search

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #168547

    algeorgiadis
    Participant

    Hello there,
    I have enabled catalog mode and I hide all the prices with functions:

    //Remove prices from grids
    remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
    
    //remove prices from product pages
    add_filter( 'woocommerce_variable_sale_price_html', 'clr_remove_prices', 10, 2 );
    add_filter( 'woocommerce_variable_price_html', 'clr_remove_prices', 10, 2 );
    add_filter( 'woocommerce_get_price_html', 'clr_remove_prices', 10, 2 );
    
    function clr_remove_prices( $price, $product ) {
    if ( ! is_admin() ) $price = '';
    return $price;
    }

    But when i click the search button on the front page The results that it brings have prices.
    How can I remove prices from there.

    Thank you very much.

    #168590

    Hello,

    Please add this code to the functions.php of the child theme to hide the prices:

    function basel_header_block_search() {
       $header_search = basel_get_opt( 'header_search' );
       if( $header_search == 'disable' ) return;
       $classes = 'search-button';
       $classes .= ' basel-search-' . $header_search;
       if ( basel_get_opt( 'mobile_search_icon' ) ) $classes .= ' mobile-search-icon';
       ?>
          <div class="<?php echo esc_attr( $classes ); ?>">
             <a href="#">
                <i class="fa fa-search"></i>
             </a>
             <div class="basel-search-wrapper">
                <div class="basel-search-inner">
                   <span class="basel-close-search"><?php esc_html_e('close', 'basel'); ?></span>
                   <?php basel_header_block_search_extended( false, true, array('thumbnail' => 1, 'price' => 0), false ); ?>
                </div>
             </div>
          </div>
       <?php
    }

    Best Regards

    #168594

    algeorgiadis
    Participant

    Thank you very much for the quick reply Elise.
    It works for the desktop version, but it still shows the price in the mobile version.
    I attach to you my search theme options.

    Attachments:
    You must be logged in to view attached files.
    #168689

    Hello,

    Please provide the site admin access to the private area.

    Best Regards

    #168707

    algeorgiadis
    Participant

    Sorry Elise, this is in production and the only staging environment that I have is in localhost.
    But nevermind I disabled search for mobile and I am ok for this solution for know.
    Thank you very much.

    #168767

    Fine. If you have any questions please feel free to contact us.

    Best Regards

Viewing 6 posts - 1 through 6 (of 6 total)