-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move mollie script & Fix missing 6.4 block
- Loading branch information
Showing
3 changed files
with
58 additions
and
42 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{% block mollie_head_scripts %} | ||
|
||
{# pages where apple pay requires js with their mollie_applepaydirect_restrictions names as values #} | ||
{% set onlyShowHere = { | ||
'frontend.checkout.confirm.page' : '', | ||
'frontend.checkout.cart.page' : 'cart', | ||
'frontend.navigation.page' : 'plp', | ||
'frontend.account.edit-order.page' : '', | ||
'frontend.detail.page' : 'pdp' | ||
} %} | ||
|
||
|
||
{% set currentRoute = app.request.attributes.get('_route') %} | ||
{% set includeJsInHeader = false %} | ||
|
||
{# js always required on this pages #} | ||
{% if currentRoute == 'frontend.checkout.cart.page' or currentRoute == 'frontend.checkout.confirm.page' or currentRoute == 'frontend.account.edit-order.page' %} | ||
{% set includeJsInHeader = true %} | ||
{% endif %} | ||
|
||
{# requirement check for apple pay direct #} | ||
{% if mollie_applepaydirect_enabled == true or mollie_applepay_enabled == true %} | ||
{% if currentRoute in onlyShowHere|keys and onlyShowHere[currentRoute] not in mollie_applepaydirect_restrictions %} | ||
{% set includeJsInHeader = true %} | ||
{% endif %} | ||
{% if 'offcanvas' not in mollie_applepaydirect_restrictions %} | ||
{% set includeJsInHeader = true %} | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if includeJsInHeader == true and mollie_javascript_check_duplicate === true %} | ||
{% for script in theme_scripts() %} | ||
{% if script == 'js/mollie-payments/mollie-payments.js' %} | ||
{% set includeJsInHeader = false %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
<script> | ||
window.mollie_javascript_use_shopware = '{{ mollie_javascript_use_shopware }}' | ||
</script> | ||
|
||
{% if mollie_javascript_use_shopware != '1' and includeJsInHeader == true %} | ||
<script type="text/javascript" src="{{ asset('bundles/molliepayments/mollie-payments.js', 'asset') }}" defer></script> | ||
{% endif %} | ||
|
||
{% endblock %} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% sw_extends '@Storefront/storefront/base.html.twig' %} | ||
|
||
{% block base_script_hmr_mode %} | ||
|
||
{{ parent() }} | ||
|
||
{% sw_include '@Shopware/mollie/head.html.twig' %} | ||
|
||
{% endblock %} |
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