WPML
apply_filters( 'wcml_product_price_by_currency', integer $product_id, string $currency )
Type
filter
Version de WooCommerce Multilingual
3.9

Description

  • Ce hook renvoie le prix personnalisé s’il est saisi. Sinon, il renvoie le prix en fonction du taux de change défini.
  • Ce hook fonctionne uniquement sur l’interface publique.

Arguments

$product_id
(entier) (Requis) L’ID du produit
$currency
(chaîne) (Requis) Le code de la devise pour laquelle vous souhaitez obtenir le prix, par ex. « USD », « EUR », etc.

Exemple d’utilisation

Exemple
 // Get the EUR price of the product ID = 80 
$product_id = 80; 
$currency = 'EUR'; 
echo apply_filters( 'wcml_product_price_by_currency', $product_id, $currency );
 
Remarque : Le code Multidevise n’est pas toujours chargé. Si vous constatez que ce filtre ne fonctionne pas, veuillez consulter le hook wcml_load_multi_currency_in_ajax.

wcml_custom_prices_fields_labels, wcml_is_cache_enabled_for_switching_currency, wcml_geolocation_get_user_country, wcml_user_store_strategy, wcml_rounded_price, wcml_currencies_without_cents, wcml_product_custom_prices, wcml_custom_prices_strings, wcml_switch_currency, wcml_custom_prices_fields

Les 24 hooks de la catégorie Fonctionnalité multidevise →