I'm trying to figure out how I can separate my products into categories and have them listed much like the way the "article" module displays articles.

I've played with the ecommerce settings, category settings and anything else I can think of, but when I go to my store page, all of my products are displayed on the front page.

Is there a way to group products into categories with the ecommerce module?

Comments

moshe weitzman’s picture

products are just any other kind of node. group the using taxonomy terms and then install a taxo module of your choice to display gthese catagories. try taxonomy_dhtml or taxonomy_context for example.

adamgreenwell’s picture

Wow! The Taxonomy DHTML worked better than anything I had hoped for. I never really thought to use a module in conjuntion with the ecommerce module to do what I wanted. Thanks for the help.

leanazulyoro’s picture

Version: 4.5.x-1.x-dev » 5.x-3.4
Component: product.module » store
Status: Closed (fixed) » Active

That's not a pretty good solution, taxonomy_dhtml (as well as taxonomy_menu) creates a block with the list of terms, but they link to the regular page whre the nodes of the term are displayed, i'd actually like the products displayed with the "products" view provided with the ecommerce module, i've been trying a little snipet to list the terms, but modifying the url the link to.

This is the code:

$vid = 1; // put here the id of the vocabulary
$terms = taxonomy_get_tree($vid);
print "<div class=\"item-list\">";
print "<ul>";
foreach ( $terms as $term ) {
$tcount = taxonomy_term_count_nodes($term->tid);
print "<li>".
l($term->name." (".$tcount.")",'products/'.$term->name, array('title' => $tcount." posts in ".$term->name)).
"</li>";
} /* end foreach */
print "</ul>";
print "</div>";

I'm not a great developer, i actually didn't came up with this code, i just took it and modified it so that the url would look like this: products/[term-name].
NOTE: i also modified the products view, adding an argument "Taxonomy: Term Name"

this way i get a list of al terms that links to the products view passing the term name as an argument. It also includes the count of nodes for each term.

Now, i need some help from a more advanced developer to:
- modify the code so it creates submenu items acording to the vocabulary hierarchy
- modify the counter so it doesn't take in count the subproducs, only the master products

somebody?

brmassa’s picture

Status: Active » Fixed

leandro,

im also the taxonomy menu developer. it now allow you to use views, which is a much better and generic solution.

regards,

massa

leanazulyoro’s picture

Thanks bruno, great work, works perfect.
one more suggestion for furder versions: allow even more flexibility to create the url, so the final result is more seo optimised, i mean, for example, use the term name instead of the id, and i don´t think that the vocabulary id is need, since you choose them from taxonomy menu settings.
maybe, you can use the same but add a "friendly url" field in wich the user can create a custom path with tokens and stuff. anyway, just a suggestion, thanks for everything

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.