How to? Customize frontend template (F.e. review.phtml of onepage checkout)

Last modified by Greg Demetrick on Tue, June 12, 2012 14:13
Source|Old Revisions  

We want to overwrite review.phtml of onepage checkout to provide f.e. terms and conditions download.

We created our own module called Mymodule. At first we have to create new layout xml for this module. we copy checkout.xml layout from design/frontend/default/default/layout/checkout.xml to design/frontend/default/default/layout/mymodule.xml and overwrite layout of checkout in our config.xml

  1.         <layout>
  2.              <updates>
  3.                   <checkout>
  4.                         <file>mymodule.xml</file>
  5.                   </checkout>                 
  6.              </updates>
  7.         </layout>

Then we change code of our layout to load our own template. Our customized template is located in /design/frontend/default/default/template/mymodule/onepage/review.phtml

Change in mymodule.xml

  1. <block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">
  2.                     <block type="checkout/onepage_review_info" name="checkout.onepage.review.info" as="info" template="checkout/onepage/review/info.phtml"/>
  3.                 </block>

to

  1. <block type="mymodule/onepage_review" name="termsandconditions.onepage.review" as="review" template="mymodule/onepage/review.phtml">
  2.                     <block type="checkout/onepage_review_info" name="checkout.onepage.review.info" as="info" template="checkout/onepage/review/info.phtml"/>
  3.                 </block>



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs