Skip to main content
Bumped by Community user
Bumped by Community user

I'm trying to bring simple products thumbnails of an producta grouped product on product detail page. I can show their thumbnails easily onin Magento1 but I am not able to do this onin Magento2.

OnIn Magento1, myMy simple products can be shown like this :

[![enter image description here][1]][1]

So I tried this code at below located file

app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type/grouped.phtml

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

<!-- add simple products(associated product) thumbnails -->
        <td>
            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">
        </td>

<!-- add simple products(associated product) thumbnails -->

If I run this code, my code get imagegets images as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1 and media folder also was migrated manually. I want to get these image from cache folder. How can I do that?

Thank you [1]: https://i.sstatic.net/AW11j.png

I'm trying to bring simple products thumbnails of an product product on product detail page. I can show their thumbnails easily on Magento1 but I am not able to do this on Magento2.

On Magento1, my simple products can be shown like this :

[![enter image description here][1]][1]

So I tried this code

app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

<!-- add simple products(associated product) thumbnails -->
        <td>
            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">
        </td>

<!-- add simple products(associated product) thumbnails -->

If I run this code, my code get image as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1 and media folder also was migrated manually. I want to get these image from cache folder. How can I do that?

Thank you [1]: https://i.sstatic.net/AW11j.png

I'm trying to bring simple products thumbnails of a grouped product on product detail page. I can show their thumbnails easily in Magento1 but I am not able to do this in Magento2.

In Magento1, My simple products can be shown like this :

[![enter image description here][1]][1]

So I tried this code at below located file

app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type/grouped.phtml

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

<!-- add simple products(associated product) thumbnails -->
        <td>
            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">
        </td>

<!-- add simple products(associated product) thumbnails -->

If I run this code, my code gets images as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1 and media folder also was migrated manually. I want to get these image from cache folder. How can I do that?

Thank you [1]: https://i.sstatic.net/AW11j.png

M2- How to get thumbnails of associated products on a grouped product from image cache.

I'm trying to bring simple products thumbnails of an product product on product detail page. I can show their thumbnails easily on Magento1Magento1 but i won'tI am not able to do this on Magento2Magento2.

On Magento1Magento1, my simple products can be shown like this :

[![enter image description here][1]][1]

So I tried this code

app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

<!-- add simple products(associated product) thumbnails -->
        <td>
            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">
        </td>

<!-- add simple products(associated product) thumbnails -->

If iI run this code, my code get image as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1Magento1 and media folder also was migrated manuallymigrated manually. I want to get these image from cache folder. How can iI do that?

Thank you [1]: https://i.sstatic.net/AW11j.png

M2- How to get thumbnails of associated products on a grouped product from image cache.

I'm trying to bring simple products thumbnails of an product product on product detail page. I can show their thumbnails easily on Magento1 but i won't on Magento2.

On Magento1, my simple products can be shown like this :

[![enter image description here][1]][1]

So I tried this code

app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

<!-- add simple products(associated product) thumbnails -->
        <td>
            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">
        </td>

<!-- add simple products(associated product) thumbnails -->

If i run this code, my code get image as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1 and media folder also was migrated manually. I want to get these image from cache folder. How can i do that?

Thank you [1]: https://i.sstatic.net/AW11j.png

M2- How to get thumbnails of associated products on a grouped product from image cache

I'm trying to bring simple products thumbnails of an product product on product detail page. I can show their thumbnails easily on Magento1 but I am not able to do this on Magento2.

On Magento1, my simple products can be shown like this :

[![enter image description here][1]][1]

So I tried this code

app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

<!-- add simple products(associated product) thumbnails -->
        <td>
            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">
        </td>

<!-- add simple products(associated product) thumbnails -->

If I run this code, my code get image as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1 and media folder also was migrated manually. I want to get these image from cache folder. How can I do that?

Thank you [1]: https://i.sstatic.net/AW11j.png

Source Link
3CE
  • 594
  • 6
  • 27

M2- How to get thumbnails of associated products on a grouped product from image cache.

I'm trying to bring simple products thumbnails of an product product on product detail page. I can show their thumbnails easily on Magento1 but i won't on Magento2.

On Magento1, my simple products can be shown like this :

[![enter image description here][1]][1]

So I tried this code

app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

<!-- add simple products(associated product) thumbnails -->
        <td>
            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">
        </td>

<!-- add simple products(associated product) thumbnails -->

If i run this code, my code get image as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1 and media folder also was migrated manually. I want to get these image from cache folder. How can i do that?

Thank you [1]: https://i.sstatic.net/AW11j.png