1

Trying to add a new cart block to the header within local.xml this is what i have

    <default>
        <reference name="header">
            <block type="checkout/cart_sidebar" name="cart_topbar" as="topCart" template="checkout/cart/top-cart.phtml"/>
        </reference>
    </default>

Then with in the header i call it with <?php echo $this->getChildHtml('topCart')?> however it shows nothing.

If i try changing the type to type="core/template" then the template will show the content. So this leads me to think i'm missing something specific to the checkout/cart_sidebar type?

The top-cart.phtml file simple contains a single text line to eliminate anything within that.

1
  • You've taken all of the proper diagnostic steps, very good work! Commented Jan 1, 2013 at 15:13

1 Answer 1

1

that's is your local.xml?

syntax is correct.

have you modify any thing else in Mage/Checkout/Block/Cart/Sidebar.php?

Sign up to request clarification or add additional context in comments.

3 Comments

I haven't, but previous developers might have. At least i know the syntax is all good and in theory it should work. Thxs for the help
Incase anyone else is wondering, turned out to be a bigger issue with the cart in general from previous devs. The syntax and placements are all good from the question.
can you send me Mage/Checkout/Block/Cart/Sidebar.php this file please. please check in local first. and mention in comment that file is collected from local/core

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.