Skip to content
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

fix(storefront): BCTHEME-355 fix additional checkout buttons #2109

Merged
merged 2 commits into from
Sep 29, 2021
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
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)
- Fix sliding carousel with products cause footer headers flickering. [#2119](https://github.com/bigcommerce/cornerstone/pull/2119)


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