Thursday, 2 April 2020

How to move “Add to Wishlist” Button after “Add to Cart” in Product View page in magento 2

Just add below code to catalog_product_view.xml file for the simple and configurable product:


For Simple Product
<referenceBlock name="product.info.addtocart">
     <block class="Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist" name="view.addto.wishlist" template="Magento_Catalog::product/view/addto/wishlist.phtml" />
 </referenceBlock>

 For Configurable Product
  <referenceBlock name="product.info.addtocart.additional">
     <block class="Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist" name="view.addto.wishlist.bottom" template="Magento_Catalog::product/view/addto/wishlist.phtml" />
 </referenceBlock>

No comments:

Post a Comment