/**
  * {@inheritdoc}
  */
 public function getAttributeText($attributeCode)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getAttributeText');
     if (!$pluginInfo) {
         return parent::getAttributeText($attributeCode);
     } else {
         return $this->___callPlugins('getAttributeText', func_get_args(), $pluginInfo);
     }
 }
 public function testGetAttributeText()
 {
     $this->assertNull($this->_model->getAttributeText('status'));
     $this->_model->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
     $this->assertEquals('Enabled', $this->_model->getAttributeText('status'));
 }
Example #3
0
 /**
  * Retrieve configurable settings
  *
  * @param Product $product
  * @return array
  */
 public function getConfigurableSettings($product)
 {
     $data = array();
     $attributes = $this->_configurableType->getUsedProductAttributes($this->getProduct());
     foreach ($attributes as $attribute) {
         $data[] = array('attribute_id' => $attribute->getId(), 'label' => $product->getAttributeText($attribute->getAttributeCode()), 'value_index' => $product->getData($attribute->getAttributeCode()));
     }
     return $data;
 }