Articles on: Advanced Setup

Changing the selected purchase option to pay in full

This guide will make it so that the Pay in full radio button on a product page is selected on page load when using Downpay deposits.



Setup with theme editor



Navigate to your online store.
Select Customize to open the theme editor for the theme you would like to make the change on.
Navigate to the product template that has deposits enabled and add a new block type: Custom liquid.

Copy and paste the script below into the Custom liquid block.

<script type="text/javascript">
window.addEventListener("downpay:product:loaded", function() {
//alert('downpay test');
ele1 = document.getElementById("purchase-option-label");
ele1.checked = false;
ele1.click();
var event1 = new Event('change');
ele1.dispatchEvent(event1);
ele2 = document.getElementById("purchase-option-full");
ele2.checked = true;
ele2.click();
var event2 = new Event('change');
ele2.dispatchEvent(event2);
});
</script>




Click Save in your theme editor and preview your theme to review the change.



Jump to top

Updated on: 15/07/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!