currency-switcher
4 weeks ago
class-wcml-custom-prices.php
4 weeks ago
class-wcml-multi-currency-configuration.php
4 weeks ago
class-wcml-multi-currency-coupons.php
1 year ago
class-wcml-multi-currency-install.php
4 weeks ago
class-wcml-multi-currency-orders.php
4 weeks ago
class-wcml-multi-currency-prices.php
4 weeks ago
class-wcml-multi-currency-reports.php
4 weeks ago
class-wcml-multi-currency-resources.php
4 weeks ago
class-wcml-multi-currency-shipping.php
4 weeks ago
class-wcml-multi-currency-table-rate-shipping.php
4 weeks ago
class-wcml-multi-currency.php
4 weeks ago
class-wcml-price-filter.php
4 weeks ago
class-wcml-w3tc-multi-currency.php
4 weeks ago
class-wcml-multi-currency-coupons.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | class WCML_Multi_Currency_Coupons { |
| 4 | |
| 5 | public function __construct() { |
| 6 | |
| 7 | add_action( 'woocommerce_coupon_loaded', [ $this, 'filter_coupon_data' ] ); |
| 8 | |
| 9 | } |
| 10 | |
| 11 | public function filter_coupon_data( $coupon ) { |
| 12 | |
| 13 | $discount_type = $coupon->get_discount_type(); |
| 14 | |
| 15 | if ( $discount_type === 'fixed_cart' || $discount_type === 'fixed_product' ) { |
| 16 | $coupon->set_amount( apply_filters( 'wcml_raw_price_amount', $coupon->get_amount() ) ); |
| 17 | } |
| 18 | |
| 19 | $coupon->set_minimum_amount( apply_filters( 'wcml_raw_price_amount', $coupon->get_minimum_amount() ) ); |
| 20 | $coupon->set_maximum_amount( apply_filters( 'wcml_raw_price_amount', $coupon->get_maximum_amount() ) ); |
| 21 | |
| 22 | } |
| 23 | |
| 24 | } |
| 25 |