Adding Magento_Catalog to Custom ModuleHow to create magento2 custom theme/designHow to override a phtml file from a custom module in magento 2?Magento 2 The page isn’t redirecting properly in custom moduleAdding css to a module in Magento 2checkout_index_index not overriding in Magento 2.2.4 versionEditing custom module installed in VENDOR folder through a custom themeMagento 2 : How to override a custom module which install via composer?What happen when two module override same file?how to override Custom theme phtml file by custom moduleHow to override the checkout_cart_configure.xml template file into custom module
Why does Kathryn say this in 12 Monkeys?
How hard would it be to convert a glider into an powered electric aircraft?
When writing an error prompt, should we end the sentence with a exclamation mark or a dot?
How to translate “Me doing X” like in online posts?
Can you really not move between grapples/shoves?
What are the words for people who cause trouble believing they know better?
Bent spoke design wheels — feasible?
Select items in a list that contain criteria #2
Implement Homestuck's Catenative Doomsday Dice Cascader
How can you travel on a trans-Siberian train when it is fully booked?
siunitx error: Invalid numerical input
Why is the relationship between frequency and pitch exponential?
What LISP compilers and interpreters were available for 8-bit machines?
SF novella separating the dumb majority from the intelligent part of mankind
How do photons get into the eyes?
Subtables with equal width?
Trapping Rain Water
Required to check-in in person at international layover airport
The economics of a "no deal" Brexit
What is the advantage of carrying a tripod and ND-filters when you could use image stacking instead?
Proof that shortest path with negative cycles is NP hard
Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut
How can drunken, homicidal elves successfully conduct a wild hunt?
Does the first version of Linux developed by Linus Torvalds have a GUI?
Adding Magento_Catalog to Custom Module
How to create magento2 custom theme/designHow to override a phtml file from a custom module in magento 2?Magento 2 The page isn’t redirecting properly in custom moduleAdding css to a module in Magento 2checkout_index_index not overriding in Magento 2.2.4 versionEditing custom module installed in VENDOR folder through a custom themeMagento 2 : How to override a custom module which install via composer?What happen when two module override same file?how to override Custom theme phtml file by custom moduleHow to override the checkout_cart_configure.xml template file into custom module
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I wanted to override the content of addtocart.phtml which is located in
vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
Now I want to modify the content of this and add this to my custom module located in
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
But my changes does not appear. Is my path wrong? What or where should I place the custom addtocart.phtml file?
magento2 module magento2.2 blocks magento2.3
add a comment |
I wanted to override the content of addtocart.phtml which is located in
vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
Now I want to modify the content of this and add this to my custom module located in
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
But my changes does not appear. Is my path wrong? What or where should I place the custom addtocart.phtml file?
magento2 module magento2.2 blocks magento2.3
add a comment |
I wanted to override the content of addtocart.phtml which is located in
vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
Now I want to modify the content of this and add this to my custom module located in
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
But my changes does not appear. Is my path wrong? What or where should I place the custom addtocart.phtml file?
magento2 module magento2.2 blocks magento2.3
I wanted to override the content of addtocart.phtml which is located in
vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml
Now I want to modify the content of this and add this to my custom module located in
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
But my changes does not appear. Is my path wrong? What or where should I place the custom addtocart.phtml file?
magento2 module magento2.2 blocks magento2.3
magento2 module magento2.2 blocks magento2.3
asked May 28 at 15:02
MadzQuestioningMadzQuestioning
2569
2569
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You have to override in to your theme to below path:
/var/www/html/magentoroot/app/design/frontend/Vendor/customtheme/Magento_Catalog/templates/product/view/addtocart.phtml
if you make addtocart.phtml in your custom module like
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
you need to change catalog_product_view.xml layout too
add a comment |
if you want to override core template in your custom module then you have to create that particular layout file and write a code of "setTemplate" as below:
catalog_product_view.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.addtocart">
<action method="setTemplate">
<argument name="template" xsi:type="string">Package_Module::product/view/addtocart.phtml</argument>
</action>
</body>
</page>
Then you can create a file inside your module according to a path defined in
Package/Modeule/view/frontend/templates/product/view/addtocart.phtml
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%2f276435%2fadding-magento-catalog-to-custom-module%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have to override in to your theme to below path:
/var/www/html/magentoroot/app/design/frontend/Vendor/customtheme/Magento_Catalog/templates/product/view/addtocart.phtml
if you make addtocart.phtml in your custom module like
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
you need to change catalog_product_view.xml layout too
add a comment |
You have to override in to your theme to below path:
/var/www/html/magentoroot/app/design/frontend/Vendor/customtheme/Magento_Catalog/templates/product/view/addtocart.phtml
if you make addtocart.phtml in your custom module like
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
you need to change catalog_product_view.xml layout too
add a comment |
You have to override in to your theme to below path:
/var/www/html/magentoroot/app/design/frontend/Vendor/customtheme/Magento_Catalog/templates/product/view/addtocart.phtml
if you make addtocart.phtml in your custom module like
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
you need to change catalog_product_view.xml layout too
You have to override in to your theme to below path:
/var/www/html/magentoroot/app/design/frontend/Vendor/customtheme/Magento_Catalog/templates/product/view/addtocart.phtml
if you make addtocart.phtml in your custom module like
app/code/CustomVendor/CustomModule/view/frontend/templates/product/view/addtocart.phtml
you need to change catalog_product_view.xml layout too
answered May 29 at 5:42
Rutvee SojitraRutvee Sojitra
2,0701321
2,0701321
add a comment |
add a comment |
if you want to override core template in your custom module then you have to create that particular layout file and write a code of "setTemplate" as below:
catalog_product_view.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.addtocart">
<action method="setTemplate">
<argument name="template" xsi:type="string">Package_Module::product/view/addtocart.phtml</argument>
</action>
</body>
</page>
Then you can create a file inside your module according to a path defined in
Package/Modeule/view/frontend/templates/product/view/addtocart.phtml
add a comment |
if you want to override core template in your custom module then you have to create that particular layout file and write a code of "setTemplate" as below:
catalog_product_view.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.addtocart">
<action method="setTemplate">
<argument name="template" xsi:type="string">Package_Module::product/view/addtocart.phtml</argument>
</action>
</body>
</page>
Then you can create a file inside your module according to a path defined in
Package/Modeule/view/frontend/templates/product/view/addtocart.phtml
add a comment |
if you want to override core template in your custom module then you have to create that particular layout file and write a code of "setTemplate" as below:
catalog_product_view.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.addtocart">
<action method="setTemplate">
<argument name="template" xsi:type="string">Package_Module::product/view/addtocart.phtml</argument>
</action>
</body>
</page>
Then you can create a file inside your module according to a path defined in
Package/Modeule/view/frontend/templates/product/view/addtocart.phtml
if you want to override core template in your custom module then you have to create that particular layout file and write a code of "setTemplate" as below:
catalog_product_view.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.addtocart">
<action method="setTemplate">
<argument name="template" xsi:type="string">Package_Module::product/view/addtocart.phtml</argument>
</action>
</body>
</page>
Then you can create a file inside your module according to a path defined in
Package/Modeule/view/frontend/templates/product/view/addtocart.phtml
answered May 29 at 5:56
DivyeshDivyesh
821321
821321
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%2f276435%2fadding-magento-catalog-to-custom-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