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;








1















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?










share|improve this question




























    1















    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?










    share|improve this question
























      1












      1








      1








      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 28 at 15:02









      MadzQuestioningMadzQuestioning

      2569




      2569




















          2 Answers
          2






          active

          oldest

          votes


















          1














          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






          share|improve this answer






























            1














            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





            share|improve this answer























              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
              );



              );













              draft saved

              draft discarded


















              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









              1














              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






              share|improve this answer



























                1














                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






                share|improve this answer

























                  1












                  1








                  1







                  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






                  share|improve this answer













                  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







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 29 at 5:42









                  Rutvee SojitraRutvee Sojitra

                  2,0701321




                  2,0701321























                      1














                      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





                      share|improve this answer



























                        1














                        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





                        share|improve this answer

























                          1












                          1








                          1







                          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





                          share|improve this answer













                          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






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered May 29 at 5:56









                          DivyeshDivyesh

                          821321




                          821321



























                              draft saved

                              draft discarded
















































                              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%2f276435%2fadding-magento-catalog-to-custom-module%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

                              Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                              Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                              Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림