Invalid coupon amount
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 teachmeter on October 7, 2021, 10:18Hi,
I've noticed some strange behaviour in your plugin.
When the option "Individual fixed amount for coupon" for plugin WooCommerce Currency Switcher is on and the client added a coupon (percentage, 10) no special rules, unlimited usage.
Then the coupon works properly in cart for the base currency. As soon as the currency was switched from default to for example EUR then the coupon started to throw a fatal error in the cart.
Some stack trace:
PHP Fatal error: Uncaught WC_Data_Exception: Invalid discount amount in /var/www/html/web/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php:856 Stack trace: #0 /var/www/html/web/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(528): WC_Data->error('coupon_invalid_...', 'Invalid discoun...') #1 /var/www/html/web/wp-content/plugins/woocommerce-currency-switcher/classes/woocs_after_33.php(4634): WC_Coupon->set_amount('150') #2 /var/www/html/web/wp-includes/class-wp-hook.php(303): WOOCS->woocommerce_coupon_loaded(Object(WC_Coupon)) #3 /var/www/html/web/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array) #4 /var/www/html/web/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #5 /var/www/html/web/wp-content/plugins/woocommerce/includes/data-stores/class-wc-coupon-data-store-cpt.php(150): do_action('woocommerce_cou...', Object(WC_Coupon)) #6 /var/www/html/web/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(159): WC_Coupon_Data_Store_CPT->read(Object(WC_Coupon)) #7 in /var/www/html/web/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php on line 856This leads to the culprit which is woocs_after_33.php #4600 woocommerce_coupon_loaded()line 4619 if ($this->is_fixed_coupon) {} which is read from the options as far as I saw.In the end when debugging it caused a confusion to woocommerce because the amount was translated from 10% to 150 -> and this throws an error as the percentage can't be more than 100.I am not sure what this function is doing because it doesn't allow me to enter multiple currencies in the coupon edition menu in Woocommerce.But fixing the fatal error is as easy as disabling it. Is this a bug? Or do I not understand the functionality?
Hi,
I've noticed some strange behaviour in your plugin.
When the option"Individual fixed amount for coupon" for plugin WooCommerce Currency Switcher is on and the client added a coupon (percentage, 10) no special rules, unlimited usage.
Then the coupon works properly in cart for the base currency. As soon as the currency was switched from default to for example EUR then the coupon started to throw a fatal error in the cart.
Some stack trace:
PHP Fatal error: Uncaught WC_Data_Exception: Invalid discount amount in /var/www/html/web/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php:856
Stack trace:
#0 /var/www/html/web/wp-content/plugins/woocommerce/includes/class-wc-coupon.php(528): WC_Data->error('coupon_invalid_...', 'Invalid discoun...')
#1 /var/www/html/web/wp-content/plugins/woocommerce-currency-switcher/classes/woocs_after_33.php(4634): WC_Coupon->set_amount('150')
#2 /var/www/html/web/wp-includes/class-wp-hook.php(303): WOOCS->woocommerce_coupon_loaded(Object(WC_Coupon))
#3 /var/www/html/web/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array)
#4 /var/www/html/web/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
#5 /var/www/html/web/wp-content/plugins/woocommerce/includes/data-stores/class-wc-coupon-data-store-cpt.php(150): do_action('woocommerce_cou...', Object(WC_Coupon))
#6 /var/www/html/web/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(159): WC_Coupon_Data_Store_CPT->read(Object(WC_Coupon))
#7 in /var/www/html/web/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php on line 856Quote from Pablo Borysenco on October 7, 2021, 10:53Hello
Paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png and FTP+ wp-admin access - https://share.pluginus.net/image/i20210618130637.png
Update the plugin to latest version - https://currency-switcher.com/how-to-make-auto-update-for-wordpress-plugins-and-themes-bought-on-envato
Hello
Paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png and FTP+ wp-admin access - https://share.pluginus.net/image/i20210618130637.png
Update the plugin to latest version - https://currency-switcher.com/how-to-make-auto-update-for-wordpress-plugins-and-themes-bought-on-envato
Quote from teachmeter on October 7, 2021, 16:34Hi,
Thanks for the reply. I realised that the clients plugin is not up to date. And this plugin was bought in 2019 according to the changelog.
If we update to the latest version this isn't happening?
Test case:
- Set Individual fixed amount for coupon to ON
- set coupon to percentage, value 10 in woocommerce
- Select product currency other than default
- Add to cart
- Apply percentage coupon in checkout
Hi,
Thanks for the reply. I realised that the clients plugin is not up to date. And this plugin was bought in 2019 according to the changelog.
If we update to the latest version this isn't happening?
Test case:
- Set Individual fixed amount for coupon to ON
- set coupon to percentage, value 10 in woocommerce
- Select product currency other than default
- Add to cart
- Apply percentage coupon in checkout
Quote from Pablo Borysenco on October 8, 2021, 11:26Hello
Paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png
We do not support older versions of the plugin
Hello
Paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png
We do not support older versions of the plugin
Quote from teachmeter on October 8, 2021, 13:36Thanks for the reply. You can remove this topic in that case.
Thanks for the reply. You can remove this topic in that case.
Quote from Pablo Borysenco on October 11, 2021, 09:43Hello
Ok! Great!
Hello
Ok! Great!