5

I tried to override the core template file which located in

app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml

like this:

app/code/local/Test/ShippingCost/etc/config.xml

<frontend>
      <layout>
            <updates>
              <test_shippingcost>
                  <file>test_shippingcost.xml</file>
              </test_shippingcost> 
            </updates>
        </layout>
</frontend>

app/design/frontend/base/default/layout/test_shippingcost.xml

<?xml version="1.0"?>
<layout version="0.1.0">
  <checkout_onepage_index>
    <reference name="checkout.onepage.shipping_method.available">
          <action method="setTemplate">
              <template>test/shippingcost/checkout/onepage/shipping_method/available.phtml</template>
          </action>
    </reference>
  </checkout_onepage_index>
</layout>

app/design/frontend/base/default/template/test/shippingcost/checkout/onepage/shipping_method/available.phtml

<h1> Success Override </h1>

the problem is, it still shows the old phtml file content instead of the new one

  • are you sure you are using base/default theme and not rwd or custom? – Piyush Oct 18 '17 at 4:45
  • @Piyush yes because when i changed the app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml , it changed the content – Shell Suite Oct 18 '17 at 4:50
  • as I can see in core files the block checkout.onepage.shipping_method.available is not added under checkout_multishipping_overview you may need to change your handle to checkout_onepage_index or if you have to add this block instead of override – Piyush Oct 18 '17 at 5:01
  • @Piyush still not working, see my updated question – Shell Suite Oct 18 '17 at 6:03
  • 1
    Shouldn't you just add a folder under your template and add a file there? Like: app/design/frontend/ThemeName/ThemeDefault/template/checkout/onepage/shipping_method/available.phtml – fja3omega Oct 18 '17 at 6:36
1

In your module's XML file add dependency

For example

in your app/etc/modules/Test_ShippingCost.xml file would be look like

<?xml version="1.0"?>
<config>
    <modules>
    <Test_ShippingCost>
        <active>true</active>
        <codePool>local</codePool>
        <depends>
            <Mage_Checkout /><!--Add this depend module and that will your layout after checkout.xml-->
        </depends>  
     </Test_ShippingCost>
    </modules>
</config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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