Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Case Study: Super Duper Chefs

Video loading...

  • 0:08
    Using Drupal: Product Review Case Study: Super Duper Chefs
  • 0:10
    with Addison Berry
  • 0:19
    On the web today there's so much information, and so
  • 0:22
    many products that people are often looking for things out there
  • 0:26
    to help them to rank them and rate them,
  • 0:27
    and determine how they should proceed.
  • 0:30
    So should I buy this widget?
  • 0:31
    Should I watch that movie?
  • 0:33
    In this series, we're going to create a product review site that
  • 0:37
    will allow us to not only have opinions in the form of a review,
  • 0:41
    but will also have rating on there so that those reviews can be
  • 0:44
    ranked, and the products that they represent
  • 0:47
    can be ranked for people to determine,
  • 0:49
    should they buy this kitchen widget?
  • 0:52
    So in this lesson we're going to be taking a look at our Super Duper
  • 0:55
    Chefs case study, and look at what are the requirements
  • 0:59
    that we need to build for this website.
  • 1:01
    And then we'll talk about our implementation plan,
  • 1:03
    and how we plan to tackle those requirements, and get the job done.
  • 1:08
    So let's build a product review site,
  • 1:10
    and look how ratings work in Drupal.
  • 1:14
    So Bob and Sarah are co-workers and food lovers,
  • 1:17
    and they've built a collection of kitchen gadgets, and pots and pans,
  • 1:22
    and things like that, and all of their cooking.
  • 1:25
    And they often turn to their friends for advice
  • 1:28
    when purchasing new gear, because that can get kind of expensive.
  • 1:31
    And so they've decided to actually set up a website
  • 1:33
    called Super Duper Chefs, which is where they and their friends
  • 1:37
    can write recommendations about the cooking equipment they use,
  • 1:41
    sharing tips and that kind of thing, and just
  • 1:43
    sharing their experience and knowledge.
  • 1:46
    So after talking things over with their friends,
  • 1:48
    they think they have a pretty good handle on what
  • 1:51
    the basics of the site should offer for them.
  • 1:54
    So the most important feature is that the kitchen products reviewed
  • 1:58
    by the site's official contributors should have their own ratings
  • 2:02
    and summaries, with their best and worst features.
  • 2:05
    Each review should also provide up to date
  • 2:08
    pricing information for the product.
  • 2:11
    In addition to the official reviews, visitors to the site
  • 2:14
    should also be able to offer their opinions on the products,
  • 2:17
    compare those ratings, and stuff like that,
  • 2:19
    and leave their own rating.
  • 2:21
    And then the last big piece that they need to have on the site
  • 2:24
    is that everyone who uses the site, whether an official reviewer
  • 2:27
    or just someone visiting, everybody should be able to search
  • 2:30
    for reviews that match certain criteria.
  • 2:33
    For, example, it should be easy to find reviews of products
  • 2:36
    by a particular manufacturer, or ones that say,
  • 2:39
    mention waffles, or something like that.
  • 2:42
    So we need to be able to search for the stuff that's being created
  • 2:45
    in a way that's actually meaningful to people.
  • 2:48
    So you can see, here is our finished Super Duper Chefs site.
  • 2:52
    This is what we're going to be building in this series.
  • 2:56
    Now the first step is to figure out how to translate those features
  • 3:00
    that they want into our shopping list of Drupal
  • 3:05
    functionality, as it were.
  • 3:07
    Now Drupal Core provides a lot of the things
  • 3:10
    that they're going to need.
  • 3:12
    So we can create a product review content type with the custom fields
  • 3:16
    that we want to have, but then we're going
  • 3:18
    to need to step outside of core and look at using the Views module
  • 3:22
    to create our listings and our search.
  • 3:25
    And we're also going to need to step out and figure out how to create
  • 3:29
    a rating system that we can use on this site.
  • 3:33
    So three requirements for this website
  • 3:36
    are going to require functionality that we have not countered
  • 3:39
    yet in terms of Drupal Core or Views.
  • 3:42
    We need to import product information from another website.
  • 3:46
    We need to allow users to rate and review content,
  • 3:49
    and we need to build a custom search page, not just a listing.
  • 3:54
    So first things first, product information.
  • 3:57
    You can see on our site here, I have some reviews,
  • 4:00
    and I have product information.
  • 4:02
    I actually have a link, and I have an image of the product.
  • 4:07
    And if I click through to the full node, you'll see I have even more.
  • 4:10
    It tells me the manufacturer, and importantly
  • 4:12
    it tells me the current price.
  • 4:14
    So this is really important information
  • 4:17
    that we need right here.
  • 4:19
    Where we are getting this information is from Amazon.com.
  • 4:24
    So all of this information here is definitely
  • 4:26
    crucial to our requirements.
  • 4:29
    And so the easiest way to do this, instead of looking all
  • 4:32
    this information up and typing it in by hand, is to let someone else
  • 4:36
    do the work.
  • 4:37
    And so, if we look at amazon.com, amazon.com
  • 4:41
    has a lot of products, pretty much anything
  • 4:44
    that we're probably going to be found on amazon.com.
  • 4:47
    And they provide access to their full database and product
  • 4:51
    information, using the Amazon product advertising API.
  • 4:56
    So we can use amazon.com's API I for the data
  • 5:00
    that we need, and we don't actually have to enter any of this stuff in.
  • 5:03
    The way that we're going to do that is by using the Amazon module.
  • 5:07
    That's going to hook up Amazon's API to our Drupal site,
  • 5:11
    so that they can communicate, and we can
  • 5:13
    get the information that we need.
  • 5:15
    So in addition to our product information,
  • 5:18
    we also mentioned the ratings.
  • 5:21
    So we have an editor rating here, with some stars.
  • 5:25
    And then we also have reader ratings it down here.
  • 5:29
    So if I was to leave a comment, and I'm just viewing the site,
  • 5:32
    I can also leave my rating, which will
  • 5:34
    be different than that editor rating.
  • 5:37
    So the Drupal community has dozens and dozens of ways of sort
  • 5:41
    of rating and ranking things come up with quite a lot more time
  • 5:46
    it sounds very fairly straightforward,
  • 5:48
    but there are lots of different ways to rate
  • 5:50
    and rank things in, and create forms for that.
  • 5:54
    So you can on drupal.org, look at the module list under download
  • 5:58
    and extend.
  • 5:59
    There is an evaluation and rating module category,
  • 6:03
    so you can filter a list to see all of those.
  • 6:07
    So by going to Drupal's download and extend modules area,
  • 6:12
    and then changing that module category,
  • 6:14
    you get a list of all kinds of modules.
  • 6:18
    One that we're going to use on this site is called five-star
  • 6:22
    and the reason we're using this one is, aside
  • 6:24
    from having a cool little widget with little stars or hearts
  • 6:28
    that you can click on to pick, and you can set the number of the range
  • 6:33
    of your rating and such like that.
  • 6:35
    The important thing that Five Star module is going to offer us
  • 6:39
    is the ability to average a rating.
  • 6:42
    So instead of just having a rating that gets stuck on to something
  • 6:46
    and sort of set in stone, we can actually get multiple ratings
  • 6:49
    on something and then average those things out and display that.
  • 6:54
    So by using this we're going to be able to let users vote on content,
  • 6:58
    and show us the average.
  • 7:00
    In addition, five star also has a field which gives us a separate way
  • 7:05
    to add an official rating, different from what
  • 7:09
    we're going to provide to our users.
  • 7:11
    So you have two different ways of implementing five star,
  • 7:13
    depending on how you need to use it.
  • 7:16
    For our instance we need to use both of those.
  • 7:19
    Most of the rating and evaluation modules
  • 7:21
    that are out there is based on something
  • 7:23
    called the voting API, which is another Drupal module.
  • 7:27
    And that ends up just being a dependency,
  • 7:30
    because it's sort of a unified engine tjat
  • 7:32
    handles the storage and presentation of voting and rating information,
  • 7:36
    and then five star would put on its particular things that it's doing.
  • 7:40
    So we'll need both floating API and five star module, in order
  • 7:44
    to get our rating system into place.
  • 7:47
    Now the last big feature that we need to add
  • 7:49
    here is this Product Finder.
  • 7:52
    We've added a link for Product Finder,
  • 7:54
    and this takes us to a view of our products.
  • 7:59
    So you can see that we have a view, and it's sort of a classic view.
  • 8:02
    It lists things, it's pulling in information from our review nodes.
  • 8:07
    We can sort things in the list.
  • 8:10
    But the big difference on this view is that we actually
  • 8:14
    have these search boxes on top of the view here, as well.
  • 8:18
    This is different than Drupal's Core search,
  • 8:20
    because Drupal Core Search is going to look for keywords on all
  • 8:24
    our nodes, and that's not exactly what we're going for.
  • 8:27
    We want to have a very specific, very tailored search form, that
  • 8:31
    is specifically just for the product, not for the entire site.
  • 8:36
    Luckily, views has this feature built in.
  • 8:40
    So we can use fields that are in our, view as search fields as well.
  • 8:46
    So we're going to be looking at how to sort of take views another step
  • 8:49
    further, by exposing filters on our views.
  • 8:54
    So, theses are the main pieces that we're building.
  • 8:57
    We have our Product Finder.
  • 8:59
    Then once I find a product that I'm looking for,
  • 9:02
    I'm going to see a review, with an editor rating.
  • 9:05
    A bunch of information about the product that's being pulled
  • 9:07
    directly from Amazon.com, so it's up to date.
  • 9:11
    And then I can leave my own comment and my own rating,
  • 9:14
    on this particular product if I want to.

Case Study: Super Duper Chefs

Loading...

With so much information, and so many products, on the web today, people often want to get an opinion to help rank and rate things. Should I buy this widget? Should I watch this movie? In this series, we’re going to use a handful of Drupal modules to build a product review website that lets community members give their opinions, along with a way to rate their review as well. To kick things off, in this lesson we will:

  • Review the Super Duper Chefs case study
  • Discuss our implementation