Home › Forums › WoodMart support forum › Issue with WooPayments and Woodmart Theme › Reply To: Issue with WooPayments and Woodmart Theme
leejay123
We implemented custom code that successfully resolved the console errors related to the paymentMethodMessaging element on the cart page, https://iblazevape.co.uk/cart/, specifically addressing the error: Uncaught IntegrationError: paymentMethodMessaging Element didn’t mount normally. This solution also fixed the spacing issue between the total amount and the “Proceed to Checkout” button, as described for problem one.
Furthermore, by not loading WooPayments on the cart page and only on the checkout page, it allows us to use a custom layout for the cart page and maintain the functionality of the sticky container without conflicts.
What We Did:
(1) Disabled WooCommerce Payments Plugin on the Cart Page: We used code to temporarily disable the WooCommerce Payments plugin specifically on the cart page to prevent conflicts that were causing console errors.
(2) Dequeueing and Deregistering Scripts: We targeted and removed specific WooCommerce Payments and Stripe scripts that were causing the paymentMethodMessaging element to fail mounting properly. This helped prevent the associated errors from appearing in the console.
(3) Blocking External Stripe Scripts: Additional filtering was applied to block external Stripe scripts from loading on the cart page, further ensuring that the unwanted elements did not render and cause errors.
Suppressing Console Errors: We included a script to suppress any remaining Stripe is not defined errors, which improved the overall page performance and user experience by keeping the console clean.
Why We Did This:
Prevent Console Errors: The primary goal was to eliminate the console errors that were interfering with the functionality and display on the cart page.
Fix Spacing Issues: By removing the conflicting elements and scripts, we also resolved the spacing problem between the total amount and the “Proceed to Checkout” button.
This approach has stabilized the cart page, but we would appreciate your insight or any additional recommendations you might have to refine this further.
i tried to share the code but Wordfence blocks It!
Howver we still have issue with problem 2