一段分类代码--产品分类的!
来源:互联网 发布:python十进制转二进制 编辑:程序博客网 时间:2024/04/30 01:58
<?php
02 $c=Mage::getModel('catalog/category');
//根据属性得到一个模型集合。
03 $pc=$c->loadByAttribute('name','选购礼盒');
04 if($pc->hasChildren()) {
05 $ids = $pc->getChildren();
//得到所有产品的分类集合。
06 $subCategories = Mage::getModel('catalog/category')->getCollection();
//使用getSelect()方法和where() 方法重新选取。
07 $subCategories->getSelect()->where("e.entity_id in ($ids)");
08 $subCategories->addAttributeToSelect('*');
09 $subCategories->load();
10 }
11 ?>
layout中的标签<cms_page_read>就是当weburl/cms/page/read 为访问路径的时候加载的layout handle,layout为默认的!!好强大,今晚让我想出来了!!
!
//装载缓存。
$this->loadLayout();
//得到block实例。
$block=Mage::getBlockSingleton('profile/profile');
//load profile
//$block->getProfile()----------Return a collection of profiles.
$profile = $block->getProfile();
if($profile) {
//操作layout中的参数(通过方法),好灵活!!
$this->getLayout()->getBlock('head')->setTitle($profile->getData("content_heading"))
->setDescription($profile->getData("meta_description"))
->setKeywords($profile->getData("meta_keywords"));
}
//画出来!!
$this->renderLayout();
//Return a collection of profiles.
public function getProfiles($category_id) {
$profiles = Mage::getModel('profile/profile')->getCollection()
//下面的在细细研究!!
->addStoreFilter(Mage::app()->getStore()->getId());
$profiles->addFieldToFilter('category_id', $category_id);
$profiles->setOrder("creation_time", "DESC");
return $profiles;
}
- 一段分类代码--产品分类的!
- Rational 产品的分类.
- 产品的需求分类
- SAP产品的分类
- 谁有产品分类的代码,发一个分享一下
- [BT_product]蓝牙产品的分类
- magento代码调用分类页产品
- 项目代码的分类
- magento 所有产品的url去掉分类,分类url不变
- 我国的PLC产品PLC的分类
- 中间件的定义、分类以及典型产品
- magento -- 获得产品所属于的分类
- 互联网产品的分类与运营
- 互联网产品的分类与运营
- Magento获取指定分类下的产品
- 唐山托盘的分类产品性能介绍
- 互联网产品的定义及分类
- 产品经理的常见分类和术语
- 用QT在Windows下编写dll程序
- sdfsdf
- 64 vs 32
- asp.net 常用控件命名规则
- 北大ACM(POJ)1109我的解决代码:
- 一段分类代码--产品分类的!
- 产品列表页面函数的整理!
- XML下的action方法!!
- MSN QQ在线聊天代码
- Magento在代码中调用静态块
- 函数指针的用法
- Windows7睡觉的几个姿势
- DBID,SID,DB_NAME,DB_DOMAIN,INSTANCE_NAME,DB_UNIQUE_NAME,SERVICE_NAMES 及监听参数的说明
- 常用的软件保护技术