Collapsible menu for product options.

Posts: 6
Joined: 03/04/2008

Hi,

For products that has many options but not necessary present to user at all time, a collapsible menu just like the Shopping cart in the block menu would save space and enhance the site's appearance. What you guys think?

Peace.

Sam

Posts: 3744
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

You can do this w/ hook_form_alter() in a custom module, but in general I think it's bad practice. Usability tests have found customers will always expand fieldsets anyways, and you're hiding information they will want to see at a glance.

Posts: 6
Joined: 03/04/2008

Ryan, I am fairly new to Drupal and Ubercart, and don't have any programming backgrounds, just know some html and css Smiling

Agree, for most sites, user would like to see the options available at glance, but i am building a restaurant site which would allow users to order online, and for the menu section (product page) I would like to resemble it as close as to a restaurant menu style.

http://web-graphics.com/mtarchive/001622.php <--- here's an example

In almost all of the items in menu have options, such as size, choice of meat, custom request, ect.. so having the options presented to users at all time would probably take up too much space?

Posts: 3744
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I see what you mean. I'm not really sure how to make this all work to be styled like that, honestly. For sure, one way to shorten the page is to turn the attributes section into a fieldset, but that's going to require some PHP. You could always come up w/ a different way to handle the menu items, but I don't have any ideas on hand.

Restaurants using Ubercart was one of the last things I would've expected, but it comes up quite often. Some day we'll have to get one of you guys to write a tutorial on your implementation. Sticking out tongue

Posts: 33
Joined: 01/30/2008

I'm using ubercart for a restaurant.

I have two needs:

- A menu: a form with different sections(main course, desert) and 2 checkboxes for each dish (normal, small).
I'm using a custom form that build itself dynamically. Each section is a taxonomy term. The form populates all the dishes in that section.
We can make it more generalized by adding sections - fields with Ajax. Each field will get one or more taxonomy terms and will present all the products for this section. We can take this a step further and display the cart block beside the form and populate it by AJAX.
The module will populate all the products and checkboxes for their attributes:

Section_name product_name Big Small
----------------------------------------
Section1
product1 (checkbox) (checkbox)
product2 (checkbox) (checkbox)
Section2
product3 (checkbox) (checkbox)

SUBMIT

- Dynamic product kit. The user can buy products separately or as part of a meal and get a discount. I'm presenting the same form as in the previous section only this time in each section there are radio buttons instead of checkboxes. When the user submits the form I'm creating a product kit with the selected products and add the appropriate attributes and discount and add it to the cart.

Section1
product_option1 (radio_button)
product_option2 (radio_button)
Section2
product_option3 (radio_button)
product_option4 (radio_button)

ADD_TO_CART

I'll be happy to share it but I need your help to make it more stable.
Is there a way to make a virtual product kit with all the functionality instead of creating another product kit for each meal?

What do you think?

Posts: 3744
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

@dolittle: I'm not sure about making a virtual product kit like this. The closest thing I can imagine is adding attributes/options to a "meal" product.

Also, I'm going to open a "Focus Group" forum for "Restaurants." If it's ok with you guys, I'd like to move this thread in there so we can direct other folks with similar needs to meet in the same forum.

Posts: 33
Joined: 01/30/2008

A "Focus Group" will be great!
Will it be a section in the forum?

The reason I want to create a virtual product kit is because I want to sell the products as a part of a product kit and as separate products.

I can't ask the store manager to enter each product twice or more as an attribute option and as a separate product. In addition, he needs to know how many units of desert to prepare regardless if it's sold as a part of meal or separately.

Having a virtual product kit combined with the webform module and taxonomies terms will let us build "sales" forms and sophisticated product kits with options.

It'll be useful for a computer store and many more as well.

The webform module http://drupal.org/project/webform let you build forms as node and to define custom php code for validation and processing.
We could post some php snippest in ubercart website that will go through the form and add the products to the cart.

Posts: 3744
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Ok, separate forum created. Can I maybe get you to post your topic in a separate thread so we don't lose the original focus of this one? It could be titled something like, "Dynamic product kits for building meals?" Maybe we can get Lyle to weight in on it.