Post by Lucmac » Fri Jan 27, 2023 3:19 am

Hi, I'm running a fresh install of opencart 3.0.3.8. The reason I'm running a fresh install is because the last opencart I was working on started to show some weird behaviour, which was as follows: when I placed a new order this was being saved in the oc_order table but not being saved in the oc_order_history table, hence it was not showing up on the front- nor back-end. So I thought to myself, let me do a fresh install of opencart as the behaviour may be due to some mods I had running.
I have now a fresh install of opencart and I could place an order successfully. However when I went to make a new order, I got the order successful screen but the same thing has happened i.e. the order is being saved in the oc_order table but not in the oc_order_history table.
To try and debug I then deleted the first order, to see if this had anything to do with the customer not being to place a new order whilst there was an existing order pending, but this didn't solve the problem.
To debug even more I then decided to create a new user account, but the same thing has happened, i.e. the new user can place a successful order but this is not being saved in the oc_order_history table.

Has anyone heard of this before? I have come to a complete standstill now. A fresh install of oc allows me to make one order and one order only.

When I write that I am running a fresh install of oc, I mean that it's a complete new download of oc on a new directory with new database tables, i.e. a completely fresh install with no mods, nothing!
Last edited by Lucmac on Tue Jan 31, 2023 3:10 am, edited 1 time in total.

New member

Posts

Joined
Mon Apr 22, 2019 5:29 pm

Post by xxvirusxx » Fri Jan 27, 2023 3:26 am

Lucmac wrote:
Fri Jan 27, 2023 3:19 am
A fresh install of oc allows me to make one order and one order only.
Impossible.
From where you have downloaded oc 3.0.3.8?

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Lucmac » Fri Jan 27, 2023 3:39 am

xxvirusxx wrote:
Fri Jan 27, 2023 3:26 am
Lucmac wrote:
Fri Jan 27, 2023 3:19 am
A fresh install of oc allows me to make one order and one order only.
Impossible.
From where you have downloaded oc 3.0.3.8?
I agree, it's impossible, but the impossible has become possible. I downloaded the file from https://www.opencart.com/index.php?rout ... ad/history.

New member

Posts

Joined
Mon Apr 22, 2019 5:29 pm

Post by Lucmac » Fri Jan 27, 2023 4:04 am

I'm going to have to test this on my localhost, if it works there then this must be a server issue!

New member

Posts

Joined
Mon Apr 22, 2019 5:29 pm

Post by by mona » Fri Jan 27, 2023 8:41 pm

The order is written just after the payment method is confirmed and just prior to the order confirmation page is send.
The order history is written by the payment method itself after the order is confimed.

Just before the order history is written though, the order confirmation emails and alerts are send out by events.

So if the order is written but the order history is not, chances are that you have an issue with the payment method and/or the email events.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by paulfeakins » Fri Jan 27, 2023 8:56 pm

Lucmac wrote:
Fri Jan 27, 2023 3:19 am
but this is not being saved in the oc_order_history table.
Why are you looking directly at database tables?

Isn't the order history table only populated when you view an order and add order history?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Lucmac » Sun Jan 29, 2023 2:43 am

Thanks for the help so far with this. I have found the solution, but I have no idea what the solution is and wonder if you can help with this?

My server guy suggested that I clear the cache between orders, so I tried this today and it worked like a charm. So when I place an order, I then clear my browser cache, then I can successfully make a new order which is then saved in the order_history table, with the admin being notified via email, and with the customer being able to view the order in their order history.

So the question is, why is this happening? As I've said originally, this is happening with e fresh oscommerce install.

Thanks / Luke

New member

Posts

Joined
Mon Apr 22, 2019 5:29 pm

Post by Lucmac » Sun Jan 29, 2023 2:48 am

thought I'd also mention that this is alos happening on different devices, both on my mobile phone and desktop.

New member

Posts

Joined
Mon Apr 22, 2019 5:29 pm

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Lucmac » Sun Jan 29, 2023 9:45 pm

xxvirusxx wrote:
Sun Jan 29, 2023 3:19 am
Add this fix, and try again

viewtopic.php?t=206449#p786660
It looks like this hit the nail on the head, thank you! I'll continue reading up about this, for now the fix works and I'm happy for this. I read on github that this may also be due to cloudflare so I'll do some more digging and chat with my server guys.

Once again, thank you very much, this has plagued me for a week!!!

/ Luke

New member

Posts

Joined
Mon Apr 22, 2019 5:29 pm
Who is online

Users browsing this forum: apnsolution, fatihcr and 17 guests