logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Monday, April 18, 2022 9:52:06 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

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

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

nadeem  
#2 Posted : Tuesday, April 19, 2022 2:21:15 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 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.
judy at Web2Market  
#3 Posted : Tuesday, April 19, 2022 5:59:15 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

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.
judy at Web2Market  
#4 Posted : Tuesday, April 19, 2022 7:56:48 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 289

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;
}
nadeem  
#5 Posted : Wednesday, April 20, 2022 2:23:12 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 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!
Users browsing this topic
Guest
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.