diff --git a/src/Resources/app/storefront/src/mollie-payments/plugins/apple-pay-direct.plugin.js b/src/Resources/app/storefront/src/mollie-payments/plugins/apple-pay-direct.plugin.js index 93db8a56f..53f974b58 100644 --- a/src/Resources/app/storefront/src/mollie-payments/plugins/apple-pay-direct.plugin.js +++ b/src/Resources/app/storefront/src/mollie-payments/plugins/apple-pay-direct.plugin.js @@ -66,7 +66,8 @@ export default class MollieApplePayDirect extends Plugin { if (applePayContainers) { applePayContainers.forEach(function (container) { - container.remove(); + container.style.display = 'none'; + container.classList.add('d-none'); }); } return; diff --git a/src/Resources/views/storefront/component/buy-widget/buy-widget-form.html.twig b/src/Resources/views/storefront/component/buy-widget/buy-widget-form.html.twig index 7b2851abc..9b66aa5a1 100644 --- a/src/Resources/views/storefront/component/buy-widget/buy-widget-form.html.twig +++ b/src/Resources/views/storefront/component/buy-widget/buy-widget-form.html.twig @@ -14,7 +14,7 @@ {% endblock %} -{% block buy_widget_buy_button_container %} +{% block buy_widget_buy_form_inner %} {{ parent() }} {% block page_product_detail_buy_container_apple_direct %} {# this is for Shopware < 6.4 #} diff --git a/tests/Cypress/cypress/e2e/storefront/payment-methods/applepay-direct.cy.js b/tests/Cypress/cypress/e2e/storefront/payment-methods/applepay-direct.cy.js index 5658eaa96..0539ae0d6 100644 --- a/tests/Cypress/cypress/e2e/storefront/payment-methods/applepay-direct.cy.js +++ b/tests/Cypress/cypress/e2e/storefront/payment-methods/applepay-direct.cy.js @@ -280,7 +280,7 @@ describe('Apple Pay Direct - UI Tests', () => { topMenu.clickOnSecondCategory(); listing.clickOnFirstProduct(); - repoPDP.getApplePayDirectButton().should('not.exist'); + repoPDP.getApplePayDirectButton().should('not.have.class', 'd-none'); }) }) @@ -304,7 +304,7 @@ describe('Apple Pay Direct - UI Tests', () => { cy.visit('/'); topMenu.clickOnSecondCategory(); - repoListing.getApplePayDirectButton().should('not.exist'); + repoListing.getApplePayDirectButton().should('not.have.class', 'd-none'); }) }) @@ -332,7 +332,7 @@ describe('Apple Pay Direct - UI Tests', () => { listing.clickOnFirstProduct(); pdp.addToCart(1); - repoOffcanvas.getApplePayDirectButton().should('not.exist'); + repoOffcanvas.getApplePayDirectButton().should('not.have.class', 'd-none'); }) }) @@ -364,7 +364,7 @@ describe('Apple Pay Direct - UI Tests', () => { checkout.goToCartInOffCanvas(); - repoCart.getApplePayDirectButton().should('not.exist'); + repoCart.getApplePayDirectButton().should('not.have.class', 'd-none'); }) })