シグネチャPHP
apply_filters( 'wcml_product_price_by_currency', integer $product_id, string $currency )
説明
- このフックは、入力されている場合はカスタム価格を返します。それ以外の場合は、設定された為替レートに基づく価格を返します。
- このフックはフロントエンドでのみ機能します。
引数
$product_idinteger必須商品ID$currencystring必須価格を取得したい通貨コード(例:「USD」、「EUR」など)
使用例
PHP
// 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 );