File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
app/code/Magento/SalesRule
Model/Rule/Condition/Product
Test/Unit/Model/Rule/Condition/Product Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \SalesRule \Model \Rule \Condition \Product ;
7
7
8
+ use Magento \Quote \Api \Data \TotalsItemInterface ;
9
+
8
10
/**
9
11
* Subselect conditions for product.
10
12
*/
@@ -163,9 +165,12 @@ public function validate(\Magento\Framework\Model\AbstractModel $model)
163
165
}
164
166
}
165
167
}
168
+ if ($ attr !== TotalsItemInterface::KEY_BASE_ROW_TOTAL ) {
169
+ $ childrenAttrTotal *= $ item ->getQty ();
170
+ }
166
171
if ($ hasValidChild || parent ::validate ($ item )) {
167
172
$ total += ($ hasValidChild && $ useChildrenTotal && $ childrenAttrTotal > 0 )
168
- ? $ childrenAttrTotal * $ item -> getQty ()
173
+ ? $ childrenAttrTotal
169
174
: $ item ->getData ($ attr );
170
175
}
171
176
}
Original file line number Diff line number Diff line change @@ -249,6 +249,25 @@ public function dataProviderForFixedBundleProduct(): array
249
249
],
250
250
false
251
251
],
252
+ 'validate true for bundle product data with conditions for attribute base_row_total ' =>
253
+ [
254
+ [
255
+ 'id ' => 'attribute_set_id ' ,
256
+ 'name ' => 'base_row_total ' ,
257
+ 'attributeScope ' => 'frontend ' ,
258
+ 'attributeOperator ' => '== '
259
+ ],
260
+ [
261
+ 'id ' => 1 ,
262
+ 'type ' => ProductType::TYPE_BUNDLE ,
263
+ 'qty ' => 2 ,
264
+ 'price ' => 100 ,
265
+ 'hasChildren ' => true ,
266
+ 'baseRowTotal ' => 200 ,
267
+ 'valueParsed ' => 200
268
+ ],
269
+ false
270
+ ],
252
271
'validate true for simple product data with conditions ' =>
253
272
[
254
273
[
You can’t perform that action at this time.
0 commit comments