Skip to content

Commit

Permalink
fix(storefront): BCTHEME-355 fix additional checkout buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-alexsaiannyi committed Sep 6, 2021
1 parent 6478161 commit e61bd1c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- additional checkout buttons don't work on applying 100% discount coupon. [#2109](https://github.com/bigcommerce/cornerstone/pull/2109)

## 6.0.0 (08-06-2021)
- Translation mechanism for config.json has been updated. [#2089](https://github.com/bigcommerce/cornerstone/pull/2089)
Expand Down
3 changes: 3 additions & 0 deletions assets/js/theme/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default class Cart extends PageManager {
this.$cartContent = $('[data-cart-content]');
this.$cartMessages = $('[data-cart-status]');
this.$cartTotals = $('[data-cart-totals]');
this.$cartAdditionalCheckoutBtns = $('[data-cart-additional-checkout-buttons]');
this.$overlay = $('[data-cart] .loadingOverlay')
.hide(); // TODO: temporary until roper pulls in his cart components
this.$activeCartItemId = null;
Expand Down Expand Up @@ -221,6 +222,7 @@ export default class Cart extends PageManager {
totals: 'cart/totals',
pageTitle: 'cart/page-title',
statusMessages: 'cart/status-messages',
additionalCheckoutButtons: 'cart/additional-checkout-buttons',
},
};

Expand All @@ -235,6 +237,7 @@ export default class Cart extends PageManager {
this.$cartContent.html(response.content);
this.$cartTotals.html(response.totals);
this.$cartMessages.html(response.statusMessages);
this.$cartAdditionalCheckoutBtns.html(response.additionalCheckoutButtons);

$cartPageTitle.replaceWith(response.pageTitle);
this.bindEvents();
Expand Down
5 changes: 5 additions & 0 deletions templates/components/cart/additional-checkout-buttons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if cart.additional_checkout_buttons}}
{{#each cart.additional_checkout_buttons}}
{{{this}}}
{{/each}}
{{/if}}
11 changes: 4 additions & 7 deletions templates/pages/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@
</div>
{{/if}}

{{#if cart.additional_checkout_buttons}}
<div class="cart-additionalCheckoutButtons cart-content-padding-right">
{{#each cart.additional_checkout_buttons}}
{{{this}}}
{{/each}}
</div>
{{/if}}
<div data-cart-additional-checkout-buttons class="cart-additionalCheckoutButtons cart-content-padding-right">
{{> components/cart/additional-checkout-buttons}}
</div>

{{else}}
<h3 tabindex="0">{{lang 'cart.checkout.empty_cart'}}</h3>
{{/if}}
Expand Down

0 comments on commit e61bd1c

Please sign in to comment.