To add new products to a CMS Home page use the block code
{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
I am a Magento 2 Certified Developer, and I have more than 10 years of experience in the Magento, PHP, and WordPress sectors. I specialise in backend and frontend Magento module development. In addition, when someone updates their store's products, those will be instantly updated on the destination domain via API. Also, I have developed a Magento multivendor marketplace website. I have developed more than 700 custom modules as per the requirements.
{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
{{block type="catalog/product_list" category_id="8" template="catalog/product/list.phtml"}}
Mage::getSingleton('core/session')->setMyCustomData('demo');
This code for retrieve the session variable
$session = Mage::getSingleton('core/session', array('name' => 'frontend'));
echo $session->getMyCustomData();
$adminUserModel = Mage::getModel('admin/user');
$userCollection = $adminUserModel->getCollection()->load();
Mage::log($userCollection->getData());
$catID = "15"; $children = Mage::getModel('catalog/category')->getCategories($catID); foreach ($children as $category) { echo $category->getId(); echo $category->getName(); print_r($category->getData()); }
$products = Mage::getModel('catalog/category')->load($cat_id)
->getProductCollection()->addAttributeToSelect('*')
->addAttributeToFilter(
'status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_DISABLED)
//replace DISABLED to ENABLED for products with status enabled
);