Skip to content

Commit

Permalink
Merge pull request bigcommerce#2257 from serhii-tkachenko/PAYPAL-1474
Browse files Browse the repository at this point in the history
feat(payment): PAYPAL-1474 added data attribute for 'Check out' buttons and add…
  • Loading branch information
serhii-tkachenko authored Sep 7, 2022
2 parents 77a1b01 + 575b85a commit a9b906c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
21 changes: 16 additions & 5 deletions assets/scss/components/stencil/cart/_cart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -535,14 +535,15 @@ $card-preview-zoom-bottom-offset: 6rem;
}
}

.cart-additionalCheckoutButtons {
@extend %additionalCheckoutButtons;
.cart-acceleratedCheckoutButtons {
align-items: end;
display: flex;
flex-direction: column;
width: 100%;
}

.previewCart-additionalCheckoutButtons {
.cart-additionalCheckoutButtons {
@extend %additionalCheckoutButtons;
padding-bottom: spacing("single");
padding-right: spacing("single");
}

// Cart Preview
Expand Down Expand Up @@ -679,3 +680,13 @@ $card-preview-zoom-bottom-offset: 6rem;
padding: spacing("double");
text-align: center;
}

.previewCart-acceleratedCheckoutButtons {
width: 100%;
}

.previewCart-additionalCheckoutButtons {
@extend %additionalCheckoutButtons;
padding-bottom: spacing("single");
padding-right: spacing("single");
}
9 changes: 8 additions & 1 deletion templates/components/common/cart-preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ <h6 class="previewCartItem-name">
{{/each}}
</ul>
<div class="previewCartAction">
{{#if cart.additional_checkout_buttons}}
<div data-cart-accelerated-checkout-buttons class="previewCart-acceleratedCheckoutButtons"></div>
{{/if}}
{{#if cart.show_primary_checkout_button}}
<div class="previewCartAction-checkout">
<a href="{{urls.checkout.single_address}}" class="button button--small button--primary">
<a
href="{{urls.checkout.single_address}}"
class="button button--small button--primary"
data-primary-checkout-now-action
>
{{lang 'cart.preview.checkout_now'}}
</a>
</div>
Expand Down
21 changes: 17 additions & 4 deletions templates/pages/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@

{{{region name="cart_below_totals"}}}

{{#if cart.additional_checkout_buttons}}
<div data-cart-accelerated-checkout-buttons class="cart-acceleratedCheckoutButtons cart-content-padding-right"></div>
{{/if}}

{{#if cart.show_primary_checkout_button}}
<div class="cart-actions cart-content-padding-right">
<a class="button button--primary" href="{{urls.checkout.single_address}}" title="{{lang 'cart.checkout.title'}}">{{lang 'cart.checkout.button'}}</a>
<a
class="button button--primary"
href="{{urls.checkout.single_address}}"
title="{{lang 'cart.checkout.title'}}"
data-primary-checkout-now-action
>
{{lang 'cart.checkout.button'}}
</a>
{{#if cart.show_multiple_address_shipping}}
<a class="checkoutMultiple" href="{{urls.checkout.multiple_address}}">
{{lang 'cart.preview.checkout_multiple'}}
Expand All @@ -43,9 +54,11 @@
</div>
{{/if}}

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

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

0 comments on commit a9b906c

Please sign in to comment.