【发布时间】:2016-03-29 23:35:51
【问题描述】:
我正在尝试检索下拉属性列表并检查该值是否存在(如果存在,我需要获取该值并将其分配给产品),如果不存在,我将不得不创建它并获取其值将其分配给产品。
$attribute = $this->objectManager->create('Magento\Eav\Model\Entity\Attribute');
$attributeId = $attribute->getIdByCode('catalog_product','manufacturer');
$model = $this->objectManager->create('Magento\Catalog\Model\ResourceModel\Eav\Attribute');
$model->load($attributeId);
print_r($model->getFrontendLabel());
【问题讨论】:
-
你能发布一些代码吗?
-
是的,请立即查看
标签: php magento-2.0