availability:

WooCommerce Multilingual Version: 3.9

description:
  • Get the product price in selected currency.
  • This hook returns the custom price if entered. Otherwise, it returns the price based on the set exchange rate.
  • This hook works in the front-end only.
type:
filter
category:
Multi­-currency Feature
parameters:
apply_filters( 'wcml_product_price_by_currency', integer $product_id, string $currency )
$product_id
(integer) (Required) The product ID
$currency
(string) (Required) The currency code you want to get the price for, e.g. “USD”, “EUR”, etc.
hook example usage:

 

Example

// 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 );