Thursday 31 January 2013

Friday 18 January 2013

Feature Product check yes/on

<?php
 $featured_products=Mage::getModel('catalog/product')
                                         ->getCollection()
                                         ->addAttributeToFilter('status', 1)
                                         ->addAttributeToFilter('visibility', 4)
                                         ->addAttributeToFilter('featured', 1);

?>

Thursday 17 January 2013

Friday 11 January 2013

How to call staic block any XML file


<reference name="left">
    <block type="cms/block" name="sample_block" before="-">
        <action method="setBlockId"><block_id>sample_block</block_id></action>
    </block>   
</reference>

How to call image in static block

{{skin url='images/media/about_us_img.jpg'}}

How to call staick block in your template or .phtml files

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('my_static_block_name')->toHtml() ?>

Wednesday 9 January 2013

Phtml page call in cms page in magento

{{block type="core/template"  template="custompage/homecontent.phtml"}}

Product Type in magento


<?php  $productype=$_product->getTypeID(); ?>

Product Available (In stock/Out of stock)


<?php
         $thisProduct = Mage::getModel('catalog/product')->load($_product->getId());
         if($thisProduct->isAvailable()):
            echo $this->__('In stock');
         else:
            echo $this->__('Out of stock');
         endif;
    ?>