So am trying to learn and do somethings for myself and working on an addon for my shop. I want to know how I can do a dropdown with options 1,2,3 in it. I copied an example of store code with a dropdown but don't know how to add the options I want in it.
//$contents[] = ['text' => TEXT_INFO_OPTIONS . '<br>' . tep_draw_pull_down_menu('user_options', (1, 2, 3))];
I have a dropdown but no options in it. Please I need help with this.
Dropdown box help
-
- VIP Member
- Posts: 2025
- Joined: Mon Oct 07, 2019 4:39 am
- : Buy Me A Beverage
- Has thanked: 28 times
- Been thanked: 187 times
Re: Dropdown box help
You don't say what store code you are using but maybe look at the Navbar Account module to see how it is done
https://github.com/CE-PhoenixCart/Phoen ... ccount.php
Re: Dropdown box help
Am not sure about this link, I only wanted to populate numbers 1, 2, 3 as options in my dropdown. The link you passed me only gives dropdown for links and doesn't look like format of my example. Thanks you
-
- VIP Member
- Posts: 2025
- Joined: Mon Oct 07, 2019 4:39 am
- : Buy Me A Beverage
- Has thanked: 28 times
- Been thanked: 187 times
Re: Dropdown box help
https://github.com/CE-PhoenixCart/Phoen ... t.php#L147
shows the code that function is expecting so maybe the values should be a string.
-
- VIP Member
- Posts: 578
- Joined: Fri Oct 25, 2019 7:01 pm
- Has thanked: 9 times
- Been thanked: 49 times
Re: Dropdown box help
Depending on what you want the options to be, could you just use a text link to a language define or constant. Not a coder by the way. If options 1,2,3 are always going to be the same this may be one way of doing it.maryjane wrote: ↑Wed Apr 13, 2022 5:49 am So am trying to learn and do somethings for myself and working on an addon for my shop. I want to know how I can do a dropdown with options 1,2,3 in it. I copied an example of store code with a dropdown but don't know how to add the options I want in it.
//$contents[] = ['text' => TEXT_INFO_OPTIONS . '<br>' . tep_draw_pull_down_menu('user_options', (1, 2, 3))];
I have a dropdown but no options in it. Please I need help with this.
-
- Lead Developer
- Posts: 2439
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 51 times
- Been thanked: 138 times
Re: Dropdown box help
The list of selections needs to be a multi-dimensional array in the format ID and TEXT, eg;
Will create the following output:
Code: Select all
tep_draw_pull_down_menu('user_options', [
['id' => 1, 'text' => 'one'],
['id' => 2, 'text' => 'two']
]);
Code: Select all
<select name="user_options" class="form-control">
<option value="1">one</option>
<option value="2">two</option>
</select>
Gamechanger Addon: Queued Emails, try before you buy.