Ina Code Blog

bunch of code in one place
Jun
10

Magento: How to move cart block from sidebar to header?

Posted by admin in Magento

Open file: /app/design/frontend/your_theme/your_theme/template/page/html/header.phtml and add this line where you want the cart block to be displayed:

<?php echo $this->getChildHtml(’cart_sidebar_head’) ?>

Open file: /app/design/frontend/your_theme/your_theme/layout/page.xml and insert this in block type page/html_header:

<block type=”checkout/cart_sidebar” name=”cart_sidebar_head” template=”checkout/cart/sidebar.phtml” buy prescription drugs />

You probably don’t need cart block in you sidebar anymore so open file: /app/design/frontend/your_theme/your_theme/layout/checkout.xml and remove or comment these lines:

<block type=”checkout/cart_sidebar” name=”cart_sidebar” template=”checkout/cart/sidebar.phtml” before=”-”>
<action method=”addItemRender”><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method=”addItemRender”><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method=”addItemRender”><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
</block>

best cialis

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Jun
3

Magento: how to display a certain attribute?

Posted by admin in Magento

Here is how you can display certain attribute on product page. In my case I needed to display cost price:

prescription drugs without prescription cialis generic best price <?php echo $_helper->productAttribute($_product, $this->htmlEscape($_product->getCost()), ‘cost’) ?>

Or use this for your custom attributes:

<?php echo $_helper->productAttribute($_product, $this->htmlEscape($_product->getCustom()), ‘Custom’) ?>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]