build a new formatter for Product reference, "Rendered product" the same as "Rendered entity" formatter for Entity Reference.
This will display the referenced products rendered by entity_view(), using the selected "view mode" of the formatter.

Files: 
CommentFileSizeAuthor
#10 rendered_product_formatter-1783462-10.patch5.44 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 3,570 pass(es).
[ View ]
#9 1783462-9.rendered_product_formatter.patch5.29 KBrszrama
PASSED: [[SimpleTest]]: [MySQL] 3,570 pass(es).
[ View ]
#1 rendered_product_formatter-1783462-2.patch5.25 KBvasike
PASSED: [[SimpleTest]]: [MySQL] 3,589 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new5.25 KB
PASSED: [[SimpleTest]]: [MySQL] 3,589 pass(es).
[ View ]

and here is the patch (based on EntityReference code).

I'd love this feature; however, it'd be nice to have the option to still include the Add to Cart form with it. Perhaps the rendered entity should be pulled in as an extra pseudo-field, rather than as a formatter for the product reference field?

Would it work in your case to use a Views block that renders the product entity, Jesse?

It may; but I'd need the Views block to be able to be updated when the user changes the value of the Add to Cart dropdown.

EDIT: Oops, dupe comment. (It gave me an error when I first posted it.)

#2 is a feature request that is off topic for this issue, and even if it was in it's own issue, I'd consider it a won't fix. We inject product fields into the node display just so that you can display anything (product-related) you want before / after the add to cart form.

This change definitely needs to be a formatter, no way around it.

Issue tags:+kickstart blocker

We need this in order to spin off Add to cart confirmation as a contrib module.

This isn't a bug in Commerce as far as I can tell, but are you guys not seeing this when you try to view an entity with a rendered product in its content?

Notice: Undefined variable: url in include() (line 35 of /Users/rszrama/src/git/drupal/entity/entity.tpl.php).

Status:Needs review» Needs work
StatusFileSize
new5.29 KB
PASSED: [[SimpleTest]]: [MySQL] 3,570 pass(es).
[ View ]

Additionally, commerce_product_reference_field_formatter_prepare_view() is a little aggressive at the moment, in that it's going to run for any field formatter defined by commerce_product_reference.module and not just the new "Rendered product" display formatter.

Updates should go against the attached patch.

Status:Needs work» Needs review
StatusFileSize
new5.44 KB
PASSED: [[SimpleTest]]: [MySQL] 3,570 pass(es).
[ View ]

here is a patch that adds an extra check for the display type (formatter) in the commerce_product_reference_field_formatter_prepare_view() function

Assigned:vasike» Unassigned
Category:task» feature
Status:Needs review» Fixed

Excellent. Gave it another option to change the $page parameter passed to entity_view() and added a hook function until a new release comes out for Entity API; see #1601162: Undefined variable: url in entity.tpl.php. Thanks!

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