SignaturePHP
apply_filters( 'wcml_product_price_by_currency', integer $product_id, string $currency )
Description
- This hook returns the custom price if entered. Otherwise, it returns the price based on the set exchange rate.
- This hook works only on the front-end.
Arguments
$product_idintegerRequiredThe product ID$currencystringRequiredThe currency code you want to get the price for, e.g. “USD”, “EUR”, etc.
Example Usage
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 );