Add product name in product view within a new phtml?How to Add a new Tab in Product View Page in Magento 2Add custom js to product viewMagento 2 : Display Related Products Block in Product ViewGet product detail at custom phtml in catalog view layoutMagento2 - How to get a custom attribute for catalog product?Magento 2: Adding a new function to MagentoCatalogBlockProductViewAdd similar product to product view pageMagento2 - Override Template order summary in sales email orderNot able to add Custom phtml file on Product Page - Magento 2.2.4Add configurable swatches inside Related Product block in magento2 product view page

Can both line and load go to same screw on a GFCI outlet?

Did 007 exist before James Bond?

What impact would a dragon the size of Asia have on the environment?

Could a planet have a naturally occuring moon at one of its Lagrange points?

Can you perfectly wrap a cube with this blocky shape?

Do aircraft cabins have suspension?

Why does the Earth have a z-component at the start of the J2000 epoch?

Getting fresh water in the middle of hypersaline lake in the Bronze Age

Video editor for YouTube

I have accepted an internship offer. Should I inform companies I have applied to that have not gotten back to me yet?

Can a Resident Assistant Be Told to Ignore a Lawful Order?

What systems of robust steganography are out there?

What are some symbols representing peasants/oppressed persons fighting back?

Why did Spider-Man take a detour to Dorset?

Do First Order blasters maintain a record of when they were fired?

If I stood next to a piece of metal heated to a million degrees, but in a perfect vacuum, would I feel hot?

What's the meaning of こそ in this sentence?

Why isn't aluminium involved in biological processes?

Is it possible to cast two 9th level spells without taking a long rest in 5e?

How to change checkbox react correctly?

Is there a way to tell what object an 18 digit ID refers to?

Is this artwork (used in a video game) real?

Is there an English equivalent for "Les carottes sont cuites", while keeping the vegetable reference?

Why use null function instead of == [] to check for empty list in Haskell?



Add product name in product view within a new phtml?


How to Add a new Tab in Product View Page in Magento 2Add custom js to product viewMagento 2 : Display Related Products Block in Product ViewGet product detail at custom phtml in catalog view layoutMagento2 - How to get a custom attribute for catalog product?Magento 2: Adding a new function to MagentoCatalogBlockProductViewAdd similar product to product view pageMagento2 - Override Template order summary in sales email orderNot able to add Custom phtml file on Product Page - Magento 2.2.4Add configurable swatches inside Related Product block in magento2 product view page






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I copied catalog_product_view.xml and pasted it into appdesignfrontendMythemeDreamShopMagento_Cataloglayout folder and code is added before the default.phtml



<block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


enter image description here










share|improve this question
























  • You are saying that you want name of the product but code says you are showing category name. What do you want please explain more?

    – Sukumar Gorai
    Jul 9 '18 at 7:30











  • I want product name

    – kim na na
    Jul 9 '18 at 7:58











  • How did you add the file.phtml in your catalog page? Can you post the xml code in your question?

    – Sukumar Gorai
    Jul 9 '18 at 8:30












  • <block class="MagentoCatalogBlockProductViewOptionsTypeDefaultType" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>

    – kim na na
    Jul 9 '18 at 9:01











  • Are you calling it in product details page?

    – Sukumar Gorai
    Jul 9 '18 at 9:05

















1















I copied catalog_product_view.xml and pasted it into appdesignfrontendMythemeDreamShopMagento_Cataloglayout folder and code is added before the default.phtml



<block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


enter image description here










share|improve this question
























  • You are saying that you want name of the product but code says you are showing category name. What do you want please explain more?

    – Sukumar Gorai
    Jul 9 '18 at 7:30











  • I want product name

    – kim na na
    Jul 9 '18 at 7:58











  • How did you add the file.phtml in your catalog page? Can you post the xml code in your question?

    – Sukumar Gorai
    Jul 9 '18 at 8:30












  • <block class="MagentoCatalogBlockProductViewOptionsTypeDefaultType" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>

    – kim na na
    Jul 9 '18 at 9:01











  • Are you calling it in product details page?

    – Sukumar Gorai
    Jul 9 '18 at 9:05













1












1








1


1






I copied catalog_product_view.xml and pasted it into appdesignfrontendMythemeDreamShopMagento_Cataloglayout folder and code is added before the default.phtml



<block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


enter image description here










share|improve this question
















I copied catalog_product_view.xml and pasted it into appdesignfrontendMythemeDreamShopMagento_Cataloglayout folder and code is added before the default.phtml



<block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


enter image description here







magento2 product layout template






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 10 '18 at 8:05









Sanne

8433 silver badges17 bronze badges




8433 silver badges17 bronze badges










asked Jul 9 '18 at 7:27









kim na nakim na na

998 bronze badges




998 bronze badges












  • You are saying that you want name of the product but code says you are showing category name. What do you want please explain more?

    – Sukumar Gorai
    Jul 9 '18 at 7:30











  • I want product name

    – kim na na
    Jul 9 '18 at 7:58











  • How did you add the file.phtml in your catalog page? Can you post the xml code in your question?

    – Sukumar Gorai
    Jul 9 '18 at 8:30












  • <block class="MagentoCatalogBlockProductViewOptionsTypeDefaultType" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>

    – kim na na
    Jul 9 '18 at 9:01











  • Are you calling it in product details page?

    – Sukumar Gorai
    Jul 9 '18 at 9:05

















  • You are saying that you want name of the product but code says you are showing category name. What do you want please explain more?

    – Sukumar Gorai
    Jul 9 '18 at 7:30











  • I want product name

    – kim na na
    Jul 9 '18 at 7:58











  • How did you add the file.phtml in your catalog page? Can you post the xml code in your question?

    – Sukumar Gorai
    Jul 9 '18 at 8:30












  • <block class="MagentoCatalogBlockProductViewOptionsTypeDefaultType" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>

    – kim na na
    Jul 9 '18 at 9:01











  • Are you calling it in product details page?

    – Sukumar Gorai
    Jul 9 '18 at 9:05
















You are saying that you want name of the product but code says you are showing category name. What do you want please explain more?

– Sukumar Gorai
Jul 9 '18 at 7:30





You are saying that you want name of the product but code says you are showing category name. What do you want please explain more?

– Sukumar Gorai
Jul 9 '18 at 7:30













I want product name

– kim na na
Jul 9 '18 at 7:58





I want product name

– kim na na
Jul 9 '18 at 7:58













How did you add the file.phtml in your catalog page? Can you post the xml code in your question?

– Sukumar Gorai
Jul 9 '18 at 8:30






How did you add the file.phtml in your catalog page? Can you post the xml code in your question?

– Sukumar Gorai
Jul 9 '18 at 8:30














<block class="MagentoCatalogBlockProductViewOptionsTypeDefaultType" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>

– kim na na
Jul 9 '18 at 9:01





<block class="MagentoCatalogBlockProductViewOptionsTypeDefaultType" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>

– kim na na
Jul 9 '18 at 9:01













Are you calling it in product details page?

– Sukumar Gorai
Jul 9 '18 at 9:05





Are you calling it in product details page?

– Sukumar Gorai
Jul 9 '18 at 9:05










3 Answers
3






active

oldest

votes


















0














Change the xml to below code:



<block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


In your template file productname.phtml add the below code:



$this->getProduct()->getName();


Note: This should work if you are using this product in your product details page.






share|improve this answer






























    0
















    1. app/design/frontend/Theme/name/Magento_Catalog/layout/catalog_product_view.xml




      <?xml version="1.0"?>
      <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <referenceContainer name="product.info.main">
      <block class="MagentoCatalogBlockProductView" name="product.name" template="Magento_Catalog::productData.phtml" before="-" />
      </referenceContainer>
      </page>




    2. app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml




      <?php echo __('Product name : ').$this->getProduct()->getName(); ?>






    share|improve this answer






























      0














      Put below code in your catalog_product_view.xml it may helps you.



      <move element="page.main.title" destination="product.info.main" before="-"/>





      share|improve this answer

























        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%2f232810%2fadd-product-name-in-product-view-within-a-new-phtml%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        Change the xml to below code:



        <block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


        In your template file productname.phtml add the below code:



        $this->getProduct()->getName();


        Note: This should work if you are using this product in your product details page.






        share|improve this answer



























          0














          Change the xml to below code:



          <block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


          In your template file productname.phtml add the below code:



          $this->getProduct()->getName();


          Note: This should work if you are using this product in your product details page.






          share|improve this answer

























            0












            0








            0







            Change the xml to below code:



            <block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


            In your template file productname.phtml add the below code:



            $this->getProduct()->getName();


            Note: This should work if you are using this product in your product details page.






            share|improve this answer













            Change the xml to below code:



            <block class="MagentoCatalogBlockProductView" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


            In your template file productname.phtml add the below code:



            $this->getProduct()->getName();


            Note: This should work if you are using this product in your product details page.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 9 '18 at 9:04









            Sukumar GoraiSukumar Gorai

            7,6443 gold badges7 silver badges31 bronze badges




            7,6443 gold badges7 silver badges31 bronze badges























                0
















                1. app/design/frontend/Theme/name/Magento_Catalog/layout/catalog_product_view.xml




                  <?xml version="1.0"?>
                  <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                  <referenceContainer name="product.info.main">
                  <block class="MagentoCatalogBlockProductView" name="product.name" template="Magento_Catalog::productData.phtml" before="-" />
                  </referenceContainer>
                  </page>




                2. app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml




                  <?php echo __('Product name : ').$this->getProduct()->getName(); ?>






                share|improve this answer



























                  0
















                  1. app/design/frontend/Theme/name/Magento_Catalog/layout/catalog_product_view.xml




                    <?xml version="1.0"?>
                    <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                    <referenceContainer name="product.info.main">
                    <block class="MagentoCatalogBlockProductView" name="product.name" template="Magento_Catalog::productData.phtml" before="-" />
                    </referenceContainer>
                    </page>




                  2. app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml




                    <?php echo __('Product name : ').$this->getProduct()->getName(); ?>






                  share|improve this answer

























                    0












                    0








                    0









                    1. app/design/frontend/Theme/name/Magento_Catalog/layout/catalog_product_view.xml




                      <?xml version="1.0"?>
                      <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                      <referenceContainer name="product.info.main">
                      <block class="MagentoCatalogBlockProductView" name="product.name" template="Magento_Catalog::productData.phtml" before="-" />
                      </referenceContainer>
                      </page>




                    2. app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml




                      <?php echo __('Product name : ').$this->getProduct()->getName(); ?>






                    share|improve this answer















                    1. app/design/frontend/Theme/name/Magento_Catalog/layout/catalog_product_view.xml




                      <?xml version="1.0"?>
                      <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                      <referenceContainer name="product.info.main">
                      <block class="MagentoCatalogBlockProductView" name="product.name" template="Magento_Catalog::productData.phtml" before="-" />
                      </referenceContainer>
                      </page>




                    2. app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml




                      <?php echo __('Product name : ').$this->getProduct()->getName(); ?>







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 9 '18 at 10:03









                    PЯINCƏPЯINCƏ

                    8,5673 gold badges11 silver badges50 bronze badges




                    8,5673 gold badges11 silver badges50 bronze badges





















                        0














                        Put below code in your catalog_product_view.xml it may helps you.



                        <move element="page.main.title" destination="product.info.main" before="-"/>





                        share|improve this answer



























                          0














                          Put below code in your catalog_product_view.xml it may helps you.



                          <move element="page.main.title" destination="product.info.main" before="-"/>





                          share|improve this answer

























                            0












                            0








                            0







                            Put below code in your catalog_product_view.xml it may helps you.



                            <move element="page.main.title" destination="product.info.main" before="-"/>





                            share|improve this answer













                            Put below code in your catalog_product_view.xml it may helps you.



                            <move element="page.main.title" destination="product.info.main" before="-"/>






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 23 '18 at 9:57









                            Aakash JoshiAakash Joshi

                            1114 bronze badges




                            1114 bronze badges



























                                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%2f232810%2fadd-product-name-in-product-view-within-a-new-phtml%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

                                Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                                Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                                Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form