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;
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"/>
magento2 product layout template
|
show 2 more comments
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"/>
magento2 product layout template
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
|
show 2 more comments
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"/>
magento2 product layout template
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"/>
magento2 product layout template
magento2 product layout template
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
|
show 2 more comments
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
|
show 2 more comments
3 Answers
3
active
oldest
votes
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.
add a comment |
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>
app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml
<?php echo __('Product name : ').$this->getProduct()->getName(); ?>
add a comment |
Put below code in your catalog_product_view.xml it may helps you.
<move element="page.main.title" destination="product.info.main" before="-"/>
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
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
add a comment |
add a comment |
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>
app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml
<?php echo __('Product name : ').$this->getProduct()->getName(); ?>
add a comment |
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>
app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml
<?php echo __('Product name : ').$this->getProduct()->getName(); ?>
add a comment |
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>
app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml
<?php echo __('Product name : ').$this->getProduct()->getName(); ?>
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>
app/design/frontend/Theme/name/Magento_Catalog/templates/productData.phtml
<?php echo __('Product name : ').$this->getProduct()->getName(); ?>
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
add a comment |
add a comment |
Put below code in your catalog_product_view.xml it may helps you.
<move element="page.main.title" destination="product.info.main" before="-"/>
add a comment |
Put below code in your catalog_product_view.xml it may helps you.
<move element="page.main.title" destination="product.info.main" before="-"/>
add a comment |
Put below code in your catalog_product_view.xml it may helps you.
<move element="page.main.title" destination="product.info.main" before="-"/>
Put below code in your catalog_product_view.xml it may helps you.
<move element="page.main.title" destination="product.info.main" before="-"/>
answered Aug 23 '18 at 9:57
Aakash JoshiAakash Joshi
1114 bronze badges
1114 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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