1

I'm trying to overwrite checkout_index_index.xml under module-checkout

It is currently using the file I have created in my theme but the shipping selection is breaking and now showing prices or reloading on zip code change.

I have copied the whole file from the default theme so it's not my code but maybe something isn't including like I found the discount item wasn't working.

So I had to add that manually but can't seem to find whats breaking the shipping any ideas thanks.

Path is

/theme_name/theme/Magento_Checkout/layout/checkout_index_index.xml

enter image description here

4
  • 1
    Can you paste file path ?
    – Pawan
    Commented Jul 25, 2017 at 3:44
  • @PawanKParmar Updated Commented Jul 25, 2017 at 3:55
  • it can help you: magento.stackexchange.com/a/107473/44340
    – Pawan
    Commented Jul 25, 2017 at 4:29
  • @PawanKParmar Not what I'm after sorry the file is overwriting fine and Magento is seeing it because I can add and remove things but the shipping methods are not showing correctly when I add the checkout_index_index.xml file to the layout folder with the same content as the default theme it doesn't work Commented Jul 25, 2017 at 4:38

1 Answer 1

2

So I have not found the problem but I have found a solution

in checkout_index_index.xml in your theme, you can't copy all the content from the default theme but if you want to add stuff to the content section you can use

<referenceBlock name="checkout.root"> 

When using

<referenceContainer name="content">

The shipping table stops working

This is currently my way around it and you can then copy all the info inside

<block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="onepage.phtml" cacheable="false">
....
</block>

From the defult theme and chnage things as you wish i also recomend adding discount to the side bar when overwriting this file as it doenst seem to show the discount if you dont.

<item name="discount" xsi:type="array">
    <item name="component" xsi:type="string">Magento_SalesRule/js/view/cart/totals/discount</item>
    <item name="config" xsi:type="array">
    <item name="title" xsi:type="string" translate="true">Discount</item>
</item>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.