Checkout Confirmation

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
ajackson
Ensign (ENS)
Ensign (ENS)
Posts: 18
Joined: Wed Sep 28, 2016 3:25 am

Checkout Confirmation

Post by ajackson » Wed Dec 14, 2016 3:06 am

My company is trying to write a javascript confirmation check on the "Pay with Card" button on the opc.aspx checkout page(one page checkout option selected). We want to have the user confirm that they want to follow through with the transaction. The button already has a script written on the "OnClientClick" attribute that prevents user from submitting order twice. Is there a way to do this without removing the functionality for submitting the order twice. Any help on this will be appreciated.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Checkout Confirmation

Post by mazhar » Wed Dec 14, 2016 11:09 pm

Simply edit ConLib/Checkout/PaymentForms/CreditCardPaymentForm.ascx file and then update following code responsible to stop form re-submission.

Code: Select all

CreditCardButton.OnClientClick = "if (Page_ClientValidate('" + this.ValidationGroup + "')) { this.value='Processing...';this.onclick=function(){return false;}; }";
to something like this

Code: Select all

CreditCardButton.OnClientClick = "if (Page_ClientValidate('" + this.ValidationGroup + "') && getConfirmation()) { this.value='Processing...';this.onclick=function(){return false;}; }";
Finally in your ascx file you need to add a javascript method for your confirmation code.

Code: Select all

<script>
function getConfirmation() {
return confirm("Are you sure you want to proceed with payment?");
}
</script>

Post Reply