Skip to content
Snippets Groups Projects
Commit 6311b5c7 authored by Oleksii Korshenko's avatar Oleksii Korshenko Committed by GitHub
Browse files

MAGETWO-86786: Fix missing discount label in checkout #13141

parents 4700a065 f7a79871
Branches
No related merge requests found
......@@ -44,6 +44,25 @@ define([
return this.totals()['coupon_label'];
},
/**
* Get discount title
*
* @returns {null|String}
*/
getTitle: function () {
var discountSegments;
if (!this.totals()) {
return null;
}
discountSegments = this.totals()['total_segments'].filter(function (segment) {
return segment.code === 'discount';
});
return discountSegments.length ? discountSegments[0].title : null;
},
/**
* @return {Number}
*/
......
......@@ -7,7 +7,7 @@
<!-- ko if: isDisplayed() -->
<tr class="totals">
<th colspan="1" style="" class="mark" scope="row">
<span class="title" data-bind="text: title"></span>
<span class="title" data-bind="text: getTitle()"></span>
<span class="discount coupon" data-bind="text: getCouponLabel()"></span>
</th>
<td class="amount" data-bind="attr: {'data-th': title}">
......
......@@ -7,7 +7,7 @@
<!-- ko if: isDisplayed() -->
<tr class="totals discount">
<th class="mark" scope="row">
<span class="title" data-bind="text: title"></span>
<span class="title" data-bind="text: getTitle()"></span>
<span class="discount coupon" data-bind="text: getCouponCode()"></span>
</th>
<td class="amount">
......
......@@ -80,6 +80,10 @@
margin-bottom: 0;
overflow: inherit;
}
.discount.coupon {
display: none;
}
}
// Products table
......
......@@ -49,6 +49,10 @@
}
}
.discount.coupon {
display: none;
}
.grand.incl {
& + .grand.excl {
.mark,
......
......@@ -166,6 +166,10 @@
text-align: left;
}
}
.discount.coupon {
display: none;
}
}
// Products table
......
......@@ -49,6 +49,10 @@
}
}
.discount.coupon {
display: none;
}
.grand.incl {
& + .grand.excl {
.mark,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment