我想对可配置产品进行检查,以查看其是否具有特定申博娱乐。不仅限于任何申博娱乐,还包括用于在可配置产品中创建关联产品的全局申博娱乐– a “超级产品申博娱乐”. 所以 here ya go:
1 2 3 4 5 |
$_产品 = $这个->得到Product(); $_申博娱乐 = $_产品->得到TypeInstance(真正)->得到ConfigurableAttributes($_产品); 前言($_申博娱乐 如 $_申博娱乐){ var_dump($_申博娱乐->调试()); } |
的“->debug()” method returns the set of values you can use the 得到 magic method 上. For example:
1 2 3 4 5 6 7 8 9 10 11 |
数组 'product_super_attribute_id' => 串 '263' (长度=3) “ product_id” => 串 '27' (长度=2) 'attribute_id' => 串 '80' (长度=2) '位置' => 串 '0' (长度=1) 'product_attribute(Mage_Catalog_Model_Resource_Eav_Attribute)' => 数组 'attribute_id' => 串 '80' (长度=2) 'entity_type_id' => 串 '4' (长度=1) 'attribute_code' => 串 '颜色' (长度=5) ... |
所以 var_dump($ _ attribute->getAttributeId()); 将返回 串’80’ (length=2)。只需使用“get” with the Capitalized Label, 得到ProductAttribute(), 得到ProductId(), 得到Position(), etc. Enjoy!