Home › Forums › Basel support forum › Hide Prices in search
Hide Prices in search
- This topic has 5 replies, 2 voices, and was last updated 4 years, 3 months ago by Elise Noromit.
-
AuthorPosts
-
January 17, 2020 at 12:55 pm #168547
algeorgiadisParticipantHello 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.
January 17, 2020 at 3:21 pm #168590
Elise NoromitMemberHello,
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
January 17, 2020 at 3:41 pm #168594
algeorgiadisParticipantThank 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.January 18, 2020 at 2:26 pm #168689
Elise NoromitMemberHello,
Please provide the site admin access to the private area.
Best Regards
January 18, 2020 at 4:20 pm #168707
algeorgiadisParticipantSorry 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.January 19, 2020 at 12:24 pm #168767
Elise NoromitMemberFine. If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register