Magento 2.2 problem with .phtml overwriting using moduleHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlMagento2: How to rename the Details tab on the product details page, via overwriting layout file?main.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Problem with custom moduleMagento 2.2: Problem with varnish.vcl generatedMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsHelp with overwriting .phtml file in Magento 2.2.7
How can I use my cell phone's light as a reading light?
When do flights get cancelled due to fog?
Is conquering your neighbors to fight a greater enemy a valid strategy?
In layman's terms, does the Luckstone just give a passive +1 to all d20 rolls and saves except for death saves?
Why am I getting unevenly-spread results when using $RANDOM?
How can I review my manager, who is fine?
Can we share mixing jug/beaker for developer, fixer and stop bath?
Need a non-volatile memory IC with near unlimited read/write operations capability
Diagram with cylinder shapes and rectangles
What does "frozen" mean (e.g. for catcodes)?
What factors could lead to bishops establishing monastic armies?
What is the highest level of accuracy in motion control a Victorian society could achieve?
What exactly is a "murder hobo"?
Which is a better conductor, a very thick rubber wire or a very thin copper wire?
Function that detects repetitions
What are the effects of abstaining from eating a certain flavor?
NOLOCK or Read Uncommitted locking / latching behaviours
What is this burst transmission sequence across the entire band?
Was it ever illegal to name a pig "Napoleon" in France?
Computer name naming convention for security
Why is there paternal, for fatherly, fraternal, for brotherly, but no similar word for sons?
QR codes, do people use them?
Alice's First Code Review
How should I ask for a "pint" in countries that use metric?
Magento 2.2 problem with .phtml overwriting using module
How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlMagento2: How to rename the Details tab on the product details page, via overwriting layout file?main.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Problem with custom moduleMagento 2.2: Problem with varnish.vcl generatedMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsHelp with overwriting .phtml file in Magento 2.2.7
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to overwrite gallery.phtml block from single product page.
Magento 2 file 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">
<body>
<referenceContainer name="content">
<block class="MagentoCatalogBlockProductView" name="product.detail.info" as="product_detail_info" template="product/view/detail_layout.phtml" after="-" >
<block class="MagentoCatalogBlockProductViewGallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml"/>
</block>
</referenceContainer>
</body>
</page>
I want to replace gallery.phtml file.
Here's my two method:
1st - layout.xml method
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">
<body>
<referenceBlock name="product.info.media.image">
<arguments>
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</arguments>
</referenceBlock>
</body>
</page>
2nd method - di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoCatalogBlockProductView">
<plugin name="custom_widget_name" type="UNBXDProductAttributesPluginCatalogBlockProductViewGallery" />
</type>
</config>
Gallery.php
<?php
namespace UNBXDProductAttributesPluginCatalogBlockProductView;
class Gallery
public function after_construct(MagentoCatalogBlockProductView $result)
$result->setTemplate('UNBXD_ProductAttributes::catalog/product/view/gallery.phtml');
return $result;
?>
Nothing seems to work. I know this block in nested in another block. Is referenceBlock name 'product.info.media.image' correct in this case?
magento2
add a comment |
I want to overwrite gallery.phtml block from single product page.
Magento 2 file 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">
<body>
<referenceContainer name="content">
<block class="MagentoCatalogBlockProductView" name="product.detail.info" as="product_detail_info" template="product/view/detail_layout.phtml" after="-" >
<block class="MagentoCatalogBlockProductViewGallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml"/>
</block>
</referenceContainer>
</body>
</page>
I want to replace gallery.phtml file.
Here's my two method:
1st - layout.xml method
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">
<body>
<referenceBlock name="product.info.media.image">
<arguments>
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</arguments>
</referenceBlock>
</body>
</page>
2nd method - di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoCatalogBlockProductView">
<plugin name="custom_widget_name" type="UNBXDProductAttributesPluginCatalogBlockProductViewGallery" />
</type>
</config>
Gallery.php
<?php
namespace UNBXDProductAttributesPluginCatalogBlockProductView;
class Gallery
public function after_construct(MagentoCatalogBlockProductView $result)
$result->setTemplate('UNBXD_ProductAttributes::catalog/product/view/gallery.phtml');
return $result;
?>
Nothing seems to work. I know this block in nested in another block. Is referenceBlock name 'product.info.media.image' correct in this case?
magento2
add a comment |
I want to overwrite gallery.phtml block from single product page.
Magento 2 file 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">
<body>
<referenceContainer name="content">
<block class="MagentoCatalogBlockProductView" name="product.detail.info" as="product_detail_info" template="product/view/detail_layout.phtml" after="-" >
<block class="MagentoCatalogBlockProductViewGallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml"/>
</block>
</referenceContainer>
</body>
</page>
I want to replace gallery.phtml file.
Here's my two method:
1st - layout.xml method
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">
<body>
<referenceBlock name="product.info.media.image">
<arguments>
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</arguments>
</referenceBlock>
</body>
</page>
2nd method - di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoCatalogBlockProductView">
<plugin name="custom_widget_name" type="UNBXDProductAttributesPluginCatalogBlockProductViewGallery" />
</type>
</config>
Gallery.php
<?php
namespace UNBXDProductAttributesPluginCatalogBlockProductView;
class Gallery
public function after_construct(MagentoCatalogBlockProductView $result)
$result->setTemplate('UNBXD_ProductAttributes::catalog/product/view/gallery.phtml');
return $result;
?>
Nothing seems to work. I know this block in nested in another block. Is referenceBlock name 'product.info.media.image' correct in this case?
magento2
I want to overwrite gallery.phtml block from single product page.
Magento 2 file 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">
<body>
<referenceContainer name="content">
<block class="MagentoCatalogBlockProductView" name="product.detail.info" as="product_detail_info" template="product/view/detail_layout.phtml" after="-" >
<block class="MagentoCatalogBlockProductViewGallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml"/>
</block>
</referenceContainer>
</body>
</page>
I want to replace gallery.phtml file.
Here's my two method:
1st - layout.xml method
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">
<body>
<referenceBlock name="product.info.media.image">
<arguments>
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</arguments>
</referenceBlock>
</body>
</page>
2nd method - di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoCatalogBlockProductView">
<plugin name="custom_widget_name" type="UNBXDProductAttributesPluginCatalogBlockProductViewGallery" />
</type>
</config>
Gallery.php
<?php
namespace UNBXDProductAttributesPluginCatalogBlockProductView;
class Gallery
public function after_construct(MagentoCatalogBlockProductView $result)
$result->setTemplate('UNBXD_ProductAttributes::catalog/product/view/gallery.phtml');
return $result;
?>
Nothing seems to work. I know this block in nested in another block. Is referenceBlock name 'product.info.media.image' correct in this case?
magento2
magento2
asked Jun 28 at 9:40
AmigaAmiga
113 bronze badges
113 bronze badges
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Try This :-
<referenceBlock name="product.info.media.image">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
Still nothing:/
– Amiga
Jun 28 at 10:05
check your file path and after code clean cache and then try
– Rk Rathod
Jun 28 at 10:08
path is correct /app/code/UNBXD/ProductAttributes/view/frontend/templates/catalog/product/view/gallery.phtml
– Amiga
Jun 28 at 10:15
add a comment |
If I add remove='true'
<?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">
<body>
<referenceBlock name="product.info.media.image" remove="true">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
image is removed so reference name is correct but new template isn't injected....
add a comment |
path looks ok. All cache cleaned, recompilled files ect...
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%2f280042%2fmagento-2-2-problem-with-phtml-overwriting-using-module%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
Try This :-
<referenceBlock name="product.info.media.image">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
Still nothing:/
– Amiga
Jun 28 at 10:05
check your file path and after code clean cache and then try
– Rk Rathod
Jun 28 at 10:08
path is correct /app/code/UNBXD/ProductAttributes/view/frontend/templates/catalog/product/view/gallery.phtml
– Amiga
Jun 28 at 10:15
add a comment |
Try This :-
<referenceBlock name="product.info.media.image">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
Still nothing:/
– Amiga
Jun 28 at 10:05
check your file path and after code clean cache and then try
– Rk Rathod
Jun 28 at 10:08
path is correct /app/code/UNBXD/ProductAttributes/view/frontend/templates/catalog/product/view/gallery.phtml
– Amiga
Jun 28 at 10:15
add a comment |
Try This :-
<referenceBlock name="product.info.media.image">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
Try This :-
<referenceBlock name="product.info.media.image">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
answered Jun 28 at 9:51
Rk RathodRk Rathod
2,5433 silver badges22 bronze badges
2,5433 silver badges22 bronze badges
Still nothing:/
– Amiga
Jun 28 at 10:05
check your file path and after code clean cache and then try
– Rk Rathod
Jun 28 at 10:08
path is correct /app/code/UNBXD/ProductAttributes/view/frontend/templates/catalog/product/view/gallery.phtml
– Amiga
Jun 28 at 10:15
add a comment |
Still nothing:/
– Amiga
Jun 28 at 10:05
check your file path and after code clean cache and then try
– Rk Rathod
Jun 28 at 10:08
path is correct /app/code/UNBXD/ProductAttributes/view/frontend/templates/catalog/product/view/gallery.phtml
– Amiga
Jun 28 at 10:15
Still nothing:/
– Amiga
Jun 28 at 10:05
Still nothing:/
– Amiga
Jun 28 at 10:05
check your file path and after code clean cache and then try
– Rk Rathod
Jun 28 at 10:08
check your file path and after code clean cache and then try
– Rk Rathod
Jun 28 at 10:08
path is correct /app/code/UNBXD/ProductAttributes/view/frontend/templates/catalog/product/view/gallery.phtml
– Amiga
Jun 28 at 10:15
path is correct /app/code/UNBXD/ProductAttributes/view/frontend/templates/catalog/product/view/gallery.phtml
– Amiga
Jun 28 at 10:15
add a comment |
If I add remove='true'
<?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">
<body>
<referenceBlock name="product.info.media.image" remove="true">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
image is removed so reference name is correct but new template isn't injected....
add a comment |
If I add remove='true'
<?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">
<body>
<referenceBlock name="product.info.media.image" remove="true">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
image is removed so reference name is correct but new template isn't injected....
add a comment |
If I add remove='true'
<?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">
<body>
<referenceBlock name="product.info.media.image" remove="true">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
image is removed so reference name is correct but new template isn't injected....
If I add remove='true'
<?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">
<body>
<referenceBlock name="product.info.media.image" remove="true">
<action method="setTemplate">
<argument name="template" xsi:type="string">UNBXD_ProductAttributes::catalog/product/view/gallery.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
image is removed so reference name is correct but new template isn't injected....
answered Jun 28 at 10:08
AmigaAmiga
113 bronze badges
113 bronze badges
add a comment |
add a comment |
path looks ok. All cache cleaned, recompilled files ect...
add a comment |
path looks ok. All cache cleaned, recompilled files ect...
add a comment |
path looks ok. All cache cleaned, recompilled files ect...
path looks ok. All cache cleaned, recompilled files ect...
answered Jun 28 at 10:14
AmigaAmiga
113 bronze badges
113 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%2f280042%2fmagento-2-2-problem-with-phtml-overwriting-using-module%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