magento2: Discount Description does not get displayed on cart page

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

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (13 by maintainers)

Most upvoted comments

@ishakhsuvarov This is still an issue in 2.1.7, the supposed fix doesn’t work. Please re-open and fix this issue for real.

On Magento 2.1.3 still only the coupon code gets displayed regarding discounts. Fixed discount starting at specific cart amount (eg over 75€ -> get 2%) is applied, but no label is displayed, even though one can set it for the cart rule.

It’s still an issue in Magento 2.1.4. =/