hi
at the product detailed page ,
how to keep showing all product thumbnail images ,after select an option image.
thanks
Solved! Go to Solution.
Hello @bestshop24h
Hope you are talking about configurable product
There are diff gallerySwitchStrategy
you need to change this into prepend
so final code of
"gallerySwitchStrategy": "prepend",
vendor/magento/module-swatches/view/frontend/templates/product/view/renderer.phtml
hope it will help you.
go to vendor/magento/module-swatches/view/frontend/templates/product/view/renderer.phtml
edit the text "replace" in the following code
"gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
'Magento_ConfigurableProduct') ?: 'replace'; ?>",
change from "replace" to "prehend"
"gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
'Magento_ConfigurableProduct') ?: 'prepend'; ?>",
and then,at the backend-system-cache management,click
flush cache storage and Flush Magento Cache
Hi @bestshop24h
Try to customise your product detail page, get all product images using below code and set your design according to your requirement:
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->create('Magento\Catalog\Model\Product')->load($_product->getId()); $images = $product->getMediaGalleryImages(); foreach($images as $child){ ?> <img src="<?php echo $child->getUrl(); ?>" > <?php } ?>
It may help you to resolve issue.
If issue resolve, please click on 'Kudos' & Accept as Solution!
Hello @bestshop24h
Hope you are talking about configurable product
There are diff gallerySwitchStrategy
you need to change this into prepend
so final code of
"gallerySwitchStrategy": "prepend",
vendor/magento/module-swatches/view/frontend/templates/product/view/renderer.phtml
hope it will help you.
go to vendor/magento/module-swatches/view/frontend/templates/product/view/renderer.phtml
edit the text "replace" in the following code
"gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
'Magento_ConfigurableProduct') ?: 'replace'; ?>",
change from "replace" to "prehend"
"gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
'Magento_ConfigurableProduct') ?: 'prepend'; ?>",
and then,at the backend-system-cache management,click
flush cache storage and Flush Magento Cache
How to get the child products images as well associated with this parent product using this code