2

Shop Now button is coming from addtocart.phtml file.

I want to display Shop Now button after image. After image, content is coming from view.phtml file.

product preview

In catalog.xml file , I am trying to move block but no effect

   <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>  
   <block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
   <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>  

I want to put Shop Now Button after media file.

  • You have to move codes in template (phtml) files. – Adarsh Khatri Dec 13 '16 at 5:27
  • @AdarshKhatri - How to move codes from addtocart.phtml to view.phtml file? While moving it is giving me error. – jassi Dec 13 '16 at 5:29
  • No no, you have to move within the template. Could you add your view.phtml? (Your screenshot looks like list.phtml though) – Adarsh Khatri Dec 13 '16 at 5:31
  • @AdarshKhatri - The screenshot which I have sent is of view.phtml – jassi Dec 13 '16 at 5:33
  • @AdarshKhatri - Thank you very much. Your answer is right – jassi Dec 13 '16 at 5:42
1

To change the position of the add to cart button, you should change the code in template files, not in layout files.

You can go to view.phtml file and move the cart calling code as you need.

Cart calling code may look something similar to this:

<?php echo $this->getChildHtml('addto');?>
//OR
<?php echo $this->getChildHtml('addtocart');?>

Remember when you move this code, it must be inside <form> nodes.

This should help you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.