C
C
cosm1c2016-07-07 12:37:57
PHP
cosm1c, 2016-07-07 12:37:57

Magento. How to get a link to the image of the current product?

There is a custom item and two simple items with different colors (yellow and green).
If you open a simple product (yellow), then the zoom image is displayed from the custom product, which does not match the color of the product. If you click on the image thumbnail, then zoom photo becomes correct.
Zoom image requested next. way:

<img class = "s5" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(600); ?>" data-zoom-image="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" alt="" />

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CodeKeeper, 2016-07-07
@CodeKeeper

If you open a simple product (yellow), then the zoom image is displayed from the custom product

The case is not entirely clear. Is this all happening on a custom product page and is it a colorswitcher or something else?

C
cosm1c, 2016-07-07
@cosm1c

A T-shirt custom product (product.html) has been created and has images of a white T-shirt attached to it. Also created 2 simple products Yellow T-shirt (product.html?color=Yellow#) and Green T-shirt (product.html?color=Green# ), these simple products differ from each other only in color. The site displays only simple products. If you open the product "Green T-shirt" on the site, the product card in the photo shows a green T-shirt, but if you hover over the image, an enlarged photo appears from the custom product T-shirt (product.html) photo with a white T-shirt.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question