Guest Posted July 1, 2004 Posted July 1, 2004 This is not an OSC problem per say but I'm getting a lot of customers that keep hammering the checkout button and as a result the order is being created two, three, or more times. What I would like to do is put a warning message somewhere near the checkout button asking the customer to be patient and click the checkout button only once. Could someone give me an example of how to do this? Thanks in advance.
way2savory Posted July 1, 2004 Posted July 1, 2004 Dont quote me exactly, but i would venture to guess in the checkout_confirmation.php <?php /* $Id: checkout_confirmation.php,v 1.24 2003/02/06 17:38:16 thomasamoulton Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ define('NAVBAR_TITLE_1', 'Checkout'); define('NAVBAR_TITLE_2', 'Confirmation'); define('HEADING_TITLE', 'Order Confirmation'); define('HEADING_DELIVERY_ADDRESS', 'Delivery Address'); define('HEADING_SHIPPING_METHOD', 'Shipping Method'); define('HEADING_PRODUCTS', 'Products'); define('HEADING_TAX', 'Tax'); define('HEADING_TOTAL', 'Total'); define('HEADING_BILLING_INFORMATION', 'Billing Information'); define('HEADING_BILLING_ADDRESS', 'Billing Address'); define('HEADING_PAYMENT_METHOD', 'Payment Method'); define('HEADING_PAYMENT_INFORMATION', 'Payment Information'); define('HEADING_ORDER_COMMENTS', 'Comments About Your Order'); define('TEXT_EDIT', 'Edit'); ?> I woudl try to just add it here: define('HEADING_ORDER_COMMENTS', 'Comments About Your Order<br>PLEASE only click once to prevent from duplicate billing.Thank you.');
way2savory Posted July 1, 2004 Posted July 1, 2004 Or see if adding html below the whole php would work?
Guest Posted July 1, 2004 Posted July 1, 2004 Thank you for the quick reply Toni. I applied the changes you suggested but they're not showing up on the order confirmation page (which is where the order is actually "submitted"). The button that gets hammered is the "confirm order" button on that page. I could try just entering HTML at the bottom but want to make sure I'm editing the corret page first.
way2savory Posted July 1, 2004 Posted July 1, 2004 I tested adding html to the confirm page and it just displayed it at the top above the header. The page is infact checkout_confirmation.php I am only versed in editing. not WRITING php. i dont know if you can add another defines or not. If it were me(and i may do this) i might just edit it Good luck.
way2savory Posted July 1, 2004 Posted July 1, 2004 I apologise! THis only works if the person adds a comment to their order. i just added it to mine and tested it. (lol) i am sure if you edit theheading_ payment_information it will show up EVERY time. Here is a pic of what i have now under the comments. :lol:
kagg Posted July 2, 2004 Posted July 2, 2004 Find the following line in checkout_confirmation.php: <link rel="stylesheet" type="text/css" href="stylesheet.css"> Add following lines afetr the above <script language="JavaScript"><!-- var submitcount = 0; function checkFields() { if (submitcount == 0) { //sumbit form submitcount ++; return true; } else { alert("Transaction is in progress."); return false; } } //--> </script> Find then: echo tep_draw_form('checkout_confirmation', $form_action_url, 'post'); Replace with: echo tep_draw_form('checkout_confirmation', $form_action_url, 'post','onSubmit="return checkFields(checkout_confirmation);"'); The above code will display alert message that "transaction is in progress" if the customer presses the confirm button more than once on confirmation page.
Guest Posted July 2, 2004 Posted July 2, 2004 Thanks Kavita, I'm using 2.2 MS2 and I don't have the <link rel="stylesheet" type="text/css" href="stylesheet.css"> in my checkout_confirmation file. I've checked both the checkout_confirmation in the catalog folder and the one in the includes\languages\english directory.
kagg Posted July 2, 2004 Posted July 2, 2004 Place the javascript code between <head> tag of checkout_confirmation.php in catalog folder.
Guest Posted July 17, 2004 Posted July 17, 2004 There's no <head> tag in my checkout_configmation.php file. It doesn't look like there's any HTML in the file at all. (which would appear to be a normal thing in a php coded site no?).
Guest Posted July 17, 2004 Posted July 17, 2004 Do you have any template module installed on your site? You can add the javascript code at the end of /includes/check_form.js.php before closing tag //--></script>
Guest Posted July 17, 2004 Posted July 17, 2004 I don't have a template module and don't have the check_form file either. Am I going to need a template module installed to make this happen? If so how about a reccomendation?
Guest Posted July 17, 2004 Posted July 17, 2004 No, you do not need to install any module for this. Can you post the code in checkout_confirmation.php?
Guest Posted July 17, 2004 Posted July 17, 2004 I'm sure I can but don't really know where it's "safe" to post in that file.
siavash Posted July 17, 2004 Posted July 17, 2004 I have done a very simple thing and it works. see whether its your cup of tea. need to add to : catalog/checkout_confirmation.php about the end of the file look for this: <?php if (isset($$payment->form_action_url)) { $form_action_url = $$payment->form_action_url; } else { $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); } echo tep_draw_form('checkout_confirmation', $form_action_url, 'post'); if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n"; ?> right after the above code add whatever you fancy telling your customers like what i have done below: <!-- Double-click Confirmation Warning //--> <p align="center"><b><font size="1" color="#FF0000" face="Verdana">WARNING! Please click "confirm order" button ONLY ONCE to prevent duplicate order and billing. Thank you.</font></b></p> <!-- Double-click Confirmation Warning e_of//--> otherwise stick a javascript somewhere to give warnings if your customers clicked a second time, etc. Did you try? Did you fail? No matter! Try again. Fail again! But fail better!
gandalfthewhite Posted July 18, 2004 Posted July 18, 2004 The help post from the first page worked great, for the "transaction in progress" popup if someone clicks on the confirmation button. This should help with anyone trying to do mass-order spamming or any junk like that. :) Thx.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.