FOX - Professioneller WooCommerce-Währungsumschalter

So runden Sie den Preis auf 99 Cent

Öffne dein aktuelles wp-Theme functions.php Datei und legen Sie dort den nächsten Code ab:

add_filter('woocs_raw_woocommerce_price', function($price) { return round($price + 0.01) – 0.01; });

Sie können auch Manipulationen für ausgewählte Währungen mit IF vornehmen:

add_filter('woocs_raw_woocommerce_price', function ($price) { global $WOOCS; if ($WOOCS->current_currency === 'USD') { $price = round($price + 0.01) - 0.01; } /* if ($ WOOCS->aktuelle_Währung !== 'EUR') { $price = round($price + 0.01) - 0.01; } * */ return $price; });

Lesen Sie auch: https://currency-switcher.com/hook/woocs_raw_woocommerce_price/

Herkunft: https://wordpress.org/support/topic/round-price-xx-99/