get category id from product
2015-08-07 10:39
387 查看
/**
* get categories from a product
*/
$categoryIds=$product->getCategoryIds();
/**
* looping through the array of category ids
*/
foreach($categoryIdsas$categoryId){
$category=Mage::getModel('catalog/category')->load($categoryId);
?>
Category:<ahref="<?phpecho$category->getCategoryUrl()?>"><?phpecho$category->getName()?></a><br/>
<?php
}
?>
* get categories from a product
*/
$categoryIds=$product->getCategoryIds();
/**
* looping through the array of category ids
*/
foreach($categoryIdsas$categoryId){
$category=Mage::getModel('catalog/category')->load($categoryId);
?>
Category:<ahref="<?phpecho$category->getCategoryUrl()?>"><?phpecho$category->getName()?></a><br/>
<?php
}
?>
相关文章推荐
- Gold Balanced Lineup - poj 3274 (hash)
- ArgoUML 的简单用法
- Algorithms—82.Remove Duplicates from Sorted List II
- 不一样的控制面板 GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
- Algorithms—143.Reorder List
- 哈希-Gold Balanced Lineup
- 哈希-Gold Balanced Lineup 分类: POJ 哈希 2015-08-07 09:04 2人阅读 评论(0) 收藏
- scikit-learn(工程中用的相对较多的模型介绍):1.12. Multiclass and multilabel algorithms
- django.test.client 使用随记
- VIEWGOOD(远古)政府流媒体视频解决方案
- Codeforces Round #313 Gerald's Hexagon (数论)
- django book学习笔记――模型
- Codeforces Round 313- Gerald's Hexagon
- goxceed
- 惊人go语言(image网站开发)
- Dijkstra's shortest path algorithm
- Go语言及Web框架Beego环境搭建手顺
- go语言解析html
- 1030 - Discovering Gold (lightoj 1030 概率DP)
- [Golang] 从零开始写Socket Server(1): Socket-Client框架