PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]
Cyber Monday 2021
Cyber Monday 2021 timer

Support Forum

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

Unable to round cents to 0.99, 0.50 or 0.95 when switching currencies

This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see blue-green button on the right side) and press Save button.
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.
12

Hello

It is possible to define it on the single product page but not possible on the store page.

your code is not correct and will not work

Hi Pablo, please can you advise what the right code would then for single product pages?

Hello

An example:

add_filter('woocs_raw_woocommerce_price', function($price){

if(is_product()){

global $post, $woocommerce, $product;

if ($product-> is_virtual('yes')) {

return round($price-0.01)

}

}

return round($price-0.01) - 0.05;

});

Thanks Pablo, but I receive a syntax error on:
"if ($product-> is_virtual('yes')) {"

syntax error, unexpected 'if' (T_IF)

 

Thanks Pablo, but I receive a syntax error on:
"if ($product-> is_virtual('yes')) {"

syntax error, unexpected 'if' (T_IF)

*Also want to note I would like all products ending with XX.95, however virtual products to be say $70.00.

Hello

Perhaps there is an invalid character in the code

Write this code by hand (do not copy)

And  drop me  a screenshot  of  this  code in your file

I updated the code to work without syntax error.. then on the digital product page it works for a second, shows example: $140.00 then it reverts back to $130.95.
Test site: https://tarotemporium.com.au/shop/tarot-reading/cheryl-marianne/

Code:
Code

Hello

Ah,  yes!  If  you  use - https://share.stackovergo.com/image/i20210824102833.png  - prices are redrawn in AJAX mode and this function"is_product()" does not work in ajax mode

Okay, so what now?

In this case, you should customize the plugin code in file  - wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - add  code -  https://share.stackovergo.com/image/i20210824124502.png

if ($product AND $product-> is_virtual('yes')) {
return round($price-0.01);
}

This worked, great! Thanks!

Great!  Welcome;)

12