Switch of WOOCS for one product only
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 pleaseIf 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.
Quote from Michael on July 27, 2022, 13:18Hello, I want to switch off the currency conversion for one product only.
We have one product in our shop which should be 1990 in EUR and USD, ignoring the actual exchange rate. All other products should not be affected by this (so a fixed 1:1 exchange rate in the settings is not an option).
It should also be changed (not automatically converted) in the database forever since another plugin (pricing and discounts) needs to take the 1990 I'm EUR and USD as well.
How can I do this? Hardcoding via the product ID is totally okay, it doesn't need to be very sophisticated. Just for this one product only and forever.
Best regards
Michael
Hello, I want to switch off the currency conversion for one product only.
We have one product in our shop which should be 1990 in EUR and USD, ignoring the actual exchange rate. All other products should not be affected by this (so a fixed 1:1 exchange rate in the settings is not an option).
It should also be changed (not automatically converted) in the database forever since another plugin (pricing and discounts) needs to take the 1990 I'm EUR and USD as well.
How can I do this? Hardcoding via the product ID is totally okay, it doesn't need to be very sophisticated. Just for this one product only and forever.
Best regards
Michael
Quote from Pablo Borysenco on July 28, 2022, 10:58Hello Michael
it is possible to do it but only on the single product page. An example:
add_filter('wp_head',function(){ if(is_product()){global $product; $id = $product->get_id(); if ($id!= X){ return; }global $WOOCS; $WOOCS->set_currency('EUR'); } });
Hello Michael
it is possible to do it but only on the single product page. An example:
add_filter('wp_head',function(){
if(is_product()){ global $product;
$id = $product->get_id();
if ($id!= X){
return;
} global $WOOCS;
$WOOCS->set_currency('EUR');
}
});Quote from Michael on July 28, 2022, 13:31Hello Pablo,
thank you for your answer.
For the frontend display we don't have any issue.
Our issue is that the 'real' price from the database is taken by the bulk purchase plugin. Is there however any possibility to disable the plugin for this one product so it wouldn't alter the price in USD and EUR in the database?
Best Regards
Hello Pablo,
thank you for your answer.
For the frontend display we don't have any issue.
Our issue is that the 'real' price from the database is taken by the bulk purchase plugin. Is there however any possibility to disable the plugin for this one product so it wouldn't alter the price in USD and EUR in the database?
Best Regards
Quote from Pablo Borysenco on July 29, 2022, 09:05Hello
All prices must be stored in only one currency
Unfortunately my plugin does not have this feature.
Hello
All prices must be stored in only one currency
Unfortunately my plugin does not have this feature.
Quote from Michael on July 29, 2022, 20:39Okay, I understand that the plugin doesn't have the feature build in.
But could you hint me where (which file) I could hardcode and exclude the plugin for one product?
Okay, I understand that the plugin doesn't have the feature build in.
But could you hint me where (which file) I could hardcode and exclude the plugin for one product?
Quote from Pablo Borysenco on August 1, 2022, 18:41hello
How my plugin works: Prices are stored in the base currency in the database. My plugin does not change this and does not affect it in any way.
before displaying the product, my plugin intercepts the prices and converts them on the fly
in file - \wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - function - raw_woocommerce_price
hello
How my plugin works: Prices are stored in the base currency in the database. My plugin does not change this and does not affect it in any way.
before displaying the product, my plugin intercepts the prices and converts them on the fly
in file - \wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - function - raw_woocommerce_price
Quote from Michael on August 3, 2022, 13:55I got it I think.
At the top of the function
raw_woocommerce_price
I simply put
//exclude one product from currency conversion
$id = $product->get_id();
if($id == XXX OR $id == XXX) {
return$price;
}
Where XXX is the product id of your WooCommerce product.
That does the trick for me. Maybe this helps someone else with the similar issue.
I got it I think.
At the top of the function
raw_woocommerce_price
I simply put
//exclude one product from currency conversion
$id = $product->get_id();
if($id == XXX OR $id == XXX) {
return$price;
}
Where XXX is the product id of your WooCommerce product.
That does the trick for me. Maybe this helps someone else with the similar issue.
Quote from Pablo Borysenco on August 4, 2022, 16:08Hello
Thank you for your cooperation
Welcome;)
Hello
Thank you for your cooperation
Welcome;)