Page 1 of 1

Strange behavior on edit/delete orders (admin side)

Posted: Tue Dec 08, 2015 9:25 am
by moodleboy
I posted this to the official 2.1.0.1 bug report yesterday http://forum.opencart.com/viewtopic.php ... 20#p593573:
1) When admin goes to edit an order (Sales -> Orders -> Edit, then clicking "Continue" to get to the "Products" tab), the associated customer cart is populated with products in the order. If customer logs in, they see their cart populated with their previous order. This can (and has) cause confusion.

2) When deleting an order, clicking the delete button temporarily shows the loading button (good), then shows success message (also good), but order still shows in list (not good). Admin must refresh page for the order to disappear.

These show up on a clean install of 2.1.0.1
I also opened an issue on github https://github.com/opencart/opencart/issues/3716

Today, I noticed that Daniel had closed the issue on github. So I thought, "wow - that was a fast fix!" But when I just downloaded a brand new, pure vanilla, OC and set it up, the issues are still there, and there are no modified files in the github directory to signify that anything was changed.

So I am asking the community:
  • Has anyone else noticed this as well?
  • Are these bugs or (very odd) features?
  • If they are bugs, why were they simply closed on github without any explanation whatsoever? Did I miss the fix somewhere?
The second item (the non-deleting order) is minor, and the work-around is easy (just refresh the page). However, the first one is pretty bad, I think. Imagine this scenario: 1) A customer places an order and checks out with payment, 2) the admin goes to edit it, 3) The customer logs back in at the same time and sees the products back in their cart, and 4) The customer deletes the items from the cart, messing up the order on the backend.

If anyone has any thoughts on this, I would like to hear them.

Thanks!

Re: Strange behavior on edit/delete orders (admin side)

Posted: Tue Dec 08, 2015 3:41 pm
by VictorDrummond
moodleboy wrote:1) When admin goes to edit an order (Sales -> Orders -> Edit, then clicking "Continue" to get to the "Products" tab), the associated customer cart is populated with products in the order. If customer logs in, they see their cart populated with their previous order. This can (and has) cause confusion.

2) When deleting an order, clicking the delete button temporarily shows the loading button (good), then shows success message (also good), but order still shows in list (not good). Admin must refresh page for the order to disappear.

These show up on a clean install of 2.1.0.1

So I am asking the community:
  • Has anyone else noticed this as well?
  • Are these bugs or (very odd) features?
  • If they are bugs, why were they simply closed on github without any explanation whatsoever? Did I miss the fix somewhere?
The second item (the non-deleting order) is minor, and the work-around is easy (just refresh the page). However, the first one is pretty bad, I think. Imagine this scenario: 1) A customer places an order and checks out with payment, 2) the admin goes to edit it, 3) The customer logs back in at the same time and sees the products back in their cart, and 4) The customer deletes the items from the cart, messing up the order on the backend.

If anyone has any thoughts on this, I would like to hear them.

Thanks!
On an install of 2.03.1 I'm definitely seeing issue 1 ... Now you mention it ... But not issue 2 ...

Interestingly, I just tested across four different browsers on various devices including Android, so as to NOT be using the same browser/device as for admin editing - thinking that could be something to do with it, and yes it still did it no matter which device, HOWEVER...

After testing what you've posted, as a customer whether separate device or not, I'm certainly not seeing the deletion of items from my cart doing any "messing up the order on the admin backend" not in customer front end account history either, even on the same browser/device as admin, so I'm not even concerned about this, although it's good to know about it, I'll work around it if I need to edit customers' order for some reason and just clear their cart on their behalf.

I've setup to run https://www. only across everything including admin so I did consider the possibility that my redirects may cause me an issue here or there such as this... But so far it's all good really.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Wed Dec 09, 2015 12:58 am
by moodleboy
After testing what you've posted, as a customer whether separate device or not, I'm certainly not seeing the deletion of items from my cart doing any "messing up the order on the admin backend" not in customer front end account history either, even on the same browser/device as admin, so I'm not even concerned about this, although it's good to know about it, I'll work around it if I need to edit customers' order for some reason and just clear their cart on their behalf.
Actually, the admin's order is affected if the user modifies the cart. Use this to test:
1) On one computer, log in as a customer (with a store account) and purchase a couple of items. Log out when done.
2) On another computer with a different IP address, log into the store's admin panel (I used my computer for the admin and my cell phone without wifi for the customer to guarantee different IP addresses)
3) As admin, start the order edit process, and click "continue" once to get to the "products" tab
4) As the customer, log back into the store, and verify that your cart is re-populated with the previous order.
5) As the customer, delete some of the items in your cart
6) As admin, still on "product" tab, click "Continue" three times to get to the "Totals" tab
7) Now, the product list is different and does not show the items deleted by the customer. If the admin clicks "Save", the order will be modified with the invalid amounts.

If someone else can please verify this, I'd like to know since I think this can be potentially serious. I still don't know why Daniel marked it as "Closed" without providing a fix or a comment.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Wed Dec 09, 2015 1:15 am
by daniGo
You are right, this is how it works.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Wed Dec 09, 2015 1:23 am
by moodleboy
You are right, this is how it works.
Do you mean it is supposed to do this? I think that could cause a big issue for the admin because if a user modifies the cart when the admin is editing it, the admin may not realize it, and thus change the order.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Wed Dec 09, 2015 1:37 am
by daniGo
It may happen that errors occur. But it is a very small chance that both admin and customer at same time edit cart. I do not like the new cart so for my site i wrote a new cart and fix this.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Wed Dec 09, 2015 1:43 am
by moodleboy
But it is a very small chance that both admin and customer at same time edit cart
That's not very comforting :)

If anyone else can verify and possibly provide a fix, that would be great. I personally think it should be reopened on github.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Sun Dec 20, 2015 7:35 am
by moodleboy
Just wondering if anyone else sees this bug or cares about it.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Mon Dec 21, 2015 12:49 pm
by agatha65
I'm seeing this bug. Even more when the order is edited it changes the stored customer cart.
I have reported it on github
https://github.com/opencart/opencart/issues/3392
but it was closed without fix.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Thu Dec 24, 2015 6:30 am
by moodleboy
That's funny - I posted a bug report on github as well and within 24 hours it was also closed without a fix or explanation.

I guess that's the way they handle bugs they don't like - they ignore them :-)

I hope someone out there can find a fix for this. It doesn't seem very complicated - just enforce the session ID and/or clear the cache on the admin side after the edit is done.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Mon Feb 01, 2016 6:32 am
by htwp
If you want to fix the refresh on delete order button there is an easy fix.
Open admin/view/template/sale/order_list.tpl and after this:

if (json['success']) {
$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

add this one:


location.reload();

so the final will be like this:

if (json['success']) {
$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

location.reload();

Re: Strange behavior on edit/delete orders (admin side)

Posted: Wed Feb 10, 2016 2:30 pm
by upacreek
Seeing the same problem listed in Item 1.

Similar issue on 2.0.3.1

A Registered Customer called about having problems placing another order. Told her I would place it for her. I added a new order via Admin. Once on the Products page, it populated with all the products on her previous order that was completed several weeks ago - as well as the products she was attempting to order. Tried it on Chrome, IE and Firefox on 3 different computers. Same thing. Deleted the products from the "old" order and canceled it. Went to another computer and added order via Admin. On Products page, it now only showed her new items. I was able to complete the order.

This has been happening several times with registered customers that order new/different items on a regular basis. They are trying to place new orders and their carts are populating with products from their previous orders.

In all these years of using Opencart, I rarely received complaints from customers and they often complimented how easy the site was. Since I upgraded from 1.5.x to 2.0.3.1 a 3 months ago, I am receiving customer complaints on a regular basis stating how difficult the shopping cart has become and I am seeing lots of abandoned orders. Word of mouth is getting out and it's no longer positive.

Customer complaint 2/2/16: I reentered XXX twice and it added it and then added my last order of YYY when the ordered confirmed in the checkout. Website is getting very frustrating to use.

Customer complaint 2/6/16: My friend is having to check out for me at her computer because your website is quite unreliable and I cannot do it on my own.

Customer complaint 2/9/16: I need two more XXX, but am having trouble figuring out to do this on your website. I keep seeing items from my previous order. Would you mind helping me?

Re: Strange behavior on edit/delete orders (admin side)

Posted: Mon Feb 22, 2016 7:17 pm
by aamnah
1) When admin goes to edit an order (Sales -> Orders -> Edit, then clicking "Continue" to get to the "Products" tab), the associated customer cart is populated with products in the order. If customer logs in, they see their cart populated with their previous order. This can (and has) cause confusion.
Experiencing this issue. When an order is deleted, the order items get added back to the customer's cart. Same happends when an order status is updated to Cancelled. I have had at least 9 complaints about this from customers where items show up in their carts again for an order that was placed 3 weeks ago and was deleted or cancelled upon customer's request.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Mon Oct 10, 2016 8:16 pm
by pac_indahood
i am facing the same problem, did anyone found a fix?

Re: Strange behavior on edit/delete orders (admin side)

Posted: Tue Nov 22, 2016 1:53 pm
by htleetw
htwp wrote:If you want to fix the refresh on delete order button there is an easy fix.
Open admin/view/template/sale/order_list.tpl and after this:

if (json['success']) {
$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

add this one:


location.reload();

so the final will be like this:

if (json['success']) {
$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

location.reload();
I try it but not working....still require manual refresh to make the deleted order disappear.

Re: Strange behavior on edit/delete orders (admin side)

Posted: Thu Aug 24, 2017 6:54 pm
by mupcku
htwp wrote:
Mon Feb 01, 2016 6:32 am
If you want to fix the refresh on delete order button there is an easy fix.
Open admin/view/template/sale/order_list.tpl and after this:

if (json['success']) {
$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

add this one:


location.reload();

so the final will be like this:

if (json['success']) {
$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

location.reload();
Not working for me also, have the same issue