Magento2: Phtml file not visible on PDPHow can i rewrite TierPrice Block in Magento2Magento 2.0.x - Insert block in to the product pageMagento2 loading admin layout and template in a new pagemagento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?How to srtip all html from page layout in Magento2Magento2 Override Block - Invalid template file problemMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options
Iterate over deepest values in a nested Association
How to securely dispose of a smartphone?
Why were the first airplanes "backwards"?
List Manipulation : a,b,c,d,e,f,g,h into a,b,c,d,e,f,g,h
If two black hole event horizons overlap (touch) can they ever separate again?
If I were to build a J3 cub twice the size of the original using the same CG would it fly?
Discworld quote about an "old couple" who having said everything to each other, can finally go about living their lives
Ways to get SMD resistors from a strip
Is it okay to fade a human face just to create some space to place important content over it?
Can a successful book series let the bad guy win?
Early 2000s movie about time travel, protagonist travels back to save girlfriend, then into multiple points in future
How can combining souls together not increase its volume?
A quine of sorts
Why doesn't SpaceX land boosters in Africa?
Having to constantly redo everything because I don't know how to do it?
What game is this character in the Pixels movie from?
Why did the Apple //e make a hideous noise if you inserted the disk upside down?
Does a return economy-class seat between London and San Francisco release 5.28 tonnes of CO2 equivalents?
How do I ask a good question about a topic I am not completely familiar with?
I just started should I accept a farewell lunch for a coworker I don't know?
Two palindromes are not enough
A* pathfinding algorithm too slow
How do ohm meters measure high resistances?
Making a wall made from glass bricks
Magento2: Phtml file not visible on PDP
How can i rewrite TierPrice Block in Magento2Magento 2.0.x - Insert block in to the product pageMagento2 loading admin layout and template in a new pagemagento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?How to srtip all html from page layout in Magento2Magento2 Override Block - Invalid template file problemMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have create a module which consists an extra button on the product description page . For this I have added a layout catalog_product_view.xml which is below.
<?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">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceContainer name="product.info.main">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info" ifconfig="click_to_collect/general/enable"/>
</referenceContainer>
</body>
</page>
I do have created the respective block file and the template but my phmtl file is not rendered on the PDP . May I know why is this happening. As you can see I have added a js file as well in my layout which is rendering perfectly , but the phtml file is not. Also please note that I have removed the var/ generated/ pub/static/ did content:deploy but have no luck.
magento2 blocks phtml
New contributor
add a comment |
I have create a module which consists an extra button on the product description page . For this I have added a layout catalog_product_view.xml which is below.
<?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">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceContainer name="product.info.main">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info" ifconfig="click_to_collect/general/enable"/>
</referenceContainer>
</body>
</page>
I do have created the respective block file and the template but my phmtl file is not rendered on the PDP . May I know why is this happening. As you can see I have added a js file as well in my layout which is rendering perfectly , but the phtml file is not. Also please note that I have removed the var/ generated/ pub/static/ did content:deploy but have no luck.
magento2 blocks phtml
New contributor
which potion you want to call your phtml file ??
– Rk Rathod
Jun 21 at 6:24
below add to cart button
– user7608388
Jun 21 at 6:26
add a comment |
I have create a module which consists an extra button on the product description page . For this I have added a layout catalog_product_view.xml which is below.
<?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">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceContainer name="product.info.main">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info" ifconfig="click_to_collect/general/enable"/>
</referenceContainer>
</body>
</page>
I do have created the respective block file and the template but my phmtl file is not rendered on the PDP . May I know why is this happening. As you can see I have added a js file as well in my layout which is rendering perfectly , but the phtml file is not. Also please note that I have removed the var/ generated/ pub/static/ did content:deploy but have no luck.
magento2 blocks phtml
New contributor
I have create a module which consists an extra button on the product description page . For this I have added a layout catalog_product_view.xml which is below.
<?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">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceContainer name="product.info.main">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info" ifconfig="click_to_collect/general/enable"/>
</referenceContainer>
</body>
</page>
I do have created the respective block file and the template but my phmtl file is not rendered on the PDP . May I know why is this happening. As you can see I have added a js file as well in my layout which is rendering perfectly , but the phtml file is not. Also please note that I have removed the var/ generated/ pub/static/ did content:deploy but have no luck.
magento2 blocks phtml
magento2 blocks phtml
New contributor
New contributor
edited Jun 21 at 6:23
user7608388
New contributor
asked Jun 21 at 6:15
user7608388user7608388
162 bronze badges
162 bronze badges
New contributor
New contributor
which potion you want to call your phtml file ??
– Rk Rathod
Jun 21 at 6:24
below add to cart button
– user7608388
Jun 21 at 6:26
add a comment |
which potion you want to call your phtml file ??
– Rk Rathod
Jun 21 at 6:24
below add to cart button
– user7608388
Jun 21 at 6:26
which potion you want to call your phtml file ??
– Rk Rathod
Jun 21 at 6:24
which potion you want to call your phtml file ??
– Rk Rathod
Jun 21 at 6:24
below add to cart button
– user7608388
Jun 21 at 6:26
below add to cart button
– user7608388
Jun 21 at 6:26
add a comment |
1 Answer
1
active
oldest
votes
Try This :-
<?xml version="1.0"?>
<page
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceBlock name="product.info.options.wrapper.bottom">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info.addtocart" ifconfig="click_to_collect/general/enable"/>
</referenceBlock>
</body>
</page>
Am I suppose to close the container using reference block? Is it fisible?
– user7608388
Jun 21 at 6:33
sorry its my mistake check updated answer
– Rk Rathod
Jun 21 at 6:35
May I know what is the difference between my file and yours?
– user7608388
Jun 21 at 6:37
check answer...
– Rk Rathod
Jun 21 at 6:41
No luck. I pasted the below code in one of the extended catalog_product_view.xml file which resides in app/design it worked . But I want it to work from my module only. Please note the code which I have pasted in the file.<referenceContainer name="product.info.main"> <block class="TestClickToCollectBlockProductView" name="product.info.clicktocollect" template="Test_ClickToCollect::product/view/pdpClick.phtml" after="product.info" ifconfig="click_to_collect/general/enable"/> </referenceContainer>
– user7608388
Jun 21 at 7:01
|
show 1 more 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
);
);
user7608388 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f279109%2fmagento2-phtml-file-not-visible-on-pdp%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
Try This :-
<?xml version="1.0"?>
<page
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceBlock name="product.info.options.wrapper.bottom">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info.addtocart" ifconfig="click_to_collect/general/enable"/>
</referenceBlock>
</body>
</page>
Am I suppose to close the container using reference block? Is it fisible?
– user7608388
Jun 21 at 6:33
sorry its my mistake check updated answer
– Rk Rathod
Jun 21 at 6:35
May I know what is the difference between my file and yours?
– user7608388
Jun 21 at 6:37
check answer...
– Rk Rathod
Jun 21 at 6:41
No luck. I pasted the below code in one of the extended catalog_product_view.xml file which resides in app/design it worked . But I want it to work from my module only. Please note the code which I have pasted in the file.<referenceContainer name="product.info.main"> <block class="TestClickToCollectBlockProductView" name="product.info.clicktocollect" template="Test_ClickToCollect::product/view/pdpClick.phtml" after="product.info" ifconfig="click_to_collect/general/enable"/> </referenceContainer>
– user7608388
Jun 21 at 7:01
|
show 1 more comment
Try This :-
<?xml version="1.0"?>
<page
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceBlock name="product.info.options.wrapper.bottom">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info.addtocart" ifconfig="click_to_collect/general/enable"/>
</referenceBlock>
</body>
</page>
Am I suppose to close the container using reference block? Is it fisible?
– user7608388
Jun 21 at 6:33
sorry its my mistake check updated answer
– Rk Rathod
Jun 21 at 6:35
May I know what is the difference between my file and yours?
– user7608388
Jun 21 at 6:37
check answer...
– Rk Rathod
Jun 21 at 6:41
No luck. I pasted the below code in one of the extended catalog_product_view.xml file which resides in app/design it worked . But I want it to work from my module only. Please note the code which I have pasted in the file.<referenceContainer name="product.info.main"> <block class="TestClickToCollectBlockProductView" name="product.info.clicktocollect" template="Test_ClickToCollect::product/view/pdpClick.phtml" after="product.info" ifconfig="click_to_collect/general/enable"/> </referenceContainer>
– user7608388
Jun 21 at 7:01
|
show 1 more comment
Try This :-
<?xml version="1.0"?>
<page
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceBlock name="product.info.options.wrapper.bottom">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info.addtocart" ifconfig="click_to_collect/general/enable"/>
</referenceBlock>
</body>
</page>
Try This :-
<?xml version="1.0"?>
<page
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link src="Test_ClickToCollect::js/product/view/clickToCollect.js"/>
</head>
<body>
<referenceBlock name="product.info.options.wrapper.bottom">
<block
class="TestClickToCollectBlockProductView"
name="product.info.clicktocollect"
template="Test_ClickToCollect::product/view/pdpClick.phtml"
after="product.info.addtocart" ifconfig="click_to_collect/general/enable"/>
</referenceBlock>
</body>
</page>
edited Jun 21 at 6:40
answered Jun 21 at 6:30
Rk RathodRk Rathod
2,4413 silver badges18 bronze badges
2,4413 silver badges18 bronze badges
Am I suppose to close the container using reference block? Is it fisible?
– user7608388
Jun 21 at 6:33
sorry its my mistake check updated answer
– Rk Rathod
Jun 21 at 6:35
May I know what is the difference between my file and yours?
– user7608388
Jun 21 at 6:37
check answer...
– Rk Rathod
Jun 21 at 6:41
No luck. I pasted the below code in one of the extended catalog_product_view.xml file which resides in app/design it worked . But I want it to work from my module only. Please note the code which I have pasted in the file.<referenceContainer name="product.info.main"> <block class="TestClickToCollectBlockProductView" name="product.info.clicktocollect" template="Test_ClickToCollect::product/view/pdpClick.phtml" after="product.info" ifconfig="click_to_collect/general/enable"/> </referenceContainer>
– user7608388
Jun 21 at 7:01
|
show 1 more comment
Am I suppose to close the container using reference block? Is it fisible?
– user7608388
Jun 21 at 6:33
sorry its my mistake check updated answer
– Rk Rathod
Jun 21 at 6:35
May I know what is the difference between my file and yours?
– user7608388
Jun 21 at 6:37
check answer...
– Rk Rathod
Jun 21 at 6:41
No luck. I pasted the below code in one of the extended catalog_product_view.xml file which resides in app/design it worked . But I want it to work from my module only. Please note the code which I have pasted in the file.<referenceContainer name="product.info.main"> <block class="TestClickToCollectBlockProductView" name="product.info.clicktocollect" template="Test_ClickToCollect::product/view/pdpClick.phtml" after="product.info" ifconfig="click_to_collect/general/enable"/> </referenceContainer>
– user7608388
Jun 21 at 7:01
Am I suppose to close the container using reference block? Is it fisible?
– user7608388
Jun 21 at 6:33
Am I suppose to close the container using reference block? Is it fisible?
– user7608388
Jun 21 at 6:33
sorry its my mistake check updated answer
– Rk Rathod
Jun 21 at 6:35
sorry its my mistake check updated answer
– Rk Rathod
Jun 21 at 6:35
May I know what is the difference between my file and yours?
– user7608388
Jun 21 at 6:37
May I know what is the difference between my file and yours?
– user7608388
Jun 21 at 6:37
check answer...
– Rk Rathod
Jun 21 at 6:41
check answer...
– Rk Rathod
Jun 21 at 6:41
No luck. I pasted the below code in one of the extended catalog_product_view.xml file which resides in app/design it worked . But I want it to work from my module only. Please note the code which I have pasted in the file.
<referenceContainer name="product.info.main"> <block class="TestClickToCollectBlockProductView" name="product.info.clicktocollect" template="Test_ClickToCollect::product/view/pdpClick.phtml" after="product.info" ifconfig="click_to_collect/general/enable"/> </referenceContainer>
– user7608388
Jun 21 at 7:01
No luck. I pasted the below code in one of the extended catalog_product_view.xml file which resides in app/design it worked . But I want it to work from my module only. Please note the code which I have pasted in the file.
<referenceContainer name="product.info.main"> <block class="TestClickToCollectBlockProductView" name="product.info.clicktocollect" template="Test_ClickToCollect::product/view/pdpClick.phtml" after="product.info" ifconfig="click_to_collect/general/enable"/> </referenceContainer>
– user7608388
Jun 21 at 7:01
|
show 1 more comment
user7608388 is a new contributor. Be nice, and check out our Code of Conduct.
user7608388 is a new contributor. Be nice, and check out our Code of Conduct.
user7608388 is a new contributor. Be nice, and check out our Code of Conduct.
user7608388 is a new contributor. Be nice, and check out our Code of Conduct.
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%2f279109%2fmagento2-phtml-file-not-visible-on-pdp%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
which potion you want to call your phtml file ??
– Rk Rathod
Jun 21 at 6:24
below add to cart button
– user7608388
Jun 21 at 6:26