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?

asked Jan 11, 2017 at 14:05

1 Answer 1

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();
?>
answered Jan 11, 2017 at 14:19
4
  • what if it doesn't change for me?i mean view Commented Jan 11, 2017 at 15:05
  • so if i did create file - module/MyTheme/layout/sub.xml and i did add in tihs something like: Commented Jan 11, 2017 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 Commented Jan 11, 2017 at 16:26
  • why only while i modify rdw view.php i see changed on homepage? so how can i overide rdw file? Commented Jan 11, 2017 at 17:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.