You should notice that the layout file responsible for rendering is:


And to override this layout file, we need to copy the file to the following location in the child theme:


Now, in this file, locate the container.

This container is responsible for rendering the ‘Add to Wish List’ and ‘Add to Compare’ buttons. Add a new block as shown in the snippet below to render the social icons:

<container name=”” label=”social links” htmlTag=”div” htmlClass=”product-social-links” after=””><block class=”Magento\Catalog\Block\Product\View” name=”” as=”addto” template=”product/view/addto.phtml”/> <!– adding social sharing block –><block class=”Magento\Catalog\Block\Product\View” name=”” template=”product/view/social.phtml”/> <block class=”Magento\Catalog\Block\Product\View” name=”” template=”product/view/mailto.phtml”/></container>

We now have to create a new file in the following location:


Make sure that you store the images under the following directory:

For more read our social links blog for magento2

1 Answers

There are lots of tutorial on Magento 2 social share . The process is really easy. You have to copy the button codes and paste it in the file, like mentioned in the tutorial.

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.