[FIX] applepay_fast_checkout: select first element
This commit is contained in:
parent
12507c6365
commit
fcab884547
|
|
@ -45,7 +45,10 @@ var wpwlOptions = {
|
||||||
let isCheckoutPage = $("#oe_structure_website_sale_payment_1", window.parent.document).length;
|
let isCheckoutPage = $("#oe_structure_website_sale_payment_1", window.parent.document).length;
|
||||||
if (isCheckoutPage) {
|
if (isCheckoutPage) {
|
||||||
let applepayButton = $("apple-pay-button");
|
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;
|
window.wpwlOptions.applePay.total.amount = totalAmount;
|
||||||
console.log("Apple Pay Amount updated to:", window.wpwlOptions.applePay.total.amount);
|
console.log("Apple Pay Amount updated to:", window.wpwlOptions.applePay.total.amount);
|
||||||
applepayButton.css({
|
applepayButton.css({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue