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 : Wednesday, October 7, 2020 2:50:37 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)
It doesn't appear that the Basket.ExtendedFields collection is copied to the Order object during checkout. Or am I missing something somewhere?

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

Joe Payne2  
#2 Posted : Thursday, October 8, 2020 8:02:51 AM(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)
Digging deeper, it doesn't seem that the CustomFieldsManager class even works. There's an internal void Save() method, but none of the other methods ever call it. And since it's internal, I can't call it outside of the class.

I don't see any way to persist anything stored to the ExtendedFields object model on any entities that have it.

Edited by user Thursday, October 8, 2020 8:03:28 AM(UTC)  | Reason: Not specified

Naveed Ashraf  
#3 Posted : Friday, October 9, 2020 2:29:43 AM(UTC)
Naveed Ashraf

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)
You need to call the save on the parent entity. For example the call the save on Basket, when you add something to basket extended fields.

We have unit tests in place for persistence check, and those are working fine. So I think there is no issue with the saving or retrieving data for ExtendedFields.
Thanks for your support!
Naveed Ashraf
Ablecommerce.com
Developer Assistance Available
Naveed Ashraf  
#4 Posted : Friday, October 9, 2020 2:31:46 AM(UTC)
Naveed Ashraf

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)
Quote:
It doesn't appear that the Basket.ExtendedFields collection is copied to the Order object during checkout. Or am I missing something somewhere?


The Basket.ExtendedFields collection values do not seems to be copied to order object.

Please try using the BasketItem.CustomFields, if it suits you.
Thanks for your support!
Naveed Ashraf
Ablecommerce.com
Developer Assistance Available
Joe Payne2  
#5 Posted : Friday, October 9, 2020 6:40:15 AM(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 I will try it with calling Save() on the parent entity. I didn't see how that was going to trigger since CustomFieldsManager has it's own internal save.

Unfortunately the custom value I need to store isn't specific to a particular line item. And basket line items are unpredictable especially if someone moves through checkout and then returns to the store. Ultimately I switched to a session variable which seems to work well enough for now.

ExtendedFields (CustomFieldsManager) is not well-suited for the basket object given the values will not persist in certain scenarios.
Users browsing this topic
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.