-1

I'm having this problem:

I'm using Commerce Kickstart 7.x-1.19 (also tryed on 2.x) and I'm trying to create a simple view to replace my homepage with a list of products, set the relation to the referenced prodcut etc. Everything is working as expected except for images that are not linked to content (node display) for anonymous users.

I know that the image formatter must be changed on Product Type -> Manage Display and not in the content type itself.

If I change a settings in the on the View I'm working, I can set any Image Style and is rendered as it should be, even Color box is working as expected for every user, but for some reason when I choose any Image Style and set Link image to: content this is not working, the image is not linking to the node.( Field title does link to the content)

I think this is a permissions issue because when I was setting this view I had this problem: Views results empty for unprivileged user when using Relationship (https://drupal.org/node/1276450), I fixed that using the permission View any product of any type.

Any help or idea is very appreciated, this is driving me crazy...

Thankyou

0

I was having the same issue and was discussing this in an issue ticket for Drupal Commerce. Here is what I found:

It is extremely unclear how to display products using Views. After much googling, I had settled on creating a View displaying either CONTENT or COMMERCE PRODUCTS displaying FIELDS. I would then add a RELATIONSHIP to CONTENT: REFERENCED PRODUCT. This worked and it was easy to add fields and get the output exactly how I wanted it. The problem, and the reason I reopened this ticket, is that the COMMERCE PRODUCT: IMAGE field would link to the admin display, not the product display.

The problem was what I chose to display when creating the View. First, I updated Commerce Kickstart, which broke all my existing Views with a SQL error. Then I installed a fresh Commerce Kickstart to test product display views. There were numerous issues with the install, one which broke the front page. No idea. But through testing the fresh install, I stumbled across the idea to study the COLLECTION view that comes with Commerce Kickstart. I noticed that it was displaying PRODUCT DISPLAY content, and a field of CONTENT: RENDERED ENTITY with the PRODUCT LIST view mode.

Long story short, I discovered that by using Display Suite, I could create custom view modes, which would be customized with the exact fields I wanted to display. This had to be done on both the CONTENT TYPE (product displays) and VARIATION TYPES. While MANAGING DISPLAY for the type you are editing, select the tab at the bottom labeled CUSTOM DISPLAY SETTINGS to enable the custom view mode made in Display Suite. Then you can select the view mode for the content types and change the fields available. Its a bit tricky to figure out where to change what values (in CONTENT TYPES versus VARIATION TYPES) but I'm sure most people can figure it out.

After you create your VIEW MODE, create a new View that displays PRODUCT DISPLAY items, not CONTENT or COMMERCE PRODUCTS. Then make sure you are using RENDERED ENTITY either for the whole node or in a field (where it will be listed CONTENT: RENDERED ENTITY). Under the RENDERED ENTITY settings, select the VIEW MODE you created, and viola! It outputs the fields you want AND links to the content not the admin page. What it outputs will require some CSS styling, as there are more default drupal styles applied to the rendered entity than just plain fields. But that can be tweaked in the Views settings themselves or by using Mothership Base theme.

This is from my original post is on Drupal Commerce Issues.

Hope this helps! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.