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

WooCommerce Smart Coupons

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.
12

Hi there

I've seen that there is already an adaption of the Plugin"WooCommerce Smart Coupons" by Storeapps. But it seem that it is for an older version: https://currency-switcher.com/woocommerce-smart-coupons-by-storeapps

Can you take a look and adapt it for the current version? I've looked through wp-content\plugins\woocommerce-smart-coupons\includes\class-wc-sc-coupon-process.php, but cant find the part you pasted the code into that you show on your screenshot.

Thank you in advance!

Hello

Please drop me wp-admin+ftp access to your test site - https://share.pluginus.net/image/i20230222134241.png ->https://share.pluginus.net/image/i20230222134615.png

Describe the incompatibility in more detail.

I will add this plugin to latest version

I've added the data you have requested. The staging environment is older, but the affected plugins are up to date.

I've added a"Gift Coupon" product in WooCommerce with the ID of 2659.

All the prices are input in EURO, but the frontend shows the CHF prices. Unfortunately, when viewing the gift coupon product and adding a value, say CHF 100, it gets (unneccesarily) converted again with the exchange rate as it expects the value to be in EURO instead of CHF. You can see this in the shopping cart after adding the gift coupon. It says"Price" CHF 100,"Total" CHF 105 (exchange rate set is 1.05 for EURO - CHF).

Thank you very much for your effort and time!

Hello

Thank you!  I added this plugin to adaptation queue

Hello

In file  -"\woocommerce-smart-coupons\includes\class-wc-sc-purchase-credit.php" -  please add this code - https://share.pluginus.net/image/i20250620141943.png

//woocs
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$cart_item_data['credit_amount'] = $cart_item_data['credit_amount'] / $rate;
}
}
}
and add in functions.php:
add_filter('wc_sc_credit_called_price_cart', function ($price, $args) {
if (class_exists('WOOCS') AND $price > 0) {
global $WOOCS;
$price = $WOOCS->woocs_exchange_value(floatval($price));
}
return $price;
}, 10, 2);
clear all cache and do a test

Thank you for the code.

This works on the main language, once switched to another language, the problem returns. Is there anything I can do so it works on all languages?

Hello

My  test - https://share.pluginus.net/video/v20250704145702.mp4 - It seems you didn't translate the products correctly, the language switch doesn't work at all

I have already implemented it on the live site. Let me add a translation on the staging site so you can check it out. Ill post in a couple of minutes once I'm done.

Can you please remove the video you've just posted as it identifies the website. Thank you very much!

Alright, I've added the translation to the staging environment.

When I add a gift card to the cart on the german version, for example CHF 100, it gets added to the cart as CHF 100. So far, so good. But when I switch to the french version and add CHF 200, the previous gift card that had been added in the german version all of a sudden has a value of CHF 105 instead of CHF 100.

Hello

Ok!  Our developer will check it on Friday.

Hello

in file   -"\woocommerce-smart-coupons\includes\class-wc-sc-purchase-credit.php" -  please add this code - https://share.pluginus.net/image/i20250718150148.png

//woocs
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$cart_item_data['credit_amount'] = $cart_item_data['credit_amount'] / $rate;
}
}
}
and add in functions.php:
add_filter('wc_sc_credit_called_price_cart', function ($price, $args) {
if (class_exists('WOOCS') AND $price > 0) {
global $WOOCS;
$price = $WOOCS->woocs_exchange_value(floatval($price));
}
return $price;
}, 10, 2);
clear all cache and do a test

my  test - https://share.pluginus.net/video/v20250718150532.mp4

Thank you for your work, Pablo!
The adding to the cart and checkout process now works fine, but once I've bought the credit, I get credited CHF 105 instead of CHF 100: https://imgur.com/a/N9FBw6H

 

Hello

Please do a test and describe in detail all the incompatibilities and steps to get these errors

  1. Buy a new coupon for CHF 100. This seems to work so far (adding to cart, checking out, paying etc.) The order shows up with the correct ammount in the backend under"WooCommerce" ->"Orders".
  2. As an admin, set the new order you just made to"completed". The user now gets the coupon assigned.
  3. As the user who bought the coupon, the new coupon is listed under"My Account" ->"Coupons" (/mein-konto/wc-smart-coupons/). But it has a value of CHF 105 instead of CHF 100 (see https://imgur.com/a/N9FBw6H)

Hello

Ok! Thank you

I will check it

Hi Pablo, any news on this issue?

Hello

Our developer was on vacation, we will check this issue on Friday

Hello

I did a test.  I bought and confirmed two coupons - https://share.pluginus.net/image/i20250829131350.png .  But I don't see them on the account page - https://share.pluginus.net/image/i20250829131234.png

Maybe I'm doing something wrong?

Can you try again, does the coupon show up now? I've changed some options. You seem to be doing everything correctly.

12