ArtcoInc Posted December 15, 2014 Share Posted December 15, 2014 (osC 2334bs) Today, I received two duplicate orders from a customer, 3 seconds apart. There are two different order numbers, and two acknowledgement emails. Payment was through Paypal, and both orders have the same Paypal transaction number (there was only one Paypal payment received). 1) How do I go about investigating how this happened? And, how do I prevent this from happening again? 2) What is the best method to deal with the duplicate order? Short of editing the database, there is no way to delete the order, or is there? Thanks Malcolm Link to comment Share on other sites More sharing options...
npn2531 Posted December 15, 2014 Share Posted December 15, 2014 There are various ways to disable the submit order button, once it is clicked. For example on my website I use simple javascript snippets to display a spinner gif once 'submit' is pressed. You can see the code for it here, (that code is getting a bit out-dated and you'll need to adjust the html for 2.3, but you'll be able to see the idea involved) www dot css-oscommerce dot com/prevent-double-order-submissions-with-jquery/ Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
ArtcoInc Posted December 16, 2014 Author Share Posted December 16, 2014 @@npn2531 Thank you very much! :) How would this apply since I have the Paypal Express module installed? With it, the customer doesn't have to go through the checkout process. :blush: Malcolm Link to comment Share on other sites More sharing options...
npn2531 Posted December 16, 2014 Share Posted December 16, 2014 I don't know much about Paypal. Installing Paypal on my site is going to be my next project. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
Roaddoctor Posted July 4, 2015 Share Posted July 4, 2015 Could someone please post an example of this that works on 2.3.4 standard. I've tried several suggestions and I either don't understand the code (jquery) or I break the button it seems. I've had 3 dup orders this week and would like to stop that. There is this is in checkout_confirmation.php. I'd like to simply have the spinner replace the button once clicked (or spinner on an overlay?) <div style="float: right;"> <?php if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary'); ?> </div> Thank you in advance dave -Dave Link to comment Share on other sites More sharing options...
greasemonkey Posted July 4, 2015 Share Posted July 4, 2015 Hey Dave what do you have for your JavaScript? You need something like <script>$(function() { //$("#confirmation .btn").click(function(){$(".confirmation").click(function(){ $(this).prop('disabled', true); }); });</script>[\code] Link to comment Share on other sites More sharing options...
greasemonkey Posted July 4, 2015 Share Posted July 4, 2015 Check this post....http://www.oscommerce.com/forums/topic/399545-prevent-double-clicks-on-order-confirmation-with-bootstrap/ Link to comment Share on other sites More sharing options...
♥Tsimi Posted July 5, 2015 Share Posted July 5, 2015 I could be wrong, but isn't there a setting in PayPal that prevents an order with the same id? Block accidental payments: You may prevent accidental payments by blocking duplicate invoice IDs Yes, block multiple payments per invoice ID No, allow multiple payments per invoice ID Link to comment Share on other sites More sharing options...
Roaddoctor Posted July 5, 2015 Share Posted July 5, 2015 @@Tsimi Where is that setting? I've been testing with other methods such as check or PO, not with paypal. but the dup orders over the week were paypals. Why does this not work. What am I doing wrong? (this is 2.3.4 standard. Not BS) <script> $(function() { //$("#confirmation .btn").click(function(){ $(".confirmation").click(function(){ $(this).prop('disabled', true); }); }); </script> <div style="float: right;" class="confirmation"> <!--<div style="float: right;">--> <?php if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } // echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary'); echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary', array('params' => 'data-loading-text="Loading..." autocomplete="off"')); ?> </div> -Dave Link to comment Share on other sites More sharing options...
Roaddoctor Posted July 5, 2015 Share Posted July 5, 2015 Ok moved class, but now when clicked the button is disabled from double click, but an order does not process either <script> $(function() { //$("#confirmation .btn").click(function(){ $(".confirmation").click(function(){ $(this).prop('disabled', true); }); }); </script> <div style="float: right;"> <?php if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } // echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary'); echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary', array('params' => 'class="confirmation" data-loading-text="Processing..." autocomplete="off"')); ?> </div> -Dave Link to comment Share on other sites More sharing options...
♥mattjt83 Posted July 5, 2015 Share Posted July 5, 2015 You can try adding in a form submit to your click function. In your function after you disable the button: $("form[name=form_name_here]").submit(); Matt Link to comment Share on other sites More sharing options...
♥Tsimi Posted July 5, 2015 Share Posted July 5, 2015 @@Roaddoctor Paypal page -> profile -> my selling tools -> block payments -> click on the "update" link Link to comment Share on other sites More sharing options...
Roaddoctor Posted July 5, 2015 Share Posted July 5, 2015 @@mattjt83 Matt, as usual your spot on - working and tested in IE FF Chrome. Thank you very much! <script> $(function() { //$("#confirmation .btn").click(function(){ $(".confirmation").click(function(){ $(this).prop('disabled', true); $("form[name=checkout_confirmation]").submit(); }); }); </script> <div style="float: right;"> <?php if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } // echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary'); echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary', array('params' => 'class="confirmation" data-loading-text="Processing..." autocomplete="off"')); ?> </div> With double click disabled I guess its not necessary. but could the above work with the spinner.gif during processing so the customer has some visual indication that processing is occurring? i.e. <img src="ext/jquery/bxGallery/spinner.gif" /> Thx all for the help Dave -Dave Link to comment Share on other sites More sharing options...
Roaddoctor Posted July 5, 2015 Share Posted July 5, 2015 @@Tsimi TY! will check that -Dave Link to comment Share on other sites More sharing options...
♥mattjt83 Posted July 5, 2015 Share Posted July 5, 2015 <script> $(function() { $(".confirmation").click(function(){ $(this).prop('disabled', true); $(this).before('<img src="ext/jquery/bxGallery/spinner.gif" />'); $("form[name=checkout_confirmation]").submit(); }); }); </script> Untested but should work... This would all of course be better suited for a header_tag module. Matt Link to comment Share on other sites More sharing options...
Roaddoctor Posted July 7, 2015 Share Posted July 7, 2015 <script> $(function() { //$("#confirmation .btn").click(function(){ $(".confirmation").click(function(){ $(this).prop('disabled', true); $("form[name=checkout_confirmation]").submit(); }); }); </script> <div style="float: right;"> <?php if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } // echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary'); echo tep_draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'check', null, 'primary', array('params' => 'class="confirmation" data-loading-text="Processing..." autocomplete="off"')); ?> </div> now I'm confused... with above in place a duplicate order just processed. argghh. back to drawing board. -Dave Link to comment Share on other sites More sharing options...
allaboutwicker Posted July 14, 2015 Share Posted July 14, 2015 Did you get this figured out? I just got a duplicate order come through PayPal Pro Direct. The orders have 2 different numbers as well as transaction numbers from PayPal. I have a modified 2.3.4 BS version site. The orders went through seconds apart so I am guessing customer clicked button twice? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.