Last active
July 20, 2021 16:28
-
-
Save plugin-republic/93a9a97c2329fea612c20bdc735d941d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pewc_get_multicurrency_price( $price, $item, $product ) { | |
// 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, 3 ); | |
add_filter( 'pewc_filter_option_price', 'pewc_get_multicurrency_price', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This worked for me once I'd added the additional
$item
parameter, otherwise my option prices all returned0
.