problem with coupons
-
Hi there!
We have come across some very unpleasant issue with X-Currency that we are not able to fix. Namely, we cannot use coupons that have “Exclude sale items” restriction, because when X-Currency plugin is enabled this restriction simply doesn’t work as it’s supposed. Namely, when the restriction is active and we have a non-sale item in cart, the coupon doesn’t work as well as when we have a sale item in the cart. That has been checked and rechecked. When we switch off X-Currency everything starts to work fine again.
We started research by ourselves and that’s what we have found out. X-Currency somehow changes the sale price of all items that are not on sale to “0” instead of empty value “”. And that is really crucial for Woocommerce, because in the function that checks whether a product is on sale it has the following condition in /includes/abstracts/abstract-wc-product.php:
public function is_on_sale( $context = 'view' ) {if ( '' !== (string) $this->get_sale_price( $context ) && $this->get_regular_price( $context ) > $this->get_sale_price( $context ) ) {$on_sale = true;The condition
'' !== (string) $this->get_sale_price( $context )is always true because the sale price is really “0” and not “”!Please advise, how could this be treated and fixed? Unfortunately we cannot use your plugin because of this small issue. Can it be fixed in the next updates?
Thanks in advance!
best regards,
Michael
You must be logged in to reply to this topic.