Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Displaying products

From: Create Your First Online Store with Drupal Commerce

Video: Displaying products

We've set up our store, and added one product; a bottle of olive oil. The way Drupal Commerce works, that's only the first half of the equation. That product won't appear on our site until we also display the product, sort of like moving items from the warehouse to the front of the store. To do that, we will create something called a product display node. Because we are using Commerce Kickstart, we get a few things that you'll have to set up by hand if you installed it from scratch. The first is in the modules. You will have to turn on two modules that are down here under the Commerce area.

Displaying products

We've set up our store, and added one product; a bottle of olive oil. The way Drupal Commerce works, that's only the first half of the equation. That product won't appear on our site until we also display the product, sort of like moving items from the warehouse to the front of the store. To do that, we will create something called a product display node. Because we are using Commerce Kickstart, we get a few things that you'll have to set up by hand if you installed it from scratch. The first is in the modules. You will have to turn on two modules that are down here under the Commerce area.

First is Cart, and second is Product Reference. You'll need Product Reference, because that's what ties together the products with the product displays. Another thing that we get from installing from the Kickstart is a product display node content type. You see that by going up to Structure, and Content Types, and there is Product Display. As with other kinds of nodes in Drupal, you can change the fields that it contains by going over to Manage Fields, and as you see, there's only three by default. There is the Title, and the Body, and then there is a Product.

This is, once again, what ties our display node to the product itself, through a product reference. Now it's time to actually add a product display. There are two ways to do this. The obvious way is by clicking Add product display. The other way is the more drupaly one, by going up to Content, Add content, and Product display. In either case, it gets us to this form. I'm going to fill it out using some text that in our exercise files, and we'll copy the title here: Our best olive oil. And also, the body here: this is our description of the product.

Now, you'll remember there were three fields in the product display content type. The third one is right here; the reference to the product itself. I happen to remember that we called it olive oil, something, something. So as I start to type it in, it looks through all of the products and says, oh yes, that's the one. If we had more than one that started with olive, or that had olive in it, we would see the whole list here. But I will just click this, and go down, and Save, and there it is. This is the full view of our product. It is also set up, by default, to put that on the front page of our site, so a catalog starts compiling, just as we add products.

If we click on our logo, and go to the front page of our site, there it is, and there is even an Add to cart button here. Now the truth is, we could leave things as they are now, and we would be able to just shop from the site as it is. But I would like to go back and make a few changes to show you how to affect the way that products are displayed. There are two kinds of changes you can make. One kind affects only the display of a particular product, and the other one affects the display of all products. First, I am just going to change this particular product. To do that, you click its title to go to its full node, and there is this little Edit tab here.

Besides the things that we filled out earlier, if you scroll to the bottom, you will see all of these things, which are called vertical tabs. We could, for example, add a menu link here, and have that show up at the top of the page, make different revisions as we change things throughout the process of building our site, and so on. The one I'm going to change, though, is this URL path setting. If we switch over to the way that somebody sees this site as a visitor, which I have in another browser, and reload, you will notice that we see our product, but when we click it, the URL is this node/1; it's not really very friendly. And furthermore, that node/1 doesn't say anything to search engines like Google, or Bing.

We can make it more friendly both to people, and to search engines, by going back to that node here, and adding what's called a URL alias. I'm going to call this our best olive oil half liter, let's say, and then Save it. And now if you look at the top of the page, there it is. Much better for search engines, and it is also more friendly to people. There are other things that you can change in those vertical tabs, and if you want to learn more, see the Drupal 7 Essential Training Course. Now I would like to move on to the more powerful part, which will show you how to change the display of every product on your site.

For example, let's say that you want to make this graphic bigger, or put a label next to it, and you want it to be consistent on all the products in your site. You can do that by editing either the product display, or the product, and it's sometimes not clear which you edit. What I usually do is I start with the product display, and to do that go up to Structure, and Content Types, and once again, we have Product display. Now, instead of clicking edit, or manage fields, I click manage display. So I wanted to change the look of that image, and I go over here, and I see, ah, wait a second; I have to change that on the product itself. But there are some things that I change on the node.

For example, if I were to show a label here for the body -- let's do that; I'll put it above, and Save, and then close out this overlay -- we now see this label here that says Body. I don't really like that, so I will go back, and I will change it by clicking Structure, Content type, Product display, and manage display, and just remove it; easy enough. And of course, Save. But let's go ahead and change that image. I can either go to the Product Manage Display tab, or just click this link here. I'll do that, and then click manage display, and here I can change the style of that image.

Let's say I want to change it from medium to large, and Update, and Save. Now let's go back and see how that looks. Yup; it immediately refreshed, and now we see a much bigger picture. Now, I know that Drupal Commerce's two- step process for listing product is a bit odd, and it's sometimes confusing to tell whether you're supposed to affect the product, or the product display. The way I handle it is to first create products, and then create the display nodes that I need to display those products.

In fact, you have to go in that order, because in order to display a product, you first have to have it, and then make a reference to that product. Then, if I want to change the way these things look on the site, I start with the product display, because I know there are links back to the product if I need to make any changes there. So now we have all of our products displaying on our site, and along the way, I pointed out that we have this Add to cart button right here. Believe it or not, it's already possible to start shopping on the site. We will talk about the shopping cart, and checkout bits, in the video, Seeing your site from a customer's viewpoint.

Show transcript

This video is part of

Image for Create Your First Online Store with Drupal Commerce
Create Your First Online Store with Drupal Commerce

35 video lessons · 11101 viewers

Tom Geller
Author

 
Expand all | Collapse all
  1. 16m 44s
    1. Welcome
      54s
    2. Previewing the finished project
      4m 10s
    3. Surveying the store-building process
      4m 29s
    4. Using the exercise files
      7m 11s
  2. 12m 12s
    1. Installing Drupal Commerce using Commerce Kickstart
      6m 5s
    2. Configuring your store's basic information
      6m 7s
  3. 31m 29s
    1. Accepting PayPal payments
      5m 9s
    2. Setting up individual products
      3m 17s
    3. Displaying products
      6m 30s
    4. Categorizing products
      5m 31s
    5. Adding simple taxes
      4m 39s
    6. Seeing your site from the customer's viewpoint
      3m 26s
    7. Processing orders
      2m 57s
  4. 17m 39s
    1. Understanding products and other entities
      3m 3s
    2. Understanding line items
      3m 16s
    3. Understanding rules
      5m 10s
    4. Integrating your store into a Drupal site
      6m 10s
  5. 29m 46s
    1. Adding product variations
      7m 2s
    2. Managing product variations
      3m 50s
    3. Importing simple products
      10m 11s
    4. Importing complicated products
      8m 43s
  6. 29m 52s
    1. Shipping products
      4m 50s
    2. Managing inventory
      4m 30s
    3. Managing orders
      5m 39s
    4. Managing customer profiles
      4m 55s
    5. Using Views to gain better oversight
      5m 0s
    6. Accepting other payment methods
      4m 58s
  7. 24m 52s
    1. Changing your store's look
      6m 24s
    2. Streamlining the checkout process
      5m 19s
    3. Launching your store
      13m 9s
  8. 29m 25s
    1. Offering product discounts
      8m 56s
    2. Gaining insight from Google Analytics
      5m 45s
    3. Making your site more visible to search engines (SEO)
      5m 52s
    4. Encouraging customer buzz
      8m 52s
  9. 56s
    1. Goodbye
      56s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Create Your First Online Store with Drupal Commerce .

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.