1616class LianaObserver
1717{
1818 protected static $ display ;
19- protected static $ redemption ;
19+ protected static $ redemption_params ;
2020 protected static $ tiers ;
2121
2222 /**
@@ -46,8 +46,8 @@ class LianaObserver
4646 public static function init ($ display )
4747 {
4848 self ::$ display = $ display ;
49- self ::$ redemption = $ display ['redemption ' ];
5049 self ::$ tiers = $ display ['tiers ' ];
50+ self ::$ redemption_params = $ display ['redemption ' ];
5151 self ::$ redemption_cache = array ();
5252
5353 add_filter ('woocommerce_get_shop_coupon_data ' , array (__CLASS__ , 'getWooCouponData ' ), 10 , 2 );
@@ -129,11 +129,8 @@ protected static function getAllowedDiscount($account, $order_value, $is_notice
129129
130130 $ max_amount = $ order_value ;
131131
132- if (
133- isset (self ::$ redemption ) && isset (self ::$ redemption ['min_beans ' ])
134- && isset (self ::$ redemption ['max_percentage ' ])
135- ) {
136- $ min_beans = self ::$ redemption ['min_beans ' ];
132+ if (isset (self ::$ redemption_params ['min_beans ' ]) && isset (self ::$ redemption_params ['max_percentage ' ])) {
133+ $ min_beans = self ::$ redemption_params ['min_beans ' ];
137134 if ($ account_beans < $ min_beans ) {
138135 if ($ is_notice ) {
139136 $ message = strtr (
@@ -149,7 +146,7 @@ protected static function getAllowedDiscount($account, $order_value, $is_notice
149146 return null ;
150147 }
151148
152- $ percent_discount = self ::$ redemption ['max_percentage ' ];
149+ $ percent_discount = self ::$ redemption_params ['max_percentage ' ];
153150 if ($ percent_discount < 100 ) {
154151 $ max_amount = (1.0 * $ order_value * $ percent_discount ) / 100 ;
155152 if ($ is_notice && $ max_amount < $ account_beans_value ) {
0 commit comments