-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add blocks to the cart page share basket template (#42)
Co-authored-by: Janko <[email protected]>
- Loading branch information
Showing
1 changed file
with
36 additions
and
33 deletions.
There are no files selected for viewing
69 changes: 36 additions & 33 deletions
69
src/Resources/views/storefront/page/checkout/cart/index.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,45 @@ | ||
{% sw_extends '@Storefront/storefront/page/checkout/cart/index.html.twig' %} | ||
|
||
{% block page_checkout_cart_product_table %} | ||
<div class="mb-3"> | ||
<div class="row"> | ||
<div class="col-sm-12 col-md-8 col-lg-6"> | ||
|
||
{% if page.froshShareBasketState == 'cartExists' %} | ||
|
||
{% sw_include '@Storefront/storefront/utilities/frosh-share-basket.html.twig' with { | ||
froshShareBasketUrl: page.froshShareBasketUrl, | ||
froshShareBasketState: page.froshShareBasketState, | ||
} %} | ||
|
||
{% elseif page.froshShareBasketState != 'cartLoaded' %} | ||
|
||
<div class="js-frosh-share-basket-container" data-frosh-share-basket-buttons="true"> | ||
<form action="{{ path('frontend.frosh.share-basket.save') }}" | ||
method="post" | ||
class="js-frosh-share-basket-form" | ||
data-form-ajax-submit="true" | ||
data-form-ajax-submit-options='{ | ||
"replaceSelectors": ".js-frosh-share-basket-container", | ||
"submitOnce": true | ||
}'> | ||
|
||
{% block frosh_share_basket_save_button %} | ||
<button type="submit" class="btn btn-primary"> | ||
{{ "frosh-share-basket.saveCart"|trans }} | ||
</button> | ||
{% block frosh_share_basket_container %} | ||
<div class="mb-3"> | ||
<div class="row"> | ||
<div class="col-sm-12 col-md-8 col-lg-6"> | ||
{% block frosh_share_basket %} | ||
{% if page.froshShareBasketState == 'cartExists' %} | ||
{% block frosh_share_basket_existing_cart %} | ||
{% sw_include '@Storefront/storefront/utilities/frosh-share-basket.html.twig' with { | ||
froshShareBasketUrl: page.froshShareBasketUrl, | ||
froshShareBasketState: page.froshShareBasketState, | ||
} %} | ||
{% endblock %} | ||
</form> | ||
</div> | ||
|
||
{% endif %} | ||
{% elseif page.froshShareBasketState != 'cartLoaded' %} | ||
{% set froshBasketAjaxSubmitOptions = { | ||
replaceSelectors: ".js-frosh-share-basket-container", | ||
submitOnce: true, | ||
} %} | ||
|
||
{% block frosh_share_basket_form %} | ||
<div class="js-frosh-share-basket-container" data-frosh-share-basket-buttons="true"> | ||
<form action="{{ path('frontend.frosh.share-basket.save') }}" | ||
method="post" | ||
class="js-frosh-share-basket-form" | ||
data-form-ajax-submit="true" | ||
data-form-ajax-submit-options="{{ froshBasketAjaxSubmitOptions|json_encode }}"> | ||
{% block frosh_share_basket_save_button %} | ||
<button type="submit" class="btn btn-primary"> | ||
{{ "frosh-share-basket.saveCart"|trans }} | ||
</button> | ||
{% endblock %} | ||
</form> | ||
</div> | ||
{% endblock %} | ||
{% endif %} | ||
{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{{ parent() }} | ||
|
||
{% endblock %} |