Quote from genX on August 27, 2022, 19:27
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 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