<?php echo $this->getLayout()->createBlock(‘mymodule/myblock’)->setTemplate(‘mymodule/myblock.phtml’)->toHtml(); ?>
Category Archives: Magento
List all products under a given category on homepage magento
{{block type=”catalog/product_list” name=”home.catalog.product.list” alias=”products_homepage” category_id=”4″ template=”catalog/product/list.phtml”}}
List all products on home page magento
{{block type=”catalog/product_list” name=”home.catalog.product.list” alias=”products_homepage” template=”catalog/product/list.phtml”}}
List new products on home page Magento
{{block type=”catalog/product_new” name=”home.catalog.product.new” alias=”product_homepage” template=”catalog/product/new.phtml”}}
Include a static block on sidebar
<reference name=”left”>
<block type=”cms/block” name=”blockName” before=”-” >
<action method=”setBlockId”><block_id>block_identifier</block_id></action>
</block>
</reference>
Magento Ordering Sidebar Blocks
before=”-” – It lists as the first block
after=”-“- It lists as the last block
before=”block_name” – To load before a block
after=”block_name” – To load after a block
Get user group magento
<?php
echo Mage::getSingleton(‘customer/session’)->getCustomerGroupId();
?>
Check user is logged in or not magento
<?php
if($this->helper('customer')->isLoggedIn())
echo “logged in”;
?>
Gateway error: (TESTMODE) The merchant login ID or password is invalid or the account is inactive Magento
If you are testing the authorise.net in test mode make sure that Gateway URL is
https://test.authorize.net/gateway/transact.dll
If its in live mode make sure that the details you have given are correct and the authorize.net account is active .
Check the if the products is grouped or not Magento
if(Mage::helper(‘core’)->escapeHtml($product->getTypeId())==”grouped”)
echo “Grouped Product”;