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

I can’t add coupon during order creation

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.

Dear support,

The problem is described here:

https://wordpress.org/support/topic/i-cant-add-coupon-during-order-creation/

It also happens with already created orders.

From the dashboard, I can't add a coupon when the plugin is active, I get error 500 on admin-ajax call.

 

Thanks

Daniele

Hello Daniele

Please  try  in file  - \wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php  - comment/delete  this  line - https://share.pluginus.net/image/i20230921145624.png and  add  this  code  - https://share.pluginus.net/image/i20230921145659.png

add_action( 'woocommerce_new_order_item', function($item_id, $item, $order_id){
if (wp_doing_ajax() && isset($_POST['action']) && 'woocommerce_add_coupon_discount' == $_POST['action']) {
$currencies = $this->get_currencies();
$order = wc_get_order($order_id);
$_order_currency = $order->get_currency();
if (isset($currencies[$_order_currency])) {
$this->set_currency($_order_currency);
}
$this->set_currency('EUR');
}

}, 10,3 );

and  do a test

if you have no experience in programming you can provide me with FTP access - https://share.pluginus.net/image/i20230222134241.png -> https://share.pluginus.net/image/i20230222134615.png - I'll change the code