質問

I am using Magento 2.2 for my store. I have created a custom attribute. I have modified list.phtml and catalog_product_view.xml and I have created a myatrribute.phtml. I have also enabled visible in storefront to yes for the attribute.

I have done re-indexing and flushed the cache.

My attribute is showing in product view and category view. The attribute is not showing in the Homepage category list.

Any idea how I can enable the attribute in homepage category list.

My custom attribute phtml file:

<?php
echo $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getMunit(), 'munit');
?>
役に立ちましたか?

解決

Enable Used in Product Listing to Yes and check.

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top