AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
9.0.2 basket.ExtendedFields and checkout
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?
|
|
|
|
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
|
|
|
|
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. |
|
|
|
|
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. |
|
|
|
|
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.
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
General Questions
»
9.0.2 basket.ExtendedFields and checkout
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