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
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
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?
Thanks for your timeCode:$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>';
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?
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
Oh yeah, and I also realised that it already WAS a dropdown box and all I had to change was the size definition. duh!
Where do you put this code? Is it possible to do the same with any sidebox?
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
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
However I don't think this is a bug but a template issue.Code:// 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' => '', 'text' => PULL_DOWN_MANUFACTURERS); }
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
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
Bookmarks