Jump to content

Most orders do not appear in back office


Recommended Posts

Hi

 

I've an ongoing problem where nearly all orders regardless of payment type (PayPal or other options) do not appear correctly in the back office.  The order is listed but the details of the order are usually blank or incomplete, but this is not affecting every order, about 70% of orders.

 

Payment is received ok (and if I look under the customer details the order is there) but the order information is not posting back correctly to the site.

 

Whenever I test this myself it works EVERY time which is the frustrating part.

 

The problem is intermittent (but obviously affecting most orders).

 

Does anyone know what might be causing this (and something that wouldn't necessarily happen every time)?  Is there a module that might be affecting this.  It's something I've seen elsewhere on the formum but so far haven't got to the bottom of it.  I'm wondering if a file might have got corrupted when I installed the software originally -so maybe someone knows what file(s) I could consider replacing.

 

Thanks

Andrew

Link to comment
Share on other sites

Just looked at the error log via Cpanel and it's completely blank...  It's a shame that it's not showing something in a way.

 

As much as I've tried I can't seem to see a pattern in terms of the orders that go through ok and the ones that don't.  Whenever I test the site (and it works every time), I'm usually using just one product, but I wouldn't have thought the number of products in an order would be relevant.

 

I would really like to get to the bottom of this problem though.

Link to comment
Share on other sites

I'm using host gator.  I just spoke to them and they said there wouldn't be anything on the server logs (I don't know if I've been given bad advice by them -but I did tell them what you suggested).

 

I have, however, checked the PrestaShop "advanced parameters" log and get the following error each time an order doesn't go through:

 

 4         Cart cannot be loaded or an order has already been placed using this cart Cart      22129      0x 1

 

thanks

Link to comment
Share on other sites

you may find some useful information using this search link

 

https://www.google.com/search?q=prestashop+%09Cart+cannot+be+loaded+or+an+order+has+already+been+placed+using+this+cart+Cart+site:www.prestashop.com&client=firefox-a&hs=lla&rls=org.mozilla:en-US:official

 

as for your error log, I'd call again or see if in cpanel this needs to be activated. I use plesk so am not familiar with it

Link to comment
Share on other sites

I'm using host gator.  I just spoke to them and they said there wouldn't be anything on the server logs (I don't know if I've been given bad advice by them -but I did tell them what you suggested).

 

I have, however, checked the PrestaShop "advanced parameters" log and get the following error each time an order doesn't go through:

 

 4         Cart cannot be loaded or an order has already been placed using this cart Cart      22129      0x 1

 

thanks

 

 

Hi! What version of PrestaShop are you using? Also, is this an upgraded store?

Link to comment
Share on other sites

Hi Benjamin

-thanks for your reply.

 

This is an upgrade from v1.1 to 1.5.3

 

I know, ideally, I should now upgrade to the very latest version but I've spent literally months ironing out all the little issues and only just going live with it now so reluctant to upgrade for a second time (mainly due to time really).

 

If you know of any specific files from the latest version that I could replace that might help this problem, that would be appreciated.

 

A while back I added this to classes/Mail.php around line 246 (I found this fix on an issue tracker)

if (empty(Context::getContext()->link))
Context::getContext()->link = new Link();
 

This meant that some (rather than no) orders are going through, but hasn't fully fixed the issue.

  • Like 1
Link to comment
Share on other sites

Hi Benjamin

-thanks for your reply.

 

This is an upgrade from v1.1 to 1.5.3

 

I know, ideally, I should now upgrade to the very latest version but I've spent literally months ironing out all the little issues and only just going live with it now so reluctant to upgrade for a second time (mainly due to time really).

 

If you know of any specific files from the latest version that I could replace that might help this problem, that would be appreciated.

 

A while back I added this to classes/Mail.php around line 246 (I found this fix on an issue tracker)

 

if (empty(Context::getContext()->link))

Context::getContext()->link = new Link();

 

This meant that some (rather than no) orders are going through, but hasn't fully fixed the issue.

 

great work finding this!

could you please post the link of the forge and or github solution to this?

Link to comment
Share on other sites

Hello

 

The fix I referred to doesn't fix my current wider issue of orders not appearing correctly in back office, but here's a bit more info that might help some people (and hopefully someone can help me with my issue)...

 

This was a fix relating to mail alerts interferring with payment modules (I would imagine this is fixed anyway in the latest version of prestashop):

 

http://www.prestashop.com/forums/topic/263129-moneybookersskrill-problem/

 

http://forge.prestashop.com/browse/PNM-635?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs  (note, this fix isn't specific to just one payment module and reference to line 250 should be 246)

 

 

With regards to my issue...  At the time of my previous post I thought the problem was specific to Moneybookers (but it's in fact a problem with PayPal too) -and most likely other payment modules (no others installed).  I'm hoping Benjamin knows something else about this issue.  It is possibly due in my case due to the upgrade from 1.1 to 1.5.3  I'm really not sure although I do seem to notice this problem evident in other posts where people have upgraded rather than fresh installed.

 

El Patron -I noticed you replied to a post yourself a few days ago where you said you had a similar problem that I'm experiencing, but in v1.5.2 (I have 1.5.3).  If you have any ideas regarding the issue I'm experiencing, gratefully received!

 

I have, however, now seen this in the issue tracker...

 

http://forge.prestashop.com/browse/PSCFV-5935

 

Do you think this could help my problem?  It says it's 1.5.2 but I guess that's not a 100% certainty that it doesn't affect 1.5.3 too?

 

I also found this (but as I have a newer PayPal module I doubt this will help):

 

http://forge.prestashop.com/browse/PNM-844?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel#issue-tabs

 

I'm reluctant to start randomly changing stuff around (that I don't fully understand) before getting a bit more input about this.

 

Something I don't understand is there are fixes listed in the spec list for PS 1.5.4 relating to Moneybookers even though Moneybookers isn't even included in that release of PS.  This makes no sense.  I'm intruiged to know what these updates actually are so I can copy them to my version of PS.  A lot of my problems are with the moneybookers module (although the problems I experience with that are shared by a lot of people on other payment modules too) -and as mentioned, I'm getting pretty much the same issue with PayPal anyway (I doubt by coincidence particularly as both are working intermittently).  Some people say de-activating the mail module helps with some of these problems (didn't with me) -but the above mentioned fix is meant to get around that issue.

 

Because I have other PS 1.4 site, 1.2 site and 1.1 site all working fine, I'm 99.9% sure the problem is specific to the 1.5.3 installation Iv'e got.

Link to comment
Share on other sites

HI Andrew, just checking one time because I've seen you checked error logs in the Cpanel and so forth, but have you turned on the native Error reporting inside PrestaShop. The file is config/defines.inc.php edit around line 28

 

 

/* Debug only */
define('_PS_MODE_DEV_', true);
if (_PS_MODE_DEV_)
{

 

Make sure it says MODE DEV true

 

Let me know if you already done that.  

Link to comment
Share on other sites

i have this problem too, orders do not appear in back office. since yesterday all was working but after upgrading my server to a new one this problem came out..

i tried with 

 

if (empty(Context::getContext()->link))
Context::getContext()->link = new Link();

 

but with no positive results

Link to comment
Share on other sites

i have this problem too, orders do not appear in back office. since yesterday all was working but after upgrading my server to a new one this problem came out..

i tried with 

 

if (empty(Context::getContext()->link))

Context::getContext()->link = new Link();

 

but with no positive results

 

Can you check the Advance Parameters Log and see if you get the same error "    "Cart cannot be loaded or an order has already been placed using this cart Cart "

Link to comment
Share on other sites

Can you check the Advance Parameters Log and see if you get the same error "    "Cart cannot be loaded or an order has already been placed using this cart Cart "

yes, i got it

 

Cart cannot be loaded or an order has already been placed using this cart

Link to comment
Share on other sites

Hi Benjamin

Thanks for your reply.

I've not done that, yet. The site is live at the moment.  Will I need to take the site offline in order to have this enabled?  I read this can only be enabled for short times for security?

Thanks

Andrew

 

It's not something that you absolutely must do. However, be aware that any customers can see any error because it will show up on your store.

 

If you can, you can turn it on maintenance mode for a bit while you investigate. 

Link to comment
Share on other sites

ok I'll try this a bit later tonight (I'm in UK so in a couple hours it will be 10pm and safe to play about with it) when people are less likely to see  -and I'll report back tonight or tomorrow.

 

Unfortunately, though the really strange (and hard to believe) thing is that however many times I try and process a test order, it seems to go through fine every time.  The more I think about it, the more I think orders of multiple products (thus bigger information transfer) are affected by this problem more -and most likely why it's not evident when I put a test order through -so I'll try a bigger order.

 

I just realised I need to have the site live while I check this or the payment modules won't be able to receive the post backs... so in effect I'd get a "false positive".

 

I really appreciate you taking the time to answer these questions.

Edited by Andrew H (see edit history)
Link to comment
Share on other sites

HI Andrew, just checking one time because I've seen you checked error logs in the Cpanel and so forth, but have you turned on the native Error reporting inside PrestaShop. The file is config/defines.inc.php edit around line 28

/* Debug only */
define('_PS_MODE_DEV_', true);
if (_PS_MODE_DEV_)
{

Make sure it says MODE DEV true

 

Let me know if you already done that.  

 

 

HI Andrew, just checking one time because I've seen you checked error logs in the Cpanel and so forth, but have you turned on the native Error reporting inside PrestaShop. The file is config/defines.inc.php edit around line 28

/* Debug only */
define('_PS_MODE_DEV_', true);
if (_PS_MODE_DEV_)
{

Make sure it says MODE DEV true

 

Let me know if you already done that.  

i tried this but i don't get any errors..

Link to comment
Share on other sites

I don't know about Conidig but my products are physical.  If there are no errors, it might be the same reason I usually get no issues when I test it myself.  The only difference I've noticed between orders that fail and ones that don't are the number of products in the order.  More unique products in an order are more likely to fail (I can't be 100% sure of this, however).  I've not had a single order fail after testing about 20 times, but almost every order received from third parties fails (in my case).  If it's not order quantity related, it might be time-of-the-day related as I usually test at off-peak times.  I can't think of any other reason.

Link to comment
Share on other sites

i'm getting the problem (in my case) with PayPal and another payment module.  Initially I thought it was just one, but PayPal started causing the same issues as well.

 

 

No, physical products

 

Hi, sorry to pry into this situation but I just want to understand a little more. 

 

Can you tell me the update history of the stores that are having this problem. Reason being is that I think this was a upgrade bug concerning versions <1.4 that were upgraded to early versions of 1.5. 

 

Can you detail your upgrade history like 1.1 to 1.4 and then 1.4. to 1.5 etc. 

Link to comment
Share on other sites

Also, please make sure to update your PayPal module to the latest version, if you are in Canada, USA, or Mexico use this module, http://addons.prestashop.com/en/payments-gateways-prestashop-modules/8277-paypalusa.html

 

If you are anywhere else Europe, Asia, Oceania etc.. use this one, http://addons.prestashop.com/en/payments-gateways-prestashop-modules/1748-paypal.html

 

Make sure to have a backup before! 

Link to comment
Share on other sites

Hi  - I started originally with v1.0 and upgraded to v1.1 a few years ago.  After a number of little fixes v1.1 was very stable.  Early this year I upgraded from v1.1 to v1.5.3  so quite a big step.  Since then I've had quite a lot of issues to deal.  All but this and a voucher problem are now fixed.

 

I'm in UK and installed the latest version 3.5.8 of the PayPal module; I installed the European version.  I did notice however, that someone said there was also a UK-specific version, but I wonder if this is wrong as I've found no such thing.

 

When I upgraded, I did have an issue (and fix for the issue) with it which I explained in another post http://www.prestashop.com/forums/topic/268385-paypal-problem/

 

I don't think this problem (referenced in my above post) is directly related to the current issue -I'm now going to run some tests like you've suggested (and double check if this problem has occured again) and I'll report back shortly.

Edited by Andrew H (see edit history)
Link to comment
Share on other sites

OK....  Reporting back after running a couple of test orders with reporting activated.

 

Two messages (I think relating to the two orders I ran through the system) did appear in the error log but nothing in the customer facing side of the site.  These are the two messages:

 

27    3   The file /home/USERNAME/public_html/product.php is deprecated and will be removed in the next major version.   0   0x 0    04/09/2013 22:58:56

 

28    3    The file /home/USERNAME/public_html/order-confirmation.php is deprecated and will be removed in the next major version.     0x 0     04/09/2013 23:03:51

 

 

As is usual, whenever I place orders they go through without issue.  This is so frustrating as every single order from customers today has failed but both orders I've just tested, using both PayPal and Moneybookers went through without issue.  It's driving me crazy that I can never replicate this problem.

 

I think my theory about number of products is wrong too because I created 6 test products and this number of products didn't cause me any issues either.

 

Could it be that the issue is related to new accounts created in the new store?  My account is based on an account from my old version.  I have (before today) tested payment using guest checkout -also without issue.

 

I know it's unbelievable, but it makes no sense why all my test orders are fine but (nearly) all customer orders are not.

 

Are newly created accounts from v1.5 treated different (or seen differently) to accounts created in earlier versions?  Are the error message above part of the issue?

 

Thanks

Andrew

Edited by Andrew H (see edit history)
Link to comment
Share on other sites

Unfortunately there is no obvious constant.  Due to the nature of the products, there aren't that many repeat customers.  Since making the new website live, there have been no repeat customers from the old store.  The odd few orders that have come through have not been repeat customers (except me, where it works fine every time with whatever product).

 

However, there is one thing I have noticed.  There are new products in the store that can be customised (old store didn't have this).  I've been thinking it's "lucky" that each time I have an order where there is a personalised product -that the order comes through.  I've just realised that EVERY time a customer places an order that contains one or more customised products, the order comes through ok.  There have only been about 4 or 5 such orders, but considering about 70% of the small number of orders that have been ok have been customised orders, it could be more than a coincidence.  I don't know if this is caused by the fact that the products are new or that the products have been added to the new (rather than old) site.

 

Nearly all others do not come through or in some cases partially come through (so some of the products in the order appear) -but the full cart and order is always visible via the customer in the back office.

 

I doubt it's relevant, but the only modification I made to the site with regards to customisation was the following:

(I found this elsewhere in the forum -I'm only mentioning it on the offchance it's related -though I doubt it)

Remove the line, or comment out, which says:
require_once(dirname(__FILE__).'/init.php');
The file is in your admin directory and called displayimage.php and it's line 28

The reason for this modification was that the images uploaded with custom orders were not otherwise downloadable.

 

thanks
Andrew

Link to comment
Share on other sites

you said "Could it be that the issue is related to new accounts created in the new store?  My account is based on an account from my old version.  I have (before today) tested payment using guest checkout -also without issue."

 

Yes, please test with new account registration.

 

and yes, take up dh42's offer to review you db table structures.

Link to comment
Share on other sites

Okay cool, by any chance is there a constant payment method that these orders are paying with? Are they all one payment method?

 

 

Yes, i'm only using moneybookers. Never upgraded prestashop. Now i'm gonna try to register a new account and test from it. Because unlikely andrew orders always doesnt appears even when they are made by me

Link to comment
Share on other sites

i've tried with a new account to place an order. the website tell me this error

 

We noticed a problem with your order. If you think this is an error, you can contact our customer support.

 

But checking the back office now the order does appear, the only wrong thing is that from the option tab is selected order annullated

Link to comment
Share on other sites

This is going to be a PITA, but I would try this. Contact your host and ask them to turn on php error reporting. 

 

I am pretty sure you said that your site was in maintenance mode, leave it in it. Ftp into your site to this file /modules/bankwire/controllers/front/validation.php. 

 

You will see a line that looks similar to this, it should be around line 64.

$this->module->validateOrder($cart->id, 2, $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);

Paste that in over the line that is already there. Where I have the number 2, in your back office go to orders >> order status's and make sure that number matches the order status that is set when a payment with moneybookers or paypal comes through. Now enable the bankwire payment module, create a new account and start placing orders. Back up your database, then start placing a bunch of orders, you are trying to make it error so you can see what the error is. 

 

Prestashop is creating the order in ps_orders, but it is not creating anything in the ps_order_details or the ps_order_carriers. 

 

Also enable error reporting in prestashop as well. 

 

That is the best advice I can give you right now. 

Link to comment
Share on other sites

This is going to be a PITA, but I would try this. Contact your host and ask them to turn on php error reporting. 

 

I am pretty sure you said that your site was in maintenance mode, leave it in it. Ftp into your site to this file /modules/bankwire/controllers/front/validation.php. 

 

You will see a line that looks similar to this, it should be around line 64.

$this->module->validateOrder($cart->id, 2, $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);

Paste that in over the line that is already there. Where I have the number 2, in your back office go to orders >> order status's and make sure that number matches the order status that is set when a payment with moneybookers or paypal comes through. Now enable the bankwire payment module, create a new account and start placing orders. Back up your database, then start placing a bunch of orders, you are trying to make it error so you can see what the error is. 

 

Prestashop is creating the order in ps_orders, but it is not creating anything in the ps_order_details or the ps_order_carriers. 

 

Also enable error reporting in prestashop as well. 

 

That is the best advice I can give you right now. 

i tried it but i didn't get any errors..

After a successful payment with moneyb i still have Cart cannot be loaded or an order has already been placed using this cart.

Link to comment
Share on other sites

What did the php error log say? If you are logging errors, an error will be spit out to the log file when that message appears. 

PHP Fatal error: Call to a member function getPageLink() on a non-object in /home/nerdto/public_html/classes/Mail.php on line 237

PHP Fatal error: Call to a member function getProductLink() on a non-object in /home/nerdto/public_html/classes/Product.php on line 3530

Link to comment
Share on other sites

Ok, do your products have customization's to them? If so create a test product without a customization and try. If it messes up let me know what error message you get. 

i created a new order without customization and all worked right..

order was created and payment accepted

Link to comment
Share on other sites

It looks to be the old products customization. How many products do you have? I would take an old product and delete the customization and then add it again and see if it works. If so, I would do that for every product with a customization. 

Link to comment
Share on other sites

It looks to be the old products customization. How many products do you have? I would take an old product and delete the customization and then add it again and see if it works. If so, I would do that for every product with a customization. 

i have more than 400 products

Link to comment
Share on other sites

Do you know how to use phpmyadmin? If so export all of the ps_customization tables and email them to me @ [email protected] or send my your cpanel info through a pm and tell me what database it is and the product you changed the customization for. 

i don't know if the problem was resolved by this:

 

if (empty(Context::getContext()->link))
Context::getContext()->link = new Link();
 
because i've added that code around line 26 of validation.php
 
up: ps_customization in database is empty
Edited by conidig (see edit history)
Link to comment
Share on other sites

By the way, Conidig, did you add this to line 26 of validation.php for moneybookers module I assume?  This is the exact same module causing me most issues (but gave me no issue in v1.4), although have similar problems with PayPal.  The bug report did only refer to version 1.5.2 but I might give it a try in 1.5.3 anyway and see what happens.

Edited by Andrew H (see edit history)
Link to comment
Share on other sites

I've realised what causes my payment methods to stop working but not sure why.

 

The other day, I was editing the PayPal settings, trying to get it to work with "force compile" enabled.  I switched the shop back to "do not compile" -and realised moneybookers was working.  It worked great for a few days without one failed order.

 

PayPal still wasn't working.

 

Yesterday I reset the PayPal module, trying to get that to work, (with force compile enabled again).  I set it back to "do not compile" and then moneybookers and paypal stopped working.  Through messing about with these settings I've got PayPal working again but not Moneybookers.

 

It's driving me crazy.  Does anyone have any idea why force compile could cause this issue (or maybe it's the disabling of force compile).  I have noticed that this setting is also affecting something else in the shop so I wonder if it's somehow not working properly.

 

 

 

*** UPDATE ***   16/10/2013

 

I've found part of the reason for the problem in the upgrade from the old version of Prestashop.

 

Although the reason is partly my fault for using the wrong product code format, I certainly think the prestashop upgrade should have handled the issue better.

 

Certain field lengths that were different in the old version but not acceptable in the new version and invalid code values in certain product codes (but were not rejected in old versions) meant that products from the original store were not processing properly (and when the cart contains these products) stops the order processing correctly.

 

I realised today because 3 or 4 orders that didn't work contained the same product.  When editing the product, without correcting the excessive characters or incorrect product codes meant an error page appeared.  However, until I came to edit the page there was no indication of this problem.

 

A good solution would have been the installation process to detect this issue and warn of the consequences or even better - for it not to slap tighter different rules on fields on new versions during an upgrade because this makes the upgrade process much more complicated and the months and months of issues and hassle I've had with this.  Other than this, even better... PS should have automatically corrected the problems in the upgrade,  I had no way of knowing except the hard way which isn't good enough to be honest.

 

I can't be sure yet if this was 100% of the reason for the problems, but I know is certainly a contributory factor.

Edited by Andrew H (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...