I have a very basic module:
app/code/local/Demo/Custom/Block/Giftproducts.php
class Demo_Custom_Block_Giftproducts extends Mage_Core_Block_Template { public function getGiftProducts() { //code omitted } } app/code/local/Demo/Custom/etc/config.xml
<?xml version="1.0"?> <config> <modules> <Demo_Custom> <version>1.0.0</version> </Demo_Custom> </modules> <global> <blocks> <giftproducts> <class>Demo_Custom_Block</class> </giftproducts> </blocks> </global> </config> app/design/frontend/custom_theme/default/layout/custom.xml
<?xml version="1.0" ?> <layout> <default> <reference name="content"> </reference> </default> <checkout_cart_index> <reference name="checkout.cart"> <block type="custom/giftproducts" name="giftproducts" template="custom/giftproducts.phtml" /> </reference> </checkout_cart_index> </layout> app/etc/modules/Demo_Custom.xml:
<?xml version="1.0"?> <config> <modules> <Demo_Custom> <active>true</active> <codePool>local</codePool> </Demo_Custom> </modules> </config> app/design/frontend/custom_theme/default/tempalte/custom/giftproducts.phtml:
<?php echo 'got here'; In cart.phtml I then call the block like this:
<?php echo $this->getChildHtml('giftproducts') ?> Everything is doublechecked, seems pretty clear, cache is cleared, however I just cannot get the template to bo executed. tired various combinations of declaration in xml file, but with no luck.
Any help or guidance is much appreciated.