FOX - Currency Switcher for WooCommerce

woocs_price_format

Ce hook est utilisé dans index.php du plugin -> public function woocommerce_price_format :
public function woocommerce_price_format()
{
    $currencies = $this->get_currencies();
    $currency_pos = 'left';
    if (isset($currencies[$this->current_currency]))
    {
        $currency_pos = $currencies[$this->current_currency]['position'];
    }
    $format = '%1$s%2$s';
    switch ($currency_pos)
    {
        case 'left' :
            $format = '%1$s%2$s';
            break;
        case 'right' :
            $format = '%2$s%1$s';
            break;
        case 'left_space' :
            $format = '%1$s %2$s';
            break;
        case 'right_space' :
            $format = '%2$s %1$s';
            break;
    }

    return apply_filters('woocs_price_format', $format, $currency_pos);
}
Donc, si vous avez une idée de votre propre format de prix, utilisez ce hook avec ou sans conditions selon votre propre logique :
add_filter('woocs_price_format', 'my_woocs_custom_format', 999, 2);

function my_woocs_custom_format($format, $currency_pos)
{
    //do smth with $format here
    return $format;
}