获取自定义类别的模型
Get model of custom category
我们在类别树中添加了一些类别属性
是否可以创建一个 foreach Mage::getModel(custom categories)
来获取自定义类别的所有值?
您应该可以访问这些属性,但您需要先加载类别。现在仅仅获取自定义属性可能有点困难。
$cateogry = Mage::getModel('catalog/category')->load('category here');
//this could get you all attributes
$attributes = $category->getAttributes();
//this would get you just the two attributes that look custom above
$customAttributes = array(
'latitude' => $category->getLatitude(),
'longitude' =>$category->getLongitude(),
);
希望对您有所帮助!
我们在类别树中添加了一些类别属性
是否可以创建一个 foreach Mage::getModel(custom categories)
来获取自定义类别的所有值?
您应该可以访问这些属性,但您需要先加载类别。现在仅仅获取自定义属性可能有点困难。
$cateogry = Mage::getModel('catalog/category')->load('category here');
//this could get you all attributes
$attributes = $category->getAttributes();
//this would get you just the two attributes that look custom above
$customAttributes = array(
'latitude' => $category->getLatitude(),
'longitude' =>$category->getLongitude(),
);
希望对您有所帮助!