-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions (*)
magento 2.3
Steps to reproduce (*)
On Cart Page only Coupon codes get displayed. There is no provision to display discount description on Cart Page ? Whereas on Order View Page, checkout page summary everywhere the discount description gets displayed.
For Cart page In file: /vendor/magento/module-quote/Model/ResourceModel/Quote/Address/Attribute/Frontend/Discount.php - following coding is there:
$title = __('Discount');
$couponCode = $address->getQuote()->getCouponCode();
if (strlen($couponCode)) {
$title .= sprintf(' (%s)', $couponCode);
}
Hence, only coupon code gets displayed.
Whereas, For Order view page in file: /vendor/magento/module-sales/Block/Order/Totals.php - following coding is there.
_initTotals()
if ($this->getSource()->getDiscountDescription()) {
$discountLabel = __('Discount (%1)', $source->getDiscountDescription());
} else {
$discountLabel = __('Discount');
}
Actual result (*)
I am not sure if this is a feature or a bug, but currently discount is displayed differently on cart page as compared to other pages. Which i think is not correct. This is especially highlighted when a coupon code is added to cart and a custom discount with discount description is added to cart.
Expected result (*)
Discount Description should display on cart page