Post by Lembo » Tue Apr 30, 2019 7:51 am

Hello,
I was wondering why when i edit order it duplicate in the order table in mysql Database
It's weird that same order has more than order id because it's duplicated after editing
how to avoid duplicating orders?

New member

Posts

Joined
Wed Oct 17, 2018 9:56 am

Post by rjcalifornia » Tue Apr 30, 2019 12:17 pm

Lembo wrote:
Tue Apr 30, 2019 7:51 am
Hello,
I was wondering why when i edit order it duplicate in the order table in mysql Database
It's weird that same order has more than order id because it's duplicated after editing
how to avoid duplicating orders?
How did you edit the order and how did you notice it duplicated?

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by Lembo » Wed May 01, 2019 3:40 pm

rjcalifornia wrote:
Tue Apr 30, 2019 12:17 pm
Lembo wrote:
Tue Apr 30, 2019 7:51 am
Hello,
I was wondering why when i edit order it duplicate in the order table in mysql Database
It's weird that same order has more than order id because it's duplicated after editing
how to avoid duplicating orders?
How did you edit the order and how did you notice it duplicated?
Edited Order using the admin panel
Sales tab -> Orders -> Edit " Next to view button "

I've noticed duplicated lines when i tried to export orders to xls file
it returned more than 10 orders while it's shown i have only 8 orders
so i checked the order table at mysql and it had 10 lines of orders
6 lines and 2 duplicated orders which i've edited

New member

Posts

Joined
Wed Oct 17, 2018 9:56 am

Post by Lembo » Fri May 03, 2019 11:29 am

Is there is anybody can help?

New member

Posts

Joined
Wed Oct 17, 2018 9:56 am

Post by OSWorX » Sun May 05, 2019 6:21 pm

Lembo wrote:
Fri May 03, 2019 11:29 am
Is there is anybody can help?
Not really.
Because when editing orders, they are not duplicated - in a default installation.
Maybe you have additional extensions installed?

It would be also helpfully, if you post the used OpenCart version (see Forum rules!).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by rjcalifornia » Tue May 07, 2019 11:17 am

Lembo wrote:
Wed May 01, 2019 3:40 pm
rjcalifornia wrote:
Tue Apr 30, 2019 12:17 pm
Lembo wrote:
Tue Apr 30, 2019 7:51 am
Hello,
I was wondering why when i edit order it duplicate in the order table in mysql Database
It's weird that same order has more than order id because it's duplicated after editing
how to avoid duplicating orders?
How did you edit the order and how did you notice it duplicated?
Edited Order using the admin panel
Sales tab -> Orders -> Edit " Next to view button "

I've noticed duplicated lines when i tried to export orders to xls file
it returned more than 10 orders while it's shown i have only 8 orders
so i checked the order table at mysql and it had 10 lines of orders
6 lines and 2 duplicated orders which i've edited
That's not normal, usually doesn't happen. Which extensions you have in your store?

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by shashank1992 » Wed Apr 27, 2022 4:31 pm

if you look into the edit order code,
you will notice that the possibility of the edit from the admin panel creating a new order is there.
it can happen , when the session doesn't have the order_id.
You can debug more to find out.

Code: Select all

if (!isset($this->session->data['order_id'])) {
				$this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data);
			} else {
				$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
				if ($order_info) {
					$this->model_checkout_order->editOrder($this->session->data['order_id'], $order_data);
				}
			}

Newbie

Posts

Joined
Fri Apr 01, 2022 2:52 pm

Post by rjcalifornia » Fri Apr 29, 2022 10:44 pm

shashank1992 wrote:
Wed Apr 27, 2022 4:31 pm
if you look into the edit order code,
you will notice that the possibility of the edit from the admin panel creating a new order is there.
it can happen , when the session doesn't have the order_id.
You can debug more to find out.

Code: Select all

if (!isset($this->session->data['order_id'])) {
				$this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data);
			} else {
				$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
				if ($order_info) {
					$this->model_checkout_order->editOrder($this->session->data['order_id'], $order_data);
				}
			}
Wait, I don't think that can happen without an order_id

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide
Who is online

Users browsing this forum: No registered users and 24 guests