logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Monday, December 6, 2021 2:28:15 PM(UTC)
Joe Payne2

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/seY1vm52h

I 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.

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Tuesday, December 7, 2021 2:51:16 AM(UTC)
shaharyar

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.

thanks 1 user thanked shaharyar for this useful post.
Joe Payne2 on 12/7/2021(UTC)
shaharyar  
#3 Posted : Tuesday, December 7, 2021 6:40:17 AM(UTC)
shaharyar

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
thanks 1 user thanked shaharyar for this useful post.
Joe Payne2 on 12/7/2021(UTC)
Joe Payne2  
#4 Posted : Tuesday, December 7, 2021 12:58:58 PM(UTC)
Joe Payne2

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?
Users browsing this topic
Guest (3)
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.