UTS 10-2505
NETZTEIL Trafo
pri. 220 V
sek. 18 V DC 10 VA (10W)
100 x 50 x 60 mm
Zustand: Gebraucht
Unsere Artikelnummer: S9/134
namespace Local\Produkt_Zustand_Module\Block\Product\Attribute; use Magento\Framework\View\Element\Template; use Magento\Catalog\Model\Product; use Magento\Framework\Registry; class Zustand extends Template { protected $_registry; public function __construct( Template\Context $context, Registry $registry, array $data = [] ) { $this->_registry = $registry; parent::__construct($context, $data); } public function getZustand() { // Fetch the current product from the registry $product = $this->_registry->registry('product'); if ($product) { $atCode = $this->getData('at_code'); // Get the attribute code from layout $atCall = $this->getData('at_call'); // Get the method name (getAttributeText) if ($atCall && method_exists($product, $atCall)) { // Call the method on the product and return the value $zustandValue = $product->$atCall($atCode); return $zustandValue; } } return ''; // Return empty if no value found } }
UTS 10-2505
NETZTEIL Trafo
pri. 220 V
sek. 18 V DC 10 VA (10W)
100 x 50 x 60 mm
Zustand: Gebraucht
Unsere Artikelnummer: S9/134