FOX - Currency Switcher for WooCommerce

woocs_price_format

Dieser Hook wird in der index.php des Plugins verwendet -> 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);
}
Falls Sie also eine eigene Vorstellung von Ihrem Preisformat haben, nutzen Sie diesen Hook mit oder ohne Bedingungen nach Ihrer eigenen Logik:
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;
}