/** * {@inheritdoc} */ public function getFrontendInput() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getFrontendInput'); if (!$pluginInfo) { return parent::getFrontendInput(); } else { return $this->___callPlugins('getFrontendInput', func_get_args(), $pluginInfo); } }
/** * Retrieve Product Attribute Value * * @param Product $product * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute * @return \Magento\Framework\Phrase|string */ public function getProductAttributeValue($product, $attribute) { if (!$product->hasData($attribute->getAttributeCode())) { return __('N/A'); } if ($attribute->getSourceModel() || in_array($attribute->getFrontendInput(), ['select', 'boolean', 'multiselect'])) { //$value = $attribute->getSource()->getOptionText($product->getData($attribute->getAttributeCode())); $value = $attribute->getFrontend()->getValue($product); } else { $value = $product->getData($attribute->getAttributeCode()); } return (string) $value == '' ? __('No') : $value; }
/** * Retrieve label of attribute scope * * GLOBAL | WEBSITE | STORE * * @param EavAttribute $attribute * @return string */ public function getScopeLabel(EavAttribute $attribute) { $html = ''; if (!$attribute || $this->storeManager->isSingleStoreMode() || $attribute->getFrontendInput() === AttributeInterface::FRONTEND_INPUT) { return $html; } if ($attribute->isScopeGlobal()) { $html .= __('[GLOBAL]'); } elseif ($attribute->isScopeWebsite()) { $html .= __('[WEBSITE]'); } elseif ($attribute->isScopeStore()) { $html .= __('[STORE VIEW]'); } return $html; }