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

Custom Plugin Is Conflicting With WOOCS

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.

Hello there,

I have created a custom function which uses these three hooks:

//Change Price on the FrontEnd
add_filter("woocommerce_get_price_html","supersu_alter_price_display", 9999, 2);
// Change Actual Product Price on Product Page and The Cart
// and apply the discount
add_action("woocommerce_before_calculate_totals","supersu_alter_price_cart", 9999);
// Change Price in Minicart
add_action("woocommerce_before_mini_cart","supersu_force_cart_calculation");

 

What this basically does is, add a fixed amount of price to the price shown to the user based on geolocation, then I offer them discount using coupons using a few formulas and conditions.

I basically want to keep the default price and everything for Indian Customers (INR) and add a static amount per item for foreign customers and then offer them discount.

 

So let us say the product is worth 1000 INR, and I add 3000 static amount to it, to make it 4000 INR for foreign countries, it conflicts with WOOCS. What basically happens is that, first the 1000 INR price get converted to USD (lets assume us customer) i.e. approx 12.8 USD, then the 3000 get added to it and the price display as 3012.8 USD.

However, I first want my plugin to add 3k to the main price and then WOOCS to change the price based on geolocation.

Looking for urgent help

Thank You

Hello

In this case, you should use other hooks to add the price.

OR  convert your custom price before recalculation - https://currency-switcher.com/function/woocs-woocs_exchange_value