View Single Post
  #7  
Old 03-09-2017, 06:42 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Re: Adding product attributes to minicart

I have still not been able to figure out how to list product attributes in the minicart.

I have expanded my experimentation to include this code:

PHP Code:
getAttributeValues:
<
span FOREACH="item.getAttributeValues(),a">
  
Key'{a.getName()}'
  
value'{a.getAttributeValue()}'
  
Key'{a.getActualValue()}' value'{a.getActualName()}'
</span>

getAttributesList:
<
li FOREACH="item.getAttributesList(),a">
  
Key'{a.getName()}'
  
value'{a.getAttributeValue()}'
  
Key'{a.getActualValue()}' value'{a.getActualName()}'
</li>

Values:
<
ul>
  <
li FOREACH="item.getAttributeValues(),val">
    
Key'{val.getActualValue()}' value'{val.getActualName()}'
  
</li>
</
ul>
ValuesIds:
<
ul>
  <
li FOREACH="item.getAttributeValuesIds(),ak,av">
    
Key'{ak}' value'{av}'
  
</li>
</
ul>
{foreach:
item.getAttributeValuesIds(),key,value}
  
These are values from item.getAttributeValuesIds() function. key: {key} and value: {value}
{
end:}
{foreach:
item.getAttributeValuesIds(),value}
  
These are values from item.getAttributeValuesIds() function. value: {value}
{
end:}
{
item.getAttributeValuesIds()}
{
item.getAttributeValuesPlain()}
{
item.getAttributeValuesAsString()}
<
widget class="\XLite\View\Product\AttributeValues" orderItem="{item}" /> 

However, NO attributes are being printed (global, class, or product-specific). I can call things like {item.getName()} and {item.getURL()}, and they return correct values.

Help?
__________________
X-Cart version 5.2
Reply With Quote