I'm trying to show all available sizes for one product on list.phtml
I've set up a custom attribute size_age
(id:142) but when I try use the code
$attributeLabel = $customer->getResource() ->getAttribute('size_age') ->getFrontend() ->getAttribute() ->getFrontendLabel();
I get this error:
Fatal error: Call to a member function getResource() on null
UPDATE:
thank you for your answers. I changed the code to:
$attributeLabel = $_product->getResource() ->getAttribute('size_age') ->getFrontend() ->getAttribute() ->getFrontendLabel();
I dont have any error right now.
But I dont get any output. I'm trying to echo all available sizes for the product.
$customer
variable ? Shouldn't it be a$product
variable ?$_product
, NOT$customer