Magento 2 : checkout_cart_index.xml problem












1















When I copy checkout_cart_index.xml page to my theme it works fine but when I change



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Checkout::cart/form.phtml" after="cart.summary">


to



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Theme::cart/form.phtml" after="cart.summary">


For overriding a template file from my theme the discount coupon form disappears and it also disappears from from html too.



Thanks in advance.










share|improve this question




















  • 1





    only phtml file override as your theme path folder not to xml file need to override.

    – Vijay-CyberLocker
    Feb 21 '18 at 12:40











  • If I do not override XML theme path it get template from module_checkout rather than my custom_theme

    – Abdullah Shahid
    Feb 21 '18 at 13:10
















1















When I copy checkout_cart_index.xml page to my theme it works fine but when I change



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Checkout::cart/form.phtml" after="cart.summary">


to



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Theme::cart/form.phtml" after="cart.summary">


For overriding a template file from my theme the discount coupon form disappears and it also disappears from from html too.



Thanks in advance.










share|improve this question




















  • 1





    only phtml file override as your theme path folder not to xml file need to override.

    – Vijay-CyberLocker
    Feb 21 '18 at 12:40











  • If I do not override XML theme path it get template from module_checkout rather than my custom_theme

    – Abdullah Shahid
    Feb 21 '18 at 13:10














1












1








1








When I copy checkout_cart_index.xml page to my theme it works fine but when I change



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Checkout::cart/form.phtml" after="cart.summary">


to



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Theme::cart/form.phtml" after="cart.summary">


For overriding a template file from my theme the discount coupon form disappears and it also disappears from from html too.



Thanks in advance.










share|improve this question
















When I copy checkout_cart_index.xml page to my theme it works fine but when I change



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Checkout::cart/form.phtml" after="cart.summary">


to



<block class="MagentoCheckoutBlockCartGrid" name="checkout.cart.form" as="cart-items" template="Magento_Theme::cart/form.phtml" after="cart.summary">


For overriding a template file from my theme the discount coupon form disappears and it also disappears from from html too.



Thanks in advance.







magento2 layout






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 21 '18 at 14:03









Matt Antley

1,061518




1,061518










asked Feb 21 '18 at 12:33









Abdullah ShahidAbdullah Shahid

7910




7910








  • 1





    only phtml file override as your theme path folder not to xml file need to override.

    – Vijay-CyberLocker
    Feb 21 '18 at 12:40











  • If I do not override XML theme path it get template from module_checkout rather than my custom_theme

    – Abdullah Shahid
    Feb 21 '18 at 13:10














  • 1





    only phtml file override as your theme path folder not to xml file need to override.

    – Vijay-CyberLocker
    Feb 21 '18 at 12:40











  • If I do not override XML theme path it get template from module_checkout rather than my custom_theme

    – Abdullah Shahid
    Feb 21 '18 at 13:10








1




1





only phtml file override as your theme path folder not to xml file need to override.

– Vijay-CyberLocker
Feb 21 '18 at 12:40





only phtml file override as your theme path folder not to xml file need to override.

– Vijay-CyberLocker
Feb 21 '18 at 12:40













If I do not override XML theme path it get template from module_checkout rather than my custom_theme

– Abdullah Shahid
Feb 21 '18 at 13:10





If I do not override XML theme path it get template from module_checkout rather than my custom_theme

– Abdullah Shahid
Feb 21 '18 at 13:10










2 Answers
2






active

oldest

votes


















1














If you want to override the the .phtml template file try to put your form.phtml file inside




app/design/frontend/YourVendorThemeName/YourAciveThemeName/Magento_Checkout/templates/cart/form.phtml




You should use setTemplate action in layout xml file, if you want to override phtml from your custom module



checkout_cart_index.xml



    <?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">
<body>
<referenceBlock name="checkout.cart.form">
<action method="setTemplate">
<argument name="template" xsi:type="string">Magento_Theme::cart/form.phtml</argument>
</action>
</referenceBlock>
</body>
</page>





share|improve this answer

































    0














    All I do is move checkout.cart.coupon to my container and it is was apparent where I want. Here is the code



    <move element="checkout.cart.coupon" destination="summary-col1" before="-"/>





    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%2f214439%2fmagento-2-checkout-cart-index-xml-problem%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














      If you want to override the the .phtml template file try to put your form.phtml file inside




      app/design/frontend/YourVendorThemeName/YourAciveThemeName/Magento_Checkout/templates/cart/form.phtml




      You should use setTemplate action in layout xml file, if you want to override phtml from your custom module



      checkout_cart_index.xml



          <?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">
      <body>
      <referenceBlock name="checkout.cart.form">
      <action method="setTemplate">
      <argument name="template" xsi:type="string">Magento_Theme::cart/form.phtml</argument>
      </action>
      </referenceBlock>
      </body>
      </page>





      share|improve this answer






























        1














        If you want to override the the .phtml template file try to put your form.phtml file inside




        app/design/frontend/YourVendorThemeName/YourAciveThemeName/Magento_Checkout/templates/cart/form.phtml




        You should use setTemplate action in layout xml file, if you want to override phtml from your custom module



        checkout_cart_index.xml



            <?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">
        <body>
        <referenceBlock name="checkout.cart.form">
        <action method="setTemplate">
        <argument name="template" xsi:type="string">Magento_Theme::cart/form.phtml</argument>
        </action>
        </referenceBlock>
        </body>
        </page>





        share|improve this answer




























          1












          1








          1







          If you want to override the the .phtml template file try to put your form.phtml file inside




          app/design/frontend/YourVendorThemeName/YourAciveThemeName/Magento_Checkout/templates/cart/form.phtml




          You should use setTemplate action in layout xml file, if you want to override phtml from your custom module



          checkout_cart_index.xml



              <?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">
          <body>
          <referenceBlock name="checkout.cart.form">
          <action method="setTemplate">
          <argument name="template" xsi:type="string">Magento_Theme::cart/form.phtml</argument>
          </action>
          </referenceBlock>
          </body>
          </page>





          share|improve this answer















          If you want to override the the .phtml template file try to put your form.phtml file inside




          app/design/frontend/YourVendorThemeName/YourAciveThemeName/Magento_Checkout/templates/cart/form.phtml




          You should use setTemplate action in layout xml file, if you want to override phtml from your custom module



          checkout_cart_index.xml



              <?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">
          <body>
          <referenceBlock name="checkout.cart.form">
          <action method="setTemplate">
          <argument name="template" xsi:type="string">Magento_Theme::cart/form.phtml</argument>
          </action>
          </referenceBlock>
          </body>
          </page>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 21 '18 at 14:24

























          answered Feb 21 '18 at 14:18









          Idham ChoudryIdham Choudry

          1,27811038




          1,27811038

























              0














              All I do is move checkout.cart.coupon to my container and it is was apparent where I want. Here is the code



              <move element="checkout.cart.coupon" destination="summary-col1" before="-"/>





              share|improve this answer






























                0














                All I do is move checkout.cart.coupon to my container and it is was apparent where I want. Here is the code



                <move element="checkout.cart.coupon" destination="summary-col1" before="-"/>





                share|improve this answer




























                  0












                  0








                  0







                  All I do is move checkout.cart.coupon to my container and it is was apparent where I want. Here is the code



                  <move element="checkout.cart.coupon" destination="summary-col1" before="-"/>





                  share|improve this answer















                  All I do is move checkout.cart.coupon to my container and it is was apparent where I want. Here is the code



                  <move element="checkout.cart.coupon" destination="summary-col1" before="-"/>






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 34 mins ago









                  Teja Bhagavan Kollepara

                  2,96341847




                  2,96341847










                  answered Feb 22 '18 at 8:09









                  Abdullah ShahidAbdullah Shahid

                  7910




                  7910






























                      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%2f214439%2fmagento-2-checkout-cart-index-xml-problem%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

                      What other Star Trek series did the main TNG cast show up in?

                      Berlina muro

                      Berlina aerponto