Forked from plugin-republic/pewc_get_multicurrency_price.php
Created
July 20, 2021 16:28
-
-
Save tamara-m/35734c4d42c9088d7a899d75ac5d8654 to your computer and use it in GitHub Desktop.
This file contains hidden or 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