Discussions

Navigating Drupal Commerce Products

So I have this Commerce build I am working on, I've worked with Commerce before but never a top to bottom build.

I had to import close to 40,000 products, to which Feeds Importer for Commerce worked like magic. The problem I have now is creating a reasonable way to navigate these products.

What I would Like is a drill down, or tree structure for products. In the products I have imported 3 fields. Product Type (Bolts, Nuts, Washers), Product Category (Stainless Steel Bolts, Welding Nuts) and Product Sub Category (Metric Stainless Steel Bolts, 5 inch Welding Nuts).

So with that, I want to use these fields to create a sort of navigation that works like this.

Lists Product Types - You click One (Bolts), Pulls up all the bolts and the option to click on Product Category (Stainless Steel Bolts), and finally when you click on that it pulls up Stainless steel bolts and you can click on a sub category (Metric Stainless Steel Bolts)

Now there are only about 40 Product Types, so I created a view to navigate through those. But I have no idea how to go about navigating through the 1300 Product Categories and the 8000 Product Subcategories, short of custom creating a view for each an manually linking, which would take eons.

Can anyone point me in the right direction to do this sort of thing. I'd prefer not to do it with Apache Solr, that will come in at a later release of the site.

I REALLY appreciate any help.

Posted: Sep 4, 2014

Comments

joshmiller Josh Miller on September 5, 2014

Gary,

Ah, it sounds like you have an unwieldy catalog and aren't sure how to manage the View that will display the 40,000+ products?

I recommend a simple hierachical taxonomy, assume all products will have one of those designations, and then build a view that shows all the taxonomy terms or the products, if you have drilled in far enough.

So there would be two challenges, both should be relatively easy to handle:

1) How do you put the right taxonomy term on each product?

I would recommend creating a Views Bulk Operations view that brings in products based on matching criteria (probably product type). Then I would create a simple Rules Component that takes a product as an argument and adds a given taxonomy term (this part could be clever and if the VBO doesn't supply the term, it would ask you to supply one, but I think it might do that x 40,000 so its better if you create a component per term).

Finally, add those components as operations for the VBO product view you created, and then let your site bulk update each product with your new "catalog terms."

And that brings us to the second the challenge:

2) How do you create one view that could manage this whole process?

I have created a youtube video that makes this pretty simple (with one vacabulary):

But there is one possibility! What if you already have all the vocabularies and just want a view to manage the hierarchy? Fear not! I have a video that shows you how to treat each vocabulary as a level of hierarchy as well (with a little imagination, this could be done with product types too, kind of):

Sanjay Wadhwa on October 13, 2014

I had a similar issue. Josh Miller's Hierarchical views worked brilliantly. I had 150 categories from a single vocabulary with category images in a grid layout, drilling down until products showed. Then on clicking on the product photo it went to the product administration page. Could not get individual product to show with shopping cart and had no clue how to achieve that. Another issue was could not get the taxonomy menu to synchronise with the hierarchical views. Took everything down and have just installed Kickstart. came to know about display nodes later, still not quite clear to me. Need to import 350 products for now, later the number of products could go upto 4000 (not 40,000, as in above post).
My question is, once I import the products as generic product, would it be possible to change them into different product types (having colour, size attributes)?