2014年4月12日

deal with 'non-admin area' warn

摘要: We usually use the follow code to delete product in Magento$product = Mage::getSingleton('catalog/product')->load($productId);$product->delete();Of course, you are given a warn from magento. To solve this problem, you should add the follow code before and after delete Mage::register(&# 阅读全文

posted @ 2014-04-12 19:53 冯亮 阅读(167) 评论(0) 推荐(0) 编辑

How to use pagination in Magento

摘要: classYour_Module_Block_Entityname_ListextendsMage_Core_Block_Template{ protected function _construct(){ // We get our collection through our model parent::_construct(); // Instantiate a new Pager block $this->_entities =Mage::getModel('your_module/entityname')->getCollecti... 阅读全文

posted @ 2014-04-12 17:13 冯亮 阅读(213) 评论(0) 推荐(0) 编辑

导航