Skip to content

Instantly share code, notes, and snippets.

@hendcorp
Last active August 20, 2017 09:31
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 hendcorp/df31350b45d08cc76494b9b5532c089c to your computer and use it in GitHub Desktop.
Save hendcorp/df31350b45d08cc76494b9b5532c089c to your computer and use it in GitHub Desktop.
<?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