Magento 2 : checkout_cart_index.xml problem
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
add a comment |
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
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
add a comment |
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
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
magento2 layout
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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>
add a comment |
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="-"/>
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%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
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>
add a comment |
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>
add a comment |
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>
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>
edited Feb 21 '18 at 14:24
answered Feb 21 '18 at 14:18
Idham ChoudryIdham Choudry
1,27811038
1,27811038
add a comment |
add a comment |
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="-"/>
add a comment |
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="-"/>
add a comment |
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="-"/>
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="-"/>
edited 34 mins ago
Teja Bhagavan Kollepara
2,96341847
2,96341847
answered Feb 22 '18 at 8:09
Abdullah ShahidAbdullah Shahid
7910
7910
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%2f214439%2fmagento-2-checkout-cart-index-xml-problem%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
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