Skip to main content
Tweeted twitter.com/StackMagento/status/1114271701993390082
added 3 characters in body; edited title
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

Product attributes on wishlsitwishlist

I'm trying to display a couple of product attributes on the wishlist page.
However, when I call $product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under
Store -> Attributes -> Product -> binding -> Storefront Properties and "Used in Product Listing" is set to "Yes"

I also toggled "Visible on Catalog Pages on Storefront" with no change.

What am I missing?

Product attributes on wishlsit

I'm trying to display a couple product attributes on the wishlist page.
However, when I call $product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under
Store -> Attributes -> Product -> binding -> Storefront Properties and "Used in Product Listing" is set to "Yes"

I also toggled "Visible on Catalog Pages on Storefront" with no change.

What am I missing?

Product attributes on wishlist

I'm trying to display a couple of product attributes on the wishlist page.
However, when I call $product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under
Store -> Attributes -> Product -> binding -> Storefront Properties and "Used in Product Listing" is set to "Yes"

I also toggled "Visible on Catalog Pages on Storefront" with no change.

What am I missing?

I'm trying to display a couple product attributes on the wishlist page. 
However, when I call $product->getData('attribute_code')$product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

app/code/vendor/extension/etc/catalog_attributes.xml

app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under 
Store -> Attributes -> Product -> binding -> Storefront PropertiesStore -> Attributes -> Product -> binding -> Storefront Properties and "Used in Product Listing""Used in Product Listing" is set to "Yes""Yes"

I also toggled "Visible on Catalog Pages on Storefront""Visible on Catalog Pages on Storefront" with no change.

What am I missing?

I'm trying to display a couple product attributes on the wishlist page. However when I call $product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under Store -> Attributes -> Product -> binding -> Storefront Properties and "Used in Product Listing" is set to "Yes"

I also toggled "Visible on Catalog Pages on Storefront" with no change.

What am I missing?

I'm trying to display a couple product attributes on the wishlist page. 
However, when I call $product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under 
Store -> Attributes -> Product -> binding -> Storefront Properties and "Used in Product Listing" is set to "Yes"

I also toggled "Visible on Catalog Pages on Storefront" with no change.

What am I missing?

Source Link
Tim
  • 51
  • 4

Product attributes on wishlsit

I'm trying to display a couple product attributes on the wishlist page. However when I call $product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under Store -> Attributes -> Product -> binding -> Storefront Properties and "Used in Product Listing" is set to "Yes"

I also toggled "Visible on Catalog Pages on Storefront" with no change.

What am I missing?