Skip to main content
Bumped by Community user
Bumped by Community user
make edit visible
Source Link
Manashvi Birla
  • 8.9k
  • 9
  • 28
  • 53

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


UPDATEUPDATE:

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.

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.

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.

added 331 characters in body
Source Link
marc
  • 11
  • 1
  • 4

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.

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

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.

added 7 characters in body; edited tags
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

I'm trying to show all available sizes for one product on list.phtmllist.phtml

I've set up a custom attribute "size_age"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

Fatal error: Call to a member function getResource() on null

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

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

added 4 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239
Loading
Source Link
marc
  • 11
  • 1
  • 4
Loading