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

rszrama’s picture

Status: Active » Fixed

You'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.

amfis’s picture

Other 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.

Status: Fixed » Closed (fixed)

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

mefisto75’s picture

A 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.