
Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on August 19, 2021, 11:41
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
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

tarot emporium(@tarot-emporium)
47 PostsTopic Author
Customers
Quote from tarot emporium on August 19, 2021, 13:49
Hi Pablo, please can you advise what the right code would then for single product pages?
Hi Pablo, please can you advise what the right code would then for single product pages?

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on August 20, 2021, 10:44
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;
});
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;
});

tarot emporium(@tarot-emporium)
47 PostsTopic Author
Customers
Quote from tarot emporium on August 20, 2021, 13:59
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)

tarot emporium(@tarot-emporium)
47 PostsTopic Author
Customers
Quote from tarot emporium on August 20, 2021, 14:01
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.
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.

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on August 23, 2021, 09:52
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
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

tarot emporium(@tarot-emporium)
47 PostsTopic Author
Customers
Quote from tarot emporium on August 24, 2021, 04:41
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:

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:


Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on August 24, 2021, 09:32
Hello
Ah, yes! If you use - https://share.pluginus.net/image/i20210824102833.png - prices are redrawn in AJAX mode and this function"is_product()" does not work in ajax mode
Hello
Ah, yes! If you use - https://share.pluginus.net/image/i20210824102833.png - prices are redrawn in AJAX mode and this function"is_product()" does not work in ajax mode

tarot emporium(@tarot-emporium)
47 PostsTopic Author
Customers
Quote from tarot emporium on August 24, 2021, 09:39
Okay, so what now?
Okay, so what now?

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on August 24, 2021, 11:45
In this case, you should customize the plugin code in file - wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - add code - https://share.pluginus.net/image/i20210824124502.png
if ($product AND $product-> is_virtual('yes')) {
return round($price-0.01);
}
In this case, you should customize the plugin code in file - wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - add code - https://share.pluginus.net/image/i20210824124502.png
if ($product AND $product-> is_virtual('yes')) {
return round($price-0.01);
}

tarot emporium(@tarot-emporium)
47 PostsTopic Author
Customers
Quote from tarot emporium on August 24, 2021, 12:19
This worked, great! Thanks!
This worked, great! Thanks!

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on August 25, 2021, 09:34
Great! Welcome;)
Great! Welcome;)