1

I am trying to add button to view.php but i can't do this. I need any step by step tutorial how to do this, can anyone help me?


Thanks for reply i did something like this: i create my own template here:

app/design/frontend/module/MyTheme/template/catalog/product

I have here view.phtml and i have

app/design/frontend/module/MyTheme/template/catalog/product/view

and in this folder i have sub.phtml i want to see sub.phtml in view.phtml but while i do something like this:

<?php echo $this->getChildHtml('sub') ?>

It'snt visible on Product View so do you maybe know what I'm doing wrong?

EDIT: So i did create file in path:

app/design/frontend/module(namespace)/MyTheme/layout/sub.xml Inside this file i wrote something like that:

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalog_product_view>
    <reference name="product.info">
         <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
    </reference>
    </catalog_product_view>
</layout>

And now it should works?

0

view.php is a block class. My suggestion donot do anything at this block.

If want to change anything then please go at this block class template phtml files.

basically this view.php 's template is view.phtml which is located at app/design/frontend/[Yourpackage/[YourTheme]/template/catalog/product/.

You should do required changes at this phtml file

edit:

As you want to call catalog/product/view/delivery.phtml in catalog/product/view.phtml then you should to call your phtml file under block name="product.info" . at layout xml file catalog.xml

 <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">

........

Or ,you can call this phtml via direct call of sub.phtml at view.phtml

<?php
echo $this->getLayout()->createBlock('catalog/product_view')->setTemplate('catalog/product/view/sub.phtml')->toHtml();
?>
  • what if it doesn't change for me?i mean view – lxkn Jan 11 '17 at 15:05
  • so if i did create file - module/MyTheme/layout/sub.xml and i did add in tihs something like: – lxkn Jan 11 '17 at 16:05
  • it still don't work for me in my own template folder i have changed this block in sub.xml and i refreshed page nothing happend so i think it's not working – lxkn Jan 11 '17 at 16:26
  • why only while i modify rdw view.php i see changed on homepage? so how can i overide rdw file? – lxkn Jan 11 '17 at 17:01

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.