WPML
apply_filters( 'wcml_product_price_by_currency', integer $product_id, string $currency )
النوع
filter
إصدار WooCommerce Multilingual
3.9

الوصف

  • يُرجع هذا الخطّاف السعر المخصص في حال إدخاله. وبخلاف ذلك، فإنه يُرجع السعر بناءً على سعر الصرف المحدد.
  • يعمل هذا الخطّاف في الواجهة الأمامية فقط.

الوسطاء

$product_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 →