0

I want to override two phtml one is product view.phtml and another one is addtocart.phtml

I m trying this code:

<catalog_product_view>

    <reference name="product.info">
          <action method="setTemplate">
            <template>coupon/catalog/product/view.phtml</template>
        </action>  

    </reference>
</catalog_product_view>

now i m copy catalog/product/ view.phtml and paste in my file and change what i want to change

Using this i can override view phtml but i m not getting proper phtml

i m attaching image

enter image description here

is this correct way to override view phtml

  • can you please tell where you have pasted this xml code? – Amit Bera Oct 19 '15 at 9:10
  • in my module xml – Newbie Oct 19 '15 at 9:19
  • Your code same to right.May be some code missing on your coupon/catalog/product/view.phtml – Amit Bera Oct 19 '15 at 9:22
0

For ovveriding, you don't need xml.

Make sure you have a theme set to the package. In you case, a folder with this path: app/design/frontpage/rwd/mytheme/template

Within the template folder, you can now get any file from /base/default or rwd/default and override it in you theme folder.

Have a look into the magento designers guide. There's the template hirarchie better explained then I do this here.

If you use extension like AOE Template Hints, you'll be able to identify blocks much faster.

0

replace <template> with <name> tag

<reference name="product.info">
      <action method="setTemplate"><name>coupon/catalog/product/view.phtml</name></action>  

</reference>

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.