On sites with a huge amount of products it's maybe interesting to have a hidden product reference field, to avoid loading / displaying all the products.
In our case we have >150'000 Products and a Product nodes contain up to 20'000 Product references - with this amount it doesn't make sense to assign the stuff manually - thus there's no need for a (editable) product reference field in the node edit form.
Nevertheless, the product reference field instance on the node is still very useful since it provides the possibility to configure the display settings - that's why we want to keep the field instance, but not the editable form element in the node edit form.
Attached patch simple displays nothing - but it could be changed to just display some information about the referenced products.
Suggestions welcome :)

Comments

rszrama’s picture

Component: Product reference » Contributed modules
Status: Needs review » Postponed

I would've swore there was a way using the API to add fields to bundles that were only accessible via the API, but I can't find it in the docs now. Perhaps someone else could dig it up, or maybe it used to be possible but was removed. In any event, I don't see us adding this to core, but I think it could make for a handy little contrib. I was going to suggest a form alter, but I suppose that doesn't really do anything from a performance standpoint since it would still have to load all the product data.

rszrama’s picture

Component: Contributed modules » Product reference
Status: Postponed » Fixed

Decided to go ahead and commit this. Added a help text to the top of the field edit page, though, and I altered out options that pertain to UI based data entry (the required checkbox, widget help text, and default value widget elements).

Commit: http://drupalcode.org/project/commerce.git/commitdiff/0be3620

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.