New Zenner
- Join Date:
- May 2009
- Posts:
- 43
- Plugin Contributions:
- 0
Manufacturer side box drop down list
Hi there,
I want to change the form element in the manufacturers sidebox to a drop down list. How is this done?
Thanks for your time
Views: 3,119
New Zenner
Hi there,
I want to change the form element in the manufacturers sidebox to a drop down list. How is this done?
Thanks for your time
New Zenner
ok, I did using the following code. It seems to work but can anyone tell me if there are any errors, or things I need to add?
$content = "";
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
$content .= zen_draw_form('manufacturers_form', zen_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get');
$content .= zen_draw_pull_down_menu('manufacturers_id', $manufacturer_sidebox_array, (isset($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : ''), 'onchange="this.form.submit();"') . zen_hide_session_id();
$content .= '</form>';
$content .= '</div>';
Thanks for your time:smile:
New Zenner
I found a problem.
The drop down box starts off by saying Please Select which is fine.
When you select a manufacturer, it redirects to that page and says Please Select again. EXCEPT when you select the last name in the list and then it displays that name even after re-directing and if you select again, there is another option that says --Reset--
Could someone explain to me what's happening?
New Zenner
After a bit of checking I found that this isn't a probelm with the dropdown box code but rather a problem with the manufacturers sidebar in general.
When I select the --RESET-- option it takes me back to a messed-up version of my home page.
Obviously this isn't what I need!
How have other people fixed this bug?
Thanks
New Zenner
Oh yeah, and I also realised that it already WAS a dropdown box and all I had to change was the size definition. duh!
New Zenner
Where do you put this code? Is it possible to do the same with any sidebox?
Zen Follower
Best way to change teh manufactures list into a dropdown list is to do it in the Admin....no need to add in extra code!
Go to Admin panel - Configuration - Maximum values.
Then find Manufacturers List - Scroll Box Size/Style (about 7 down) If you set this to a 1 or a 0 then it will be a dropdown box
New Zenner
good methods, thanks Ooba_Scott for sharing
New Zenner
Wilbo:
After a bit of checking I found that this isn't a probelm with the dropdown box code but rather a problem with the manufacturers sidebar in general.
When I select the --RESET-- option it takes me back to a messed-up version of my home page.
Obviously this isn't what I need!
How have other people fixed this bug?Thanks
Did you ever figure out how to fix the problem of the -RESET- link taking you to a version of your home page with the wrong stylesheet? I can't seem to find a solution to this problem.
Thanks!
Totally Zenned
I have the same problem.
The Reset selection passes a url with a missing id:
for example
http://...../index.php?main_page=index&manufacturers_id=
instead of
http://...../index.php?main_page=index&manufacturers_id=1
The "missing id" is (not) defined in the "else" in
\includes\modules\sideboxes\YOUR_TEMPLATE\manufacturers.php
// Display a list
$manufacturer_sidebox_array = array();
if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '' ) {
$manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
} else {
$manufacturer_sidebox_array[] = array('id' => [B]''[/B], 'text' => PULL_DOWN_MANUFACTURERS);
}
However I don't think this is a bug but a template issue.
I have three templates and it is only in the extensively-modified (by others) one that things go wrong.
So anyone with this problem (page with broken layout) has to find their own solution.
regards
Steve
Totally Zenned
As is usually the case I have changed my mind, and have reported this as a bug:
http://www.zen-cart.com/forum/showthread.php?t=159774
regards
Steve
New Zenner
great thread, helped me alot to figure out how to make a drop down. thanks. :clap:
Tell staff why this post should be reviewed.