Multiple Options Attribute
PermalinkJust curious if anyone else has figured this out yet or ran into this problem. I have a custom attribute that will allow multiple options to be chosen. When I do this:
$event_levels = $ep->getAttribute('pb_levels');
And just echo it out, it merges all the chosen attributes together. I noticed it's not in an array. I tried doing a search for a \n, but found none. Any one else know how it's put together? It can't just be in the DB as "option1 option2". Or is it? I couldn't find it.
Thanks!

If not... I know for sure that there are other methods within the attribute controller that can provide a more structured format, but I don't have any example code handy right now.
James
Hmmm. I tried to do a search and it wasn't seeing the new line. Here's my code:
$event_levels = $ep->getAttribute('pb_levels'); $event_levels = str_replace('\n', ', ', $event_levels); echo "<br/>For: ".$event_levels."<br/>";
The end result is no comma and just a space between them.
Your code won't work, even if there is a new line. Replace '\n' with"\n".
James
Thanks for the tip!
James