Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

How Catalog Functionality Works in Drupal Commerce 2.x

Parent Feed: 

Once upon a time, people had to thumb through thick tomes of printed material called “catalogs” to find the products they wanted to buy. If you’re old enough to remember looking through the Sears catalog at Christmas time looking for toys to ask Santa for, you know what I’m talking about. (And if you aren’t old enough to remember that, I don’t want to talk to you.)

While print catalogs have largely gone the way of the dinosaurs, the concept of letting people browse a selection of products has not. That’s where online catalog functionality comes in.

What is catalog functionality on a website?

Basically, it’s a listing of products. You need to display multiple products on a page so people can browse through them and pick the one they want. There can be filters and categories and various other ways of going from thousands of products down to a manageable number that people can actually scan through.

How does Drupal Commerce 2.x handle catalogs?

In Commerce 2.x, everything is just search results that come up, but it appears like a catalog. So if you filter by a specific tag or parameter, it presents like a catalog with nice rows of products. But since it’s really just a search result, you can apply all the filters that you would for a search. You can do a keyword search in a category, for instance. Or you can filter by price, brand, color, or any other parameter you care to use. Think of the kind of shopping experience you get on Amazon (only more specific), and you’ll get what we’re talking about here.

How do you know what’s going to be displayed?

There are lots of different options. You can choose to display everything with the “television” tag, for instance. Results can be displayed alphabetically, or you can have the top sellers display first, or you can have products come first and have accessories listed lower down. You can add manual weightings to products, or you can have weightings based on other tags or even on dynamic data. There’s a lot of adaptability.

How is this different from Commerce 1.x?

In Commerce 1, you could use views and display products that way, which allowed for some filtering, but it was pretty basic. In Commerce 2.x, catalogs are now searches, so they’re cool and flexible, and they can do whatever you want.

To learn more, check out our High Five episode “How Drupal Commerce 2.x handles Catalog Functionality.”

Subscribe to our YouTube Channel for more Drupal Commerce goodness!

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web