Skip to content

Commit 38ba59d

Browse files
committed
ACPT-1408: Investigate 1m call on 1k rules
1 parent c741823 commit 38ba59d

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

app/code/Magento/Quote/Model/Quote/Address.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
* @method float getDiscountAmount()
8787
* @method Address setDiscountAmount(float $value)
8888
* @method float getBaseDiscountAmount()
89-
* @method Address setBaseDiscountAmount(float $value)
9089
* @method float getGrandTotal()
9190
* @method Address setGrandTotal(float $value)
9291
* @method float getBaseGrandTotal()
@@ -142,6 +141,8 @@ class Address extends AbstractAddress implements
142141

143142
private const CACHED_ITEMS_ALL = 'cached_items_all';
144143

144+
private const BASE_DISCOUNT_AMOUNT = 'base_discount_amount';
145+
145146
/**
146147
* Prefix of model events
147148
*
@@ -1796,4 +1797,15 @@ protected function getCustomAttributesCodes()
17961797
{
17971798
return array_keys($this->attributeList->getAttributes());
17981799
}
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+
}
17991811
}

app/code/Magento/SalesRule/Model/Quote/Discount.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,9 @@ public function collect(
199199
unset($itemsToApplyRules[$key]);
200200
}
201201

202-
//@TODO write actual implementation//
203-
// $address->setDiscountAmount($total->getDiscountAmount());
204-
// $address->setBaseDiscountAmount($total->getBaseDiscountAmount());
205202
$totalDiscount += $item->getBaseDiscountAmount();
206-
// $address->setBaseDiscountAmount($totalDiscount);
207-
// $address->setSubtotalWithDiscount($total->getSubtotal() + $total->getDiscountAmount());
208-
209-
// $this->calculator->initTotal($item, $rule, $address);
210203
}
211204
$address->setBaseDiscountAmount($totalDiscount);
212-
// $this->calculator->initTotals($items, $address);
213205
}
214206
$this->calculator->initTotals($items, $address);
215207
foreach ($items as $item) {

dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ private function createProduct(float $price): ProductInterface
305305

306306
return $productRepository->save($product);
307307
}
308-
//
308+
309309
/**
310310
* Gets order entity by increment id.
311311
*

0 commit comments

Comments
 (0)