Magento获取当前栏目ID:$_cat= new Mage_Catalog_Block_Navigation();$curent_cat= $_cat->getCurrentCategory();$curent_cat_id= $curent_cat->getId(); 或者Mage::regi...
分类:
其他好文 时间:
2014-08-21 18:40:14
阅读次数:
172
$root_id = Mage::app()->getStore()->getRootCategoryId(); $categories = Mage::getModel('catalog/category')->getCategories($root_id);获得分类名称 fore...
分类:
其他好文 时间:
2014-08-21 14:58:04
阅读次数:
210
public function send() { $emailTemplate = Mage::getModel('core/email_template'); // Send all emails from corresponding list while (!empty($this->_emai...
分类:
其他好文 时间:
2014-08-19 20:42:15
阅读次数:
184
$thumb_path = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail()); $small_path...
分类:
其他好文 时间:
2014-08-11 20:35:32
阅读次数:
312
1 $_product->getResource()->getAttribute('my_attribute_name')->getFrontend()->getValue($_product);注:在列表页获得的产品可能信息不全,需要获得产品id之后,使用 1 $_product = Mage:....
分类:
其他好文 时间:
2014-08-11 14:55:12
阅读次数:
205
$subcategories = Mage::getModel('catalog/category')->getCategories($current_category_id);foreach($subcategories as $cat){$cat->getName();//名称Mage::hel...
分类:
其他好文 时间:
2014-08-06 18:45:51
阅读次数:
201
$products = Mage::getResourceModel('catalog/product_collection') ->setStoreId($storeId) ->addStoreFilter($storeId) ->addAttributeToSelect(...
分类:
其他好文 时间:
2014-07-28 11:31:40
阅读次数:
178
$order_object=Mage::getModel('sales/order')->load("order_id");注:order_id 是订单号后面的数字;$res['points_spend']=Mage::helper('rewards')->getPointsString($orde...
分类:
其他好文 时间:
2014-07-26 00:31:26
阅读次数:
195
1. Text Field $fieldset->addField('title', 'text', array( 'label' => Mage::helper('form')->__('Title3'), 'class' => 'required-entry', 'required' => tr...
分类:
其他好文 时间:
2014-07-26 00:21:36
阅读次数:
391
查询:$model = Mage::getModel('mynews/mynews'); $collection = $model->getCollection(); $collection->addAttributeToSelect(array('name', 'image', 'url_key'...
分类:
其他好文 时间:
2014-07-25 23:51:50
阅读次数:
352