How to show image in grouped product












4














For grouped products, I would like to see the picture of the by-products.



I tried several things but without success:



in files : Magento_GroupedProducttemplatesproductviewtype
In the loop of associated product, i wrote this code :



$productImage = $block->getImage($_item, 'product_base_image');


<a href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
<?php echo $productImage->toHtml(); ?>
</a>


but it does not work!!
Would anyone have an idea.
Thanks










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Did you get the solution?
    – 3CE
    Oct 30 '17 at 14:05
















4














For grouped products, I would like to see the picture of the by-products.



I tried several things but without success:



in files : Magento_GroupedProducttemplatesproductviewtype
In the loop of associated product, i wrote this code :



$productImage = $block->getImage($_item, 'product_base_image');


<a href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
<?php echo $productImage->toHtml(); ?>
</a>


but it does not work!!
Would anyone have an idea.
Thanks










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Did you get the solution?
    – 3CE
    Oct 30 '17 at 14:05














4












4








4


1





For grouped products, I would like to see the picture of the by-products.



I tried several things but without success:



in files : Magento_GroupedProducttemplatesproductviewtype
In the loop of associated product, i wrote this code :



$productImage = $block->getImage($_item, 'product_base_image');


<a href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
<?php echo $productImage->toHtml(); ?>
</a>


but it does not work!!
Would anyone have an idea.
Thanks










share|improve this question















For grouped products, I would like to see the picture of the by-products.



I tried several things but without success:



in files : Magento_GroupedProducttemplatesproductviewtype
In the loop of associated product, i wrote this code :



$productImage = $block->getImage($_item, 'product_base_image');


<a href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
<?php echo $productImage->toHtml(); ?>
</a>


but it does not work!!
Would anyone have an idea.
Thanks







magento2 product-images grouped-products






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 7 '18 at 10:43









MGento

1,249319




1,249319










asked Nov 21 '16 at 10:18









straussstrauss

1761416




1761416





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Did you get the solution?
    – 3CE
    Oct 30 '17 at 14:05


















  • Did you get the solution?
    – 3CE
    Oct 30 '17 at 14:05
















Did you get the solution?
– 3CE
Oct 30 '17 at 14:05




Did you get the solution?
– 3CE
Oct 30 '17 at 14:05










1 Answer
1






active

oldest

votes


















0














This is what I have done which might point you in the right direction:



1) It took me forever to get the right path to extend the template from vendormagentomodule-grouped-productviewfrontendtemplatesproductviewtypegrouped.phtml to my theme directory appdesignfrontendVendornameThemenameMagento_GroupedProducttemplatesproductviewtypegrouped.html



2) I added the line <?php $productImage = $block->getImage($_item, $image); echo $productImage->toHtml(); ?>



3) the trick now is to figure out how to define what goes in $image - i have created my own definition in my theme appdesignfrontendVendornameThemenameetcview.xml



<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="grouped_list_product_thumbnail" type="thumbnail">
<width>75</width>
<height>90</height>
</image>
</images>
</media>
</view>


So for me, $image = "grouped_list_product_thumbnail";



This is working for me although it is showing the placeholder and not the thumbnail - it seems my test migration did not copy the thumbnail linkage properly



This might help you solve yours though :)






share|improve this answer























  • Hi! There. Images module name would be "Magento_Catalog"? not "Magento_GroupedProduct"? Thank you
    – 3CE
    Oct 30 '17 at 14:19










  • yes, grouped products are just a part of Catalog, they don't have a separate module (unlike Bundles which have a module on top)
    – iphigenie
    Nov 2 '17 at 11:40











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f146705%2fhow-to-show-image-in-grouped-product%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This is what I have done which might point you in the right direction:



1) It took me forever to get the right path to extend the template from vendormagentomodule-grouped-productviewfrontendtemplatesproductviewtypegrouped.phtml to my theme directory appdesignfrontendVendornameThemenameMagento_GroupedProducttemplatesproductviewtypegrouped.html



2) I added the line <?php $productImage = $block->getImage($_item, $image); echo $productImage->toHtml(); ?>



3) the trick now is to figure out how to define what goes in $image - i have created my own definition in my theme appdesignfrontendVendornameThemenameetcview.xml



<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="grouped_list_product_thumbnail" type="thumbnail">
<width>75</width>
<height>90</height>
</image>
</images>
</media>
</view>


So for me, $image = "grouped_list_product_thumbnail";



This is working for me although it is showing the placeholder and not the thumbnail - it seems my test migration did not copy the thumbnail linkage properly



This might help you solve yours though :)






share|improve this answer























  • Hi! There. Images module name would be "Magento_Catalog"? not "Magento_GroupedProduct"? Thank you
    – 3CE
    Oct 30 '17 at 14:19










  • yes, grouped products are just a part of Catalog, they don't have a separate module (unlike Bundles which have a module on top)
    – iphigenie
    Nov 2 '17 at 11:40
















0














This is what I have done which might point you in the right direction:



1) It took me forever to get the right path to extend the template from vendormagentomodule-grouped-productviewfrontendtemplatesproductviewtypegrouped.phtml to my theme directory appdesignfrontendVendornameThemenameMagento_GroupedProducttemplatesproductviewtypegrouped.html



2) I added the line <?php $productImage = $block->getImage($_item, $image); echo $productImage->toHtml(); ?>



3) the trick now is to figure out how to define what goes in $image - i have created my own definition in my theme appdesignfrontendVendornameThemenameetcview.xml



<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="grouped_list_product_thumbnail" type="thumbnail">
<width>75</width>
<height>90</height>
</image>
</images>
</media>
</view>


So for me, $image = "grouped_list_product_thumbnail";



This is working for me although it is showing the placeholder and not the thumbnail - it seems my test migration did not copy the thumbnail linkage properly



This might help you solve yours though :)






share|improve this answer























  • Hi! There. Images module name would be "Magento_Catalog"? not "Magento_GroupedProduct"? Thank you
    – 3CE
    Oct 30 '17 at 14:19










  • yes, grouped products are just a part of Catalog, they don't have a separate module (unlike Bundles which have a module on top)
    – iphigenie
    Nov 2 '17 at 11:40














0












0








0






This is what I have done which might point you in the right direction:



1) It took me forever to get the right path to extend the template from vendormagentomodule-grouped-productviewfrontendtemplatesproductviewtypegrouped.phtml to my theme directory appdesignfrontendVendornameThemenameMagento_GroupedProducttemplatesproductviewtypegrouped.html



2) I added the line <?php $productImage = $block->getImage($_item, $image); echo $productImage->toHtml(); ?>



3) the trick now is to figure out how to define what goes in $image - i have created my own definition in my theme appdesignfrontendVendornameThemenameetcview.xml



<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="grouped_list_product_thumbnail" type="thumbnail">
<width>75</width>
<height>90</height>
</image>
</images>
</media>
</view>


So for me, $image = "grouped_list_product_thumbnail";



This is working for me although it is showing the placeholder and not the thumbnail - it seems my test migration did not copy the thumbnail linkage properly



This might help you solve yours though :)






share|improve this answer














This is what I have done which might point you in the right direction:



1) It took me forever to get the right path to extend the template from vendormagentomodule-grouped-productviewfrontendtemplatesproductviewtypegrouped.phtml to my theme directory appdesignfrontendVendornameThemenameMagento_GroupedProducttemplatesproductviewtypegrouped.html



2) I added the line <?php $productImage = $block->getImage($_item, $image); echo $productImage->toHtml(); ?>



3) the trick now is to figure out how to define what goes in $image - i have created my own definition in my theme appdesignfrontendVendornameThemenameetcview.xml



<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="grouped_list_product_thumbnail" type="thumbnail">
<width>75</width>
<height>90</height>
</image>
</images>
</media>
</view>


So for me, $image = "grouped_list_product_thumbnail";



This is working for me although it is showing the placeholder and not the thumbnail - it seems my test migration did not copy the thumbnail linkage properly



This might help you solve yours though :)







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 6 '16 at 21:21

























answered Dec 6 '16 at 21:16









iphigenieiphigenie

487216




487216












  • Hi! There. Images module name would be "Magento_Catalog"? not "Magento_GroupedProduct"? Thank you
    – 3CE
    Oct 30 '17 at 14:19










  • yes, grouped products are just a part of Catalog, they don't have a separate module (unlike Bundles which have a module on top)
    – iphigenie
    Nov 2 '17 at 11:40


















  • Hi! There. Images module name would be "Magento_Catalog"? not "Magento_GroupedProduct"? Thank you
    – 3CE
    Oct 30 '17 at 14:19










  • yes, grouped products are just a part of Catalog, they don't have a separate module (unlike Bundles which have a module on top)
    – iphigenie
    Nov 2 '17 at 11:40
















Hi! There. Images module name would be "Magento_Catalog"? not "Magento_GroupedProduct"? Thank you
– 3CE
Oct 30 '17 at 14:19




Hi! There. Images module name would be "Magento_Catalog"? not "Magento_GroupedProduct"? Thank you
– 3CE
Oct 30 '17 at 14:19












yes, grouped products are just a part of Catalog, they don't have a separate module (unlike Bundles which have a module on top)
– iphigenie
Nov 2 '17 at 11:40




yes, grouped products are just a part of Catalog, they don't have a separate module (unlike Bundles which have a module on top)
– iphigenie
Nov 2 '17 at 11:40


















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f146705%2fhow-to-show-image-in-grouped-product%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

An IMO inspired problem

Management

Investment