Here is the very simple code for getting products from a particular category and order them using product ID in decending order.
[php]
error_reporting(1);
ini_set('display_errors','1');
require_once('app/Mage.php');
Mage::app('default');
$products = Mage::getModel('catalog/category')->load(3345) //3345 : Category ID
->getProductCollection()
->addAttributeToSelect('*')->setOrder('entity_id','DESC'); //Order the collection in decending order.
foreach ($products as $p) {
echo $p->getSku().'<br/>';
}
[/php]
Hope it helps some one.
Happy coding.
Read...
ReplyDelete[...]Just as noted through this web site internet based[...]...