Icono ayuda

¿Necesitas ayuda?

Contactar con asesor por WhatsApp

Saltar al contenido

Ariapsa – Diseño de páginas web México

Cambiar o quitar el intervalo de precios en WooCommerce productos variables (Desde:)

Codigos para woocommerce


add_filter( ‘woocommerce_variable_sale_price_html’,
‘we_variable_product_price’, 10, 2 );
add_filter( ‘woocommerce_variable_price_html’,
‘we_variable_product_price’, 10, 2 );
function we_variable_product_price( $v_price, $v_product ) {
$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(__(‘Desde: %1$s’, ‘woocommerce’),
wc_price( $prod_prices[0] ) ) : wc_price( $prod_prices[0] );
$regular_prices = array( $v_product->get_variation_regular_price( ‘min’, true ),
$v_product->get_variation_regular_price( ‘max’, true ) );
sort( $regular_prices );
$regular_price = $regular_prices[0]!==$regular_prices[1] ? sprintf(__(‘Desde: %1$s’,’woocommerce’)
, wc_price( $regular_prices[0] ) ) : wc_price( $regular_prices[0] );
if ( $prod_price !== $regular_price ) {
$prod_price = ‘<del>’.$regular_price.$v_product->get_price_suffix() . ‘</del> <ins>’ .
$prod_price . $v_product->get_price_suffix() . ‘</ins>’;
}
return $prod_price;
}

 

 

Ariapsa - Diseño de páginas web México
×

Iniciar Sesión

El registro de usuarios no está permitido.