-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from buckaroo-it/BP-4174-Removed-checkout-layo…
…ut-overwrite-50 Bp 4174 removed checkout layout overwrite 50
- Loading branch information
Showing
4 changed files
with
90 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
document.addEventListener('DOMContentLoaded', function () { | ||
|
||
window.updatePosition = function () { | ||
// Select the elements by their class names | ||
const alreadyPaidElement = document.querySelector('.remaining_amount'); | ||
const grandTotalElement = document.querySelector('.grand_total'); | ||
|
||
// Ensure both elements exist before trying to move them | ||
if (alreadyPaidElement && grandTotalElement) { | ||
// Move the 'already-paid' block after the 'grand-total' block | ||
grandTotalElement.insertAdjacentElement('afterend', alreadyPaidElement); | ||
} | ||
}; | ||
|
||
// Call updatePosition on page load | ||
updatePosition(); | ||
|
||
// Reapply position when payment method changes | ||
document.querySelectorAll('input[name="payment-method-option"]').forEach((input) => { | ||
input.addEventListener('change', function () { | ||
setTimeout(function () { | ||
updatePosition(); | ||
}, 2000); | ||
}); | ||
}); | ||
}); |