Following my needs and help requests expressed in this issue: http://drupal.org/node/1432426 ...
I made some coding and succeeded in integrating Drupal Commerce with what the References Module allows to do with node/user reference fields.
I looked for this in the Commerce Product Reference View Widget, that didn't work for me (too complicate).
With this (attached) patch it is possible to use a References view on product types to format the list options content of the Product Reference field, beyond the default [sku]: [title] format (that might not be enough to better distinct products with very similar titles,, as in my case).
I am not able to create a patch (with git/drush) then just attach the files that I modified in my latest Drupal Commerce version (7.x-1.2+7-dev),
that are just these three:
- commerce.info (in 'commerce' folder);
- commerce_product.module (in 'commerce/modules/product' folder);
- commerce_product_reference.module (in 'commerce/modules/product_reference' folder);
sited in their proper folder of the attached .zip file.
It is not so much code, and mainly replicate and adapts the References/Node References module code.
In the .info file it is introduced a dependency to References module itsef, for Commerce
I also attach in the .zip package 4 commented snapshots that better shows you what this patch would gain, from the baseline.
Just follow them in the numbered order.
I don't know if all this would be useful to the DC community. For me it is ... and I definetly would use this features.
Hope this would be integrated in Drupal Commerce itself soon, if it sounds useful to you too.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | commerce-references_display_view-1436174-6.patch | 12.06 KB | jeffschuler |
| #1 | commerce_adapt_to_references_view.zip | 374.91 KB | itamair |
| commerce_adapt_to_references_view.zip | 372.54 KB | itamair |
Comments
Comment #1
itamair commentedSome corrections to the previous attachment.
This new attachment handle some exceptions without throwing errors (any reference view created on products, any product created of the referencable types, ...),
although a minor error is still thrown at the beginning, the first time the product reference field is setup ... (will try to fix)
Comment #2
bojanz commentedPlease provide this as a contrib module.
It sounds like useful functionality, but people can't be expected to download hacked Commerce installs (nor will this ever be committed to Commerce itself).
Comment #3
itamair commentedYes .. you are right. And I will try to move all this in a contribute module Asap ...!
Comment #4
bojanz commentedComment #5
Dimm commentedsubs
Comment #6
jeffschulerDimm: there's a Follow button on issues now, (up top.) You don't need to comment to subscribe.
I realize the plan is to move this elsewhere in contrib, but here's #1 as a patch for anyone who wants to try it out.