From fcab884547a12ba02dcffa8a036633ef83e30622 Mon Sep 17 00:00:00 2001 From: Abdurrahman Saber Date: Tue, 29 Jul 2025 15:46:44 +0300 Subject: [PATCH] [FIX] applepay_fast_checkout: select first element --- .../applepay_fast_checkout/static/src/js/applepay_iframe.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/odex25_donation/applepay_fast_checkout/static/src/js/applepay_iframe.js b/odex25_donation/applepay_fast_checkout/static/src/js/applepay_iframe.js index b0b4fc082..00188d977 100644 --- a/odex25_donation/applepay_fast_checkout/static/src/js/applepay_iframe.js +++ b/odex25_donation/applepay_fast_checkout/static/src/js/applepay_iframe.js @@ -45,7 +45,10 @@ var wpwlOptions = { let isCheckoutPage = $("#oe_structure_website_sale_payment_1", window.parent.document).length; if (isCheckoutPage) { let applepayButton = $("apple-pay-button"); - let totalAmount = $("#order_total > td.text-xl-right > strong", window.parent.document).text().replaceAll(",", ""); + let totalAmount = $("#order_total > td.text-xl-right > strong", window.parent.document); + if (totalAmount && totalAmount.length > 0){ + totalAmount = totalAmount[0].text().replaceAll(",", ""); + } window.wpwlOptions.applePay.total.amount = totalAmount; console.log("Apple Pay Amount updated to:", window.wpwlOptions.applePay.total.amount); applepayButton.css({