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

Issue with woocs_currency_data_manipulation filter

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.

I'm using this information as reference for a snippet to change the rate for some products on my shop.

add_filter( 'woocs_currency_data_manipulation', 'woocs_currency_data_manipulation_price_freeze', 1, 1 );
function woocs_currency_data_manipulation_price_freeze( $currencies ) {
foreach ( $currencies as $key => $value ) {
if ( has_term( array( 'precio-congelado', 'price-freeze' ), 'product_tag' ) && $key == 'ARS' ) {
$currencies[$key]['rate'] = 205.367199; // Rate to be used with products with the tag price freeze
break;
}
}
return $currencies;
}

The snippet works fine on single product pages and category pages, but it doesn't work in the cart and checkout pages. In the cart and checkout I get the price with the rate I see in the plugin settings in admin.php?page=wc-settings&tab=woocs

Any idea what could causing this? Maybe there's another filter I should be using?

I basically need a custom rate for products using certain tags.

Hello

has_term - this should not work on the checkout page, it only works when there is a global product.

Is there another filter I could use to solve my issue?

Hello

Unfortunately there is no other hook to change the rate

But your main problem is not with the hook, but with the definition of the current product