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;








3















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.










share|improve this question









New contributor



user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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

















3















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.










share|improve this question









New contributor



user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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













3












3








3








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.










share|improve this question









New contributor



user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor



user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited Jun 21 at 6:23







user7608388













New contributor



user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked Jun 21 at 6:15









user7608388user7608388

162 bronze badges




162 bronze badges




New contributor



user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




user7608388 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 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











  • 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










1 Answer
1






active

oldest

votes


















0














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>





share|improve this answer

























  • 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














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.









draft saved

draft discarded


















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









0














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>





share|improve this answer

























  • 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
















0














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>





share|improve this answer

























  • 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














0












0








0







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>





share|improve this answer















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>






share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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











user7608388 is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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