magento 笔记

来源:互联网 发布:网站域名注册流程 编辑:程序博客网 时间:2024/04/29 19:29
根据 entity_attribute 的code 读取 AttributeId  (新增字段)
$data_active_id = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', 'active_end_date')->getAttributeId();



获取storeid 
Mage::app()->getStore()->getId



sql 查询(可以写在model 中,然后调用)
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = "select attribute_id from eav_attribute where attribute_code ='is_active_date' and entity_type_id=4 ";
$results = $readConnection->fetchAll($query);
model 调用
sql 方法写在model,在使用中进行调用
Mage::getModel('newship/product')->getallproduct();





0 0
原创粉丝点击