-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: UiFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Preconditions (*)
- Install the newest version 2.2.6
Steps to reproduce (*)
- Add new product with price $18.42
- Add special price $14
- Add tier price with qty=2, type = "Discount" and value = "%12"
- Add tier price with qty=300, type = "Discount" and value = "%25"
- Add tier price with qty=1000, type = "Discount" and value = "%50"
- Save the product
Expected result (*)
- The tierprice discount calculated by specialprice and show all the tierprice
Actual result (*)
- The price and the "Discount" value on frontend for qty=2 is not visible
- The tierprice percent for qty=300 is 1% instead of 25% on frontend
Possible Solution
In:
\Magento\Catalog\Model\Product\Attribute\Backend\Tierprice.php
change modifyPriceData function like this:
protected function modifyPriceData($object, $data)
{
/** @var \Magento\Catalog\Model\Product $object */
$data = parent::modifyPriceData($object, $data);
$price = $object->getPrice();
// ADD FROM HERE
$specialprice = $object->getSpecialPrice();
$specialPriceFromDate = $object->getSpecialFromDate();
$specialPriceToDate = $object->getSpecialToDate();
$today = time();
if ($specialprice && ($object->getPrice() > $object->getFinalPrice())){
if ($today >= strtotime($specialPriceFromDate) && $today <= strtotime($specialPriceToDate) ||
$today >= strtotime($specialPriceFromDate) && is_null($specialPriceToDate)) {
$price = $specialprice;
}
}
// TO HERE
foreach ($data as $key => $tierPrice) {
$percentageValue = $this->getPercentage($tierPrice);
if ($percentageValue) {
$data[$key]['price'] = $price * (1 - $percentageValue / 100);
$data[$key]['website_price'] = $data[$key]['price'];
}
}
return $data;
}
Metadata
Metadata
Assignees
Labels
Component: UiFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release