woocommerce_variable_price_html

FILTER woocommerce\includes\class-wc-product-variable.php (ligne 186) github
Returns the price in html format. Note: Variable prices do not show suffixes like other product types. This is due to some things like tax classes being set at variation level which could differ from the parent price. The only way to show accurate prices would be to load the variation and get it's price, which adds extra overhead and still has edge cases where the values would be inaccurate. Additionally, ranges of prices no longer show 'striked out' sale prices due to the strings being very long and unclear/confusing. A single range is shown instead.

Paramètres

Entrée :
$price . $this->get_price_suffix(
Sortie :
@param string $price Price (default: '').
@return string

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_variable_price_html'
add_filter('woocommerce_variable_price_html', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($price . $this->get_price_suffix() {
    // Modifier la valeur
    return $price . $this->get_price_suffix(;
}

Actualités

Chargement des actualités...