I need to add a cart to the header. I am creating my own custom theme which feeds of the RWD theme. I need a cart that shows total items and value.
I think it will be much faster and secure to use ready made solution like this one.
I added the following code to the custom-theme/default/layout/local.xml file.
<reference name="header"> <block type="checkout/cart_sidebar" name="cart_sidebar" as="top-cart" template="checkout/cart/sidebar.phtml"/> </reference>
I then added the following code to the custom-theme/default/page/html/header.phtml where I wanted the cart to show.
<?php echo $this->getChildHtml('top-cart'); ?>
I then customised the style and layout of the following page.