Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Manufacturer side box drop down list

Manufacturer side box drop down list

Locked

Views: 3,119

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
15 May 2009, 11:46 AM
#1
wilbo avatar

wilbo

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

15 May 2009, 12:22 PM
#2
wilbo avatar

wilbo

New Zenner

Join Date:
May 2009
Posts:
43
Plugin Contributions:
0

Re: Manufacturer side box drop down list

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:

15 May 2009, 12:26 PM
#3
wilbo avatar

wilbo

New Zenner

Join Date:
May 2009
Posts:
43
Plugin Contributions:
0

Re: Manufacturer side box drop down list

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?

15 May 2009, 12:57 PM
#4
wilbo avatar

wilbo

New Zenner

Join Date:
May 2009
Posts:
43
Plugin Contributions:
0

Re: Manufacturer side box drop down list

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

15 May 2009, 1:00 PM
#5
wilbo avatar

wilbo

New Zenner

Join Date:
May 2009
Posts:
43
Plugin Contributions:
0

Re: Manufacturer side box drop down list

Oh yeah, and I also realised that it already WAS a dropdown box and all I had to change was the size definition. duh!

24 Aug 2009, 6:55 AM
#6
gypsydogg avatar

gypsydogg

New Zenner

Join Date:
Oct 2008
Posts:
9
Plugin Contributions:
0

Re: Manufacturer side box drop down list

Where do you put this code? Is it possible to do the same with any sidebox?

24 Aug 2009, 8:04 AM
#7
ooba_scott avatar

ooba_scott

Zen Follower

Join Date:
Jul 2009
Posts:
218
Plugin Contributions:
0

Re: Manufacturer side box drop down list

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

24 Aug 2009, 8:46 AM
#8
meetwinter avatar

meetwinter

New Zenner

Join Date:
Jun 2008
Posts:
13
Plugin Contributions:
0

Re: Manufacturer side box drop down list

good methods, thanks Ooba_Scott for sharing

29 Apr 2010, 5:08 AM
#9
tomboy avatar

tomboy

New Zenner

Join Date:
Apr 2010
Posts:
1
Plugin Contributions:
0

Re: Manufacturer side box drop down list

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!

17 Jul 2010, 11:51 AM
#10
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Manufacturer side box drop down list

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

20 Jul 2010, 7:15 AM
#11
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Manufacturer side box drop down list

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

10 Sep 2010, 4:55 PM
#12
ssaudio1 avatar

ssaudio1

New Zenner

Join Date:
Jun 2008
Posts:
11
Plugin Contributions:
0

Re: Manufacturer side box drop down list

great thread, helped me alot to figure out how to make a drop down. thanks. :clap: