AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
Hiding final checkout button after clicked
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
Is there a way I can hide the final checkout button on the payment forms after the user clicks it and order is starting to be processed? We have a routine that runs to send the order into to an outside source and it takes a while to get the reply back from them. The user thinks the order isn't going through, so he will click the button again and sometimes a second order will be placed. I tested it myself and it happened to me. Thanks
|
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
Isn't the button text turned to Processing... when the response is delayed? You can disable or hide the button completely by updating the PreCheckout function inside Website/Views/Checkout/_CreditCardPaymentForm.cshtml To do so, locate the following code: Code:
case "CompleteFormButton":
{
if (validateTC()) {
$("#complete-form-btn").val('Processing...');
return true;
}
else
return false;
}
and update to Code:
case "CompleteFormButton":
{
if (validateTC()) {
$("#complete-form-btn").val('Processing...');
$("#complete-form-btn").attr("disabled", true); //disable the button in case of error
$("#complete-form-btn").hide(); //hide the button in case of error
return true;
}
else {
$("#complete-form-btn").attr("disabled", false); // enable the button again in case of error
$("#complete-form-btn").show(); //show the button again in case of error
return false;
}
}
Note that I have added two lines, one to disable the button and other to hide the button only for your reference. You can use either hide or disable as needed.
|
|
|
|
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
The button doesn't change to processing, but that might be some customization a designer did. Thanks for your help.
|
|
|
|
Rank: Advanced Member
Groups: Developers
Joined: 11/7/2018(UTC) Posts: 303
Thanks: 21 times Was thanked: 5 time(s) in 5 post(s)
|
I did some experimenting as to why the button wasn't changing to Processing... I had to change .val to .text and now it works case "CompleteFormButton": { if (validateTC()) { $("#complete-form-btn").text('Processing...'); return true; } else return false; }
|
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
Nice catch! I believe this is a bug. I am going to report it to be fixed in the next version. Thanks for pointing that out!
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
Hiding final checkout button after clicked
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close