Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

How to hide prize ranges in JS?

Home / Forums / Virtue Theme / How to hide prize ranges in JS?

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
June 28, 2019 at 12:36 am

Hi,

i am using this code:

//Hide Price Range for WooCommerce Variable Products
add_filter( 'woocommerce_variable_price_html',
'lw_variable_product_price', 10, 2 );

function lw_variable_product_price( $v_price, $v_product ) {

// Product Price
$prod_prices = array( $v_product->get_variation_price( 'min', true ),
$v_product->get_variation_price( 'max', true ) );
$prod_price = $prod_prices[0]!==$prod_prices[1] ? sprintf(__('%1$s', 'woocommerce'),
wc_price( $prod_prices[0] ) ) : wc_price( $prod_prices[0] );

to hide range prize from product variants.
It is working like a charm.

but i want to also hide this prize in product page (only for varations):

i tried with p.price{display:none;} but it is hidding prize in every product – single and with varations.
Please help,
Luke

  • The forum ‘Virtue Theme’ is closed to new topics and replies.