Magento2: How to add a small Icon image on product image in product view page in magento 2Base Image, Small Image, Thumbnail Image radio buttons are not selected after product images CSV importOverlap Product image By uploaded image in product view pageMagento 2: Add border-radius to image on product pageHow to get the upsell product Collection in list page in magento 2How to add a custom template for fieldset in ui-component form in magento 2How to add new div section in ko template(Checkoutpage payment section) in magento 2Magento 2 : Payment methods uncheck while clicking custom icon in checkout pageHow the upsell products handled in view page?How to resize product view page image on different devices in magento 2how to get the weight unit of the product from quote in magento 2

How can I find an old paper when the usual methods fail?

A trip to the library

What is a "soap"?

Pokemon Go: Gym Badge Over-completed?

Finding the shaded region

Escape Velocity - Won't the orbital path just become larger with higher initial velocity?

How to prevent criminal gangs from making/buying guns?

How can I communicate my issues with a potential date's pushy behavior?

Global BGP Routing only by only importing supernet prefixes

How can I shoot a bow using strength instead of dexterity?

Is it possible to know the exact chord from the roman numerals

Boss wants me to ignore a software API license

What would it take to get a message to another star?

Lípínguapua dopo Pêpê

How does the Athlete Feat affect the Ravnica Centaur playable race?

Help, I cannot decide when to start the story

"Mouth-breathing" as slang for stupidity

Good textbook for queueing theory and performance modeling

Why is there a large performance impact when looping over an array with 240 or more elements?

What is the most difficult concept to grasp in Calculus 1?

Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?

How come the Rambam forbids picking up money found in the street?

How did Arecibo detect methane lakes on Titan, and image Saturn's rings?

What is the prop for Thor's hammer made of?



Magento2: How to add a small Icon image on product image in product view page in magento 2


Base Image, Small Image, Thumbnail Image radio buttons are not selected after product images CSV importOverlap Product image By uploaded image in product view pageMagento 2: Add border-radius to image on product pageHow to get the upsell product Collection in list page in magento 2How to add a custom template for fieldset in ui-component form in magento 2How to add new div section in ko template(Checkoutpage payment section) in magento 2Magento 2 : Payment methods uncheck while clicking custom icon in checkout pageHow the upsell products handled in view page?How to resize product view page image on different devices in magento 2how to get the weight unit of the product from quote in magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I wish to add small icon image on the product image in magento 2.



  • From which template the product image is loaded in product view page.
    Please provide me a solution.









share|improve this question


























  • You want that image, on Product detail's page only right ?

    – Aditya Shah
    May 19 '18 at 12:43











  • if my answer solves your concern then there is green right tick mark , hit that tickmark for right ansewer that will help future readers.

    – Nikunj Vadariya
    May 24 '18 at 9:33











  • Yes I want it in Product Details page @Aditya Shah

    – Jaisa
    May 25 '18 at 5:08











  • I need the exact template file to add my image icon, If you have an idea Please suggest me

    – Jaisa
    May 25 '18 at 5:18











  • Yes, got you !!

    – Aditya Shah
    May 25 '18 at 5:20

















0















I wish to add small icon image on the product image in magento 2.



  • From which template the product image is loaded in product view page.
    Please provide me a solution.









share|improve this question


























  • You want that image, on Product detail's page only right ?

    – Aditya Shah
    May 19 '18 at 12:43











  • if my answer solves your concern then there is green right tick mark , hit that tickmark for right ansewer that will help future readers.

    – Nikunj Vadariya
    May 24 '18 at 9:33











  • Yes I want it in Product Details page @Aditya Shah

    – Jaisa
    May 25 '18 at 5:08











  • I need the exact template file to add my image icon, If you have an idea Please suggest me

    – Jaisa
    May 25 '18 at 5:18











  • Yes, got you !!

    – Aditya Shah
    May 25 '18 at 5:20













0












0








0








I wish to add small icon image on the product image in magento 2.



  • From which template the product image is loaded in product view page.
    Please provide me a solution.









share|improve this question
















I wish to add small icon image on the product image in magento 2.



  • From which template the product image is loaded in product view page.
    Please provide me a solution.






template product-images magento2.2.2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 20 '18 at 7:31









JB Pakalapati

4033 silver badges19 bronze badges




4033 silver badges19 bronze badges










asked May 19 '18 at 10:42









JaisaJaisa

9482 gold badges11 silver badges50 bronze badges




9482 gold badges11 silver badges50 bronze badges















  • You want that image, on Product detail's page only right ?

    – Aditya Shah
    May 19 '18 at 12:43











  • if my answer solves your concern then there is green right tick mark , hit that tickmark for right ansewer that will help future readers.

    – Nikunj Vadariya
    May 24 '18 at 9:33











  • Yes I want it in Product Details page @Aditya Shah

    – Jaisa
    May 25 '18 at 5:08











  • I need the exact template file to add my image icon, If you have an idea Please suggest me

    – Jaisa
    May 25 '18 at 5:18











  • Yes, got you !!

    – Aditya Shah
    May 25 '18 at 5:20

















  • You want that image, on Product detail's page only right ?

    – Aditya Shah
    May 19 '18 at 12:43











  • if my answer solves your concern then there is green right tick mark , hit that tickmark for right ansewer that will help future readers.

    – Nikunj Vadariya
    May 24 '18 at 9:33











  • Yes I want it in Product Details page @Aditya Shah

    – Jaisa
    May 25 '18 at 5:08











  • I need the exact template file to add my image icon, If you have an idea Please suggest me

    – Jaisa
    May 25 '18 at 5:18











  • Yes, got you !!

    – Aditya Shah
    May 25 '18 at 5:20
















You want that image, on Product detail's page only right ?

– Aditya Shah
May 19 '18 at 12:43





You want that image, on Product detail's page only right ?

– Aditya Shah
May 19 '18 at 12:43













if my answer solves your concern then there is green right tick mark , hit that tickmark for right ansewer that will help future readers.

– Nikunj Vadariya
May 24 '18 at 9:33





if my answer solves your concern then there is green right tick mark , hit that tickmark for right ansewer that will help future readers.

– Nikunj Vadariya
May 24 '18 at 9:33













Yes I want it in Product Details page @Aditya Shah

– Jaisa
May 25 '18 at 5:08





Yes I want it in Product Details page @Aditya Shah

– Jaisa
May 25 '18 at 5:08













I need the exact template file to add my image icon, If you have an idea Please suggest me

– Jaisa
May 25 '18 at 5:18





I need the exact template file to add my image icon, If you have an idea Please suggest me

– Jaisa
May 25 '18 at 5:18













Yes, got you !!

– Aditya Shah
May 25 '18 at 5:20





Yes, got you !!

– Aditya Shah
May 25 '18 at 5:20










2 Answers
2






active

oldest

votes


















0














1) Create media image attribute From admin menu, Stores > Attributes > product.



2) Get this attribute to your file.



<?php
$_product = $objectManager->get('MagentoCatalogModelProduct')->load($productId);
$attrImage = $_product->getData('my_logo');

if(isset($attrImage) && $attrImage != 'no_selection' )
$productImageAttr = $product->getCustomAttribute( 'my_logo' );
$productImage = $this->helper('MagentoCatalogHelperImage')->init($product, 'my_logo')->setImageFile($productImageAttr->getValue());?>
<img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($product->getTitle()) ?>" />
<?php ?>





share|improve this answer

























  • In Which template is responsible to add my icon image to display on product image

    – Jaisa
    May 25 '18 at 5:14


















0














This will work for you, Just add image tag to display custom attribute in product listing page.



  • From this you can add attribute name you want to create as They have given Diamond icons and then select Catalog Input Type as Media image. Now save the attribute.

Let me know if if you have any query.






share|improve this answer



























    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%2f226698%2fmagento2-how-to-add-a-small-icon-image-on-product-image-in-product-view-page-in%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    1) Create media image attribute From admin menu, Stores > Attributes > product.



    2) Get this attribute to your file.



    <?php
    $_product = $objectManager->get('MagentoCatalogModelProduct')->load($productId);
    $attrImage = $_product->getData('my_logo');

    if(isset($attrImage) && $attrImage != 'no_selection' )
    $productImageAttr = $product->getCustomAttribute( 'my_logo' );
    $productImage = $this->helper('MagentoCatalogHelperImage')->init($product, 'my_logo')->setImageFile($productImageAttr->getValue());?>
    <img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($product->getTitle()) ?>" />
    <?php ?>





    share|improve this answer

























    • In Which template is responsible to add my icon image to display on product image

      – Jaisa
      May 25 '18 at 5:14















    0














    1) Create media image attribute From admin menu, Stores > Attributes > product.



    2) Get this attribute to your file.



    <?php
    $_product = $objectManager->get('MagentoCatalogModelProduct')->load($productId);
    $attrImage = $_product->getData('my_logo');

    if(isset($attrImage) && $attrImage != 'no_selection' )
    $productImageAttr = $product->getCustomAttribute( 'my_logo' );
    $productImage = $this->helper('MagentoCatalogHelperImage')->init($product, 'my_logo')->setImageFile($productImageAttr->getValue());?>
    <img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($product->getTitle()) ?>" />
    <?php ?>





    share|improve this answer

























    • In Which template is responsible to add my icon image to display on product image

      – Jaisa
      May 25 '18 at 5:14













    0












    0








    0







    1) Create media image attribute From admin menu, Stores > Attributes > product.



    2) Get this attribute to your file.



    <?php
    $_product = $objectManager->get('MagentoCatalogModelProduct')->load($productId);
    $attrImage = $_product->getData('my_logo');

    if(isset($attrImage) && $attrImage != 'no_selection' )
    $productImageAttr = $product->getCustomAttribute( 'my_logo' );
    $productImage = $this->helper('MagentoCatalogHelperImage')->init($product, 'my_logo')->setImageFile($productImageAttr->getValue());?>
    <img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($product->getTitle()) ?>" />
    <?php ?>





    share|improve this answer













    1) Create media image attribute From admin menu, Stores > Attributes > product.



    2) Get this attribute to your file.



    <?php
    $_product = $objectManager->get('MagentoCatalogModelProduct')->load($productId);
    $attrImage = $_product->getData('my_logo');

    if(isset($attrImage) && $attrImage != 'no_selection' )
    $productImageAttr = $product->getCustomAttribute( 'my_logo' );
    $productImage = $this->helper('MagentoCatalogHelperImage')->init($product, 'my_logo')->setImageFile($productImageAttr->getValue());?>
    <img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($product->getTitle()) ?>" />
    <?php ?>






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 24 '18 at 9:32









    Nikunj VadariyaNikunj Vadariya

    3,0431 gold badge9 silver badges25 bronze badges




    3,0431 gold badge9 silver badges25 bronze badges















    • In Which template is responsible to add my icon image to display on product image

      – Jaisa
      May 25 '18 at 5:14

















    • In Which template is responsible to add my icon image to display on product image

      – Jaisa
      May 25 '18 at 5:14
















    In Which template is responsible to add my icon image to display on product image

    – Jaisa
    May 25 '18 at 5:14





    In Which template is responsible to add my icon image to display on product image

    – Jaisa
    May 25 '18 at 5:14













    0














    This will work for you, Just add image tag to display custom attribute in product listing page.



    • From this you can add attribute name you want to create as They have given Diamond icons and then select Catalog Input Type as Media image. Now save the attribute.

    Let me know if if you have any query.






    share|improve this answer





























      0














      This will work for you, Just add image tag to display custom attribute in product listing page.



      • From this you can add attribute name you want to create as They have given Diamond icons and then select Catalog Input Type as Media image. Now save the attribute.

      Let me know if if you have any query.






      share|improve this answer



























        0












        0








        0







        This will work for you, Just add image tag to display custom attribute in product listing page.



        • From this you can add attribute name you want to create as They have given Diamond icons and then select Catalog Input Type as Media image. Now save the attribute.

        Let me know if if you have any query.






        share|improve this answer













        This will work for you, Just add image tag to display custom attribute in product listing page.



        • From this you can add attribute name you want to create as They have given Diamond icons and then select Catalog Input Type as Media image. Now save the attribute.

        Let me know if if you have any query.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 25 '18 at 10:58









        Aditya ShahAditya Shah

        5,2172 gold badges12 silver badges45 bronze badges




        5,2172 gold badges12 silver badges45 bronze badges






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f226698%2fmagento2-how-to-add-a-small-icon-image-on-product-image-in-product-view-page-in%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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form