Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Line item
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2017 at 11:07 UTC
Updated:
16 Mar 2017 at 17:34 UTC
Jump to comment: Most recent
Comments
Comment #2
bojanz commentedThe reason why we have $order->data is because there is a need to store temporary keys&values during the checkout process. This is data that has no need to be shown in a UI, rendered or in a widget.
We removed $order_item->data because it had no such needs.
In your case, wouldn't it make more sense to use configurable fields? I always err on that side architecture-wise.
I'd imagine that an external ID is valuable data, to show in a UI or manipulate from code. Commerce even has a special field type for that (commerce_remote_id), although it isn't usable from the UI at the moment (no widget/formatter).
Comment #3
floretan commentedOne of the issues with configurable fields is that it creates dependencies from custom code on configuration. I did take the route you suggested though, which led to another small bug report (#2846596: RemoteId fields cannot use "0" as a value) but it works.
Comment #5
bojanz commentedDecided to proceed with this. Added an update function and a test. Thanks!