WPML
apply_filters( 'wcml_product_price_by_currency', integer $product_id, string $currency )
סוג
filter
גרסת WooCommerce Multilingual
3.9

תיאור

  • הוק זה מחזיר את המחיר המותאם אישית אם הוזן. אחרת, הוא מחזיר את המחיר על סמך שער החליפין שהוגדר.
  • הוק זה פועל רק בצד הלקוח.

ארגומנטים

$product_id
(מספר שלם) (נדרש) מזהה (ID) של המוצר
$currency
(מחרוזת) (נדרש) קוד המטבע שעבורו תרצה לקבל את המחיר, למשל “USD”, “EUR” וכו’.

דוגמה לשימוש

דוגמה
 // 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 );
 
שים לב: קוד ריבוי מטבעות אינו נטען תמיד. אם תגלה שפילטר זה אינו פועל, עיין בהוק 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

כל 24 ההוקים בקטגוריה תכונת ריבוי מטבעות →