Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ define([
return this.totals()['coupon_label'];
},

/**
* Get discount title
*
* @returns {null|string}
*/
getTitle: function () {
var discountSegments = null;
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}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down