VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Robert_ITMan on May 02, 2014, 15:15:09 PM

Title: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on May 02, 2014, 15:15:09 PM
Please help! We are getting duplicate orders & payments with current version VM 2.6.0 - I have eliminated the possibility of it being from double-clicking the confirm purchase button on checkout (see: http://forum.virtuemart.net/index.php?topic=122883.msg422084 ). VM is creating 2 orders with different order numbers and taking 2 payments. It is not happening every time nor can I see a pattern or anything in the duplicates that might lead to a certain product nor I am unable to duplicate it myself in all my tests.

If anyone else experiencing this issue - please let us know!

If I find a solution or have anything more to report I will post it here.
Title: Re: Duplicate orders & payments
Post by: Robert_ITMan on May 21, 2014, 19:50:53 PM
SOLVED by The VM Team! I'm sure it will be in the next update (now on 2.6.0a). Here is the fix in /components/com_virtuemart/helpers/cart.php line 893 add the line $this->setCartIntoSession(); after $this->_inCheckOut = true;

private function checkoutData($redirect = true) {

$this->_redirect = $redirect;
$this->_inCheckOut = true;
$this->setCartIntoSession(); // added as instructed by VM
$this->tosAccepted = JRequest::getInt('tosAccepted', $this->tosAccepted);


I have tested this thoroughly and it works for my sites.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: AH on May 21, 2014, 21:18:42 PM
Not made it into 2.6.2

Wonder why??
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 10, 2014, 23:45:26 PM
Getting the double orders..  this code is ok to add.. in VirtueMart 2.6.6
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 10, 2014, 23:57:53 PM
I read that this fix is included with VM 2.6.6 - are you telling me it isn't... please confirm if you are getting duplicates with VM 2.6.6 (I haven't tested it yet).

I'm still using 2.6.0a on our live site with no duplicates with the fix in /components/com_virtuemart/helpers/cart.php
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 00:01:23 AM
Yes.. I am..  I just updated about a week ogo.. maybe 20 orders had no issues.. then out of the blue..today  in the last 20 minutes I got hit with back to back double orders.. 

here is the code from the 2.6.6 file

private function checkoutData($redirect = true) {

$this->_redirect = $redirect;
$this->_inCheckOut = true;
$this->setCartIntoSession();
$this->tosAccepted = JRequest::getInt('tosAccepted', $this->tosAccepted);
$this->STsameAsBT = JRequest::getInt('STsameAsBT', $this->STsameAsBT);
$this->order_language = JRequest::getVar('order_language', $this->order_language);
$this->getFilterCustomerComment();


looks like its there..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 11, 2014, 00:13:23 AM
Thanks for the quick reply! Are you getting duplicate payments too? If so I will test 2.6.6 myself ASAP and see if I can help in anyway. In the meantime - think on any changes you may have made that might have changed your settings and possibly causing the duplicates and also document everything you can think of that might help solve this.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 00:28:21 AM
Not a change.. 
and yes Payments also.. tried the double click on my dev site and I didn't get a double order.. 
Fingers crossed waiting on my next order..
Not sure what happened.. Like I said many orders with no issues after the upgrade..  then back to backs.. worries me
Title: Re: [SOLVED] Duplicate orders & payments
Post by: stensbo on June 11, 2014, 16:11:22 PM
Using Joomla 2.5.20, Multi language (only DK in VM), Beez20 copy template, Virtuemart 2.6.6, PHP Version 5.3.27, vm override.

Joomla site is live - danrider.dk -  but vm shop is only for registered shopper.

I have had orders with no issue after upgrade to 2.6.6 - but yesterday I got double ordres with different order no.

Overrides is updated .
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 16:13:59 PM
Still waiting on my next order.. we'll see..

The the hell can causue this right in the middle with nothing changed..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 17:13:17 PM
Just got another   3 in a row
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 11, 2014, 17:52:00 PM
hotrod - thanks for the updates! The developers have been notified - lets hope for a quick resolution! Glad I didn't update to 2.6.6 yet on my live sites (again 2.6.0a with above fix is working for me along with the script I added to eliminate double-clicking and showing 'please wait'). The duplicates I experienced before were completely random and statistically we received 1 duplicate every 16 orders - and we never experienced it on the test sites even though we tested thoroughly.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 18:33:08 PM
As of now.  I narrowed it down to THE SSL.  no double order when turned off.  I did just renew it thru godaddy and waiting for the new one to be installed.  but they say Cert can't be the isuue..  still using the old that is not expired yet.  But this has nothing to do with it.  looks like the order are being set thru the standard URL and The SSL causing the double orders..  Like I said. I made no changes and had 20 orders or more on the new version..  UGH..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 11, 2014, 18:47:46 PM
Good observation - SSL issue makes sense! That could explain why we never received duplicates on our test sites. I doubt it would be with the SSL cert itself, more likely the issue is due to how VM captures the order on confirmation.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 18:50:33 PM
But all of a sudden????
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 11, 2014, 18:53:07 PM
Like I said - its random, what are your stats like are they 1 in 16?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 19:00:23 PM
Every Order..    with SSL On

Seen some issues where something happens to the data base and from there out every thing is duplicated..  Maybe that?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 11, 2014, 19:57:39 PM
Totally different issue than what I experienced - yours will be easier to solve as it is every order. Again, this issue is most likely due to how VM captures the order on confirmation.

Work around - disable SSL for now..? Maybe it is something with your SSL settings, look at all the settings with SSL in them, including:
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 20:12:03 PM
This is bad..  Hard to have to change things.. when I made no changes and it just went south.. on it's own

Think I should open a new thread?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 11, 2014, 20:16:38 PM
Maybe a new thread something like 'VM 2.6.6 Duplicate orders & payments due to SSL' - post the link here so I can watch it too.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 11, 2014, 23:21:33 PM
 Posted this in the wrong thread .. Sorry..
QuoteAs of Now.. I have fixed it..  Just turned SSL back on and my order came perfect.. 1 time..

I was doing some Google searching and found a topic on a OPC site about double orders.. and I seen something about " No Price Items" ( Can't find where I was)
That brought me back to a product my partner put up yesterday that I was reviewing and he had the price override checked and there was no final price.. and when you looked at it on the site is was -29$..  I though nothing of it untill I asked him  what did you do there.  he said nothing.. So I started trying to get the prices to work right and was having some issues getting it the way it needed to be.  Got the cost  base and final and no override to take..  turned on SSL placed an order and it was fine..    Watching an order in Google real time as I type...   Lets see...  Came in Twice.. then one behind it came in once.

UGH..

Note I am Only using Authorize.net Credit Card Processing..

Gunna see what happens..  Last 2 orders only one duplicated and they could have been working in the cart as I was fixing some things.. SSL is back on..  we'll see
Slow time is now until tomorrow afternoon..  We sell heavy duty truck parts....At some point is it safe to download an older version and install it as normal?

Like I said I have a Test site.. But there is no SSL..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 12, 2014, 16:44:32 PM
 Last 3 orders have been fine.. 
Does anyone know why if a Botched price set..  Meaning the Cost / base and final are messed up.. it would cause double orders...

That's the only thing I found wrong..in the tines frame of when I started having problem..  and has seemed to correct it after fixing it..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 13, 2014, 17:37:12 PM
Last 7 have been Fine..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 17, 2014, 20:43:35 PM
hotrod - Looks like you solved your issue - though I don't fully understand what was wrong with the prices "Cost / base and final are messed up" and will remember not to play with the Product pricing settings and always leave the defaults (I only ever set the Cost Price).

FYI - I tested VirtueMart 2.6.6 and it works and I have confirmed it does have the fix as described earlier and we don't have any duplicate orders now either.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 17, 2014, 20:51:59 PM
I don't know either.. but I know it was the issue..
20 some orders later..  all is good
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 01:41:37 AM
Had..  17 single Orders..  the 18th just came in twice..  so as of now I am 1 In 18   this is a real pain.  we did nothing on the site.. and with the double click locked out as everyone says.. what in the world can be causing this???
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on June 18, 2014, 10:21:21 AM
I am happy to read that the problem is fixed. Please check the time of your doubled order. If a user is checking out twice, we get two orders, which is correct. Maybe your user just did that.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 14:10:56 PM
Checking out twice?   I don't understand..   
Times are the same 18:14
Maybe the double Click fix doesn't work in some browsers?
got and order after that at 20:16 and it came in fine.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: klattr1 on June 18, 2014, 14:43:30 PM
hotrod, can you share a link to he problematic website so we can test the front end? Also, what are you using for payment methods/processing?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 14:50:59 PM
 www.hnctruckparts.com

Just Authorized.net   
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 15:57:49 PM
Just got another..

2 out of the last 4..
So I'm gunna leave this as.. no  it's not fixed.. :o

And remember.. with SSL off..   There are no Double orders.  that I proved.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 18, 2014, 16:43:37 PM
hotrod - thanks again for your updates... I stupidly updated to 2.6.6 on my live sites when you indicated it was fixed and that it had something to do with entering the prices / costs incorrectly... hope the dev team is on it! We haven't received any orders since updating yet..! Again SSL issue makes sense! Again (as I stated before): Work around - disable SSL for now..? Maybe it is something with your SSL settings, look at all the settings with SSL in them, including:

I'm thinking it might have something to do with VM seeing the session / order twice, once as SSL and once without it - try forcing SSL as I have done above and add the following to the top of your .htaccess file (as copied from mine - you need to change the 'domain-name' to yours):
#following added to force www. and SSL
RewriteCond %{HTTP_HOST} !^www\.domain-name\.com [NC]
RewriteRule ^(.*)$ https://www.domain-name.com/$1 [R,L]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain-name.com/$1 [R,L]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 17:41:02 PM
I'm having a very hard time having to think I should be making changes to a perfectly working site before 2.6.6   I only use SSL in account and cart..

I am also against the full site SSL because a lot of browsers.. detect secure pages differential and always throw up that warning of secure and none secure pages on every page load.  this will cause people IMO to just leave..

I do have a 301 redirect to force all pages to  ( Without) www.  Since The SSL would need to be registered under both with or without..  But none of this was a factor because 9 months and 500 orders we have never had an issue..  No clue what has changed.  and it didn't start happening for maybe 20 orders into 2.6.6..

While I was typing this....

Just called our last 4 Double orders.. Every one of them was using IE.  Some didn't know the version.. 2 know it's the latest version..

I called my last 4 orders that were fine. and none of them used internet explorer......

My issue started on June 11th.
Internet Explorer Had a huge update on June 10th !!
http://www.zdnet.com/large-internet-explorer-update-headlines-june-patch-tuesday-7000030390/

BAM!!




Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 18, 2014, 19:40:21 PM
hotrod - Still, I suggest you TRY full SSL and make sure all the links in your template are relative or use https to remove any error messages - also force www. (even when not SSL - as this might be creating duplicates when SSL is later activated?). IE browser issues are the worst! No debate that IE is too strict ... yet I've learned that every issue with IE turned out to be something on my end and after resolving the issues I'm grateful for IE because it forces me to correct the errors or conflicts that I wasn't aware of before.

FYI - we have received 4 orders and no duplicates so far since updating to 2.6.6 - will keep you posted.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 20:50:57 PM
I'm Confused..

Should I remove the Force no WWW

How will forcing SSL  work in my indexed Pages in google?  we do very well in the search engines when people search for parts?  will it automatically go to SSL.. ?

I'm assuming your telling me to add the code you have above and Force SSL in server settings..  Yes?

And then what should I do with my Force Http:  I have in my Htacsess..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 18, 2014, 21:06:14 PM
hotrod - OFF TOPIC, but here: your existing (old) links without www. or SSL will simply be rewritten ... eventually google and other search engines will update your links even if you don't update your sitemap (if the change is temporary no harm done, especially if you keep the code as I provided without 301)... you might want to clear your cache and make sure your SEF links are all correct too before updating and submitting your sitemap ... the end result will give you more consistent links going forward - and better rankings too (I use Artio JoomSEF - do you use a program?). Hope that helps.

Yes, I'm curious to see if forcing https://www. will stop the duplicates for you.

Restore the default htaccess or remove any custom htaccess that might undo the code I provided (use # at the beginning of a line to comment) - attached is a copy of my htaccess (rename it remove the ending .txt).

[attachment cleanup by admin]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 21:16:39 PM
Ugh..  Right now I don't want to force www..  I'd be ok forcing the SSL with out it.. Because I have been forcing just Http  with no www..

I think I may elect to let it ride and see what happens..  It would be great if you knew you got a IE order with no Duplication..  Lets see what happens with you in the next 5 or 6 orders..

And I won't be the only one having this issue. I would assume..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 18, 2014, 21:22:24 PM
hotrod - too bad you won't try it, notice I attached my htaccess above - that might be all you need to try it.

Seeing as you are the only one reporting an issue I think you need to work on your site to remove any conflicts or issues, these tools might help:
http://validator.w3.org/
http://tools.pingdom.com/fpt/
https://developers.google.com/speed/pagespeed/insights/
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 18, 2014, 21:36:33 PM
For Now..  If it don't go away..  I will be trying all the above..  Thanks for all your help.  I'll keep you posted  you do the same..

Do you think 90% of VM users force SSL on the whole site?  I would think most run it just like I do..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on June 19, 2014, 16:36:02 PM
I have been having this problem with random credit card orders with authorize.net as well. Using Joomla 2.5.22 and Virtuemart 2.6.6. 

I see references to forcing SSL and www in previous posts.  The SSL was registered for domain.com without the www so I have been forcing visitors to the site without www, with the following code in my .htaccess

RewriteCond %{HTTP_HOST} ^www.domain.com
RewriteRule (.*) http://domain.com/$1 [R=301,L]


I am not sure if it's related and I am currently looking into why it's happening myself.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 20, 2014, 01:56:44 AM
I am still getting them  from users using Internet Explorer..
I thought that maybe it was from their update.. but I just ran an order through my store using IE9  it it duplicated.

This really needs to be looked into yes?  hard to believe out of the blue it goes bad and now I'm forced to make code change on what was a perfectly working store for 9 months..

Is the team Looking into this? 
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on June 20, 2014, 08:50:31 AM
[quote author=hotrod link=topic=123644.msg425491#msg425491 date=1403222204]
I thought that maybe it was from their update.. but I just ran an order through my store using IE9  it it duplicated.

Therefore we should kick Microsoft, no?

Quote from: hotrod on June 20, 2014, 01:56:44 AM
Is the team Looking into this? 

The team is writing vm3. The bug happens for a minority of users only for certain browsers. We added already two fixes, which lowered the problem. So we keep an eye on it, but we wont invest unpaied hours for one user for an old version.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 20, 2014, 14:01:58 PM
Understood..

I am Sorry.. but I just came across the information where I can support VM.  not sure why I never knew this.. I will be looking into doing such. 

This is a great program and has served me and my clients well for many years..  and I thank you all for this.

Rod
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on June 20, 2014, 14:23:17 PM
The support membership is quite new. here are two reviews http://forum.virtuemart.net/index.php?topic=124355.0 .
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 20, 2014, 14:51:43 PM
Thank You Mibo, 

I just purchased a Silver membership.  not for you guys to fix my issue. But to show how thankful I am for such a great program.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 20, 2014, 15:24:43 PM
tophatco - have you received any duplicates since forcing SSL on the full site? With or without www. so long as it never changes for a user session.

Quote from: tophatco on June 19, 2014, 16:36:02 PM
I see references to forcing SSL and www in previous posts.  The SSL was registered for outerbanksskeeterbeater.com without the www so I have been forcing visitors to the site without www, with the following code in my .htaccess

I wonder if the duplicate orders are caused by inconsistencies in URLs when starting the cart and checking out... if someone creates a cart with http://www.domain then checks out with https://www.domain or https://domain then that might be the issue?

FYI - new SSLs include both www and without... personally I prefer www as the links look better and are more consistently converted to actual links than without ... www.ourfingertips.ca always works where ourfingertips.ca does not and http://ourfingertips.ca doesn't look right to me.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 20, 2014, 16:42:44 PM
[SOLVED] statistically we were getting one duplicate per 16 orders and we have received 17 orders and no duplicates so far since updating to VM 2.6.6

Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 20, 2014, 19:24:45 PM
Would be cool if you could verify an order with a customer using IE
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 20, 2014, 19:57:51 PM
Quote from: hotrod on June 20, 2014, 19:24:45 PM
Would be cool if you could verify an order with a customer using IE

I can confirm several of our orders were received using IE including one I entered myself for a customer yesterday morning while they were at reception... she said politely and with a smile, "I don't do computer".
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 20, 2014, 22:23:36 PM
I can confirm an Non Duplicated order using the latest IE version.
My duplicate came from IE 9  The latest for Windows XP

I don't see how we can mark this solved.. if you have to run your shop in full SSL  with a forced www.   I'll bet that works..  But it's more of a "Work Around" ;)
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 20, 2014, 22:55:15 PM
hotrod - SOLVED because I opened this subject and my issue is solved with VM 2.6.6 - you are reporting a different issue where you state there are no duplicates when you have SSL turned off - I suggest you open a new subject along those lines or jump on another subject if you want help from the community - or hire someone. I will not help you further because you will not try my suggestions for trouble shooting your issue - that and I have wasted too much time trying to help you already.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on June 20, 2014, 23:47:23 PM
I do Appreciate the help.. I just have to do more research on changing the shop to full SSL and forcing www when I have been forcing no www.

100% of our sales come from the search engines.. we are number 1 for any part# we have..  I just can't risk losing that for a few duplicate orders from people that use a lame browser..  8 orders today and everything was fine.  all used another browser excepect one that has the latest ie updated..  so in time this can fix it's self.. I would think..  If not.. I may be forced to go your route.

Thank you for your effort..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on June 23, 2014, 17:55:00 PM
Quote from: Robert_ITMan on June 20, 2014, 15:24:43 PM
tophatco - have you received any duplicates since forcing SSL on the full site? With or without www. so long as it never changes for a user session.
I forced SSL over the weekend for the whole site and still got 1 duplicate order.  Two transactions at the exact same time for the same amount.
Quote from: Robert_ITMan on June 20, 2014, 15:24:43 PM
I wonder if the duplicate orders are caused by inconsistencies in URLs when starting the cart and checking out... if someone creates a cart with http://www.domain then checks out with https://www.domain or https://domain then that might be the issue?
I don't think people are creating a cart under the www.domain then checking out under the http://domain.com. Going straight to the site redirects you and all search engine indexes do not include it. I can't find a way to even visit the site with the www.
Quote from: Robert_ITMan on June 20, 2014, 15:24:43 PM
FYI - new SSLs include both www and without... personally I prefer www as the links look better and are more consistently converted to actual links than without ... www.ourfingertips.ca always works where ourfingertips.ca does not and http://ourfingertips.ca doesn't look right to me.
I prefer the www too, this was the first SSL I had purchased and didn't realize I had to include the www at the time, which I plan on reversing when the SSL needs to be renewed.

Overall, the site has been up almost a year without this problem existing, until 5/27 of this year. On 5/20 I had updated VM to 2.6.0a. I keep VM and Joomla up to date.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on June 24, 2014, 16:04:00 PM
Another duplicate order today. Yesterday I recoded all my template overrides from the latest default template files to make sure it wasn't something I had done. All the changes were only dealing with the markup.

I could really use some help on this. :( I am turning off authorize.net transactions until I can get a lead on what's causing it.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: GJC Web Design on June 24, 2014, 16:10:43 PM
did u try this?  http://forum.virtuemart.net/index.php?topic=124033.msg425721#msg425721
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on June 24, 2014, 16:37:54 PM
Quote from: GJC Web Design on June 24, 2014, 16:10:43 PM
did u try this?  http://forum.virtuemart.net/index.php?topic=124033.msg425721#msg425721

I am assuming you mean the changes to the cart.php by alex2311?  I am assuming this check would apply to authorize.net as well? I guess I could try it and see if it changes things. I am a bit worried that the site owner is going to get upset with the double order issue and am hesitant to accept any more credit cards until the issue is definitely resolved.

After reading through this thread again I noticed hotrod was also redirecting his http://www.domain.com to http://domain.com.  He also started having problems around the same time I did. I am wondering if this is related.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on June 26, 2014, 16:19:49 PM
tophatco - I also wonder if it has something to do with the URL, hotrod stated he does not get duplicates when SSL is off - can you confirm that?

Also it still might be caused by double-clicking or a browser issue causing double-clicks (might explain why I'm still not getting any duplicates) - I suggest you also try my code for the cart template file to eliminate the possibility of double-clicks here (still works for me on 2.6.6): http://forum.virtuemart.net/index.php?topic=122883.msg421328#msg421328 - to eliminate any possibility of the issue being caused by something different in your template, I strongly suggest you first update your template using the default that comes with 2.6.6 then add my code.

[SOLVED] statistically we were getting one duplicate per 16 orders and we have received 28 orders and no duplicates so far since updating to VM 2.6.6
Title: Re: [SOLVED] Duplicate orders & payments
Post by: oviliz on July 03, 2014, 00:06:25 AM
I notice that "$this->setCartIntoSession(); after $this->_inCheckOut = true;" suggestion are now part of VM 2.6.6 but I still have the same issue (and others)...

I'm looking now to the different suggestions indicated here... even switching to a different e-commerce.. :(
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 10, 2014, 22:39:12 PM
The idea with the checkoutprocessed does not work for all payment systems.

Please try the attached order model.

[attachment cleanup by admin]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Robert_ITMan on July 11, 2014, 04:10:32 AM
I tested Max's /administrator/components/com_virtuemart/models/orders.php and it works on our test site VM 2.6.6

Any one else try it? Does it remove your duplicates with/without SSL..?

[SOLVED] statistically we were getting one duplicate per 16 orders and we have received 54 orders and no duplicates so far since updating to VM 2.6.6
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on July 11, 2014, 05:05:37 AM
Max.. Did I try this already?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 11, 2014, 09:43:52 AM
No and you dont take it via skype man.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: nhathaitrieu6 on July 11, 2014, 12:34:59 PM
Thank You Mibo,

I just purchased a Silver membership.  not for you guys to fix my issue. But to show how thankful I am for such a great program.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 11, 2014, 14:50:48 PM
Thank you very much.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 16, 2014, 15:46:30 PM
Quote from: Robert_ITMan on July 11, 2014, 04:10:32 AM
I tested Max's /administrator/components/com_virtuemart/models/orders.php and it works on our test site VM 2.6.6

Any one else try it? Does it remove your duplicates with/without SSL..?


Sorry I haven't replied in a while.  I tested Max's orders.php over the last day.  I got a duplicate order after just 6 orders.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: oviliz on July 16, 2014, 23:53:44 PM
Maybe you should become a member...

PS. Please change the title of this thread...
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 17, 2014, 21:05:08 PM
I added some other fix,... we will release soon, contact me via pn for a version
Title: Re: [SOLVED] Duplicate orders & payments
Post by: sstreich on July 21, 2014, 04:52:56 AM
I've also been having this same problem with duplicate orders. I just did a complete Joomla/VM install JM/2.5.22 VM/2.6.6.
However after spending a few days trying resolve this I just noticed this may be an issue with sessions. I am using the option for guest checkout and this seems to be the beginning of when the dups started coming in. Turning of guest checkout seems to have stopped the duplicate orders But.........
What I just noticed is that I can set on our front page keep refreshing the Home page and as a customer is browsing the site the Breadcrumbs will change along with the customer. Once I log in all I see is where I am. Logging out I now see someone else's breadcrumbs again. Customers are also complaining items are being added and dropped from their carts. Having them log in first fixes this problem.
I've also noticed the duplicate orders are only coming from customers who originally selected the Guest checkout option.
I've gone though and made sure the sessions were being written to the #_session db and also php is writing to the correct file.
I've disabled SEO and .htaccess to see if that was the problem, no difference, disabled cache in both apache and joomla nothing I alter seems to make any difference.

Not sure if these would be the same problems?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 22, 2014, 20:04:35 PM
I think I fixed the problem, finally. Hotrod tested it already.

First there is a fix for the JS to prevent that you can checkout twice.
Second there is a boolean now, so that the cart knows that it is in checkout
and third, an old order in Pending state and other conditions (abondoned) is reused, so the order is not created twice anylonger.
4th, the states of the cart are directly stored to the session, and forced writing, closing and restarting the session.

The version will be soon available.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on July 22, 2014, 20:24:24 PM
Worked fine for me In all my tests so far.

Just tested full orders in FF, Safari, Google Chrome and The Dreaded IE..  and Works Fine.

Great Job Max..  Thank You for all you do for us. I owe you a Beer : )

For those of you that Appreciate what these guys do.  show your support here.. and become a Proud Virtuemart Supporter http://forum.virtuemart.net/index.php?topic=124355.0
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on July 22, 2014, 21:55:31 PM
Hang Tight.. Found one Bug.  a simple fix I'm sure..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on July 24, 2014, 20:34:40 PM
Been working with Max the past few days. Duplicate orders In IE and SSL was fixed but a bug was allowing orders to go through with a bad CC expiration date. Customer would get "thank you for your order" but the the payment was declined and no order showed up.  So the customer would be waiting for the product and we wouldn't even know about it.  Found this by watching an order get to /confirm  but got no email. 

(site is monitored in Google reel time all day)  Great way to see when and if customers are having issues.

After a few more tweaks by Max.. Looks like we are good to go. Since the bug was at the end of the transaction. I'm confident this is now a great working version.

I will be watching closely.. Fingers Crossed..

Again Thank You Max. and the VM Team!!
Become a Proud Virtuemart Supporter http://forum.virtuemart.net/index.php?topic=124355.0
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 25, 2014, 00:50:38 AM
Thank you very much hotrod,

I am still not quite sure if it works with all payment plugins, but I also got an idea how to get it working with different payment plugins, in case we need an extra line. But for that we must wait for Alatak.

BTW: I uploaded the new version http://dev.virtuemart.net/attachments/download/762/com_virtuemart.2.6.7_extract_first.zip

and just in case you are interested, our store runs now with vm3 and it besides an incompatible plugin, it takes less than an hour to get it running http://dev.virtuemart.net/attachments/download/761/com_virtuemart.2.9.8a_extract_first.zip of course with the same double checkout fixes
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 25, 2014, 01:10:38 AM
Quote from: Milbo on July 25, 2014, 00:50:38 AM
BTW: I uploaded the new version http://dev.virtuemart.net/attachments/download/762/com_virtuemart.2.6.7_extract_first.zip

Thanks Max and hotrod. I will test this tonight/tomorrow.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 25, 2014, 02:55:34 AM
Quote from: tophatco on July 25, 2014, 01:10:38 AM
Thanks Max and hotrod. I will test this tonight/tomorrow.

It doesn't look good for me.

I did 5 test orders with 2.6.7.  I did not get any duplicates... although.

All orders were tested using the same account/customer. Every time the test got sent to authorize.net in test mode and got approved.  But, instead of getting 5 different orders in VM, the new order replaced the old order. The Order Number changed but the Order ID did not. So I placed 5 orders, all 5 orders were authorized separately through authorize.net, but I only had 1 VM order showing in the backend, which only showed the detail of the last order.

:(
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on July 25, 2014, 03:06:33 AM
That's too bad.. 
The only difference from my set us.. is I only have guest check out.  I'm not a fan of registering for an account.. they forget their log in info. try and make new but can't because that email is used already.. and move on.. But you may need to..

I couldn't run any good tests on my Dev site with Authorized.net sand box account because any thing you put in will go through.
I have gotten 6 orders since changing this afternoon.. no issues..

I do think one of the fixs Max put in prevents double sessions.. or something to that matter..  I don't think your "test" had a true situation.. back to back orders from the same customer.. not that .. it can't ever happen. But that customer stayed in the same session for all those orders
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 25, 2014, 03:18:36 AM
Quote from: hotrod on July 25, 2014, 03:06:33 AM
That's too bad.. 
The only difference from my set us.. is I only have guest check out.  I'm not a fan of registering for an account.. they forget their log in info. try and make new but can't because that email is used already.. and move on.. But you may need to..

I couldn't run any good tests on my Dev site with Authorized.net sand box account because any thing you put in will go through.
I have gotten 6 orders since changing this afternoon.. no issues..

I have it set to not ask visitors to register either, I am just testing with a registered account.

Although, this may not be an issue for someone who doesn't want a registered account, but if you ever user shopper groups, or give discounts to certain users, there will be a problem. If users want to register to see their order history, this will be a problem as well.

I just placed one order in Firefox then went to Internet Explorer and placed another order, and the IE order replaced the Firefox order for the given user.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on July 25, 2014, 03:23:02 AM
Yea.  Agreed..

That's Really Strange..   But I'm sure an easy Fix for Max..   You should become the new tester now  ;D
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on July 25, 2014, 03:34:18 AM
Just placed 2 orders on my Dev site.. with my account.  both in Fire Fox..  Back to back  both came threw fine..   
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 25, 2014, 03:59:27 AM
I just attempted two transactions with the same account using the standard payment option instead of authorize.net and got the same results. The new order replaced the old one for the user.

Going back to 2.6.6 for now.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 25, 2014, 09:27:39 AM
how was your order status?

If an order has order status P, it can be reused. Else not. Therefore I think that your config is not setting the people who payed to "confirmed by shopper". could it be?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 25, 2014, 13:51:16 PM
Quote from: Milbo on July 25, 2014, 09:27:39 AM
how was your order status?

If an order has order status P, it can be reused. Else not. Therefore I think that your config is not setting the people who payed to "confirmed by shopper". could it be?

The order status is Pending, which is what have been using.  You may be right, if I set it to Confirmed or Confirmed by Shopper for completed orders it may change this. I have been using Pending as the status since the bug started but haven't noticed orders being replaced. I will test it out.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 25, 2014, 14:02:35 PM
Quote from: tophatco on July 25, 2014, 13:51:16 PM
The order status is Pending, which is what have been using.  You may be right, if I set it to Confirmed or Confirmed by Shopper for completed orders it may change this. I have been using Pending as the status since the bug started but haven't noticed orders being replaced. I will test it out.

Yes. I just tested it with the authorized order set to Confirmed by Shopper instead of Pending and two orders were created instead of the first being replaced.  I am running 2.6.7 live now and will be watching to see if the double orders are resolved.

Thanks Max.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on July 25, 2014, 14:38:12 PM
The sql is only reusing Pending orders. The reason is that Pending means exactly an order which is in process, but not finally confirmed.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on July 25, 2014, 14:47:00 PM
Quote from: Milbo on July 25, 2014, 14:38:12 PM
The sql is only reusing Pending orders. The reason is that Pending means exactly an order which is in process, but not finally confirmed.

I was using Pending before because it would not send out a order confirmation email for two orders if a duplicate occurred. I would manually change the order to Confirmed to send out the confirmation email for just one, then go capture the credit card transaction manually for just one, so the customer would not be notified/charged twice. Oddly, when the duplicate would occur, I would end up with two Pending orders. You would think the second Pending order would replace the first after seeing what happens if I place two orders separately.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on August 04, 2014, 20:43:15 PM
Just to follow up.  Since updating to 2.6.7 there have been 28 live orders and no duplicates. 

Thanks again VM team.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: oviliz on August 04, 2014, 20:50:50 PM
Where did you take the 2.6.7 version?

With mine 2.6.6 I have a lot of duplicated orders even with PayPal and SagePay and sometimes they comes with the same Order number and that's really (almost) crazy...
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on August 05, 2014, 00:29:53 AM
Quote from: oviliz on August 04, 2014, 20:50:50 PM
Where did you take the 2.6.7 version?

With mine 2.6.6 I have a lot of duplicated orders even with PayPal and SagePay and sometimes they comes with the same Order number and that's really (almost) crazy...

Max posted the link a while back to it in this thread.

http://dev.virtuemart.net/attachments/download/762/com_virtuemart.2.6.7_extract_first.zip
Title: Re: [SOLVED] Duplicate orders & payments
Post by: oviliz on August 06, 2014, 13:25:57 PM
Thank you tophatco.

After the update should show 2.6.7 on the VM pages or still 2.6.6?

Just to know if my update goes well.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on August 06, 2014, 13:33:39 PM
Quote from: oviliz on August 06, 2014, 13:25:57 PM
Thank you tophatco.

After the update should show 2.6.7 on the VM pages or still 2.6.6?

Just to know if my update goes well.

Mine shows 2.6.7.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: T.A. Garrison, LLC on August 08, 2014, 21:03:54 PM
I just followed through this entire thread.
I've been dealing with the duplicate orders for a couple of months, which is around the time I updated to 2.6.6

100% of what HotRod was going through and described is what I experienced.

However, my settings were (and are still) exactly as Tophatco stated as what he uses.

So I agree with HotRod that this thread was marked "Solved" prematurely.
I don't see anything from anybody stating that, in fact, all the described issues are resolved.

My duplicates are intermittent.
I could have none for a couple of weeks, then 2 back-to-back.

"I" kept thinking it was people clicking the confirmation button twice.
So I implemented the code that was in the "other" thread for the cart.php file.
I added the code July 14. The "next" duplicate order was on July 16.

There were another 2 August 3.
So obviously the updated code didn't work.

I'm going to upgrade to 2.6.7 and "pray" that the duplicates stop.

I also have the issue with the confirmation when the credit card has been declined. Several customers complain that they got a confirmation at the site, but nothing via E-mail and wanted to know if the order was actually completed.
Let's hope 2.6.7 fixes all the issues.

If there is any feedback on the upgrade either working or not, please...post something. "I" will after I get the install completed.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: tophatco on August 08, 2014, 21:22:02 PM
Quote from: LTCreations on August 08, 2014, 21:03:54 PM
If there is any feedback on the upgrade either working or not, please...post something. "I" will after I get the install completed.

46 live orders, and quite a few test orders with 2.6.7 and no duplicates.  The most orders I ever had without duplicates before 2.6.7 was 20.  Usually it was 15 or less, sometimes back to back I would get duplicates.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: welizondo on August 15, 2014, 00:16:59 AM
Solved with v 2.6.7
Thanks.

VirtueMart 2.6.7
PHP 5.3.2-1ubuntu4.24
Joomla! 2.5.20
Title: Re: [SOLVED] Duplicate orders & payments
Post by: manovit03 on August 25, 2014, 09:13:25 AM
I have updated to the latest version of VM 2.6.8 and the issue is till there.. today my orders got doubled again

can you please tell me what is the issue now?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: stensbo on August 25, 2014, 10:42:38 AM
Using Joomla 2.5.20, Multi language (only DK in VM), Beez20 copy template, Virtuemart 2.6.8, PHP Version 5.3.27. VM overrides.
Joomla site is live - danrider.dk -  but VM shop is only for registered shopper.

Overrides is updated.

Double orders almost always comes from the same customers.

Have had double orders - some with different order no. - some with same order no. but always with same order status, confirmed by customer.
CHANGED...After upgrade to 2.6.8 the first order came from a  "double order customer"  - received 2 emails with same order/order no. with different order status, pending and confirmed by customer -BUT only 1 order was created in BE.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on August 25, 2014, 20:56:31 PM
dammit, cant be true, eh?

is the confirm button greyed out, if you confirm? Which payment do you use?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: stensbo on August 26, 2014, 10:20:46 AM
Just tried to make 2 orders and yes confirm button greyed out - have a test site - tried also  1 order here - turned on beez 20 to be sure I haven't overlooked something in my overrides and it is the same here - received 2 emails with same order/order no. 1 says pending in subject and 1 says confirmed in subject - only 1 order is created in BE with status confirmed by shopper.

Our customer use the shop as a ordering system and buy on account so we only use the built in standard - no payment is needed by ordering.

Default Order Status to send email to shopper in config is set to : confirmed by shopper, canceled, refunded, shipped.
Title: Re: [SOLVED] Duplicate orders & payments
Post by: Milbo on August 26, 2014, 13:53:28 PM
do you get two emails or do you see two orders in the system?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: amanche on August 26, 2014, 17:26:28 PM
Quote from: Milbo on August 26, 2014, 13:53:28 PM
do you get two emails or do you see two orders in the system?

Quote from: Milbo on August 26, 2014, 13:53:28 PM
do you get two emails or do you see two orders in the system?

Hi,

possibly I have the same problem with after an update to vm2.6.8 (on j2.5.24, tested with beez20)

There are no double orders but the order shows the attached info for sent notifications. But I still receive the first notification.
In my case the emails are different. Only one with text infront of shipment and tax prices.

In table virtuemart_order_histories are two lines with the same created_on time and a different customer_notified as in backend.

Achim



[attachment cleanup by admin]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: stensbo on August 26, 2014, 20:38:04 PM
I get two emails ( for the same order) and see 1 order in the system
Title: Re: [SOLVED] Duplicate orders & payments
Post by: manovit03 on August 26, 2014, 20:50:22 PM
Im Getting 2 same orders, i got that even after updating to VM 2.6.8

We have custom VM template under HTML folder of Joomla custom, do you think if it requires any changes there?

Regards,
Manoj
Title: Re: [SOLVED] Duplicate orders & payments
Post by: manovit03 on August 26, 2014, 20:55:58 PM
Please check the attached screenshot for reference, we are using the standard offline credit card payment..

[attachment cleanup by admin]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: amanche on August 27, 2014, 00:02:02 AM
Hi,

I've done some more test with a vm 2.6.8 full install and nothing changed works well.

In this case I got only the vendor and shopper email but in virtuemart_order_histories there are still two entries for an order with the same time (see attachment).
This works because in configuration.checkout P (order_status_code) ist not selected to send a confirmation email (only U for COM_VIRTUEMART_ORDER_STATUS_CONFIRMED_BY_SHOPPER ist selected for an email).

The configuration of my shop uses the P in both entries an P is also selected to send an email ... so this should the problem.

But I'm wondering wether there are in vm 2.6.8 this two entries and why is the customer_notified value in my case wrong.
In vm 2.0.24c there is only on entry after checkout.

Trying a different stock handling rule for P (changed from Is_reserved to Is_available) has no effect.

Regards, Achim

[attachment cleanup by admin]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: amanche on August 29, 2014, 01:07:46 AM
Hi,

I just like to answer my former questions, even if that is no answer to the inital problem of this thread. But there are similar questions that lead to this thread.

After reading this thread twice I understand (hopefully right), that the two entries in the orders history belong to a fix for double orders after checkout. So in my case the problem was in the configuration of the default order state in the payments. I used the state "pending" in an old fashion way that works for vm 2.0.24c and earlier with only one entry in orders history.

After making a new order state for my workflow and applied that to the payments, removing the pending state from sending email all works as in vm 2.0.24c.

Regards, Achim

Title: Re: [SOLVED] Duplicate orders & payments
Post by: padalec on August 31, 2014, 17:10:29 PM
I am also getting two emails as a shopper and as vendor.

When I make a purchase on my test site I get two emails; one as PENDING ORDER and one as CONFIRMED BY SHOPPER (also vendor's email gets the same order statuses).

I did some try/error testing and I found that it has to be related to "payment methods" based on scenario below:

- I have one STANDARD PAYMENT METHOD.
- I changed the "Order Status for Pending transactions" in payment configuration (from CONFIRMED AS SHOPPER -> WHATEVER).
- one of the two emails I get as SHOPPER and as VENDOR change order status to "WHATEVER"
- the second email still shows the order status PENDING

All this happened after update to VM 2.6.8. It seems that for each order there is one email send for order status PENDING by default!?

Any ideas?

I use Joomla 2.5.24, I also use Interamind VM emails manager (disabled while I was testing the scenario above) and vm one page check out (also disabled while testing the scenario above).





Title: Re: [SOLVED] Duplicate orders & payments
Post by: amanche on August 31, 2014, 23:49:32 PM
Quote from: padalec on August 31, 2014, 17:10:29 PM
All this happened after update to VM 2.6.8. It seems that for each order there is one email send for order status PENDING by default!?

Any ideas?


Hi,

did you remove Pending in Configuration-Checkout Settings from "Default Order Status to send email to shopper" too?

Regards Achim
Title: Re: [SOLVED] Duplicate orders & payments
Post by: padalec on September 01, 2014, 08:11:18 AM
Amanche:

Yes I removed. See screenshot of my settings:


[attachment cleanup by admin]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: padalec on September 01, 2014, 17:24:52 PM
Don't know if this is the case for all here

For me I found that component InteraMind - VirtueMart Email Manager 3.1.1 is probably causing this bug.

I updated from: 2.6.8. to VM VirtueMart 2.6.8b.  The bug for duplicated email orders disappeared.

Then I went to COMPONENTS  -> VM EMAIL MANAGER and there this error was displayed:

Email Manager's code is not installed properly in VirtueMart file: /home/bctvstage/public_html/components/com_virtuemart/helpers/shopfunctionsf.php
Please check the directory and file permissions and try to re-install the component.
The component will not work properly until you fix this problem!

So I reinstalled the component InteraMind - VirtueMart Email Manager 3.1.1 and tested ... And here I have DUPLICATED emails again.

I see that EMail manager is overwriting the file: shopfuntionsf.php ( and making some backups - see image)

I will report also to Intermind support and I will post solutions here (if possible)

bye

[attachment cleanup by admin]
Title: Re: [SOLVED] Duplicate orders & payments
Post by: hotrod on September 18, 2014, 00:50:42 AM
I'm still fine..  no double orders since installing the 2.6.8..
Title: Re: [SOLVED] Duplicate orders & payments
Post by: adriespo on September 25, 2014, 20:16:31 PM
With Joomla! 2.5.25 and VirtueMart 2.6.10 I receive duplicate order e-mails but the strange it is that the first mail has payment and shipment informations blank, the second is pretty good. So indeed the second mail is not just a duplicate but it is the correct version. Where I should check to see what happens?
Title: Re: [SOLVED] Duplicate orders & payments
Post by: adriespo on September 26, 2014, 16:35:38 PM
Because of the empty shipment and payment of the first mails of the twin I managed inserting this code:


if(empty($shipment_name) || empty($payment_name)){
return false;
}


in \administrator\components\com_virtuemart\models\orders.php

I still dont know why the shopFunctionsF::renderMail function is called two times per order but at least now I have not the duplicate mails...

Title: Re: [SOLVED] Duplicate orders & payments
Post by: Balazs on September 30, 2014, 12:50:59 PM
adriespo, same issue here!

Where do I have to paste your code in orders.php?

I have pasted the code just below the comment:


// Send the email

if(empty($shipment_name) || empty($payment_name)){
return false;
}

$res = shopFunctionsF::renderMail('invoice', $order['details']['BT']->email, $vars, null,$vars['doVendor'],$this->useDefaultEmailOrderStatus);


Thanks!

Joomla 2.5.8 and Virtuemart 2.6.10
Title: Re: [SOLVED] Duplicate orders & payments
Post by: adriespo on September 30, 2014, 13:33:59 PM
Yeah, sorry, a bit tired when I wrote  ;D

Indeed you must check this before call renderMail.

Thank you!

EDIT: beware that it is a core hack, so you probably lose it after an update
Title: Re: [SOLVED] Duplicate orders & payments
Post by: mahon on October 03, 2014, 09:44:07 AM
I had the same problem.

Thank you for solving! :)