2

Considering this layout update XML:

<?xml version="1.0"?>
<layout version="0.0.1">
    <checkout_cart_index>
        <reference name="methods">
            <block type="mhquote/request_link" name="mhquote.request.link" as="mhquoteRequestLink" before="-" template="mhquote/request/link.phtml" />
            <remove name="checkout.cart.methods.onepage" />
            <remove name="checkout.cart.methods.multishipping" />
        </reference>
    </checkout_cart_index>
</layout>

When the update is applied the cart page goes from this:

Before

To this:

After

I can't understand why the new block is not shown, given that:

  • a module exists which has mhquote as a unique handler
  • the module is correctly set as for controllers in it work fine
  • methods block is a core/text_list block, so it should automatically render all child blocks
  • the template exists at app/design/frontend/<current_theme>/default/template/mhquote/request/link.phtml
  • the Disc_Quote_Block_Request_Link block class exists and extends from Mage_Core_Block_Template, Disc_Quote being the class group handled by mhquote
  • the layout update file is loaded correctly as it successfully removes the two checkout links

The block template is really simple, just a <div> with a string I'd like to show:

<div class="hellotest">
     <h1>Hello</h1>
</div>

I can't see where I'm wrong. I keep checking and rewriting it from scratch paying more attention to the namings but I can't seem to show that block.

Any idea why? Thanks in advance for your help.

=== EDIT 1 ===

This is the config.xml for the module:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Disc_Quote>
            <version>0.0.1</version>
        </Disc_Quote>
    </modules>

    <global>
        <blocks>
            <mhquote>
                <class>Disc_Quote_Block</class>
            </mhquote>
        </blocks>
        <helpers>
            <mhquote>
                <class>Disc_Quote_Helper</class>
            </mhquote>
        </helpers>
        <models>
            <mhquote>
                <class>Disc_Quote_Model</class>
            </mhquote>
        </models>
    </global>

    <frontend>
        <routers>
            <mhquote>
                <use>standard</use>
                <args>    
                    <module>Disc_Quote</module>
                    <frontName>mhquote</frontName>
                </args>
            </mhquote>
        </routers>

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

</config>
0

Assign block permission from system > Permission > Block > Add New Block

enter image description here

click on Save Block. Once clear the cache and refresh the page Hope this will help you

  • Thanks for the answer. Unfortunately, after applying your solution, the block still does not show. – GigiSan Nov 2 '16 at 10:31
  • My pleasure, Make sure about correct block type and phtml path and Make sure that block name doesn't conflict with another. – Sameer Bhayani Nov 2 '16 at 10:35
  • I don't see anything wrong, I posted the module's config.xml for reference. – GigiSan Nov 2 '16 at 10:48

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.