0

I have created is_freeshipping attribute it's a boolean (Yes/No), and it's showing while product editing in Admin Panel.

And I am getting its value successfully on the Product page, But Category page returning false (No) even though it is true(Yes).

I tried to get this value by below code.

<?php $isFreeShipping = $_product->getResource()->getAttribute('is_freeshipping')->getFrontend()->getValue($_product); ?>

Is it the correct procedure? Please suggest me how to get the value of a custom attribute in Category Page?

asked Jan 24, 2017 at 10:14

1 Answer 1

4

Please cross check your attribute is_freeshipping have the flag Use in product listing set to Yes. After setting the flag you need to do reindex product flat index if Flat catalog is enabled.

enter image description here

answered Jan 24, 2017 at 10:22
4
  • checking........ Commented Jan 24, 2017 at 10:31
  • Thank you. now working. is it mandatory? for showing category page? Commented Jan 24, 2017 at 10:34
  • 1
    Yes, is it required If you want to get attribute value in product listing page @magentotwo Commented Jan 24, 2017 at 10:36
  • Can't believe it was something this simple. Nice and easy answer! Commented Sep 24, 2020 at 13:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.