Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Thanks in advance for any help!
I am trying to display some ubercart product attributes
I put this code in the "OUTPUT CODE:" field:
<?php
$str = $row->attributes;
$arr = unserialize($str);
print_r($arr[attributes]['attribute_label'][0]);
?>
This works perfectly if the value is coming from a text field, but it's not working if the value is from a select list.
If I use this code:
<?php
$str = $row->attributes;
$arr = unserialize($str);
print_r($arr[attributes]['attribute_label']);
?>
The output looks like this:
Array ( [11] => Select List Item )
Which makes me believe I am close.
Any ideas for how to display just the Select List Item?
Thanks!
Comments
Comment #1
mgladding CreditAttribution: mgladding commentedFixed a typo in the title.