Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattradford/11b78b4bc8a68cb2e038058efc1d0e4e to your computer and use it in GitHub Desktop.
Save mattradford/11b78b4bc8a68cb2e038058efc1d0e4e to your computer and use it in GitHub Desktop.
<?php
function pewc_get_multicurrency_price( $price ) {
// Compatibility with WooCommerce multilingual
$price = apply_filters( 'wcml_raw_price_amount', $price );
if( class_exists('WOOCS') ) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$price = $WOOCS->woocs_exchange_value( floatval( $price ) );
}
}
return $price;
}
add_filter( 'pewc_filter_field_price', 'pewc_get_multicurrency_price', 10, 1 );
add_filter( 'pewc_filter_option_price', 'pewc_get_multicurrency_price', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment