PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Variations: When selecting an item in one currency, the variation price doesn't appear

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

This occurs on https://www.bedoco.store/product/cheetah-on-the-run-set/?currency=USD

We use two currencies on the site.  When you choose a variation (called style here), when using USD the price does not appear above the"add to cart" table.  It does appear when using IDR.  I can see that the correct price in USD is in the form JSON, and it does show up correctly in the cart.

I tried using the following code in the /woocommerce/woocommerce-currency-switcher/classes/woocs_after_33.php as suggested in another post, but nothing changed.

public function raw_woocommerce_price($price, $product = NULL, $min_max = NULL, $display = NULL) {

if (isset($_REQUEST['woocs_block_price_hook'])) {
return $price;
}

//***

if (isset($_REQUEST['woocs_raw_woocommerce_price_currency'])) {
$this->current_currency = $_REQUEST['woocs_raw_woocommerce_price_currency'];
}

$currencies = $this->get_currencies();

if (in_array($this->current_currency, $this->no_cents)/* OR $currencies[$this->current_currency]['hide_cents'] == 1 */) {
$precision = 0;
} else {
if ($this->current_currency != $this->default_currency) {
$precision = $this->get_currency_price_num_decimals($this->current_currency, $this->price_num_decimals);
} else {
$precision = $this->get_currency_price_num_decimals($this->default_currency, $this->price_num_decimals);
}
}

//***
$is_price_custom = false;
if ($this->is_fixed_enabled) {
if ($this->is_multiple_allowed AND $product !== NULL AND is_object($product)) {

//if (isset($product->variation_id))
if ($product->is_type('variation')) {

$tmp_val = $this->_get_product_fixed_price($product, 'variation', $price, $precision);
} elseif($product->is_type('variable')){
$tmp_val=-1;
}else {
$tmp_val = $this->_get_product_fixed_price($product, 'single', $price, $precision);
}

if ((int) $tmp_val !== -1) {
$price = apply_filters('woocs_fixed_raw_woocommerce_price', $tmp_val, $product, $price);
$is_price_custom = true;
}
}
}
//***
if ($this->is_geoip_manipulation AND ! $is_price_custom) {
if ($product !== NULL) {
try {
$product_emulator = (object) array('id' => $product->get_id());
} catch (Exception $e) {

}

$price = $this->_get_product_geo_price($product_emulator, $price);
}
}
if ($this->is_fixed_user_role AND $product !== NULL) {
if ($product->is_type('variation')) {

$tmp_val = $this->_get_product_fixed_user_role_price($product, 'variation', $price, $precision);
} elseif($product->is_type('variable')){
$tmp_val=-1;
} else {
$tmp_val = $this->_get_product_fixed_user_role_price($product, 'single', $price, $precision);
}

if ((int) $tmp_val !== -1) {
$price = $tmp_val;
$is_price_custom = false;
}
}

//***

if (!$is_price_custom) {
if ($this->current_currency != $this->default_currency) {
//Edited this line to set default convertion of currency
if (isset($currencies[$this->current_currency]) AND $currencies[$this->current_currency] != NULL) {
$price = number_format(floatval((float) $price * (float) $currencies[$this->current_currency]['rate']), $precision, $this->decimal_sep, '');
} else {
$price = number_format(floatval((float) $price * (float) $currencies[$this->default_currency]['rate']), $precision, $this->decimal_sep, '');
}
}
}

return apply_filters('woocs_raw_woocommerce_price', $price);}

Hello

Please  read  this  - https://currency-switcher.com/currency-recounts-wrong-double-zero-and-others/

it looks like a conflict with a third-party plugin.

The prices in the variations are converted correctly, but the price_html is empty - https://c2n.me/45SWmD1.png