Als een product een boolean attribuut heeft, is dit attribuut niet zichtbaar op de productpagina.

We hebben niet de beste oplossing, maar voorlopig werkt het in een van onze Magento 2.07-projecten. We hebben een functie herschreven in: vendor\magento\module-catalog\Block\Product\View\Attributes.php naar


 
 public function getAdditionalData(array $excludeAttr = ['media_gallery'])
    {
        $data = [];
          $product = $this->getProduct();
        $attributes = $product->getAttributes();

        foreach ($attributes as $attribute) {
    
     
            if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
                $value =  str_replace('"',"",json_encode($attribute->getFrontend()->getValue($product)));//$attribute->getFrontend()->getValue($product);
                if ($value == '' or $value == 'null'){
                    $value = -1;
                    
                }

                    
            
                if (!$product->hasData($attribute->getAttributeCode())) {
                    $value = __('N/A');
                } elseif ((string)$value == '') {
                    $value = __('No');
                } elseif ($attribute->getFrontendInput() == 'price' && is_string($value)) {
                    $value = $this->priceCurrency->convertAndFormat($value);
                }

                if (is_string($value) && strlen($value)) {
                    $data[$attribute->getAttributeCode()] = [
                        'label' => __($attribute->getStoreLabel()),
                        'value' => $value,
                        'code' => $attribute->getAttributeCode(),
                    ];
                }
            }
        }
   
        return $data;
    }
}