5 replies [Last post]
jasonabc's picture
Offline
Uber Donor
Joined: 05/05/2008
Juice: 573

hi all - sorry if this seems like a stupid question but I've searched high and low but can't find the answer! I have a "gift options" vocabulary set up on my store with terms:

Under $20
$21 - $50
$51 - $100
Over $100
Gifts For Him
Gifts For Her

Is there anyway I can get these terms to display in a dropdown/select box instead of all written out to the page?

thanks!

Jason

jasonabc's picture
Offline
Uber Donor
Joined: 05/05/2008
Juice: 573
Re: taxonomy dropdown/select box

anyone??

Lonnie's picture
Offline
Joined: 07/09/2009
Juice: 13
jason's query

Hi Jasonabc, I was browsing the taxonomy questions and happened upon you question and lack of an answer. Did you ever get an answer or did you just figure things our on your own? I am new to ubercart and trying to figure it out.

jasonabc's picture
Offline
Uber Donor
Joined: 05/05/2008
Juice: 573
Hi Lonnie, Yeah I did muddle

Hi Lonnie,

Yeah I did muddle upon the answer although it was a lot of searching to find something so basic. You have to add taxonomy as a filter in Views and then expose it. That will give you a selection type to choose from and "dropdown" is one of them.

cheers

Jason

jnk63's picture
Offline
Joined: 07/08/2011
Juice: 6
Clarification

As this is the top hit for this issue in a Google search, and it was something I stumbled over consistently, I wanted to point folks in a direction that worked for me using Views.

I too muddled around until I found the Views Module. My dropdown box was for various media of art:

Watercolor
Oil Painting
Sculpture
Wood Carvings

To make the dropdown work, I went to Taxonomy > Catalog and added "Watercolor," "Oil Painting," etc. as terms. Then, when adding or editing products, I'd click one of these for each product.

After installing the Views Module, I then created a Filter for "Taxonomy: Term ID." That's where you have the option to use a Dropdown box. Update and Expose ("expose" means that people who visit the site can use the filter, that it's not hidden from them). A box that says "Select terms from vocabulary Catalog" is available. Select all that you want to be in your dropdownbox (for me it was "watercolor," "oil paintings," "sculpture," and "wood carvings"). Choose "is one of" as the operator. Tick on "Reduce duplicates" and leave "Unlock operator" unchecked. Give a label for your dropdownbox, and make sure that "Optional," "Force Single" and "Limit list to selected items" are checked.

Then create another filter: "Node: is a product." Select "True." This will make sure that the things will only be displayed if they are products. Don't expose if it gives the option.

Final filter: "Node: Published" then set to "Yes." This will make sure that only things that you have published are visible. If you don't make this filter, then unpublished products could be shown! Don't expose if given the option.

To get the display to come back the way you want it, create a new Field. Fields I used were:
"Node: Title"
"Content: Image" with "product_list image linked to node" as the way in which the image is presented (it is selectable from a dropdown box).
"Product: Sell price"
"Product: Buy it now button"

Finally, in basic settings, under "Style" set it to "Table" and then hit the configuration button to tweak how you want the table to look. Use the ^v arrows on "Fields" to arrange the columns.

As a Page or Block (whichever you prefer), Add Display. I chose Page. You then create a path (url) for your page, add it to a link menu (like Primary Links) and you're set. If you choose Block, I think you'll need to enable that block on an existing page through the Blocks module, but I didn't try Block display, so I'm not sure.

That's it! I now have a page in my primary links that shows my products with a dropdown box for Art Medium. I select one of the options from the dropdown, click apply, and it returns only those Products that are identified by that Catalog term!

I hope this helps someone. I'm posting in the spirit of "give as much help as you get." This definitely isn't an all-encompassing tutorial, but a bit of a basic introduction to the idea. Play around with it, and see the "Products" View for ideas. I only got Drupal 13 days ago, so I'm learning, but something like this would have helped--so here it is! Smiling

For a big-picture conceptualization of Views, I think of it like this: Filters are what you filter content with, and Fields are what aspects of information are displayed. Style determines how that display occurs. Page/Block determines where on your site that occurs.

And honestly, I have no idea about Arguments and Relationships, and this isn't the only place I'd say that.

Good luck!

jasonabc's picture
Offline
Uber Donor
Joined: 05/05/2008
Juice: 573
Re: Clarification

I actually found you can easily/quickly accomplish this by using the Jump module;

http://drupal.org/project/jump

cheers

Jason