Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
The problem is I get NULL for each product and I can not display the value of the attribute.
Source Link

I have this attribute

pic1 enter image description here

CODE PHP:

  $attributeCode = 'product_text';

                if ($_product->getData($attributeCode) !== null){
                    echo $_product->getAttributeText($attributeCode);
                }else{
                    echo 'Is NULL';
                }

The problem is I get NULL for each product and I can not display the value of the attribute.

What is wrong?

Thanks in advanceenter image description here

I have this attribute

pic1

CODE PHP:

  $attributeCode = 'product_text';

                if ($_product->getData($attributeCode) !== null){
                    echo $_product->getAttributeText($attributeCode);
                }else{
                    echo 'Is NULL';
                }

The problem is I get NULL for each product and I can not display the value of the attribute.

What is wrong?

Thanks in advanceenter image description here

I have this attribute enter image description here

CODE PHP:

  $attributeCode = 'product_text';

                if ($_product->getData($attributeCode) !== null){
                    echo $_product->getAttributeText($attributeCode);
                }else{
                    echo 'Is NULL';
                }

The problem is I get NULL for each product and I can not display the value of the attribute.

What is wrong?

Thanks in advanceenter image description here

Source Link
Cristi
  • 143
  • 1
  • 6

How can I display the value of an attribute in list.phtml?

I have this attribute

pic1

CODE PHP:

  $attributeCode = 'product_text';

                if ($_product->getData($attributeCode) !== null){
                    echo $_product->getAttributeText($attributeCode);
                }else{
                    echo 'Is NULL';
                }

The problem is I get NULL for each product and I can not display the value of the attribute.

What is wrong?

Thanks in advanceenter image description here