Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 50
  1. #31
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default Re: Duplicate Orders/Order Confirmation

    okay, setting it to 16 seconds did not prevent the page from refreshing sooner than the 16 seconds.

    Curious though, it the function "locked" for THAT session, or if another user attempts to submit an order within that 16 second window, will their submit button be disabled?

    -cj

  2. #32
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Duplicate Orders/Order Confirmation

    Quote Originally Posted by chadderuski View Post
    Curious though, it the function "locked" for THAT session, or if another user attempts to submit an order within that 16 second window, will their submit button be disabled?
    It will only be "locked" for the user that clicked the button. But if the process takes that much time the script can not prevent the user from reloading the page and click again anyway.

    The script only prevents fast double clicks.

    I know that it would also be possible to swap the button by a "Please Wait" button or text. Maybe that would convince the user to not reload the page, or at least to wait a bit longer. But I am really a js noob so please don't expect any quick solutions from me.

    Also if the page is not being processed in a couple of seconds I think the cause of that should be found and it should fixed first.

  3. #33
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Duplicate Orders/Order Confirmation

    Hi Chadd,

    can you try this version please?

    It's the same script, but hopefully it will make clear when the button is disabled and enabled again (by changing the pointer). I tried the site you are talking about but I could not see if the script did it's job, I could not find any errors though.

    Code:
    <?php
    /**
     * jscript_main
     *
     * @package page
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: jscript_main.php 3505 2006-04-24 04:00:05Z drbyte $
     */
    ?>
    <script language="javascript" type="text/javascript"><!--
    var submitter = null;
    function popupWindow(url) {
      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=320,screenX=150,screenY=150,top=150,left=150')
    }
    
    function couponpopupWindow(url) {
      window.open(url,'couponpopupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=320,screenX=150,screenY=150,top=150,left=150')
    }
    
    function submitFunction($gv,$total) {
       if ($gv >=$total) {
         submitter = 1; 
       }
    }
    
    function submitonce()
    {
      var button = document.getElementById("btn_submit");
      button.style.cursor="wait";
      button.disabled = true;
      //button.style.color = "red";
      setTimeout('button_timeout()', 4000);  
      return false;
    }
    function button_timeout() {
      var button = document.getElementById("btn_submit");
      button.style.cursor="pointer";
      button.disabled = false;
      //button.style.color = "black";
    }
    
    //--></script>
    (the 2 red lines are added)

  4. #34
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default Re: Duplicate Orders/Order Confirmation

    Hi Paul,

    Thanks for taking a look. You'll get a chuckle out of this. Been working with the client and talking about the problem, also had to do a price update and had just posted that. He saw you online of all things and got worried he was being hacked!

    I didn't make the connection until later: Paul Tester, LOL! Gotta love that.

    I'll add the code in. Jeez, anything that helps.

    Oh, I did have one idea. I have seen sites use a semi transparent layer OVER the order submit page to cover up the underlying clickable buttons usually with some sort of "please wait text".

    I think I've seen it with ajax, but it should be doable with css and javascript, ya think? Would be a good solution provided java wasn't disabled.

    As far as the LOOOONG submit times: I've change to smtp for mail instead of php. This seems a bit faster. But I'll blame bluehost for cramming too many hosts on one box. Not sure if this is THE fix because it's hard to tell just what's going on at bluehost. But the long submit time is positively linked to the e-mail function. Was able to test that from within the admin.

    Unfortunately, dedicated or managed hosting is still out of the budget for the time being for this client.

    Thanks again ... I'll keep testing. Your latest code works for me using the 16 sec timeout... Tested several times with IE7 attempting to get a duplicate order, and everything worked okay.

    I'll poke around for that "white out" layer idea and see what I can find.

    -cj

  5. #35
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Duplicate Orders/Order Confirmation

    Quote Originally Posted by chadderuski View Post
    You'll get a chuckle out of this. Been working with the client and talking about the problem, also had to do a price update and had just posted that. He saw you online of all things and got worried he was being hacked!

    I didn't make the connection until later: Paul Tester, LOL! Gotta love that.
    Next time I will use a name like pAUL da hACKer or something


    In the mean time I tested it on my own shop (using css buttons) and on a standard 1.3.8a shop (standard image buttons) and it works fine on both. When using css buttons I think a simple but nice solution is to swap the "value" of the button, this will swap the button text. Currently I have it swap to "One moment..." (in Dutch).

    Also note there has been a problem at Paypal recently that also resulted in duplicate orders. There is a topic about it somewhere on this board, it seems to be resolved now. This script will not have any effect on typical Paypal issues like that.

    If you have duplicate orders and/or multiple transactions with several payment modules, even with moneyorder or cod for example, then this script may help to prevent the duplicates.

  6. #36
    Join Date
    Mar 2007
    Location
    Pepperell, Massachusetts
    Posts
    232
    Plugin Contributions
    1

    Default Re: Duplicate Orders/Order Confirmation

    Quote Originally Posted by paulm View Post
    Hi Chadd,

    can you try this version please?

    It's the same script, but hopefully it will make clear when the button is disabled and enabled again (by changing the pointer). I tried the site you are talking about but I could not see if the script did it's job, I could not find any errors though.

    Code:
    <?php
    /**
     * jscript_main
     *
     * @package page
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: jscript_main.php 3505 2006-04-24 04:00:05Z drbyte $
     */
    ?>
    <script language="javascript" type="text/javascript"><!--
    var submitter = null;
    function popupWindow(url) {
      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=320,screenX=150,screenY=150,top=150,left=150')
    }
     
    function couponpopupWindow(url) {
      window.open(url,'couponpopupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=320,screenX=150,screenY=150,top=150,left=150')
    }
     
    function submitFunction($gv,$total) {
       if ($gv >=$total) {
         submitter = 1; 
       }
    }
     
    function submitonce()
    {
      var button = document.getElementById("btn_submit");
      button.style.cursor="wait";
      button.disabled = true;
      //button.style.color = "red";
      setTimeout('button_timeout()', 4000);  
      return false;
    }
    function button_timeout() {
      var button = document.getElementById("btn_submit");
      button.style.cursor="pointer";
      button.disabled = false;
      //button.style.color = "black";
    }
     
    //--></script>
    (the 2 red lines are added)
    I tested this today on my site (included the functions with the red lines) with IE7. It was successful in preventing multiple clicks! However, my cursor did not change to a wait cursor.

    In fact, my cursor is a normal arrow elsewhere on the page. Before clicking, when I float over the image button, it turns into a finger. After clicking, your code changed it to the normal arrow and prevented clicking.

  7. #37
    Join Date
    Apr 2008
    Location
    UK
    Posts
    326
    Plugin Contributions
    1

    Default Re: Duplicate Orders/Order Confirmation

    Hi

    Should I change my file to the above text? Will this prevent duplicate orders?

    Thanks,

    Phil

  8. #38
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Duplicate Orders/Order Confirmation

    Yes, it will prevent duplicate orders that are caused by:

    1- The original /includes/modules/pages/checkout_confirmation/jscript_main.php Zen Cart script.

    2- Almost all double clicks by customers.

    No, it won't prevent duplicate orders that are caused by anything else.

    In my case it certainly works. I had several duplicates daily before, and haven't had any since I updated the script.

  9. #39
    Join Date
    Apr 2008
    Location
    UK
    Posts
    326
    Plugin Contributions
    1

    Default Re: Duplicate Orders/Order Confirmation

    Hi

    Thanks for getting back to me, I have saved the new file in includes/modules/pages/checkout_confirmation/MY TEMPLATE/jscript_main.php

    Will it work ok there?

    I guess we will have to see if it works, but I hope it does - it's driving me nuts!

    Thanks,

    Phil

  10. #40
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Duplicate Orders/Order Confirmation

    Quote Originally Posted by confused_aswell View Post
    I have saved the new file in includes/modules/pages/checkout_confirmation/MY TEMPLATE/jscript_main.php

    Will it work ok there?
    No that won't work, the over rides system does not work for the pages. You really need to over write /includes/modules/pages/checkout_confirmation/jscript_main.php !

 

 
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. Duplicate Orders/Order Confirmation
    By Beer_man in forum Managing Customers and Orders
    Replies: 130
    Last Post: 16 Sep 2017, 07:10 PM
  2. [Done v1.3.9e] 1.3.9d duplicate orders
    By justin2010 in forum Bug Reports
    Replies: 33
    Last Post: 29 Aug 2010, 07:31 AM
  3. [Done v1.3.9d] Duplicate orders with paypal
    By thysm00 in forum Bug Reports
    Replies: 0
    Last Post: 1 Dec 2009, 01:44 AM
  4. [Done v1.3.9] Duplicate coupon confirmation message
    By karma-lab in forum Bug Reports
    Replies: 2
    Last Post: 13 Aug 2009, 12:28 AM
  5. [Done 1.3.9] Duplicate paypal IPN orders
    By gothstone in forum Bug Reports
    Replies: 0
    Last Post: 5 Feb 2008, 01:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR