Last active
August 20, 2017 09:31
-
-
Save hendcorp/df31350b45d08cc76494b9b5532c089c 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 | |
public function musicetrade_set_price($price, $product) { | |
global $product; | |
$product_id = $product->get_id(); | |
$seller_currency = self::get_pv_shop_currency(self::get_product_vendor_id($product_id),self::shop_base_currency()); | |
$active_currency = get_woocommerce_currency(); | |
if( $active_currency != $seller_currency ) { | |
//if active currency and vendor's currency are different, do the conversion | |
$etrade_price = round(self::convert($price, $active_currency, $seller_currency)); | |
} else { | |
//otherwise, do not do anything | |
$etrade_price = $price; | |
} | |
return $etrade_price; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment