Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Product Attributes in Basket
 
JonB_78
Jr. Member
 
Total Posts:  7
Joined:  2008-10-06
 

I need to display the product attributes of the items in the user’s basket, along with their values.

In
app/design/frontend/default/<TEMPLATE>/template/catalog/product/view/type/grouped.html

I can successfully get the product attributes’ names and values:

$attributes = $_gitem->getAttributes();
foreach ( $attributes as $key => $attribute )
{
if ( $attribute->getIsUserDefined() )
{
$use_attributes[$attribute->getAttributeCode()] = $attribute->getFrontend()->getValue($_gitem);
}
}

However in:
app/design/frontend/default/<TEMPLATE>/template/checkout/cart/item/default.phtml

I can get the attribute label and code but it just won’t give me the value:

$_item = $this->getItem();
$product = $_item->getProduct();
$attributes = $product->getAttributes();

Can anyone tell me if they can get the values in the basket?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JonB_78
Jr. Member
 
Total Posts:  7
Joined:  2008-10-06
 

If anyone stumbles apon this post, I have sorted the problem out by directly querying the database.  This is a bit of a hack, but I am pulling my hair out about this problem!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top