File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed
dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 86
86
* @method float getDiscountAmount()
87
87
* @method Address setDiscountAmount(float $value)
88
88
* @method float getBaseDiscountAmount()
89
- * @method Address setBaseDiscountAmount(float $value)
90
89
* @method float getGrandTotal()
91
90
* @method Address setGrandTotal(float $value)
92
91
* @method float getBaseGrandTotal()
@@ -142,6 +141,8 @@ class Address extends AbstractAddress implements
142
141
143
142
private const CACHED_ITEMS_ALL = 'cached_items_all ' ;
144
143
144
+ private const BASE_DISCOUNT_AMOUNT = 'base_discount_amount ' ;
145
+
145
146
/**
146
147
* Prefix of model events
147
148
*
@@ -1796,4 +1797,15 @@ protected function getCustomAttributesCodes()
1796
1797
{
1797
1798
return array_keys ($ this ->attributeList ->getAttributes ());
1798
1799
}
1800
+
1801
+ /**
1802
+ * @param float $value
1803
+ * @return $this
1804
+ */
1805
+ public function setBaseDiscountAmount (float $ value )
1806
+ {
1807
+ $ this ->_data [self ::BASE_DISCOUNT_AMOUNT ] = $ value ;
1808
+
1809
+ return $ this ;
1810
+ }
1799
1811
}
Original file line number Diff line number Diff line change @@ -199,17 +199,9 @@ public function collect(
199
199
unset($ itemsToApplyRules [$ key ]);
200
200
}
201
201
202
- //@TODO write actual implementation//
203
- // $address->setDiscountAmount($total->getDiscountAmount());
204
- // $address->setBaseDiscountAmount($total->getBaseDiscountAmount());
205
202
$ totalDiscount += $ item ->getBaseDiscountAmount ();
206
- // $address->setBaseDiscountAmount($totalDiscount);
207
- // $address->setSubtotalWithDiscount($total->getSubtotal() + $total->getDiscountAmount());
208
-
209
- // $this->calculator->initTotal($item, $rule, $address);
210
203
}
211
204
$ address ->setBaseDiscountAmount ($ totalDiscount );
212
- // $this->calculator->initTotals($items, $address);
213
205
}
214
206
$ this ->calculator ->initTotals ($ items , $ address );
215
207
foreach ($ items as $ item ) {
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ private function createProduct(float $price): ProductInterface
305
305
306
306
return $ productRepository ->save ($ product );
307
307
}
308
- //
308
+
309
309
/**
310
310
* Gets order entity by increment id.
311
311
*
You can’t perform that action at this time.
0 commit comments