2013-02-27 27 views
0

我想列出检查为可用的所有属性以创建可配置产品。 (如刚刚选择后的复选框列表 “创建一个可配置的产品”在magento中获取所有属性的列表以创建新的可配置产品

我想:。

$attributes = Mage::getResourceModel('eav/entity_attribute_set_collection')->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getConfigurableId());` 

但没有收集检索

回答

0

试试这个:

$collection = Mage::getResourceModel('catalog/product_type_configurable_attribute_collection'); 

或者,如果您希望将可配置属性分配给特定产品:

也许

$product = Mage::getSingleton("catalog/product"); 
$attributes = $product->getTypeInstance(true)->getSetAttributes($product); 
foreach ($attributes as $attribute) { 
    if (($attribute->getIsConfigurable()) && ($attribute->getIsVisible()) && ($attribute->usesSource()) && ($attribute->getIsGlobal() == Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL)){ 
    ... do some things ... 
    } 
} 

没有列出这些属性的最佳方式:

+0

谢谢我会试试 – 2013-03-05 14:43:02

0

我想这一点,和它的作品!

相关问题