Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Drop Down Menu


julia

Recommended Posts

Posted

I would like to have a drop down menu where the first value is nothing. For now I have a -, but ideally I would like to have nothing. Is there a bit of code that will do this, or a symbol?

Also, is there someway that If the customer chooses this null value, that the choice doesn't show up in the shopping cart.

This is what I mean. ... We have 55 fabric choices and they are divided up into five different drop downs on the product page grouped by fabric type. I wasn't sure how else to do this.

The problem..whey you go to checkout... All of the option choices show up even though they don't have a value beside them. Its fine for the shop ownner, but looks a little confusing to the customer.

 

You can see what I mean at

http://www.olivialitton.com/osCommerce

 

Thanks ahead for any feedback.

Julie

Posted

steal things like this always somewhere where it has been used ... admin is a good spot, there the manufacturer for example has no value.

 

from admin/categories.php

    $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
   $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
   while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
     $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
                                    'text' => $manufacturers['manufacturers_name']);
   }

 

use the same for your options arrays, product_info.php

find this:

 $products_options_array = array();

replace by this:

$products_options_array  = array(array('id' => '', 'text' => TEXT_NONE));

 

 

define TEXT_NONE as --none-- or whatever in the language file ...

 

and remove from your attributes table the - value

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted
steal things like this always somewhere where it has been used ... admin is a good spot, there the manufacturer for example has no value.

 

from admin/categories.php

 ? ?$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
? ?$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
? ?while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
? ? ?$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => $manufacturers['manufacturers_name']);
? ?}

 

use the same for your options arrays, product_info.php

find this:

     

 $products_options_array = array();

replace by this:

$products_options_array ?= array(array('id' => '', 'text' => TEXT_NONE));

define TEXT_NONE as --none-- or whatever in the language file ...

 

and remove from your attributes table the - value

 

Thanks Monika!

Julie

Posted

There is also the "Must Select" contribution that can put "Please Select" at the top of your drop down list. If the customer does not choose an option it returns an error message asking them to make a choice. You can check it out here on my site.

 

Peter

Posted
There is also the "Must Select" contribution that can put "Please Select" at the top of your drop down list.  If the customer does not choose an option it returns an error message asking them to make a choice.  You can check it out here on my site.

 

Peter

 

I like that Peter, and your site design as well. I may use that for the other options to prevent them from not paying attention and choosing the wrong thing.

Unfortunately I can't use it for the fabrics because four of them will be blank.

Thanks for replying

Julie

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...