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:

echo $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getMunit(), 'munit');
  • which template do you use for Homepage category list ? – Serhii Havrylchuk Feb 12 '19 at 12:39
  • Im using Bizkick from Hiddentechies – Fast Source Feb 12 '19 at 12:40
  • Not theme but path to phtml file – Serhii Havrylchuk Feb 12 '19 at 12:41
  • app/design/frontend/Hiddentechies/bizkick_child/Magento_Catalog/templates/product/view – Fast Source Feb 12 '19 at 12:42
  • Can you add source to question? – Serhii Havrylchuk Feb 12 '19 at 12:43

Enable Used in Product Listing to Yes and check.

  • I have added this but still not working – Fast Source Feb 12 '19 at 13:24
  • Can you tell me how you are rendering listing in homepage? – Satish Dubariya Feb 12 '19 at 13:30
  • My homepage contains block which has catalog product listings + Product grid template – Fast Source Feb 12 '19 at 13:59
  • are you using widget for that? have you checked either your custom attribute is present in collection data or not? – Satish Dubariya Feb 13 '19 at 4:27
  • Yes I'm using Widget. Please elaborate how I can check custom attribute in collection data? – Fast Source Feb 13 '19 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.