AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.4 Bug when placing back-to-back admin orders
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
We finally found the cause of our demon haunting the admin create-order process. I have confirmed the behavior in a default AC 9.0.4 install. You need two separate user accounts to work with. I'll call them Test1 and Test2 for this walkthrough. It visually helps to have some items in Test2 basket before this walkthrough. Steps to reproduce: Go to Admin/People/Users and search/find user Test1. Edit the user. Click the Basket tab Click the Create Order button You're now on the search-catalog step of create-order. Find a product. Add it to the basket. Continue through to payment page. Complete the order. I used Purchase Order as the payment method but it doesn't really matter. The view-order page renders with your completed order. Now go to Admin/People/Users and find user Test2. Edit the user. Click the basket tab Click the Create Order button The basket contents page of create-order briefly renders, then suddenly changes to the search-catalog partial view. Note at this point the username has changed as well. You are no longer placing an order for Junk2. It's reverted back to Junk1. That's the bug. Here's a screen recording walkthrough on a default AC904 install. https://www.screencast.com/t/seY1vm52hI suspect the bug is caused by Able's use of a browser cookie to persist the UserID value across pages during the create-order steps. If you look at the code \Admin\Views\Orders\AddOrder.cshtml you'll find where javascript creates and reads that cookie. I think the cookie is not being checked at the right point in time in $(document).ready() for the situation when the user arrives here from the edit-user page/basket tab. We could really, really use a fix posted here when you have a solution. This issue has been haunting us, and costing us business, for months now. And my javascript is too weak to risk breaking something to fix something else.
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Hi Joe,
Thanks for sharing the details. I am going to try to reproduce the issue and will get you the fix.
|
1 user thanked shaharyar for this useful post.
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
I am able to reproduce the issue and I am going to register it. Please apply this fix as a workaround: 1- Open file \Website\Areas\Admin\Views\Orders\AddOrder.cshtml 2- Search for Code:
var UID = $.cookie("CreateOrder_UID");
if (UID != undefined)
{
$('#UserId').val(UID);
}
3- Replace with Code:
if ('@Model' > 0)
{
$('#UserId').val('@Model');
}
else
{
var UID = $.cookie("CreateOrder_UID");
if (UID != undefined)
{
$('#UserId').val(UID);
}
}
4- Please test with a fresh browser session to avoid any unexpected results. Please mention if there are any other related issues. Thanks
|
1 user thanked shaharyar for this useful post.
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Thanks! Tested locally, works good. Will deploy to live site and let you know if we see any issues.
Note: That cookie seems key to the whole create-order process. But when it's created, no expire date is set. What if someone starts a create-order, then the browser sits idle for 5-10 minutes. Will that also break create-order?
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.4 Bug when placing back-to-back admin orders
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close