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.
2 Answers
I think it will be much faster and secure to use ready made solution like this one.
-
why use extension? RWD theme have minicart as default :) Commented Apr 13, 2016 at 9:57
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.
custom-theme/default/template/checkout/cart/sidebar.phtml