Skip to content

Fix missing discount label in checkout #13141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 17, 2018
Merged
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,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}
*/
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
margin-bottom: 0;
overflow: inherit;
}

.discount.coupon {
display: none;
}
}

// Products table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
}
}

.discount.coupon {
display: none;
}

.grand.incl {
& + .grand.excl {
.mark,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@
text-align: left;
}
}

.discount.coupon {
display: none;
}
}

// Products table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
}
}

.discount.coupon {
display: none;
}

.grand.incl {
& + .grand.excl {
.mark,
Expand Down