its very Urgent
I have an attribute called 'show_product' (in the backend of Magento) with two outcomes 'yes' or 'no'. At the moment I'm just echoing the product name on the frontend. However, ideally I'd like to show all product name the attribute value. For example, if 'yes' then show all product, if 'no' then No product.
Can anyone please help me.
I tried some this
$objectManager = \Magento\Framework\App\objectManager::getInstance();
$product = $objectManager->create('Magento\Catalog\Model\Product')->load($singleproductdata['entity_id']);
$attributes = $product->getAttributes('show_product');
foreach ($attributes as $attribute) {
echo $attribute->getAttributeCode();
echo $attribute->getFrontend()->getValue($product);
}