[英]Retrieve products and sort Magento
I'm having a problem with my code currently it's loading the products but not accepting the order filter. 我的代码目前有问题,它正在加载产品,但不接受订单过滤器。 here is what I have. 这就是我所拥有的。 Would appreciate any help. 将不胜感激。
$_productCollection->clear()
->setOrder('entity_id', 'DESC')
->setPage($_GET['pageNo'],12)
->load()
;
Hello check below code 你好检查下面的代码
$collection = Mage::getModel('catalog/product')->getCollection(); $ collection = Mage :: getModel('catalog / product')-> getCollection();
$collection->setOrder('entity_id', 'DESC'); $ collection-> setOrder('entity_id','DESC');
$products = $collection->load(); $ products = $ collection-> load();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.