How to add new block to view.php (Catalog/Product/view.php)Magento Core: identical block name in one...

Good allowance savings plan?

How do I deal with a powergamer in a game full of beginners in a school club?

Do I really need to have a scientific explanation for my premise?

How do I locate a classical quotation?

How strictly should I take "Candidates must be local"?

Why would one plane in this picture not have gear down yet?

Virginia employer terminated employee and wants signing bonus returned

In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?

What is the chance of making a successful appeal to dismissal decision from a PhD program after failing the qualifying exam in the 2nd attempt?

Subset counting for even numbers

Time travel short story where dinosaur doesn't taste like chicken

Good for you! in Russian

Should I take out a loan for a friend to invest on my behalf?

How do I express some one as a black person?

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

How are such low op-amp input currents possible?

Space in array system equations

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Examples of a statistic that is not independent of sample's distribution?

Grey hair or white hair

Algorithm to convert a fixed-length string to the smallest possible collision-free representation?

Why is this plane circling around the Lucknow airport every day?

Do Bugbears' arms literally get longer when it's their turn?



How to add new block to view.php (Catalog/Product/view.php)


Magento Core: identical block name in one handleHow to access a function in block class from phtml?Show icon on product on each pageCan possible to load only catalog/product/view.phtml in custom moduleproduct list not showing on server , but working localhost magento 1.9.2Block Template not LoadingHow to add custom category blockcall other layout and block in custom phtmlMagento 2 : Display Related Products Block in Product ViewMagento 1.9 add to cart button validation













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?










share|improve this question
















bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    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?










    share|improve this question
















    bumped to the homepage by Community 11 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      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?










      share|improve this question
















      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?







      magento-1.9 blocks view






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 11 '17 at 16:08







      lxkn

















      asked Jan 11 '17 at 14:05









      lxknlxkn

      2614




      2614





      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          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();
          ?>





          share|improve this answer


























          • 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








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f154264%2fhow-to-add-new-block-to-view-php-catalog-product-view-php%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          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();
          ?>





          share|improve this answer


























          • 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
















          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();
          ?>





          share|improve this answer


























          • 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














          0












          0








          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();
          ?>





          share|improve this answer















          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();
          ?>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 11 '17 at 15:28

























          answered Jan 11 '17 at 14:19









          Amit BeraAmit Bera

          59k1575175




          59k1575175













          • 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



















          • 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

















          what if it doesn't change for me?i mean view

          – lxkn
          Jan 11 '17 at 15:05





          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





          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





          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





          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


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f154264%2fhow-to-add-new-block-to-view-php-catalog-product-view-php%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...