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)
|
I'm working with the basket id during shopping and checkout. I need it to store a custom value to ac_CustomFields that is entered on /EditBillAddress.
But the basketId is changing during checkout for anonymous checkouts. I suspect the process of converting an anonymous user record to an 'official' user record is generating a new basket object in the data instead of reusing the existing basket object.
So by the time the code reaches the point where the checkout service fires (payment method processing), the basket id is no longer the same as it was prior to /EditBillAddress. Any value persisted to ac_CustomFields prior to /EditBillAddress that is based on the basketId will no longer be found.
This completely breaks any attempt to implement ac_CustomFields as a means to maintain custom field values for the basket object.
|
|
|
|
Rank: Advanced Member
Groups: Admin, Administrators, Developers, Registered, HelpDesk, Authorized User Joined: 7/31/2019(UTC) Posts: 77
Was thanked: 8 time(s) in 8 post(s)
|
When an anonymous user login, the basket instance associated with the anonymous user account is assigned to logged in user account.
However this only happens if there are some items in basket. An empty basket is not transferred on login. So, if the anonymous user have nothing in the basket, on login the basket id will change (actually no new basket is created, but in this scenario the logged in user account retain the old associated basket).
|
|
|
|
|
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)
|
Yea but I'm not talking about sign-in. I'm talking about an anonymous checkout. Anonymous checkout creates a new separate user account that is different from the anonymous user account. Then it calls Migrate() to move child data from the old user account to the new user account it just created. This happens in EditBillAddress(). And it is changing the basket ID at that point. I just watched it do it. Which makes me question how ExtendedFields is even usable, since it's just storing stuff to ac_CustomFields based on that ID value. Which has now just changed. https://www.screencast.com/t/RhplJYLWXu2a
|
|
|
|
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)
|
Thanks for the video, it helped in understanding the issue.
This is how it is working for now. You brought up a new case for the use of custom fields. We will look into it if we can further improve this feature.
Thanks
|
1 user thanked shaharyar for this useful post.
|
|
|
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