subscribepro / subscribepro-magento2-ext

Subscribe Pro Magento 2 Integration Extension
MIT License
24 stars 22 forks source link

"Add New Card" button missing from Stored Card Payments after 2.4.7 Update #284

Closed JenFaber closed 1 month ago

JenFaber commented 3 months ago

Issue: Add New Card is missing from the Stored Payment Methods after updating Magento to 2.4.7

image

Steps To Reproduce:

  1. Go to a store front
  2. Login/create a user
  3. Select user name in top right and select account
  4. Go to Stored Payment Methods
  5. Add Card Button is Missing

Vaulting payments in account area—Logged-in customers can now vault/store new credit/debit cards and PayPal accounts in the Customer account area. Previously, customers could only vault/store when saving their payments for later use when completing a transaction on the checkout, now they can vault new credit/debit cards and PayPal accounts without needing to create a new transaction.

Affected Area: Magento Extension/Magento 2 (2.4.7)

Details

In the logs when loading that page you will see:

Broken reference: the 'vault.cards.add_button' tries to reorder itself towards 'vault.cards.list', but their parents are different: 'page.main.title' and 'content' respectively. [] []

If you edit subscribepro-magento2-ext/view/frontend/layout/vault_cards_listaction.xml and change vault.cards.list to content the button will display.

chrismshea commented 2 months ago

This is the update that will allow the button to display.

diff --git a/view/frontend/layout/vault_cards_listaction.xml b/view/frontend/layout/vault_cards_listaction.xml
index c949b71..ce54d64 100644
--- a/view/frontend/layout/vault_cards_listaction.xml
+++ b/view/frontend/layout/vault_cards_listaction.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
     <body>
-        <referenceContainer name="page.main.title">
+        <referenceContainer name="content">
             <block class="Swarming\SubscribePro\Block\Vault\AddButton"
                    name="vault.cards.add_button"
                    template="Swarming_SubscribePro::vault/add_button.phtml"
garthbrantley commented 1 month ago

We fixed this for Magento 2.4.7 and above. Will likely break some pre-2.4.7 versions.