質問

I'm having some trouble removing a block from the head on the checkout pages, I have added a core/textlist called before_head_end to the page head in the page.xml so that it is included on all pages:

Page.xml

   <block type="page/html_head" name="head" as="head">
       <block type="core/text_list" name="before_head_end" as="before_head_end">
           <block type="core/template" name="ds_head_extras" as="ds_header_extras" template="dsingleton/headerextras/head_extras.phtml"/>
       </block>
    </block>

Now, I'm trying to remove that same block on the checkout pages only, so in my checkout xml i've tried 3 different ways to remove the block, but none of them works, can someone point out where i'm going wrong?

Checkout.xml First Attempt:

<checkout_onepage_index translate="label">
        <label>One Page Checkout</label>
        <!-- Mage_Checkout -->
        <reference name="head">
            <remove name="before_head_end" />
        </reference>
</checkout_onepage_index>

Second Attempt:

<checkout_onepage_index translate="label">
        <label>One Page Checkout</label>
        <!-- Mage_Checkout -->
        <reference name="head">
            <action method="unsetChild"><name>before_head_end</name></action>
        </reference>
</checkout_onepage_index>

Third Attempt:

<checkout_onepage_index translate="label">
            <label>One Page Checkout</label>
            <!-- Mage_Checkout -->
            <reference name="head">
                <reference name="before_head_ends>
                     <action method="unsetChild"><name>ds_head_extras</name></action>
                </reference>
            </reference>
    </checkout_onepage_index>
役に立ちましたか?

解決

At first glance, all of them seem to be fine if you want to remove that block from checkout onepage. The changes you made are going to apply only on checkout_onepage_index handle, so make sure you check checkout/onepage pages. For example, this is not going to affect the cart pages, because they are using checkout_cart_index handle.

Hope it helps, cheers.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top