20,359
社区成员
发帖
与我相关
我的任务
分享
/**
* Retrieve product attributes
*
* if $groupId is null - retrieve all product attributes
*
* @param int $groupId
* @return array
*/
public function getAttributes($groupId = null, $skipSuper=false)
{
$productAttributes = $this->getTypeInstance(true)->getEditableAttributes($this);
if ($groupId) {
$attributes = array();
foreach ($productAttributes as $attribute) {
if ($attribute->isInGroup($this->getAttributeSetId(), $groupId)) {
$attributes[] = $attribute;
}
}
} else {
$attributes = $productAttributes;
}
return $attributes;
}