Hello,
I'm using the following and encountering an issue:
Drupal Commerce 7.x-1.0
Views 7.x-3.0-rc1
I've created a view that displays my product images ((Product) Commerce Product: Image). I'm trying to make that image clickable to the product display this product is found in. I've used a Relationship to get the display node info (Content: Product Reference).
My view is simple. I'm just trying to display the Content:Title (linked to the display node) as well as my (Product) Commerce Product: Image). I'm trying to also make my image clickable but it seems it only allows it to link to the 'ADMIN EDIT' for that product. I've tried using the Content: Link and rewriting the Product Image but that does not work.
How do I get a Commerce Product image to link to the display node it appears in?
Comments
Comment #1
rszrama commentedYou'd either need to make this a View of your display nodes, using a relationship to the referenced product to display the image (and thus having access to the node nid to create a link to the proper path), or I believe there's a reverse relationship bojanz created that lets you add a relationship from the product table to nodes referencing that product. This latter one will likely only work if you have a single node -> product association.
Comment #2
amfis commentedOther way:
1. add content: nid field
2. exclude it from view.
3. go to ((Product) Commerce Product: Image) field settings, select rewrite results > output this field as link > (enter) node/[nid]
P.S. you need content:nid field to put above product image field.
And you've got it.
Comment #4
mefisto75 commentedA note for those struggling with this issue.
At Product: Commerce Product: Image field settings - put Link this Image to - Nothing. Instead of linking to Content.