Product image on Views link to product admin rather than product display page?
Hi all, currently I'm making a View call new_products to display a list of latest update product. After few attempt, I have create a simple page and block to display Title & Product:Image field.
Now I have 2 problem.
1st, the product image is NOT link to the product display page, but it's link to product admin page although i have set the "LINK IMAGE TO" to "CONTENT".
2nd, 1 product can have multiple image but on this view I only need the first image. But after few hours of searching and trying, I still have no success. Can someone help me where can I limit the result to be 1st image only?
Have same problem. Though it
Have same problem. Though it only happens when you are logged in as an administrator. When you are anonymous, the image links back to the front page.
link back to the front page
link back to the front page as the permission denied the access??
Do you have any idea about configuring the views to show 1st image of the product?
SOLVED: By update to latest dev version of Commerce and Views I can control which image to show on the Views.
"Do you have any idea about
"Do you have any idea about configuring the views to show 1st image of the product?
SOLVED: By update to latest dev version of Commerce and Views I can control which image to show on the Views."
Could you give an example how to do this ?
Product image linking to product, not product admin
*Require this Relationship alone might make this all work without the rest of my instructions but it's late and no time to test this. This all might be related to this issue: https://drupal.org/node/1131192
Thank you very much!! I can
Thank you very much!! I can at least have good sleep for few days!! Thanks again.
thanks, this works. But there is a problem with multilingual settings. I use the setting www.example.com/en/... and the link to the products were put out as www.example.com/en//en/...
To avoid this I switched to "Use absolute path" in the settings of the new hidden field (path).
The piece that was missing
Thanks Brian, now the image link to the content.
I'm having the same problem
I'm having the same problem as the original poster, but regarding neardark's solution... in step 1, when editing this View, I do not get an option to choose 'Fields -> Referenced Product' when setting up a relationship. My choices are:
Commerce Line item: Referenced product
Commerce Product: Creator
Commerce Product: Node referencing products from field_product
Commerce Product: Image (field_image:fid)
Content: Referenced product
Content: Image (field_image:fid)
Field: Image (field_image:fid)
Tried all of the above relationships, but in every single case clicking on the image as a non-logged in user takes me to an Access Denied page. I've checked Permissions, and all appplicable View Content/View Product permissions are unrestricted.
Any other clues for this Drupal Commerce newbie?
Thanks for this solution.
You have solved my problem and I could do a prograss in my first commerce project.
Many Thanks for this relationship issue in views.
It's not working for me. I
It's not working for me.
I get http://product-path instead of http://example.com/product-path
(Since this seems quite a common use case it would be nice if this entire issue can be handled somewhere in the Commerce code.)
Now I switched to absolute
Now I switched to absolute path and it's slightly working, e.g. links to example.com//node-name.
But it's still broken for nodes with umlauts in the title. :(
And that was for my main products view. The images in taxonomy views are still linking to product admin stuff - and it seems it has the same settings...
this is what I get through
this is what I get through [path]
and this is a working link:
So it's probably a weird encoding issue, where token likes to add %25.
Found 2 relevant issues on d
Found 2 relevant issues on d.o:
http://drupal.org/node/1405796 - German umlaut become %-encoded using [path] tokens.
http://drupal.org/node/1405790 - Rewrite/Use-absolute-path adds a slash as prefix
Yay! Adding a Node ID field
Yay! Adding a Node ID field (above the image field) and using node/[nid] fixes both issues!
It works IF...
For me, it works, but I needed to Link image to NOTHING, so it allows Rewrite Result to work fine!
Thanks for the hints.
Another way that works
I found another way that works if we want to take advantage of Search API for indexing anf facets (the checkbox and slider widget blocks).
Here it is:
Clone the Display Products view (I did not try doing something out of Kickstart yet).
In Grid settings, you can put 3 colums.
Show: fields (important)
The field is Content: Rendered Node (you can exclude it from display, but keep it!)
Add a relationship: Indexed Node: product variations
Add a field: (product variations) Commerce Product Image (Image) with delta 0, show as link
et voila! (more exactly et voilà, if your browser displays that letter with accent)
Then you can go in Blocks, put a facet in a region, and configure by adding your page name in 'Only the listed pages'.
Maybe my solution is taking more overhead than needed but it works and takes advantage of Search API that is maybe faster than the Views indexing (I do not know the involved technology well, so just a guess!)
Image not linked
Thanks for the explanation but I can't get my image to be linked at all in my view. I have an unformatted list, with a relationship to Content:Product. I have the Referenced Product) Field Image and the path to content placed above the image field and still can't get the image to link. I even applied the category image to the product display and although the image is shown it's not a link, just an image in a div.
What is the actual value that needs to be in the rewrite section is it literally '[path]' ?
Not sure what I'm doing wrong as the image is displayed but I want it so that you can click on the image to take you to the product. The image title works fine but not the image. Any ideas?
Thanks very much @neardark. That was exactly what I was looking for.
I have this problem too. Tried the work around but not working. I am on Views 7.x-3.0-rc1 with Commerce 1.0. the the relationship is set to Content: Product Reference with fields set up in the following order.
(Product Reference) Field: Image
(Product Reference) Commerce Product: Price
(Product Reference) Commerce Product: Add to Cart form
Maybe, in the settings of the
Maybe, in the settings of the commerce image try changing the drop down menu "Link to" to "nothing". It's the one just below "Formatter" and "Appearance".
I don't think you need the
I don't think you need the Content: Product field if you added a referenced product relationship. All referenced fields are brought over via the Product Reference prefix (as oppose to content). I am not sure why views shows those fields as available when they actually not...
Also very important when rewriting the image field into a link and adding the [Path] token, make sure to have the "Link image to" Set to "Nothing".
Hope this helps someone...
"2nd, 1 product can have
"2nd, 1 product can have multiple image but on this view I only need the first image. But after few hours of searching and trying, I still have no success. Can someone help me where can I limit the result to be 1st image only?"
I have exactly the same problem. I got T-shirt node with few variations black, red, blue I want to display only one - first image. I don't know how to do this... After few hours I gave up...
[views 3.3, commerce 1.2]
Actually I have menage to do it by setting Poduct Reference:delta to 0!
@maxchock thx ! You made my day ! It resolve my multilingual problems :)