Active
Project:
Views PHP
Version:
7.x-1.x-dev
Component:
Field Handler
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2013 at 23:58 UTC
Updated:
9 Feb 2013 at 00:00 UTC
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 commentedFixed a typo in the title.