0

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');
?>
8
  • which template do you use for Homepage category list ? Commented Feb 12, 2019 at 12:39
  • Im using Bizkick from Hiddentechies Commented Feb 12, 2019 at 12:40
  • Not theme but path to phtml file Commented Feb 12, 2019 at 12:41
  • app/design/frontend/Hiddentechies/bizkick_child/Magento_Catalog/templates/product/view Commented Feb 12, 2019 at 12:42
  • Can you add source to question? Commented Feb 12, 2019 at 12:43

1 Answer 1

2

Enable Used in Product Listing to Yes and check.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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