diff --git a/includes/legacy/class-wc-legacy-coupon.php b/includes/legacy/class-wc-legacy-coupon.php index cd41f609116..9d982de331a 100644 --- a/includes/legacy/class-wc-legacy-coupon.php +++ b/includes/legacy/class-wc-legacy-coupon.php @@ -30,6 +30,7 @@ abstract class WC_Legacy_Coupon extends WC_Data { 'type', 'discount_type', 'amount', + 'coupon_amount', 'code', 'individual_use', 'product_ids', @@ -82,6 +83,7 @@ abstract class WC_Legacy_Coupon extends WC_Data { $value = $this->get_discount_type(); break; case 'amount' : + case 'coupon_amount' : $value = $this->get_amount(); break; case 'code' : diff --git a/tests/unit-tests/coupon/data.php b/tests/unit-tests/coupon/data.php index 5af592b8841..52819e32dfa 100644 --- a/tests/unit-tests/coupon/data.php +++ b/tests/unit-tests/coupon/data.php @@ -39,6 +39,7 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case { 'type', 'discount_type', 'amount', + 'coupon_amount', 'code', 'individual_use', 'product_ids', @@ -68,6 +69,7 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case { $this->assertEquals( $coupon->get_discount_type(), $coupon->type ); $this->assertEquals( $coupon->get_discount_type(), $coupon->discount_type ); $this->assertEquals( $coupon->get_amount(), $coupon->amount ); + $this->assertEquals( $coupon->get_amount(), $coupon->coupon_amount ); $this->assertEquals( $coupon->get_code(), $coupon->code ); $this->assertEquals( $coupon->get_individual_use(), ( 'yes' === $coupon->individual_use ? true : false ) ); $this->assertEquals( $coupon->get_product_ids(), $coupon->product_ids );