File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
app/code/Magento/SalesRule/Model/Rule/Condition Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ public function getInputType()
99
99
return 'numeric ' ;
100
100
101
101
case 'shipping_method ' :
102
+ case 'payment_method ' :
102
103
case 'country_id ' :
103
104
case 'region_id ' :
104
105
return 'select ' ;
@@ -115,6 +116,7 @@ public function getValueElementType()
115
116
{
116
117
switch ($ this ->getAttribute ()) {
117
118
case 'shipping_method ' :
119
+ case 'payment_method ' :
118
120
case 'country_id ' :
119
121
case 'region_id ' :
120
122
return 'select ' ;
@@ -143,6 +145,10 @@ public function getValueSelectOptions()
143
145
$ options = $ this ->_shippingAllmethods ->toOptionArray ();
144
146
break ;
145
147
148
+ case 'payment_method ' :
149
+ $ options = $ this ->_paymentAllmethods ->toOptionArray ();
150
+ break ;
151
+
146
152
default :
147
153
$ options = [];
148
154
}
@@ -168,6 +174,10 @@ public function validate(\Magento\Framework\Model\AbstractModel $model)
168
174
}
169
175
}
170
176
177
+ if ('payment_method ' == $ this ->getAttribute () && !$ address ->hasPaymentMethod ()) {
178
+ $ address ->setPaymentMethod ($ model ->getQuote ()->getPayment ()->getMethod ());
179
+ }
180
+
171
181
return parent ::validate ($ address );
172
182
}
173
183
}
You can’t perform that action at this time.
0 commit comments