Skip to content

Conversation

@randomecho
Copy link

In cases where the store may want or need to show multiple options in a SELECT form input item, this will allow an array of default values to be passed and pre-selected.

Example:

$comic_publishers[] = array("id" => 'marvel', "text" => 'Marvel');
$comic_publishers[] = array("id" => 'dc', "text" => 'DC');
$comic_publishers[] = array("id" => 'darkhorse', "text" => 'Dark Horse');
$comic_publishers[] = array("id" => 'image', "text" => 'Image Comics');
$comic_publishers[] = array("id" => 'idw', "text" => 'IDW');

$fave_publishers = array('marvel', 'darkhorse', 'image');

echo tep_draw_pull_down_menu('house_of_comics', $comic_publishers, $fave_publishers, 'size="5" multiple');

The above will show a SELECT input field of multiple options, five items showing before scrolling, where "Marvel", "Dark Horse" and "Image Comics" will be already selected.

@randomecho
Copy link
Author

@haradlpdl Do you have any feedback or notes on this?

haraldpdl added a commit that referenced this pull request Aug 7, 2014
Change while loop with foreach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant