Question

I have imported 5.000 to my drupal-commerce website.I want the user to be able to navigate fast on all of these products,so I just figured out that I need to make somehow a filter or a search that when the user chooses/selects some of the features of the product the result will be only the products with these features.How can I manage to do this on Drupal 7 and Drupal Commerce(Commerce kickstart?)

Was it helpful?

Solution

The short answer is that you'll probably want to use the Views module. You can create a Views page display for your main products page that loads the Commerce product displays. Since the product displays don't actually contain the field values that you'd want to filter (they're on the referenced products), you'll need to add a Relationship to the products. That'll let you add filter criteria for product fields (exposing them will make them visible to the user). If you want the exposed filters to appear in a sidebar, use the "Exposed form in block" option on the Views display to create a filter block that you can add to your sidebar region on Administration » Structure » Blocks (/admin/structure/block).

Most people who have used Views over the years are used to outputting the Views result using Fields and then customizing the display of the fields with template files or extensive configuration, etc. However, you can create a custom view mode for your product display content types and give them layout with Display Suite. You can output those custom displays in Views using the Content Format.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top