Page 1 of 1
Strange javascript popup dialogs in checkout
Posted: Fri Mar 06, 2009 2:25 pm
by ripdog
We just recently got up and running with our store and everytime someone clicks the checkout button to place an order there are two javacsript dialogs that popup.
Both popups simply display the number '2'. You have to click on them in order to complete the checkout process, its very annoying.
What are these and how do I turn them off?
Thanks!
Mike
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 06, 2009 4:01 pm
by nickc
There have never been javascript popups in the checkout page to my knowledge. If you didn't code them, might be wise to disconnect payment operations in your site while you research. There was at least one site reported compromised by hackers here earlier this week:
viewtopic.php?f=42&t=9974
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 20, 2009 9:19 am
by ripdog
Upon further examination, it seems to be some javascript code related to the terms and conditions checkbox in the OnePageCheckout Conlib. You can see the alert('2') that I'm talking about:
It seems to me as the alert will get shown everytime validateTC is called. I cannot be the only one with this PROBLEM!!!!!
Here is the code:
//ADD SCRIPTS FOR TERMS AND CONDITIONS
string TCScript = "function toggleTC(c) { document.getElementById(\"" + AcceptTC.ClientID + "\").checked = c; }\r\n" +
"function validateTC(source, args) { alert('2'); if (document.getElementById(\"" + AcceptTC.ClientID + "\")) args.IsValid = document.getElementById(\"" + AcceptTC.ClientID + "\").checked; }";
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "TCScript", TCScript, true);
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 20, 2009 9:29 am
by mazhar
Well Checkout Terms & Conditions is not an automatic popup. If you have specified Checkout Terms & Conditions in store settings then upon checkout it makes a link available to read Checkout Terms & Conditions.
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 20, 2009 9:34 am
by ripdog
That's barely relevant to my question.
The software has a javascript messagebox hardcoded to print the number "2" everytime some accepts terms and conditions. This messagebox has nothing to do with the textual content of the terms and conditions.
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 20, 2009 9:39 am
by mazhar
Perhaps its some debug code. I have checked 7.0.2 code and that doesn't have this alert. You can just remove
from the function.
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 20, 2009 9:42 am
by ripdog
Yes, I'll remove it.
Also, I did remove the terms and conditions and now the checkbox is gone. Logically the alert message does not pop up now when clicking the place order button, because there's no terms to validate. However, this alert will *always* popup for anyone that has terms and conditions text. I think I'm on 7.0.1 or something, so there is a bug in that version...
Thank you for the help.
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 20, 2009 11:19 am
by jmestep
I checked the javascript on three builds that I have and none of them have that alert('2'); in them.
I'm not sure if I've got build 7.0.1, though.
Re: Strange javascript popup dialogs in checkout
Posted: Fri Mar 20, 2009 11:39 am
by mazhar
I haven't seen any thing in 7.1 as well. Most probably it will be some customization or debug code written by customer.