navigate site menu

Start learning with our library of video tutorials taught by experts. Get started

Create Your First Online Store with Drupal Commerce

Create Your First Online Store with Drupal Commerce

with Tom Geller

 


This course shows how to build an online store using Drupal Commerce, a set of modules that extend Drupal. Author Tom Geller teaches the basics of configuring a store, processing a payment, and charging for shipping and taxes, as well as creating, displaying, and categorizing products. The course also explains how to integrate a store into a Drupal site, customize a store's appearance, and increase site traffic using search engine optimization (SEO) techniques.
Topics include:
  • Surveying the store-building process
  • Installing Drupal Commerce using Commerce Kickstart
  • Accepting PayPal payments
  • Processing orders
  • Understanding rules and line items
  • Listing and importing products
  • Managing inventory, orders, and customer profiles
  • Streamlining the checkout process
  • Launching a store
  • Offering product discounts
  • Analyzing site traffic with Google Analytics

show more

author
Tom Geller
subject
Business, Web, Ecommerce, Web Design, Projects
software
Drupal 7, Drupal Commerce 1.0
level
Intermediate
duration
3h 12m
released
Nov 17, 2011

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:03Hi! I am Tom Geller, and this is Create Your First Online Store with Drupal Commerce.
00:09This course will show you how to sell whatever you want over the Internet
00:12without paying the big fees that sites like Amazon and eBay charge.
00:16I'll show you how to set up your store, add products, charge for shipping and
00:20taxes, manage orders and customers, and improve your store's reach for increased sales.
00:27While you don't have to be a professional, the tools you'll be using are of
00:30pro quality, and no matter how successful your store becomes, Drupal
00:34Commerce will grow with it.
00:36As its name implies, Drupal Commerce is built on top of Drupal, a free program
00:41for building awesome Web sites.
00:43If you want to know more about Drupal generally, lynda.com's Drupal 7 Essential
00:47Training course is a good place to start.
00:50Let's get started with Create Your First Online Store with Drupal Commerce.
Collapse this transcript
Previewing the finished project
00:00This course focuses on how to create an online store that functions beautifully.
00:05There is a lot to learn, so we don't focus much on the look of the site, but
00:08there is a lot of beauty under the hood.
00:10This video shows you what it is, while the rest of the course shows you how to get there.
00:15The first thing that you'll notice about our store is that it looks like other
00:18stores you see on the Internet. It's a list of products, with Add to cart
00:22buttons, and if you click on anyone of these, you see a larger picture, and
00:25perhaps more information.
00:27But let's go back to our front page, and actually add something to our cart.
00:31We see it in the cart here, and if we go in through this View cart link, we can
00:35change its quantity -- say we want 2 things of bath salts -- or remove items, and so forth.
00:42But a store isn't just about the products you sell; you also want to be able to
00:46add tax and shipping costs on top of that, and then fulfill the order.
00:50We do that here by going up to Configure store, and there you see, for
00:53example, Payment methods.
00:55You can change how people are able to pay, or you can change how they're able to
01:00specify Shipping, and as I mentioned before, you can define taxes, including
01:06changing whether taxes are charged in- state or out-of-state, using American style
01:11sales tax, or European style VAT.
01:15Let's go through an order so we see what the customer sees as they use our store.
01:19As I showed you, they first see a cart, and then go to a checkout page.
01:23You'll notice that the tax has already been added here.
01:26I filled out my billing and shipping information earlier, and it remembered it,
01:31so we'll Continue on.
01:33Finally, we get a confirmation, and this is where you're able to pay.
01:38Add my credit card number; change the expiration date to someday in the future.
01:44This is a standard void number for credit cards, by the way, and continue, and
01:51finally we're told that our order is complete.
01:54Both the customer and the administrator of the site can view the order to make
01:58sure everything is okay, and in fact, the administrator is able to go back into
02:01orders, and edit them to add payments, remove payments, change the amount of
02:07things that are being sold, and so forth.
02:08You have an enormous amount of control for setting up discounts, payment
02:13systems, shipping methods, and workflows.
02:15For example, you could put the whole checkout process on a single screen, or
02:20just get rid of the payment part if you're giving things away.
02:23Your store contains a powerful subsystem called Rules, which you can get to by
02:27clicking Configuration, and scrolling down, and Rules.
02:31You also reach certain rules by clicking different parts of your store.
02:35One example is that you could give the first 500 purchasers of something a
02:39special bargain, or cut off a giveaway at a certain time, or even limit sales to
02:43those that are shipped within certain states.
02:46You would do that by editing the rules.
02:49Finally, as I mentioned before, your store is built on Drupal; one of the world's
02:53most popular platforms for building Web sites.
02:56So you can change its appearance by going up to Appearance, and selecting a
03:00different theme, such as I've done here with Danland.
03:02Let's see what that looks like.
03:05When I close the overlay, we see a completely different look for our site, but
03:10I'll go ahead and switch it back.
03:15You're also able to build your own themes, or modify those that are available
03:18for free on Drupal.org.
03:21Finally, you can take advantage of the literally thousands of free add-ins
03:25called modules that add functionality to Drupal.
03:28To see those go to drupal.org/project/modules.
03:36Since we're using Drupal 7, we'll filter by compatibility, so we only see
03:39those for Drupal 7. Wow!
03:41Over 2500 modules available.
03:44You'll see all of these things in this course, but again, we'll focus pretty
03:48narrowly on features that are specific to building a store.
03:51While you don't have to know Drupal to take this course, that knowledge would go
03:55a long way in making your store even better,
03:57so I recommend you also consider taking other lynda.com courses on the subject,
04:02particularly Drupal 7 Essential Training, but even without that, by the end of
04:06this course, you'll have all that you need to build a great store.
Collapse this transcript
Surveying the store-building process
00:00In the video previewing the finished project, you saw how the store will
00:04look when it's finished.
00:05This video will show you, in the most general sense, how it got to be that way,
00:09starting with a fresh installation of Drupal, with a tiny bit of site
00:12configuration, and finishing with a successful order.
00:16It's going to go way too fast for you to follow along, and you won't find any
00:19exercise files for this video. I just want to give you an idea of how it flows.
00:24The first thing we did was to install Drupal Commerce using the Commerce
00:27Kickstart distribution.
00:28You'll find it at drupal.org/ project/commerce_kickstart.
00:33I've already done that. You can learn how in the video, Installing Drupal
00:40Commerce using Commerce Kickstart. And there is our store, already installed.
00:46Now we start configuring things.
00:47I'll start by changing the appearance a bit.
00:50Go up to Appearance, change our Settings, and now we can toy around a little
00:56bit with, let's say, the colors of the heading up here. Make it a sort of olive
01:01green; a slightly darker olive green, and go down to the bottom, and save.
01:08Of course, you'll want to do a lot more customization when you build your own store.
01:15I've found that most people want to set up the site's look right away, but you
01:18can actually change it at any time; even after you have hundreds of products in the catalog.
01:22I'll show you a little more about altering your store's appearance in the video,
01:25Configuring your store's basic information.
01:28Now it's time to set up those products.
01:30Drupal Commerce puts everything related to commerce -- the products, order,
01:34shipping, and so forth -- in the Store menu up here.
01:38There are also additional links here on this Gray bar -- what's called the shortcut
01:41bar -- and one of them is Add product.
01:45I'll create a bottle of olive oil for our fictional olive oil company;
01:48the SKU will be 10001; 1 liter of olive oil.
01:55I happen to have an image already on the Desktop; we'll go and find that. And
02:08the price, let's say, is $8.00.
02:12I'll show you more about products in the video, Setting up individual products.
02:16So now your store has a product in its warehouse, so to speak, but you still need
02:20to bring it out for customers to buy.
02:22In Drupal Commerce, you do that with something called a product display.
02:26I'll add that by going up to this link: Add product display.
02:31This will also be 1 liter bottle of olive oil; scroll down, link it to the
02:42product that we just created, and save.
02:49Now if we go back to the front page of our store, we see our product, and
02:53amazingly, we can already start shopping. Everything is already built in.
02:57I'll show you that by clicking Add to cart, and actually completing the order process.
03:02We could then view our cart, change the Quantity if we want -- let's say we want 2
03:06bottles instead -- remove items if we want, and then checkout.
03:12Now, we haven't set up any taxes or shipping, but this is where it would normally show up.
03:28Finally, we review our order, make a test payment, and finish, and there we are.
03:36We've actually completed an order on our site, and as you saw, it didn't take
03:39very much set up at all.
03:41So that's the abbreviated version. There is a lot that I left out, but don't
03:45worry: I'll show you it all by the end of this course.
03:48Now, I'm not going to use the site I just created throughout the course, so I'm
03:51just going to quickly delete it.
03:53I'll do that by going back to Acquia Dev Desktop, selecting the store that I
03:58just created, and deleting it.
04:03I can complete the process by going back to my Desktop, and throwing away the
04:06files that comprise that store.
04:09If you're really eager to get started, and don't want to watch the whole course,
04:12I give a version that's a little bit less abbreviated, but still short, in the
04:16section jumpstart to sales.
04:18But I do recommend you set aside time to watch everything in the course.
04:22Once you start working with Drupal Commerce, you'll find yourself wanting to take
04:25advantage of the many features and options that it provides.
Collapse this transcript
Using the exercise files
00:00If you have access to the exercise files that come with this course, you
00:04have all the components you need to follow along with the videos on your own computer.
00:09There are two kinds of files. The first kind are content files, such as text and
00:13images that you add to your site as the course progresses.
00:16If you don't have access to the exercise files, you can use your own text and images.
00:21The second kind of exercise files bring your site up to a certain point in the course.
00:26That way you can start at any point in the course, and continue from there.
00:30There are two different kinds of procedure.
00:33The first kind of procedure, you use only the first time you're installing
00:36Drupal on your computer.
00:38The second procedure brings you up to any point in the course.
00:41I'll go through both procedures now.
00:44If you're using Drupal Commerce Kickstart for the first time, you would use this
00:47folder: 0000-drupal-commerce-kickstart-base.
00:52The folders you need are inside twotrees.zip.
00:55This is in a compressed file.
00:57On many versions of Windows, and on all versions of Mac, you can open this simply
01:01by double-clicking it.
01:03If you're on an older version of Windows, however, you may need an uncompression
01:06utility. The one that I like is called 7-Zip.
01:13But we'll just open this by double -clicking it, and then we'll take the
01:17twotrees folder that's inside it, copy it, and put it where we want our
01:21Drupal installation to be.
01:23In our case, that's on the Desktop.
01:25This may take a while.
01:27We then import these files into the Acquia Dev Desktop AMP Stack.
01:32We've already downloaded it from acquia.com/downloads.
01:36If you haven't already done so, you'll find it here.
01:39You can download either a Windows or a Mac version. It doesn't matter if you say
01:43Drupal 7, or Drupal 6, since we'll be using a completely different version of
01:47Drupal from what's included in the Dev Desktop.
01:50Once you have it up and running, you click this localhost pop-up menu, and go to More.
01:56Then click Import.
01:57Click Browse next to Site path, and find the folder that you just copied.
02:01Here it is: twotrees. Click OK, and then say that you want to create a new
02:06database by clicking this radio button.
02:09The database name must be twotrees; T, W, O, T, R, E, E, S.
02:17The server must also be twotrees, then click Import.
02:24When that's done, you can then finish the installation using the Commerce
02:28Kickstart installation profile.
02:30You can see how to do this in the video, Installing Drupal Commerce using
02:34Commerce Kickstart, and in fact, I'll very quickly do that.
02:38Alternately, you can import the database that was in the same folder as twotrees,
02:43and that's what we're going to do.
02:44We go to Acquia Dev Desktop, close out this window, so we're back at our main
02:49screen, and then say Manage my database.
02:53We see the twotrees database that Acquia Dev Desktop created. However, it
02:59contains no tables, so we're going to click Import, and then Browse, then go
03:05to our exercise files.
03:09In that drupal-commerce- kickstart-base, you'll see a file
03:12labeled twotrees.sql.zip.
03:16We click that, and then click Open, and then click Go.
03:20This may take a while.
03:21Incidentally, as I'm making this video, there is a bug in some browsers that
03:25causes the screen to hang at this point.
03:27I've found that Firefox works best, but by the time you see these videos, you may
03:32find that any browser works just fine.
03:34If you have that problem, switch to Firefox.
03:37There; it's all done.
03:39If it works correctly, you'll see this message that the Import has been
03:42successfully finished.
03:43We can tell it if it's true by going back to Acquia Dev Desktop, selecting
03:47twotrees from the pop-up, and then saying Go to my site.
03:51You can then log in to your site.
03:53By default, in all of the exercise files, the Username is admin; A, D, M, I, N. And the
03:59Password is drupal with a lowercase d; so d, r, u, p, a, l, and I just click Log in,
04:06and I'm ready to go.
04:08So that's the first time you set up your exercise files.
04:11If you want to bring it up to a certain point in the course, I'll show you how to do that now.
04:16We'll go back to our exercise files, and open up something much later on;
04:21let's say 0501-shipping.
04:24Inside there, there are two kinds of files;
04:26sites, and this one that ends in .sql.zip.
04:30The sites folder will replace what's in your current Drupal installation.
04:34First we have to throw away what's in there, or move it to another location.
04:38Remember that by doing this, you'll be destroying your existing site,
04:41so if you want to save it, back it up using the techniques that you learned
04:45in Drupal 7 Essential Training. But for us, we'll open this up, and throw away the sites folder.
04:53Then I'll open up the sites file -- again it's compressed -- take that sites folder,
04:58and put it inside twotrees.
05:01This may take a while.
05:04Then we replace the database with a database file that's here: twotrees.sql.zip.
05:10To do that, go back to Acquia Dev Desktop, and Manage my database.
05:15We have to clear out what's already in twotrees, so we click the database here,
05:21and that shows us all of the tables.
05:23Scroll to the very bottom, and then click Check All, then select Drop.
05:31We'll be asked to confirm our decision; we do want to do that, so click Yes.
05:36If that works, you'll see this message at the top that it's been
05:38executed successfully.
05:40We're now ready to import our new database.
05:43Click the Import tab, then click Browse, and find the file that you need.
05:50We were going to do 0501, so I'll go down there, select .sql.zip, and Open, and then click Go.
05:58This may take a while.
06:00If this works, you'll see the Import has been successfully finished message, and
06:04we can prove that it worked by going back to Acquia Dev Desktop, selecting
06:09twotrees, and clicking Go to my site.
06:12Once again, you may have to enter your Username and Password, which is admin
06:17and lowercase drupal.
06:18Click Log in, and you're good to go.
06:21I do want to remind you that this process will only bring you up-to-date in the
06:26version of Drupal that I used when I recorded this.
06:29If you turn this into a public site, you must update it, or you'll leave yourself
06:33open to security holes.
06:34So please do take a look at that in the Drupal 7 Essential Training course.
06:38Now, I know that seems like a long procedure, but believe me, you get used to
06:42it after a few times.
06:43Now, I have to admit that it doesn't always go as smoothly as you saw here.
06:48If you have any problems, first check my site: tomgeller.com.
06:52I'll post help there as needed.
06:54If all else fails, you can get help from lynda.com while you're logged in.
06:59Just go up to the Support menu, and select Contact Us.
07:04Then select the correct technical support option from under Technical Support,
07:07and send your message.
07:09Now let's get started!
Collapse this transcript
1. Setting Up Drupal Commerce
Installing Drupal Commerce using Commerce Kickstart
00:00If you're already a Drupal user, you might get the itch to just install Drupal
00:04Commerce by downloading all the modules separately, and then configuring them by hand.
00:09You can do that.
00:10Details about what you need are on the page at drupal.org/project/commerce.
00:15If you go to that page and scroll down a little bit, you'll see the requirements
00:18here, and there is quite a long list of them.
00:21Fortunately, there's an easier way.
00:23The folks who created Drupal Commerce also created an installation profile that
00:27includes all those pieces and it preconfigures them.
00:31That saves us a lot of time, and we're going to use this Kickstart version
00:34throughout the course.
00:35To get started, I am going to assume that you've downloaded and installed Acquia
00:39Dev Desktop, which was formerly called the Acquia Drupal Stack Installer, or DAMP.
00:44To get it, go to acquia.com/downloads.
00:49Then scroll down to Dev Desktop.
00:52The site will automatically indicate the platform that you're using.
00:55In our case, Windows, but a version is also available for Mac.
00:58It doesn't really matter whether you choose the Drupal 6 or Drupal 7
01:01version, since we are not actually going to be using the Drupal that comes with Dev Desktop.
01:06If you have any trouble with this step, see lynda.com's Drupal 7
01:09Essential Training course.
01:11Once you have Acquia Dev Desktop running, go to
01:14drupal.org/project/commerce_kickstart.
01:21Once there, scroll down, and download the version you want.
01:24Since we're on Windows, I am going to use the zip copy, although if you're on
01:28Mac or Unix, you can also use the .gz version, which is a little bit easier to
01:32install, and is also a smaller download.
01:34I recommend that you use the one that's in green here, which is the
01:37latest stable version.
01:39If you want to be on the bleeding edge, you can try the development release,
01:42which is down here in red.
01:44But for us, we will just click zip, and then go to our download location, which
01:48in our case is on our Desktop.
01:50Once there, you uncompress the file.
01:52On Windows, I do that by double-clicking, and taking the contents, and dragging
01:56them to the Desktop.
01:58This part might take a while.
02:02Once you've uncompressed the files, you can close this window, and throw
02:05away your zip file.
02:08I'm also going to rename our installation here, from drupal-7.8, to twotrees.
02:13That reflects the name of the site that we will be working with throughout this
02:16course: Two Trees Olive Oil; a fictional company in California.
02:20The next step is to import this site through the Acquia Dev Desktop.
02:24To do that, we switch to our Dev Desktop Control Panel, go to our little pop-up,
02:29and More, and click Import.
02:32You then select the folder that we've just created.
02:35It's on the Desktop at twotrees, and OK, and create a new database.
02:40You can name this whatever you'd like, but just for consistency's sake, I'm going
02:44to call this twotrees, and the server I will also call twotrees, and then Import.
02:55Once the import is complete, you will see a fairly standard Drupal
02:58installation screen.
02:59The big difference between this, and core Drupal, is this extra
03:02selection: Commerce Kickstart.
03:04Select it, and click Save and continue.
03:06We are installing in English, so we will just click Save and continue, and then
03:12Drupal Commerce goes through the standard Drupal installation process, but
03:16adding a few extra pieces, that make it Drupal Commerce.
03:19This may take a while.
03:21When that's complete, you will have the opportunity to change some of the
03:25information on your site.
03:26You will be able to change this again later, so it doesn't really matter that
03:29much what you put here.
03:30But we will just put up Drupal Commerce, and for our site e-mail address, it
03:36will just be admin@example.com, although of course, you should use your own e-mail address.
03:42Our Username will be admin, and for a Password, we are going to use drupal,
03:46with a lowercase d; d, r, u, p, a, l.
03:50We use that administrator username and password, admin and drupal, throughout this
03:55course, all in lowercase.
03:57That's important, because when you use the exercise files, you may need to enter
04:00that username and password.
04:01Of course, you can use whatever username and password you want.
04:05In fact, you shouldn't use these in any site that you intend to face the public.
04:09We will scroll down, and Save and continue.
04:12We are almost done, and then there's one final step that's specific to Drupal Commerce.
04:18If you're setting up a site, and you want to just learn how to use it, and play
04:21around a little bit, it's a good idea to let it install these sample products
04:25and product display nodes.
04:26I'll be showing you how to create these things yourself,
04:29so I'll uncheck them, and then click Create and continue. There we are!
04:34To visit our new site, we click this link, and we're all done.
04:39Now, for you experienced Drupal folks, I want to show you something very quickly
04:43about how Commerce Kickstart sets things up.
04:45It's a little different from how standard Drupal does things, and that means you
04:48have to watch out when you update your site.
04:51To show you that, I will go back to my Desktop, and open up my twotrees folder.
04:56Now, normally in Drupal, all of the information that's specific to your site is
05:00in this sites folder here.
05:02It would be an all, and then modules would contain the modules.
05:05But you don't see them here.
05:07Because this is an installation profile, all of that information is stored
05:11inside profiles, in this commerce_kickstart folder.
05:15Now, I am talking about the things that are specific to Drupal Commerce;
05:19the modules, and the way that it's set up, and so forth.
05:22If we open this modules folder, we see some of that extra stuff.
05:25In fact, this commerce folder contains all of the stuff that's specific
05:28to Drupal Commerce.
05:30I mention this because if you try to update the site in the normal way, by just
05:34replacing everything except for the sites folder, you will actually lose all of
05:38your commerce functionality,
05:39so be careful about that.
05:41Now, some of you might scoff at the idea of using this prepackaged version, but
05:45it is the method that I recommend.
05:47I mean, why reinvent the wheel?
05:49The less time you spend installing, the more time you will have to build your site.
05:53And if you don't like the way this installer does things, well, you can install
05:57Drupal Commerce manually.
05:59Just go to drupal.org/project/commerce, and follow the instructions there.
Collapse this transcript
Configuring your store's basic information
00:00When we last left our site, we had installed Drupal Commerce using
00:04Commerce Kickstart.
00:05Now we will do a few basic tweaks to the site, just so that we can make it more of our own.
00:09The first thing that we're going to do is we are going to change the name of this site.
00:12Then we will change the logo here, and also this little thing up in the corner,
00:16which is known as the Favicon.
00:18Finally, I'm going to add a search bar up here in the upper-right corner.
00:21I recommend that for all sites, unless you have a special reason not to allow
00:24people to search your site.
00:26Everything that we do in this video is just basic Drupal configuration.
00:30That stuff is under the configuration link here at the top, whereas most of the
00:34stuff that you will see in this course is under the Configure store link here.
00:38If you want to learn more about configuring your site in general, see my course,
00:42Drupal 7 Essential Training.
00:44If you've gotten this far by setting Drupal Commerce up from scratch, that is,
00:48without using the Kickstart the way that I showed you, then you will first have
00:51to turn on two modules in order to use Drupal Commerce.
00:54To do that, you go up to Modules, and either scroll down the page, or close up
00:59these groups, until you get to the Commerce group here.
01:01The two modules that you will need to turn on are Commerce, and Commerce UI, but
01:06as you see, we already have them,
01:07so I will just close out here. All right!
01:10Let's move on to configuring our site.
01:12The first thing we are going to do is to change the name here.
01:15The way you do that is by going up to Configuration, and clicking Site Information.
01:21Here I am going to change it to the name of our fictional olive oil company:
01:25Two Trees Olive Oil.
01:27You can also add a slogan.
01:30It's optional, but I am going to add one;
01:32The Best Olive Oil in the World.
01:35You can also change your e-mail address, and a few other settings here, but for
01:40now, I'll just click Save configuration, and close out the overlay, so we can see
01:43what that looks like. There it is!
01:46It did exactly what we thought it would do.
01:49The next thing I am going to do is to change the appearance a little bit.
01:52This is what Drupal calls a theme, and you reach it by going to Appearance, and
01:57then down to the Settings link next to whatever the enabled and active theme is;
02:01by default that's Bartik.
02:02So I will click Settings, and see all of the things that I can change on the page.
02:06Now, you will see that there's a color set up here.
02:10By default, it's Blue Lagoon, but if I change it to, let's say, Plum, that changes
02:13many of the colors throughout the site ,and you can see a preview of this by
02:17scrolling down a little bit, and there it is.
02:19I am going to return it to Blue Lagoon, and just change a couple of colors to
02:23make it more olive-like.
02:25First thing I'll do is in the header, I am going to turn it to some kind of
02:28green; make it a kind of lightish green.
02:32Something like that, let's say, and scroll down and see. Oh,
02:35that looks pretty good.
02:36Maybe make the bottom a similar kind of green.
02:38So go over here, and click around.
02:41That actually looks pretty good.
02:44You can also change the values by typing them in directly.
02:47So here I'll change it to hex value 292929, for example, and you see it change in
02:52your preview live as you do that.
02:53If I scroll to the bottom, and click Save configuration, and close out the
02:58overlay as I did before, we see those take effect immediately. Very good!
03:04But you're probably wondering, how can I replace that silly looking face, and
03:08put in my own logo? Well, that's easy.
03:11If you're a premium subscriber to lynda.com, or received the series on disk, you
03:15will find graphics to do so in your exercise files.
03:18If not, you can use your own, of course.
03:20You do it by going up to Appearance, and then once again changing the
03:24settings of your theme.
03:26Scroll down to the bottom where you have the options to change the logo, and the
03:30shortcut icon, which is also known as the Favicon.
03:32I will remove the default logo, and click Choose File, and then find my file.
03:38Here it is: logo.png.
03:41Click Open, and then do the same for the shortcut icon.
03:45Remove the default, and add our little icon here,
03:48the Favicon, and then Save configuration, and then turn off the Overlay so we can
03:54see the effects of our work.
03:57Indeed, there's our logo, and up here in the corner is our Favicon.
04:02Now, the location of the Favicon changes depending on which browser you're using.
04:06In Firefox, I believe it's in the address bar, and so on, but it does add a nice
04:10little touch that many people forget, which means that yours is going to look
04:13especially good by comparison.
04:16The last change I am going to make is to add a search bar up here in the corner.
04:20There are two things I have to do.
04:22First, I'm going to move a block into this area.
04:25I do that by clicking on Structure, and Blocks.
04:29Now, the way the block system works,
04:31the entire page is broken in to block regions, and you can see those by clicking
04:36Demonstrate block regions, and there is a header, featured, a few different
04:41triptychs at the bottom, and so on.
04:42I am going to put mine in the header region.
04:45So I'll exit out of this demonstration, and find the search block that I need.
04:50It's all the way at the bottom under Disabled.
04:53Change it into Header, and Save.
04:57To see it, once again, I close the Overlay, and there it is.
05:01You'll learn more about blocks in my Drupal Essential Training Course.
05:05There is one problem with this, however.
05:08By default, only the administrator gets to search the site.
05:12To change that, you will go up to People, and Permissions, and then find the search
05:17group down here at the bottom.
05:18I am going to let everybody use the search; both the administrator, and
05:26authenticated users -- that's those people who are signed in -- and those people
05:30who aren't signed in;
05:31those are anonymous users.
05:32Scroll down to the bottom, and Save again.
05:36As always, we close our Overlay to see the effects of our changes.
05:40In this case, we don't see any, since we could already use the search box.
05:44The reason I mentioned the search box, by the way, is because that's something I
05:47find I put on every site that I ever create.
05:50The only reason you wouldn't is if you have some special reason not to allow
05:53people to search the site.
05:55Now, I think we're ready to go.
05:57The steps you saw just barely touch on tasks in the Building a Drupal Site
06:01section from the Drupal Essential Training series.
06:04If you're hungry for more detail, refer to that course.
Collapse this transcript
2. Getting Ready for Sales
Accepting PayPal payments
00:00If you listen to rap at all, you know you've gots to get paid.
00:03So before we do anything else, let's look at how Drupal Commerce handles payments.
00:08I'll first show you how its example payment system works; that lets you test
00:11your store without involving any real money.
00:14Then I'll show you how to hook up your store to a PayPal account.
00:17To get started, we click Configure store, and Payment methods.
00:21Then let's go down to Example payment, and edit it.
00:26This page will become extremely familiar to you as you use Drupal Commerce.
00:31This is the interface for a Drupal module called Rules, which comes with
00:34the Commerce Kickstart.
00:36Basically, Rules comprises three parts.
00:39This part at the top, Events, is what sets the rule in motion.
00:43In this case, it happens whenever a customer selects a payment method from a pop-up menu.
00:48The Condition section tells you what has to be true for the action to take place.
00:52For example, you could decide to accept PayPal payments up to only a
00:57certain dollar amount.
00:58If the order is bigger than that, the action simply won't fire.
01:02This payment has no conditions.
01:03Customers can use it for all orders.
01:06Finally, Actions tells you what is actually going to happen when that event occurs.
01:11In this case, it's simply to allow customers to use this payment type.
01:15We will talk more about rules in the video about understanding rules.
01:19If you want to, you can read a lot more about it at drupal.org/project/rules.
01:26
01:27But, for now, we have no changes to make.
01:29So we will just get out of here by closing this overlay.
01:33Now, let's let customers pay using PayPal, which is one of the most popular
01:37methods of payment on the internet.
01:39To accept such payments, you have to get an account at paypal.com, and
01:43specifically it's at developer.paypal.com.
01:48I won't go into the details.
01:50For that, see the lynda.com series eBay for Sellers Essential Training.
01:54I already created an account: lyndaaccounttest@yahoo.com.
01:59We are going to have to have that when we go to configure the module.
02:03But Drupal Commerce Kickstart doesn't come with that module preloaded.
02:07We are going to have to get it from drupal.org.
02:09You can do so by going to drupal.org/project/commerce_paypal.
02:19From there, you scroll down to the version that you want to install.
02:22At the time that I'm recording this, it's still in Development version.
02:24I know that it works, because I've tried it, but of course, you're going to want
02:27to use whatever is the most stable version available at the time you see this.
02:31You will right-click, or Command+Click, in order to copy this link location, and
02:35then you will install this as you do any other Drupal module.
02:38For more information on that, you can see my lynda.com course, Drupal
02:42Essential Training.
02:43But we will just go up here in Modules >Install new module, and paste the URL
02:49that we just copied.
02:50This is the way that you install all modules.
02:52Click Install, and then we will enable it by clicking Enable newly added modules.
02:59Once again, we close up these groups, so that we get down to our Commerce group,
03:03and then we look for our PayPal module.
03:05There is our payment method example, and payment, which are already enabled,
03:08because they come with Commerce Kickstart, and here's our PayPal modules.
03:12We are going to use PayPal, and WPS.
03:15There is also a Payments Pro that we won't get into.
03:18Scroll down to the bottom, and save configuration.
03:22Once that's done, we can actually go and configure that payment method.
03:27Once again, we go back up to Configure store where we were before, and Payment methods.
03:31Now we see an extra choice down here: PayPal WPS.
03:36We enable it by going over to the Enable link, and clicking it.
03:39Then make sure we want to; yes, we do.
03:42It's now almost ready to use, but we still have to edit it to put in our
03:46PayPal information.
03:47So we click Edit, and down to our Actions, which we have to edit, and there is
03:53the spot we put in our PayPal e-mail address.
04:00Scroll to the bottom, and click Save.
04:06Now, I do want to mention a few of those other options that we skimmed over there.
04:09I'll click Edit, and take another look.
04:12First is the choice between Sandbox and Live.
04:15By default, you're not actually going to start accepting payments.
04:19Instead, it's going to be a way that you can test accepting payments without
04:22transacting any real money.
04:24When you're ready to switch over, you will change it to Live, of course.
04:28Then there are some other options at the bottom, which aren't as important for our purposes,
04:31so we'll just click Save.
04:35So we now have two payment methods, which we can see once again by going to
04:38Configure store, and Payment methods.
04:41We have the Example payment, and PayPal WPS.
04:45These show up when somebody buys a product from our site, and then tries to pay for them.
04:49Since we don't have any products yet, we can't demonstrate payment methods.
04:53But you will see how that works after we start adding some products to our site.
04:56We are now ready to start accepting customer's money, at least through PayPal,
05:02but customers still don't have a reason to pay us.
05:05So the next step is to start listing some products in our store.
Collapse this transcript
Setting up individual products
00:00When we're done with the next two videos, which show you how to create both a
00:03product, and a product display, you will see something like this.
00:07It's the front page of our site, with the product itself showing up in a list of other products.
00:12It has an image of the product, a description of the product, but it also has
00:15such nice little things, like this Add to Cart button.
00:19When you click on the product itself, you see it with a larger image, and a
00:23little bit of other changes, which you can affect in the product display. Let's get started.
00:29Now, it's time to list our first product.
00:32Our client in these videos is a company that produces olive oil,
00:35so we will sell a simple half liter bottle.
00:38Later, we will sell a variety of sizes, and flavors, along with cosmetics, and
00:42tickets to events in the Olive Grove, and so on, but let's start small.
00:46Now, when we're done with this first video, you won't see the product on your
00:50site, because Drupal Commerce separates product entry, which we're doing now,
00:54from product display.
00:55I'll show you about the latter in the next video, displaying products.
00:59The basic way that you add products is actually fairly simple.
01:03You go up to View products, and click Add a product.
01:06Once there, you see that there are a few required fields.
01:09You have to enter a unique identifier --
01:11I'm going to be using five digit codes throughout this video series --
01:15a title, a price, and a status, and you can also add an image if you like.
01:20This pattern is based on what's called a product type, and if you're familiar
01:24with Drupal 7, you know that this is something called an entity.
01:27It's a lot like creating a content type for nodes.
01:30I will show you just very quickly how that works, in case you're not
01:33familiar with Drupal 7.
01:35Go up to Store, and Products, and then click Product Types.
01:39We only have one, which has a number of fields in it, which we can see by
01:43clicking Manage Fields. There it is;
01:46the SKU, the Title, Image, Price, Status; these are the fields you just saw a minute ago.
01:50You can make changes to these fields by clicking on Edit next to the field itself.
01:55Let's put in a default image, so that if we don't have an image of the product,
01:59people will see something, instead of just a blank space.
02:02To do that, you scroll down to the area where you can add that -- this default
02:05image down here -- and click Choose File.
02:08We have a default image in the exercise files;
02:10this one right here.
02:11So I will choose it, and open, and Save settings.
02:16Then, we close our Overlay, if we'd like.
02:18You will see how this affects our store as we go on throughout the course.
02:22Now let's go back, and actually add a product.
02:24Once again, we go up to Store, and Products, or we could simply click View
02:28Products in the shortcut bar here.
02:30But however we get there, we then click Add a product.
02:33I will make this 10001.
02:37The Title is Olive Oil, .5 liter.
02:42In this case, I do have an image in my exercise file,
02:44so I will select that, and let's say it's $10.00, and scroll to the bottom, and Save.
02:51If you're building a full catalog, here you have an option to add another
02:54immediately, but we will just add this one for now.
02:58That's pretty much all there is to it.
02:59Now, these products, as I say, do not show up on the site yet. They're sort of
03:03like boxes of things in the warehouse.
03:06On your Drupal Commerce Web site, you have to move them into the retail store, so
03:10to speak, before anyone can buy them.
03:13So the next thing we'll do is to create a way to display this product.
Collapse this transcript
Displaying products
00:00We've set up our store, and added one product; a bottle of olive oil.
00:04The way Drupal Commerce works, that's only the first half of the equation.
00:09That product won't appear on our site until we also display the product, sort of
00:13like moving items from the warehouse to the front of the store.
00:17To do that, we will create something called a product display node. Because we
00:21are using Commerce Kickstart, we get a few things that you'll have to set up by
00:24hand if you installed it from scratch.
00:26The first is in the modules. You will have to turn on two modules that are down
00:30here under the Commerce area.
00:33First is Cart, and second is Product Reference.
00:37You'll need Product Reference, because that's what ties together the products
00:41with the product displays.
00:43Another thing that we get from installing from the Kickstart is a product
00:46display node content type.
00:48You see that by going up to Structure, and Content Types, and there is Product Display.
00:54As with other kinds of nodes in Drupal, you can change the fields that it
00:57contains by going over to Manage Fields, and as you see, there's only three by default.
01:02There is the Title, and the Body, and then there is a Product.
01:06This is, once again, what ties our display node to the product itself, through
01:10a product reference.
01:12Now it's time to actually add a product display. There are two ways to do this.
01:16The obvious way is by clicking Add product display.
01:20The other way is the more drupaly one, by going up to Content, Add content,
01:25and Product display.
01:27In either case, it gets us to this form.
01:29I'm going to fill it out using some text that in our exercise files, and we'll
01:33copy the title here: Our best olive oil. And also, the body here: this is our
01:41description of the product.
01:42Now, you'll remember there were three fields in the product display content type.
01:47The third one is right here; the reference to the product itself.
01:51I happen to remember that we called it olive oil, something, something. So as
01:55I start to type it in, it looks through all of the products and says, oh yes, that's the one.
01:59If we had more than one that started with olive, or that had olive in it, we
02:02would see the whole list here.
02:03But I will just click this, and go down, and Save, and there it is.
02:10This is the full view of our product.
02:12It is also set up, by default, to put that on the front page of our site, so
02:15a catalog starts compiling, just as we add products.
02:19If we click on our logo, and go to the front page of our site, there it is, and
02:22there is even an Add to cart button here.
02:24Now the truth is, we could leave things as they are now, and we would be able to
02:27just shop from the site as it is.
02:29But I would like to go back and make a few changes to show you how to affect the
02:33way that products are displayed.
02:34There are two kinds of changes you can make.
02:37One kind affects only the display of a particular product, and the other one
02:41affects the display of all products.
02:44First, I am just going to change this particular product.
02:46To do that, you click its title to go to its full node, and there is this
02:49little Edit tab here.
02:52Besides the things that we filled out earlier, if you scroll to the bottom, you
02:55will see all of these things, which are called vertical tabs.
02:59We could, for example, add a menu link here, and have that show up at the top of the page,
03:03make different revisions as we change things throughout the process of building
03:07our site, and so on.
03:08The one I'm going to change, though, is this URL path setting.
03:11If we switch over to the way that somebody sees this site as a visitor, which I
03:15have in another browser, and reload, you will notice that we see our product,
03:19but when we click it, the URL is this node/1; it's not really very friendly. And
03:25furthermore, that node/1 doesn't say anything to search engines like Google, or Bing.
03:31We can make it more friendly both to people, and to search engines, by going back
03:35to that node here, and adding what's called a URL alias.
03:39I'm going to call this our best olive oil half liter, let's say, and then Save it.
03:47And now if you look at the top of the page, there it is. Much better for search
03:50engines, and it is also more friendly to people.
03:53There are other things that you can change in those vertical tabs, and if you
03:56want to learn more, see the Drupal 7 Essential Training Course.
04:00Now I would like to move on to the more powerful part, which will show you how
04:03to change the display of every product on your site.
04:06For example, let's say that you want to make this graphic bigger, or put a label
04:10next to it, and you want it to be consistent on all the products in your site.
04:13You can do that by editing either the product display, or the product, and it's
04:18sometimes not clear which you edit.
04:21What I usually do is I start with the product display, and to do that go up to
04:24Structure, and Content Types, and once again, we have Product display.
04:29Now, instead of clicking edit, or manage fields, I click manage display.
04:34So I wanted to change the look of that image, and I go over here, and I see, ah,
04:38wait a second; I have to change that on the product itself. But there are some
04:42things that I change on the node.
04:44For example, if I were to show a label here for the body -- let's do that; I'll
04:49put it above, and Save, and then close out this overlay --
04:54we now see this label here that says Body. I don't really like that, so I will
04:58go back, and I will change it by clicking Structure, Content type, Product display,
05:02and manage display, and just remove it; easy enough.
05:06And of course, Save.
05:07But let's go ahead and change that image.
05:10I can either go to the Product Manage Display tab, or just click this link
05:14here. I'll do that, and then click manage display, and here I can change the
05:20style of that image.
05:23Let's say I want to change it from medium to large, and Update, and Save.
05:29Now let's go back and see how that looks.
05:31Yup; it immediately refreshed, and now we see a much bigger picture.
05:36Now, I know that Drupal Commerce's two- step process for listing product is a bit
05:40odd, and it's sometimes confusing to tell whether you're supposed to affect the
05:44product, or the product display.
05:47The way I handle it is to first create products, and then create the display
05:51nodes that I need to display those products.
05:54In fact, you have to go in that order, because in order to display a product,
05:57you first have to have it, and then make a reference to that product. Then, if
06:02I want to change the way these things look on the site, I start with the
06:05product display, because I know there are links back to the product if I
06:09need to make any changes there.
06:12So now we have all of our products displaying on our site, and along the way, I
06:16pointed out that we have this Add to cart button right here.
06:20Believe it or not, it's already possible to start shopping on the site.
06:23We will talk about the shopping cart, and checkout bits, in the video, Seeing
06:27your site from a customer's viewpoint.
Collapse this transcript
Categorizing products
00:00Most product catalogs, whether online, or in paper, are broken into categories.
00:06A department Store catalog will have, for example, a category for lawn and garden,
00:10and another one for housewares, and so on.
00:12Drupal Commerce lets you organize your products into categories as well, but
00:16first you have to decide what those categories are.
00:19This video shows you how.
00:21The controls for such categories are under Structure, and Taxonomy, and here I
00:25should explain exactly the way Drupal works.
00:28The whole system is called its taxonomy.
00:31A taxonomy is divided into vocabularies, and each vocabulary is a
00:35different class of category.
00:37For example, let's say that you're selling shirts.
00:40You might have one vocabulary for size, and another for color. Within each
00:44vocabulary are terms that say what the thing actually is.
00:48So the size vocabulary would have the terms small, medium, and large, and the
00:53color vocabulary would have red, and black, and white, and so on.
00:57So first, we are going to have to add a vocabulary.
00:59I am going to call this one Category, and we don't actually have to put in a description.
01:07There; it's that easy.
01:08Now we will add our terms to that category.
01:11To do that, go over and click add terms, next to Category.
01:15The first one I will add is Edible oils, which fits the product that we already
01:18added to our site, so Edible oils.
01:22You can add a description, and I'll do that right now.
01:24Let's say, A centerpiece of good eating, and then a URL alias.
01:31
01:32I'll add one here, and you will understand what it does when I'm done with the video.
01:36I'll just make it edible-oils, and Save.
01:39You'll notice that after you've added a term, you're asked to add another one.
01:44That just follows the way that people usually work.
01:46They'll usually start adding term after term, which is very convenient I
01:50think, so I will actually add Cosmetics with its own URL alias, and save. And
02:00finally, Apparel, and save.
02:07Now, we have set up our categories, but they don't actually show up anywhere
02:11until we link them to our product display nodes.
02:14So to do that, I go up to Structure, and Content types, and edit the product
02:20display content type.
02:22I will go into manage fields. In order to connect the categories to product
02:27display nodes, I am going to add a field here. I will say, Type of product, and
02:34here I will just call it type_of_product.
02:38If you have any problems with this screen, or setting up content types, or
02:42managing fields, take a look at my Drupal Essential Training Course, which goes
02:45into this in a lot more detail.
02:48For field type we select Term reference. That refers back to, as I say, those
02:53terms within the vocabulary, and I'll leave it as Select list, and save.
02:58We then choose what vocabulary we want it to be connected to, in this case,
03:01Category, which we just created. Save, and then we have a whole bunch of other
03:06settings that we could use.
03:07I'm just going to leave it as it is, and save.
03:10Now let's go back to our Content. We have this right here; we could click it, and
03:15edit it, but I also want to show you how you can see a list of all of your
03:18product display nodes.
03:19You go up to Content and click, and if you had more than one, it would show up in this list.
03:24To edit it, you just go and click edit. That takes us back to the same place as
03:28if we'd clicked edit in that other screen.
03:30As we scroll down, we now see this extra field: Type of product. It's an edible oil,
03:36so I will add that, and save.
03:38If I go back to look at it, we see we now have Type of product, Edible oils, and
03:44that actually shows up as a link.
03:46You will see what that does after I add a few more products.
03:51Now remember, adding products is a two-step process.
03:54We first add the product, and then the product display.
03:57If you're a premium subscriber on lynda .com, or if you receive this course on
04:01the disk, you can use the text and graphics in the exercise files, as I'm going to do.
04:06If not, or you're building your own store, of course, you can use any content you like.
04:10Rather than show you the whole process of adding products, and product
04:13display nodes, I am going to go ahead and add them myself, and we will come
04:17back when we're done.
04:19There; we now have three products in our site.
04:22We have our original olive oil here at the bottom;
04:24we also have some Lemon- flavored olive oil, and also Lip balm.
04:28Now, if we click on one of these two edible oils, we see that link I showed you
04:33before, Edible oils, and if you click on that link now, you'll see that it takes
04:37you to a page that shows you all of the edible oils on our site.
04:41If I were to go back to the front page and click on Lip balm, it's in the
04:47Cosmetics group, and of course, there's only one in the site, but if there were
04:50more, it would show up here.
04:52You'll also notice that our URL says cosmetics up here.
04:55Once again, that's good not only for people who are visiting the site, but
04:58also for search engines.
05:00So that's as an introduction to categories, and remember, we did that all
05:04through the Taxonomy page under Structure, and Taxonomy.
05:07There is a lot more to Categories, we didn't go into, such as
05:11creating subcategories.
05:13I do have a recommendation though: plan your taxonomy well from the beginning,
05:18and then keep tabs on it as you add products. It's easy to change direction in
05:22midstream, and forget to re-categorize things, but a store that's well organized,
05:27with thoughtful categories, is a cinch to manage, and a joy to shop.
Collapse this transcript
Adding simple taxes
00:01If you have been following the course to this point, you could actually open
00:04your store right now.
00:06You know how to create and display products.
00:09We have categorized them, and you have given customers a way to pay.
00:12But there's a lot more to running an online store than that, of course.
00:16In this jumpstart Section, I am just touching on a few topics that give you a
00:20foundation for all the rest of the things you will learn in this course.
00:23This video shows you how to apply a very simple tax to your customer's orders.
00:27But in a larger sense, it's about two features that are central to Drupal
00:31Commerce, and that you will learn more about throughout the course;
00:34line items, and rules. But let's take it back a little bit, and talk just about taxes.
00:40We go up to Store, Configuration, and Taxes.
00:45Here we have two tabs: Tax Rates, and Tax Types.
00:49You might notice a pattern between this screen, and some of the others you've
00:53seen during this course.
00:55You might remember, setting up a content type,
00:58and a content type is a pattern for nodes.
01:01You create the nodes themselves based on a content type, because as I say, it's the template.
01:06Product display is the only content type we have used in this course,
01:09although Drupal, and Drupal Commerce as well, also comes with two others,
01:12known as basic pages, and stories.
01:16Similar to content types, are product types.
01:18A product type is a pattern for products.
01:21So first you create the product type, and then you create the
01:23products themselves.
01:25Drupal Commerce comes with one product type built in.
01:28Now we are in taxes, and we have tax types. They are patterns that we use to
01:33create the taxes themselves.
01:35So let's go back to our site, and
01:36I will show you how that works.
01:39Drupal Commerce comes with two tax types.
01:41First there's the Sales tax, which is the way that we do things in United States,
01:45and several other countries.
01:46Then there is VAT, which is more of a European system.
01:50The difference between the two has to do with when the tax is applied, and there
01:54are few other small differences.
01:55Now the Tax Rates tab, actually defines how much tax there is of those two types.
02:01So let's go ahead and add one.
02:03We click Add a tax rate,
02:04and I am going to call this Flat 8% tax.
02:11The display title will also be Flat 8% tax, and if you want you can add a description.
02:17In the Rate, we actually enter this as a decimal; 8% is 8 one hundredths.
02:22You are adding 8 one hundredths of the amount of the sale, so it's dot, 0, 8; .08.
02:28And we are going to keep it as a Sales tax.
02:30This is where that tax type comes in, and Save tax rate.
02:36That's really all that you have to do, except I want to mention exactly
02:39what's happening here.
02:40When you create a tax rate, you're actually creating a rule,
02:44and if we click configure component here, you'll see a little bit about how that works.
02:49You could set up conditions here, so for example, only apply the tax if
02:52it's within a certain state, or if it's above a certain amount, or below a certain amount.
02:56And then it takes an action.
02:58And if we edit that, you can see it's our Flat 8% tax.
03:02I will show you a bit more about how to vary your taxes according to location in
03:08the video creating tax rules.
03:10But for a simple tax, that's really all you need to do.
03:13But where does the tax show up?
03:15Drupal Commerce is set by default to display taxes American-style; during the
03:20checkout phase of the purchase. So I will walk through the process to demonstrate that.
03:24We will also catch anything odd we might've missed while setting this up.
03:28To do that, I will close out this overlay, go back to my front page, and let's
03:32say that I want to, for the first time in this course, purchase something.
03:35I will purchase this Lip balm; add it to the cart.
03:39That shows up over here. I'll view the cart.
03:43Yep, it's 8 dollars.
03:44And then let's say I check out.
03:45Yep, there is our 8 dollars for the item.
03:48We only have one item, so there's our subtotal of 8 dollars, and then it adds
03:52the 8% tax, for $8.64.
03:55These parts are what are known as line items.
03:58The product here is one kind of line item, and then the tax is an item that is
04:02added after all of the products are put together.
04:05Some of this behavior varies in Drupal Commerce, and the good thing about Drupal
04:08Commerce is that you can make it vary according to your individual situation.
04:12And taxation is a kind of place where you might actually end up varying the
04:16way that things appear.
04:17It's a very complex subject, and we only scratch the surface with this simple tax example.
04:22But in Drupal Commerce, all of this implementation happens using rules.
04:27I will show you how to use rules to prevent people in your home state from
04:29paying taxes, for example, in the video understanding rules, and you can add any
04:34kind of rule you want to create any kind of tax situation that you need.
Collapse this transcript
Seeing your site from the customer's viewpoint
00:00Our store is simple, but ready for customers,
00:03but you should never launch a site until you have walked a mile in your
00:06customers shoes, so to speak.
00:08In this case, that means we have to actually go through the process of
00:11ordering something.
00:13To do that, I'm going to switch to another browser where I am not logged in
00:16so we can see the site exactly as everybody else will see it.
00:19I will switch over to the Firefox browser, where as you can see from this User
00:24login block, I'm not logged in.
00:26I'm also logged in to our fictitious user's e-mail account right here.
00:31Now let's pretend that I'm an ordinary customer buying a product from the site.
00:35So I will go down, and I will add something here,
00:37I will add something else here, and as I go through, you'll notice that the
00:42Shopping cart starts to fill up.
00:44I could look at the cart. Okay good; two items.
00:46I could actually make this 2 of the Lip balm instead of one, and say Update cart.
00:51Great; $26.00, and then I go to the Checkout.
00:55Terrific; so far it works perfectly.
00:57I have my items, I have the tax, and I have the total.
01:00I am going to add little bit of account information here.
01:03Here, I will put the e-mail address of the purchaser, and I will make up a name,
01:14and an address, and finally, continue on.
01:23It's asks us to confirm all of this information. Yup, looks good to me, and then
01:29down at the bottom you have a choice of what payment method to use.
01:32You will notice that when I change from one payment method to another, it
01:35changes the parts of the form that you have to fill in.
01:37The example payment just has this little test area where it will fail for single
01:42character value, so I will just enter something here: test, so I know that it will
01:45go through. Continue on, and there we are.
01:49Once we have completed our order, we see that as this user, we can view the
01:53order, and see exactly what we ordered.
01:55Some other things are happening, though. If we switch over to the purchaser's
01:58e-mail box, they've received some e-mails.
02:01Now remember, they have never been to the store before, so the first thing that
02:04happens is that the store creates an account on the site,
02:08and it tells them how to log in, and so on.
02:11The other e-mail message that we got tells us a little bit more about that order,
02:15and it tells us how we could go in and take a look at that order.
02:18If we go back to our site as the administrator, and click People, there! We see
02:23that person right here.
02:24And it says that they have never been to the site; that's because they have
02:27never actually logged in to the site.
02:29So each person who makes an order from your site actually becomes a user as well.
02:34That's good because it gives you a way of presenting their information in
02:37a collected format.
02:38They can log in, and look at all of their orders, the entire order history, and so on.
02:44The other good thing about this is that you can create a community in that way,
02:48which ties in with the orders that people make.
02:51If they want to talk about their orders, they have a persistent personality on
02:54your site as a result.
02:56You can also configure your site so that different people get e-mails whenever
02:59somebody makes an order; so the person who has to ship it, and wrap it up, and so forth.
03:04But we will get into those parts later on in the course.
03:07That's a pretty satisfying procedure, isn't it?
03:09The way that somebody went through and actually made a purchase looks a lot
03:13like any other store that you see on the Internet, including those that are much,
03:16much bigger than the sites that you and I will probably build.
03:19Now we are going to go back behind the scenes, and see what happens on the
03:23administrator's side when an order comes in.
Collapse this transcript
Processing orders
00:00So, someone finally bought something from your store. All right!
00:04Now you just have to fulfill the order.
00:07If you have run any sort of mail-order operation before, you know that there is
00:10more to it than just tossing something in an envelope, and sending it off.
00:13You also need to check the order, and the payment,
00:16add the customer's information to your records, and change the order's status from
00:20pending, to completed.
00:22Fortunately, the folks who created Drupal Commerce are well familiar with these procedures,
00:26and they made the software act according to familiar real-world patterns.
00:31First of all, Drupal Commerce assumes that you are going to check the site
00:34for orders frequently.
00:35You can set it up so you get an e-mail whenever an order comes in, and I'll show
00:38you how to do that in the video managing orders,
00:41but for now, let's just take a look at the orders that we have.
00:44We go up to Store, and Orders, and there's a list.
00:48In the last video, we had one order come in, and we can take a look at it by
00:51clicking on its number here, or on the view link right here, and there it is.
00:57It tells us what they ordered, how many of them, what the tax was, and so on, and
01:02also the address that it was sent to.
01:04We can edit it if somebody, for example, makes an order, and then calls up and
01:07says, you know what? I really meant to buy three of those; not two. We will just
01:11go over, and change it to three.
01:13Scroll down, and save the order.
01:17And of course, that updates all of the related information.
01:21You might have noticed that as we scroll down, there is actually a lot of things
01:24that you can change.
01:25The user information, who created it, and you can also change when it
01:29was ostensibly created.
01:30Let's go back to this part.
01:32We are going to change it from Pending, to Completed.
01:36And then we could add a log message here saying, Sent out the product, or whatever.
01:41And down to save.
01:42We are also able to take a look at the payment that they made,
01:47so we could see how they paid for each one of their orders.
01:50And if they didn't make a complete payment, we could actually add another one
01:53here. Let's say they made a partial payment, and they're going to send the money in later on;
01:57Drupal Commerce takes care of that.
01:59There is one other thing.
02:00The way that Drupal Commerce keeps track of all of this is, every time somebody
02:04makes an order on your site, it creates a user.
02:08And you can see that by going to People, and there is a list of all of the users.
02:12The one down here at the bottom, admin, is us; the people who created the site.
02:17And then here's the customer who actually made the order.
02:20If we click on that person's name or e-mail address, we could then go through and
02:24take a look at all of the orders of a specific customer, and make some changes to
02:28their individual information.
02:30This video finishes the jump start to sales section of the course,
02:34and you could get started right away with the knowledge that you have, and be
02:38happily selling your product tomorrow.
02:40If you do that, though, you'll probably need to add functionality to your store pretty soon.
02:45You'd want to give your customers more options, and get more sales, and ease your
02:49administrative load.
02:50So keep watching, and we are going to take your store from basically okay, to
02:54something that really works well.
Collapse this transcript
3. Understanding How Drupal Commerce Works
Understanding products and other entities
00:00One thing that a content management system like Drupal does is to
00:03compartmentalize your site's structure into logical patterns of information that
00:07are easy to work with.
00:09Drupal calls these entities.
00:11Now, describing entities can get a little bit confusing, and even metaphysical at
00:15times, but if you listen through it, you will find that you may understand your
00:19site's structure much better.
00:22In core Drupal, there are four kinds of entities: content, which Drupal calls
00:27nodes, users, categories, which Drupal calls taxonomies, and comments.
00:37Let's just take a look at a node.
00:39By default, nodes have only two fields, a title, and a body.
00:44But when they're displayed, a node actually pulls in parts of other entities.
00:48For example, the name that gets connected with that node comes from the user entity.
00:54There may be tags at the bottom of that node; that comes from the taxonomy.
00:59And finally, Drupal allows people to comment on nodes, and those come from a
01:03different sort of data store; the comments entities.
01:06If you've used Drupal 7 before, this is all old-hat.
01:09You can add fields to any kind of entity, and then reference them from
01:13other entity types.
01:14For example, you could add a picture to a person's profile, and then that could
01:18show up in the node.
01:19But back to Drupal Commerce.
01:22It adds several more entities.
01:27Besides the four that are in core Drupal, it also adds products, customer
01:33profiles, line items, and payment transactions.
01:39And most of these work pretty much the same as they do in core Drupal.
01:42If I switch back to our site, I will show you that.
01:45First, let's look at core Drupal.
01:47If we go up to Structure, and Content types, and then take a look at Product display,
01:52we can change the fields that go into Product display pretty easily, and you have
01:55seen this already in this course.
01:57Similarly, if we go up to Store, and Products, we have Product Types.
02:02And once again, we can add fields to those.
02:05As we go on, we can configure our store, and look at our Order settings, and
02:09actually add fields to orders.
02:11So when somebody goes through the whole order process, you could make them for
02:14example, add additional information.
02:17Let's say their age, if it's some sort of age restricted item that you are selling.
02:21These types -- content types, product types, and so forth -- are like templates.
02:26So if you're selling shirts, you create a product type that includes an image,
02:29and a field for color, and a field for size, or you might do that all through
02:32taxonomy, but once again, you are just adding fields to entities.
02:36And, as I mentioned earlier, Drupal Commerce often references one entity's field
02:41from another entity.
02:42That's why you are able to see product information in your product display nodes.
02:46And your product display nodes can also reference the person who created them, and so forth.
02:51I know this is pretty conceptual stuff, but it will all become clearer the more
02:55that you work with Drupal Commerce,
02:57and having this understanding will help you to avoid becoming confused as you
03:01go forward.
Collapse this transcript
Understanding line items
00:00When you go into a store to buy something, you are product-centric.
00:04You are looking for a particular thing, and you don't care much about what
00:06happens behind the scene, but when you're running the store, you start looking
00:10at the bigger picture.
00:12The thing that you sell is part of an order,
00:14and that order has to be tracked in inventory.
00:17Line items are an important part of the order and inventory system.
00:20Here is how it works.
00:24An order comprises a list of products that the customer has purchased.
00:28You see those here as Product 1 and Product 2.
00:31Those each have a price, and for each one of those, the customer can buy a number
00:35of them: the quantity.
00:36The price gets multiplied by the quantity, and you get the total amount for that product.
00:40Products can also have a negative price.
00:42For example, if you give a refund, shown here as -$5. Or they could have no price at all
00:48if it's a gift, or some other kind of giveaway. All of those items add up to a
00:52subtotal, and then you put on additional charges, such as shipping and tax.
00:56The things that are at the top of the screen here, before you add the shipping,
00:59and tax, and other additional charges, are known as line items.
01:03The things that come after the subtotal are not line items; in this
01:07case, shipping, and tax.
01:10However, orders don't have to work exactly this way.
01:13Here is another example.
01:15We have all of our products at the top, and they are line items.
01:19But then again, we also have the shipping item as a line item.
01:24This would be the case if it was flat rate shipping, for example.
01:26We know that no matter what, it's going to cost 6 dollars.
01:30In some order systems, the amount of shipping changes depending on the total of
01:34the line items, and in that case, shipping itself is not considered a line item,
01:37because it's variable.
01:39Tax, however, is not considered a line item in this example, because it is
01:43variable; it's a percentage based on the total amount of the line items before.
01:48You will also notice that not every line item is necessarily taxable.
01:52We have added up the amounts of the order, and that comes to $40; 10% of that is our $4 tax.
01:58We didn't charge tax on the shipping.
02:00Now let's take a look at how line items work in a Drupal Commerce store.
02:04Since we haven't set up any shipping methods yet, our order is going to be very simple.
02:07We will start by putting an item in the cart.
02:09Let's just get us some Lip balm, and go and take a look at the cart.
02:14When we look at the cart, we see only the line items.
02:17We have created a tax rule in a previous video, but we don't see it here until we go to Checkout.
02:23Now we see our line items, and then we have our tax after it.
02:27Now, line items are unusual in Drupal Commerce in that you can't create them.
02:31They are, instead, created by modules that you install, such as the commerce
02:35shipping module I will show you later in the course.
02:37I'll show you what I mean.
02:39If we go up to Store, Configuration, and Taxes, we see that Tax Rate that we added
02:45earlier, and in fact, there is a link here to add a tax rate.
02:49However, Drupal Commerce also keeps track of all of the line items, and if we go
02:53back up to Configure store here, and then down to Line item types. However, we
02:57don't have an add link up here.
02:59Instead, these line item types appear as you add modules, or enable modules, in
03:04your Drupal Commerce store.
03:06As Drupal Commerce matures, I expect we'll see some interesting definitions of
03:09what line items are.
03:11As always, drupalcommerce.org is where you can find out about
03:14these developments.
Collapse this transcript
Understanding rules
00:00Part of Drupal Commerce Kickstart is a Drupal Module called Rules, which is
00:04available separately at drupal.org/project/rules.
00:09A lot of Drupal Commerce's functioning depends on the Rules module.
00:13For example, it comes with a rule that sends the customer an e-mail message when
00:16checkout is completed.
00:18You'll see rules a lot as we go through the course.
00:20I want to just take a moment now to show you how the module works in general.
00:25Now, unless you're experienced with Drupal administration, you'll mostly only
00:28deal with rules as you configure your store.
00:30They show up in several places.
00:32One of them is related to something we already started playing with;
00:35taxes, and we can see that by going up to Store, Configuration, and Taxes.
00:42Here's our Flat 8% tax we created earlier.
00:44Let's click edit, and take a closer look at it.
00:47This is fairly simple.
00:48You get to define the rate, and what type of tax it is, as we described.
00:52But if we go back a screen, and then click configure component, we see some of
00:57the inner workings, which are a little more complicated.
01:00This is where you can add conditions.
01:02Let's take a common one.
01:04Let's say that our store is in Ohio, and U.S. tax laws say that we only have to
01:08collect state sales taxes for sales that are shipped to addresses within that state.
01:12So we only want to apply the sales tax when an order is being sent to an
01:16address that's inside Ohio.
01:18If we look here, we see that there's a Condition section.
01:21This is where we're going to add the condition to check to see if it's in Ohio.
01:24Most rules also have a section up here;
01:27Events, and we'll get to that a little bit later. And as I said earlier in the
01:30course, actions defines exactly what happens when the conditions are met.
01:33For now, we'll just click Add condition, and the condition we are going to add
01:37will be an address component comparison.
01:40This Data selector area is quite complicated;
01:43there is a few different ways that you can do this.
01:45You can type things in, you can choose them from a list, and if you click and
01:48open this Data Selectors, it shows you all of the different options.
01:51If you want more information about how all of this works, I would suggest that
01:55you take a look at the Rules documentation, which again, you can get to at
01:57drupal.org/project/rules.
02:01But going down, let's take a look at what our values are.
02:03We are going to take the billing information, it will be the state or province,
02:11and the value has to equal Ohio, and then save.
02:15Now if we look again, we can see it describes exactly what we're going for.
02:21Now, let's take a look and see if it worked.
02:23I'll close out this overlay, and we already have an item in the shopping cart
02:28which I added previously.
02:29Take a look at the cart. Okay, there it is, $8, and let's check out.
02:33Now at this point, we're going to add our address in the billing Information.
02:37So Tom Geller, Address 1, let's just say, 1 Main Street, Oberlin, Ohio, 44074.
02:44Now, if I did this correctly, I should be charged tax.
02:50Let's continue and see, and indeed I am.
02:53There is our 8% sales tax.
02:56Let's go back and change that address to something in New York, in which case it
02:59shouldn't actually charge us the tax.
03:01So I'll go back and let's say 1 Spencer Street, Mount Kisco, New York,
03:0710549, and continue. Indeed, it worked;
03:16we're not charged tax.
03:18Now I want to go back a little, and show you some of the complexities of rules.
03:22We won't be able to go into the details, because there really are a lot of them,
03:26but I am hoping that a little more exposure will help you debug rules that don't
03:30do exactly what you expect.
03:32To show you that, I'll go up to Store, Configuration, and Product pricing rules,
03:38and let's take a look at our sales tax calculation here.
03:44Now you see that little extra bit at the top, the Events section, which
03:47I mentioned earlier.
03:48Here you can change when an event occurs; when a rule is triggered, so to speak.
03:53Let's take a look at that.
03:56One example that's sort of outside of the whole world of taxes is this After
04:00adding a product to the cart.
04:02You could, for example, ask the person, would you like this to be gift-wrapped?
04:06Pop up a window, or something like that, each time that they add a product to the cart.
04:10Similarly, you could change how and when Drupal Commerce calculates shipping
04:14charges, and anything else that happens on the site.
04:17To see all the rules at once, click Configuration, and then go down and click
04:24Rules, and there's your introduction to rules.
04:29If you want to dive deeper, check out the project's homepage at
04:33drupal.org/project/rules.
04:37To really understand them, scroll down, and click Read documentation.
04:42That leads to this URL: drupal.org/node/298476.
04:50It happens that Rules has a very active development community, and this
04:53project page also has links to a FAQ -- a Frequently Asked Questions page -- and
04:57even to a discussion group.
04:59Chances are, you won't need this kind of help when you first set up your store,
05:03but it is good to have, and it's a great example of the strength of the
05:07open-source Drupal community.
Collapse this transcript
Integrating your store into a Drupal site
00:00Up until now, we've only talked about the commerce functions of your Web site,
00:04but when you install Drupal Commerce, you automatically install Drupal, one of
00:08the most popular and well supported Web site construction kits around.
00:12So it makes sense to build out your store as a full site in Drupal, rather than
00:17trying to integrate it with some other Web site platform.
00:20This video shows you some of the possibilities of Drupal, but it's so big a
00:24topic that lynda.com has several courses just about building sites in Drupal,
00:28and of course, I recommend them.
00:31But let's start by looking at Drupal sites that incorporate Drupal Commerce.
00:34We find them by going to the homepage of the project, which is
00:37at drupalcommerce.org.
00:40Then, we click on Showcase, and I am just going to pick the first one here; ioby,
00:44in our backyard, which is an excellent site.
00:47At the top, we see a gallery of different things that people are doing; things
00:51that ioby wants to promote to everybody.
00:54Look at individual projects down here, with these nice little JavaScript pop-ups;
00:58gives you a little more information.
01:00There's integration with Google Maps, which leads you to the individual projects,
01:08and an About page, and a blog, and so on; all of the things that you would expect
01:17from a fully-functioned site.
01:19So how do you make your site this amazing?
01:21Well, there are two ways.
01:23If you have an existing Drupal 7 site, you would simply add the Drupal Commerce
01:27modules on top of it, and then start building the store.
01:31The way you do that is by going back to your site, and then clicking Modules.
01:35Then you'll install, enable, and configure all the modules you need in the usual way.
01:41This Install new module link is the key, but for full instructions, see
01:45lynda.com's Drupal 7 Essential Training course. But which modules do you need?
01:50The Drupal Commerce page tells you.
01:52Let's go back to drupalcommerce.org, and click Download from drupal.org.
01:58This is where you actually get the software itself, and as you scroll down, you
02:01see this requirements list here.
02:03There are quite a few of them, but again, if you know Drupal well, you'll be
02:07able to install it and configure it yourself just fine.
02:10And best of all, you can do that on top of an existing Drupal site.
02:14The other way to integrate your store with a Drupal site is to start with the
02:17store, and then add the other site features.
02:21That's what we basically have here in the site that we've been building for
02:24Two Trees Olive Oil.
02:25So here are some quick ways to add common Web site features.
02:29Let's start with some basic pages.
02:31First we go back to our site, and we'll close out this overlay just to get back
02:34to our front page, just to see what we're doing. And then to add stuff, you go up
02:38to Content, and Add content.
02:41I am going to create a basic about Page.
02:44So I'll use Basic page.
02:45There is also an article content type, which is slightly different, and
02:48again, you can see the Drupal 7 Essential Training course to understand the differences.
02:52But for us, we'll just do a basic page.
02:54There's a title, and a body, and I am going to get that information from my exercise file.
02:59There's my title; paste it in, and the body.
03:08As I scroll down to the bottom, there are some additional options.
03:10I think I will actually create a Menu link, and the Menu link will be About.
03:15I am also going to create a URL path alias, so that it shows up in the URL bar
03:22up here, just as about, and then I'll save it, and there's our page. And in fact,
03:29we have our little tab here,
03:30so if we go back to our front page, we can go to it very easily by just
03:33clicking About, and there it is.
03:35That's a good start to filling the site with content that supports the store,
03:39but doesn't advertise a specific product.
03:42You'd obviously repeat this process many times as you build and expand your site.
03:46So that's how you add content.
03:48Now, to make a site like the one you saw earlier, you'd also need to add some
03:52functionality, such as that map widget, and photo gallery.
03:55You do that with modules.
03:57Go up and click Modules, and here we see the modules that are already installed.
04:03These are the core modules. You can close up this group if you want, or open
04:06it up to see exactly what's inside it, and then we see some things that
04:10Drupal Commerce installed as part of the Commerce Kickstart package that we started with.
04:14The important part is this Install new module bit, and if you want to see what
04:18modules are available, you can take a look at this link here;
04:21find modules and themes on drupal.org.
04:23I am going to open that up in a new tab to show you how many there are.
04:30Take a look; there's almost 9,000 available.
04:33Now, that includes some repeats. For example, it counts twice the ones that are
04:36available for Drupal 6, and Drupal 7, but there are still thousands of them.
04:40The first thing you want to do when you're searching is to filter by compatibility.
04:44Since we are using Drupal 7, we say Drupal 7, and search, and wow!
04:49There's still over 2000.
04:51The other part of building up your site is the design.
04:54To do that, let's go back to our Modules page, and you can see that it's also
04:57possible to download themes, which are entirely package designs for Drupal sites.
05:02You can do that not only from here, but also from the Appearance window.
05:07Install new theme, let's take a look at what themes are available, and again,
05:14it's very similar to the Modules page.
05:15We'll filter by compatibility, and search, and we see there's over 200 themes,
05:21including several which are sort of base themes that let you do your own
05:25custom programming.
05:26You can also completely create your own custom themes.
05:30lynda.com has a course on Drupal theming,
05:32so check that out if you want to go beyond these readymade ones.
05:35Finally, you might need some custom programming.
05:38This is, of course, a little more difficult, but lynda.com does have courses on
05:42CSS, and PHP, and other skills that will help you.
05:45One of the interesting things about Drupal is seeing how people balance its many features.
05:51You could have a huge site with only a single button for donations, which is
05:55handled by Drupal Commerce, or you could have a big catalog, but only a single
05:59non-product page, which is pretty much what our own site is at this point.
06:02Creating that balance between information and products is a big part of what
06:07will give your site its personality.
Collapse this transcript
4. Listing Products
Adding product variations
00:00We now have three products on our site.
00:03Let's review how they got there.
00:05We first created the products themselves based on a product type called
00:08product, and if we go up to Store, and click Products, we see the three products themselves.
00:14These are all based on the product type called product.
00:18After we created these products, we displayed them by creating product display
00:22nodes, and we can see those by going to Content, and there are all of our
00:26product display nodes.
00:28Creating and displaying product in Drupal Commerce always happens in those two steps.
00:33First you create the product, then you create a node to display it.
00:37It's important to understand this thoroughly, because now we're going to add a complication.
00:42You will notice that two of these products are very similar;
00:46they're both half liter bottles of olive oil.
00:48One of them is lemon- flavored, and the other is plain.
00:52They are, in effect, variations on each other.
00:55Let's say that we have several flavors, and several bottle sizes.
00:58I am going to show you an easier way to create a series of product variations
01:02that also improves the shopping experience.
01:04We will do this in three steps.
01:08First, we are going to add a field to the product itself that describes the
01:12variation, and we will call that Flavoring.
01:15Second, we will apply that flavoring to the relevant products, so the plain
01:18olive oil will be labeled as plain, and so on.
01:21Third, and this is the tricky part, we are going to create a single product
01:25display node that displays all of those variations,
01:28so we won't need to have three separate display nodes. Instead, the customer
01:32will go to them, and select the flavor that he or she wants.
01:35We will start by going back to our product type.
01:38To do that, we go up to Store, Products, and Product Types.
01:43Now I am going to add a field to our product.
01:45It's going to be called Flavoring, and that's going to be of the list type,
01:52List (text), and it will be a select list; that's fine.
01:57Our options will be Plain, Lemon, Basil, and Chili.
02:03Let's scroll down, and save, and then we have some additional options as well.
02:08For example, I will make the Default Flavoring Plain, since that's mostly what we
02:12are going to be selling.
02:14This Attribute Field Setting is a little bit complex, but you'll see what it does
02:18when we start shopping.
02:19We do want it to be enabled, however.
02:22Go down further, it shows us, again, our Allowed values, and save.
02:27Now you will see what happens when we add a new product.
02:30How about a half liter bottle of Chili olive oil?
02:33I have a graphic and some text that describes that olive oil in my exercise files.
02:38If you received this product on a disk, or are a premium member of lynda.com, you also
02:42have these exercise files.
02:43We will do that by going up to Add product, and then go to the text file that has
02:48all of that information.
02:49The SKU is going to be 1003, there is our title, our image, a little alternate
03:03text to help with the accessibility, and for price, let's make that $10. And then
03:12here's our new field; Flavoring. That's going to be Chili, and save product.
03:17Before we go on, I want to edit the other two olive oil bottles: Lemon-flavored
03:21olive oil, and the plain olive oil.
03:24This is step two that we had.
03:26So I will go in and edit. Here is the Lemon-flavored one; I'll change it to
03:29Lemon, and save. And go back to our products, and edit the plain one, so that it says Plain.
03:39Very good!
03:40Now as usual, we will add a product display to show that Chili-flavored
03:43olive oil we added.
03:46This part works the same as before.
03:48We go up to Add product display, and start entering the information.
03:52I have this all in the exercise file.
03:53So I open it; so I will copy my title, and the body text. Scroll down and
04:07choose our product -- remember it was Chili-Flavored olive oil -- it pops up, and
04:11say that it's Edible oils.
04:13Scroll down and save.
04:14There; now when we go back to our front page, it shows up the same as all of the
04:19other products that we have in our store.
04:22But that's not where we're going to stop.
04:24We now want to have all three of the different flavored edible oils to show up
04:28in one product display node.
04:31To do that, we create one product display node, which will reference multiple products.
04:35Before going on, I'm going to make the selection a little bit easier by going up
04:39to Structure, and Content types, and product display.
04:44Now this field here where it references the product; if we edit it, we see that
04:47it's this autocomplete text field.
04:50That's actually a little bit harder to work with, because we don't see what
04:52all the products are.
04:54I am going to change it to a select list,
04:57make it just a little bit easier on ourselves, and continue.
05:00Now let's go back and create that product display node that includes all of the
05:03flavors of olive oil that we have.
05:05To do that, go up to Add product display, say the title is Half-liter bottle of
05:13olive oil (plain and flavored).
05:17Go back to my exercise file and copy the description here.
05:20I am going to select multiple products.
05:25On Windows, you do that by holding the Control key, and on Mac, you do that by
05:28holding the Command key,
05:29and just selecting the ones that you want, so Olive oil, Lemon-flavored,
05:33and Chili-flavored.
05:34The type is all Edible oils.
05:37Scroll down, and save.
05:41Now, you will notice it defaults to Plain as we wanted, and it shows it as $10,
05:46but if I change it to Lemon, we immediately see the different product.
05:51Same is true for Chili, and if in fact we had different prices, it would have
05:54changed the price, and any other attributes.
05:57This is a wonderful way to create a single display node that's more
06:00convenient for people to shop.
06:02The last thing that I'm going to do is I am going to go back to my list of
06:05content, and unpublish the ones that we don't need anymore.
06:09We don't need to have all four nodes; one of them that holds three, and the other
06:12three individual ones. So I will take Chili-flavored, Lemon-flavored, and
06:16ordinary one, and Unpublish it.
06:18Now if we go back to our front page, we have the Half-liter bottle of olive oil,
06:25and the Lip balm; much cleaner. Pretty cool, huh?
06:29But I know what you're thinking.
06:30You are thinking, does this mean we have to add every variation of our product by
06:34hand? And the answer is well, yeah, basically.
06:38But there is a module that does that, and it takes away a lot of the heavy
06:41lifting. It's called Commerce Bulk Product Creation, and you can get it at
06:46drupal.org/project/commerce_bpc.
06:53If you have trouble installing it, see the video expanding a site's capabilities
06:57with modules in lynda.com series Drupal 7 Essential Training.
Collapse this transcript
Managing product variations
00:00In the video where we added product variations, we made this site easier for
00:04shoppers, but in the process, we lost something.
00:08You might remember that when we looked at the Jalapeno Oil, the one with the
00:12Chili-flavoring, it used to say something about how it was spicy and wonderful,
00:16but now we just have this generic text here, no matter what flavor we choose.
00:21That's because we have multiple products sharing one display node.
00:25But we can change it back to add a little bit more information into the product
00:29itself, so that we see a combination of both this generic text, and the individual
00:34text for each of the flavors.
00:35To do that, we go up to Store, and Product, and we are going to edit the
00:40Product Type itself.
00:41We will add a field, which will be called Flavor notes.
00:49That's going to be something called a Long text.
00:52Long text allows you to have multiple rows. And save it.
00:57
00:58As usual, we are asked for a few options.
01:01I think we can leave everything pretty much as it is, and save.
01:05So, we have added a field to the Product Type.
01:08Now, that's the template on which all of our products are based.
01:11That affects the products we already have, including the Lemon- and
01:13Chili-flavored olive oils.
01:15So now I am going to go back and add flavor notes for each of those oils.
01:19I have those flavor notes in my exercise files here, which you received if you're
01:23a premium member of lynda.com, or you got this course on a disk.
01:26So first, I will go to the Lemon-flavored olive oil node, and I will add that text.
01:32To do that, go in View products, Lemon-flavored olive oil, and edit, and
01:37there's our new field.
01:38I will just paste in, and save.
01:41Then I will do the same thing for the Chili-flavored olive oil, and save.
01:56Now if we go back and take a look, here is our Plain bottle of olive oil.
02:00If we switch it over to Chili, we see both the generic text, and this extra bit
02:06down here; Flavor notes.
02:08But you know what, I don't like the way that it looks.
02:10I am going to tidy it up a bit by removing some fields we don't need to see, and
02:14this label: Flavor notes, and so on.
02:17To do that, I'll go up to Structure, and Content types, then I'm going to manage
02:22the display of that product display.
02:26The flavor notes, for example, can go up here right underneath the body.
02:29I will just save that, and if I want to make additional changes, you'll notice
02:35there's a link here to do that.
02:36I'll go over to the product display configuration, and manage the display there,
02:41and I don't need a label, for example. I will just say Hidden, and Save.
02:46Now let's go back and take a look at that node.
02:47There is our Plain olive oil, and there's Lemon, and you'll notice it just adds
02:54the text right after it.
02:55Isn't that wonderful?
02:56We could actually continue to do that, and change the display more in ways that we want.
03:00For example, let's say that I want to turn this picture to be a little bit
03:03smaller so that we can see the text right up there at the top.
03:06I would do that by going up to Structure, and Content Types, back to our Product
03:12display, and I want to change the image, but you know what? That's not here.
03:16I have to go over to the Product display configuration, manage its display
03:20there, and I'll change it back to medium, the way that it was at the beginning of this course.
03:24Update, and save.
03:27Close that out; there. I like that look a little bit better.
03:30What you have seen here is really how you end up developing Web sites generally.
03:35Sometimes you will make cosmetic changes, but other times you will have to
03:38go back and change something fundamental, as we did when we created product variations.
03:42That's what developers call refactoring.
03:45When you do it, be sure to first backup your site in case anything goes wrong.
Collapse this transcript
Importing simple products
00:00If you're using Drupal Commerce to start an online business, you can now go off
00:04and merrily add products as you saw in previous videos.
00:08But some of you already have inventory that you want to sell through Drupal Commerce.
00:12In that case, you either have the data in an online store, or it's in some kind of
00:16database, list, or spreadsheet.
00:19Now, I can't tell you how to get the data out of some other store system, but
00:22I can tell you how to move a simple, tab delimited list of products into Drupal Commerce.
00:27For this, we will need to add a few modules.
00:29The first one, and most important, is called Commerce Feeds.
00:33You get it by going to drupal .org/project/commerce_feeds.
00:38And as usual, we go down here and copy our link, then go back to our site and
00:45click Modules, and then click Install new module to install it.
00:51Paste, Install, and go.
00:54Now, if we go back to enable that newly added module, we will find that we are not able to.
01:00Let's go down and take a look.
01:01So there is Commerce Feeds, and an example, but we can't actually click it,
01:04because it has several requirements.
01:06It needs Commerce Feeds, which in turn has its own requirements. Well, that's okay.
01:10We will just go drupal.org/project/feeds.
01:18Then do the same thing.
01:19Go back to our Modules page, and install that.
01:26Once again, we attempt to enable the modules we just added.
01:32Nope, it's still not working.
01:33We will go down and enable Feeds.
01:35Oh, but that in turn requires job scheduler, and back we go.
01:40This is something that you'll find with Drupal sometimes.
01:42You have one module that depends on another module, which in turn depends on another one.
01:47That's okay; we will get to the end of this.
01:48I'm going to go do drupal.org/ project/job_scheduler, and download that.
01:58Remember, you have to grab the Drupal 7 version, even though it's an Alpha.
02:02Hopefully by the time you watch this, it will be out of alpha, and more ready to
02:06use, but I haven't had any problems with it.
02:08Back up to the top of the page; Install.
02:14Now I believe we can enable our module.
02:16We will find out by collapsing all of these, and there is Commerce Feeds, and
02:22Commerce Feeds Example.
02:25When I enable that, it asks if I want to enable all of the other parts.
02:30The last thing I am going to do is just take a look and make sure that
02:32everything is enabled that we need enabled.
02:35So down here, Commerce Feeds; very good.
02:39We don't really need Commerce Feeds Example.
02:41And for feeds, I'm also going to add Feeds Admin UI, and Feeds Import.
02:49Then Job Scheduler is fine, and we're done.
02:51Now we're ready to start importing our products.
02:54Let's take a look at the controls.
02:56There are two parts.
02:57First, you set up the import, then you execute it.
03:02To set up the import, you go to Structure, and Feeds importers.
03:06We have two examples here, but I am going to create a new one, which I'll call a Product import.
03:14You need both, a name that you can read, Product import, and then also one for
03:17the machine, which is all lowercase with an underscore, and create.
03:21Now, the Feeds module has a lot of settings.
03:23I will only change those that are relevant to our particular import, but I
03:27definitely recommend you spend some time exploring these controls, and reading
03:31the documentation for feeds if you want to know more.
03:34That documentation is linked from the Feeds Project page, which is at
03:37drupal.org/project/feeds. But here we go.
03:41First I'll look at the Basic settings.
03:44We don't need to import every 30 minutes; we will just do it once.
03:48We're going to change it so that instead of going out to the Web to look for
03:51information, it goes to a file.
03:56The parser isn't going to change an RSS feed; instead we are going to be using
04:00our Comma Separated Value file, or CSV.
04:05For the CSV parser itself, we will change the delimiter to Tab, because that's
04:09the way that we have the file set up, as you will see in a minute.
04:11Of course, you will make these changes depending on what sort of data file you have.
04:17For processor, we are going to change it so that it creates products instead of
04:21nodes, and then we'll look at those settings.
04:24Instead of having it as an anonymous author, I will change it to admin, and the
04:30Product type becomes a Product; very good.
04:34Those are the basic changes.
04:36Then there's a few we have to look at the data file itself to understand.
04:39I already have that file open here.
04:42As I said, our bits of data are separated by tabs, but of course, they could be by
04:46commas, or other delimiters between the different fields.
04:49Our fields are listed here at the top;
04:51the SKU, the Product Name, Price, and Description.
04:55This is called the Header row, and you might have noticed that we had to specify
04:58that we are using a Header row.
05:00Now we go back to our Commerce Product processor, and we will change the
05:04mapping so that we know what fields in Drupal are going to be match with what
05:08fields in our text file.
05:10The source field -- if we look back here, the first is called SKU, and that gets
05:16mapped to Product SKU.
05:18We will add that, and then continue with the other fields.
05:27The Product Name becomes the title.
05:36The Price becomes the Price Amount, and for the Description, we actually don't
05:45have any place for it to go.
05:47Remember, the description shows up in the product display node, not in
05:51the product itself.
05:52So we will actually come back to that in just a minute, because we're also
05:54going to repeat this import for the node, so that we can display the product we've created.
06:00So we save this, and now we are ready to import.
06:03To do so, go up to the name of your site, slash, import.
06:08There is our Product import, I select it; look through the different settings.
06:13Yup, TAB delimiter; looks good.
06:14There are headers, that's unchecked, so now all we have to do is choose our file,
06:21and click Import, and when it's done, we see that three items were imported.
06:26We can check this by going up to Store, and Products, and there they are: Guided
06:32tour of our orchard, Friday- night concert, and Night in our lodge.
06:36So now we have our products in Drupal Commerce, but if you've been watching
06:39the series this far, you know we have to create the product display nodes as
06:42well. But that's okay.
06:43We can use the same exact procedure, and in fact, we will use the same data file.
06:48We will just match the products to their nodes using the SKU field.
06:52To do that, once again, we'll create an importer.
06:54Go up to Structure, Feeds importer, and New Importer.
06:58We're going to call this Product display importer, and save.
07:06Once again, we have to change many settings.
07:07I will just go through this quickly.
07:33Finally, we get back to our mapping.
07:36To see what the mapping will be, once again, we'll look at our text file.
07:40So the first one is SKU; paste it in there, and this one actually gets mapped to
07:45two different places.
07:47First, it gets mapped to the SKU as you'd expect, but it also gets mapped to
07:53something called the GUID, which is a Global ID, and I will add that.
07:59Then we go back and map the other parts.
08:01Product Name goes to the title. The Price doesn't go in, because that showed up
08:12in the product, not in the product display node.
08:15However, the Description goes to the body.
08:22Now we're ready for our import.
08:24I'll save that, and go to slash, import.
08:30This time we are going to import Product display.
08:34Make sure that we have the file we want, I will go up and find it, and away we go.
08:41There; three items were imported.
08:43We go back to our front page, and we see them right there. Because we had no
08:47images for them, we have this default image; that's all good, and we can add them
08:51to the cart, just like any other product.
08:53If we go in and take a look at the nodes themselves, they work fine.
08:58That worked pretty well, huh?
08:59But the truth is, a lot can go wrong.
09:02Here are some of the biggies.
09:05The first common error is when you have malformed separators.
09:08That's when you put in a comma when you're expecting a Tab, or if you have
09:12quotes in the wrong place, and Feeds importer thinks that that's the end of a field.
09:17The second big error is if you misspell a header.
09:20That's why you saw me often go in and copy and paste, even if it was something
09:24very simple like SKU, because I wanted to make sure that I got it exactly right,
09:28otherwise Feed importer simply won't work.
09:32Finally -- and this is a biggie --
09:34if your file has non-UNIX or Linux line endings, as you sometimes get in some
09:38text processors on Mac or Windows. That commonly comes up if you save the file
09:42into Excel, and then save it out as an Excel text file.
09:45I have to tell you, I've use the Feeds module a lot, and I have run into all of
09:50these problems when I started out,
09:52but when it works, it is beautiful.
09:54I recommend that you run a few small test imports before bringing in your entire
09:58inventory file, so you'll be able to tell whether errors are caused by your
10:02procedure, or by issues in the data.
10:05As always, backup your site before attempting any big imports or other changes.
Collapse this transcript
Importing complicated products
00:00In another video, I showed you how to import what I call simple products, with
00:04only an SKU, name, and price, and description.
00:07But in the real world, products are almost never that simple.
00:11They usually have at least a photo, and are often categorized, as if they're
00:14in a department store.
00:16They might also contain data that Drupal Commerce isn't expecting.
00:19Those three issues;
00:20picture files, taxonomies, and unexpected data, all require a bit of work to import.
00:26This video shows you how, and along the way, we're going to touch on a tricky
00:30subject related to how you define categories in your store.
00:33As we look through the front page, we see a few different kinds of products.
00:37First, we have the ones we added earlier;
00:39the olive oil, and the lip balm.
00:42They all have graphics, whereas the items that we imported later don't have any;
00:46they just get this default image instead.
00:49In this import, we're going to bring in some items that do have graphics.
00:53The first thing we have to do is to move the files over.
00:56For that, we go to our exercise files.
00:58You'll notice that there is a folder that says where you should add these.
01:02I will hide everything else,
01:03so I can see my Desktop, and then open up my Drupal Commerce installation.
01:10This has to go into sites> twotrees>files>field>image,
01:19and I will open this up, and copy all of those over.
01:22I should explain that I figured out where exactly these go by first creating
01:26some products in the normal way, and seeing where the files were placed.
01:30Then when it was time to do the import, I simply copied what Drupal
01:33was naturally doing.
01:35So we have those in the correct place, so I can close that up, and go back and
01:39take a look at the file itself.
01:42We see that we have an SKU, Product Name, Price, Flavor, and several other fields.
01:47Another way that you could look at this, by the way, is by opening it up in Excel,
01:51or some other spreadsheet program.
01:52I will bring up Excel, and then I will just drag it in, so I can see it.
01:57That's actually a little bit easier to look at, because it separates out the
02:01fields in a more organized fashion.
02:03I do want to warn you, though, if you save this Excel file, you won't be able to
02:07import it into Drupal correctly, because it'll put Windows line endings on
02:11the end of each row, instead of the proper kind of UNIX or Linux line endings.
02:16As we look through here, I just want to point out this image row down here at the end.
02:20We're specifying the entire path.
02:22This will have to be changed when you move it to a production server, because
02:25right now it's referring specifically to our development server.
02:29That's okay; when it comes time to do that import on your production server, of
02:33course, you'll use whatever the path is that you should be using there.
02:36Now I am going to take a quick look at the way that our products are set up, so
02:39I can be sure that my text file is correct in all of the fields that it has.
02:44To do that, I go up to View products, and then take a look at the Product Types.
02:48I could have also gone to Store, and Products, of course, as I usually do.
02:51Let's take a look at manage fields.
02:54Okay, so we have the SKU, Title, Image, Price, and if I look back at my
02:58text file, we have SKU, Name, which is the same as Title, Price, and
03:03there's our Image, and so forth.
03:04You would go through, and you'd make sure that you have everything that you need.
03:07There is one field I want to point out that's a little bit different.
03:11You might remember in a previous video, we put together this Flavoring field,
03:15and if we go in and take a look at it, it specifies which values are allowed.
03:20This can be an issue, because let's say that we try to import a flavoring that's
03:24not part of this list. All the rest of the import will be correct, but this
03:28particular field won't be filled out.
03:31This is one way to categorize things on the site.
03:33The other is by using taxonomies, as you learned in the video, Categorizing
03:37products, and we will be facing that a little bit later in this video.
03:42But for right now, I am just going to add the things that we need to this list.
03:45So we have Plain, Lemon, Basil, and Chili.
03:48If I take a look here, we have Flavor; orange, basil, rosemary, and garlic.
03:53Okay, so we have a few extras;
03:54orange, rosemary, and garlic.
03:56I am simply going to add those.
03:59By the way, I'm adding both the key and the value here.
04:03You can add simply one, and then Drupal will fill in the other, and you can learn
04:06about that by reading the text down here.
04:08It's just the way that Drupal works.
04:10Anyway, we'll go on, and save it.
04:12Now we're ready for our import.
04:14You might remember from the previous video that we had to go in and make sure
04:18that we were matching our fields correctly.
04:20To do that, go up to Structure, and Feeds importers.
04:24I am going to change the existing product import we have by clicking Edit, and
04:28then take a look at the mappings.
04:31We have SKU, Product Name, and Price already.
04:35So we have the SKU, Product Name, and Price; so far so good.
04:39We also have a few others;
04:40Flavor, and Flavor notes we'll have to add to that product, along with Image.
04:45These two: Description, and Catalog category, you might remember are actually in
04:49the product display node, and we'll add that later.
04:52But for now, we're going to need to add Flavor, and I will switch back to my
04:56text file to make sure that I'm copying this correctly.
05:02Flavor goes to Flavoring. Flavor notes goes to Flavor notes, and Image, which
05:17remember is a path, which goes to Image.
05:23We save that, and try our import by going to Slash, import. Here we go!
05:31Product import, make sure that we have the correct file chosen, and go for it. There we go!
05:43We have 11 items imported, and if we want to see them, we'll go up to Store, and Products.
05:51There they are; lots of new stuff.
05:54Now it's time to bring in the product displays.
05:57Again, I can take a look at the file to make sure that it's as we expect.
06:00But the thing we're going to be matching up to, you might remember, is in
06:03Structure, Content types, and Product display.
06:07Here we have Title, Body, Product, and Type of product.
06:10Let's take another look at our file in Excel.
06:13Title will be the Product Name, Description will be the Body, Category, of course,
06:19we just mentioned, and what was the last one?
06:21The product itself, which is the Product reference.
06:23So, to make this work, we will go back to our importers; Structure, Feeds
06:28importers, and Product display importer, and once again, we edit that, and change the mapping.
06:34Fortunately, most of this is already set up.
06:37The one thing that's missing is the type of product.
06:40If we look back at our spreadsheet, we have Edible oils, and Cosmetics.
06:44To check on those, we have to go to the other kind of categorization: the taxonomy.
06:48You might remember we set up this category, and if we list the terms there, we
06:51see Apparel, Cosmetics, and Edible oils.
06:54We have Cosmetics, and Edible oils.
06:56In this case, we don't have to add any additional categories.
06:59The reason I am bringing this up is to show you those two different ways of
07:02categorizing things: either as lists in the field, or as taxonomy terms. And when
07:08you're doing an import, it's very common to miss out on one of those, and
07:11therefore, you bring in your import, and it's missing those fields in those
07:15particular nodes, or products.
07:18But in this case, we should just be able to go back to our Structure, and Feeds
07:21importer, edit our Product display importer, and then we'll change the mapping to
07:26take into account that extra category.
07:29The name of the field is Catalog category.
07:32Once again, I am actually going to copy that to make sure that I have it right,
07:37and the target is going to be Type of product.
07:40Now let's try that.
07:42We save it, and go back to Import.
07:47This time we'll do a Product display import.
07:52Make sure that we have the correct file, and import.
07:58Now, the proof is in the pudding. Let's go to our front page, and there they are!
08:03We have our products, we have our product displays with all of the correct
08:06graphics. We can add them to the cart, which shows that they're actually
08:09working, and in fact, if we click Add to cart, there it is. It shows up in our Shopping cart.
08:15Well, we covered a lot of ground in this video, and yet we only scratched the surface.
08:20In the process, you saw how early decisions when planning your site can have big effects later.
08:26My intention wasn't to show you all the different ways you might have to play
08:29with feeds to make your import work, because there are simply too many
08:32possibilities. Instead, I hope this gives you some techniques that you will be
08:36able to use to get past all the rough spots that you are going to find when
08:40you try your own import process.
Collapse this transcript
5. Managing Your Workflow
Shipping products
00:00You can divide salable items into two categories;
00:03the tangible, and the virtual.
00:06We're going to talk about the tangible items, which have weight, and heft, and
00:09have to be shipped.
00:10You actually have to deliver them to the purchaser.
00:12That means collecting a delivery address, setting up a shipping method, and
00:16charging the purchaser for transit,
00:17if that's the way your store is set up.
00:19In Drupal Commerce, you do all that by first installing a general shipping
00:23module, and then installing another module that's specific to the shipping method
00:26you're going to use.
00:28As I write this, there are only a couple of such method modules.
00:31The one I'll show you will charge a specific amount for each package shipped;
00:35that is, a flat rate.
00:36We start off by downloading the basic commerce shipping module.
00:40To get it, go to drupal.org/project/ commerce_shipping, scroll down, and install
00:50it in the usual way. Then enable it.
00:59I am going to enable both the Shipping module, and the Shipping Method Example,
01:08along with the Shipping UI.
01:09Be careful, because if you don't enable the Shipping UI, you won't actually be
01:12able to make any changes. Then we save.
01:15We'll start off by looking at the Example Shipping method that comes with the module.
01:20Now remember, this doesn't actually do anything; it's included just to show
01:23people how shipping methods should work.
01:26To go to it, we go up to Configure Store, and Shipping settings.
01:29Then I will take a look at the Example plugin, and enable it, and yes, that's
01:34exactly what we want to do.
01:35Once we have done that, you can make some other changes by clicking edit.
01:39For example, I will change the action a little bit by editing it.
01:44The Shipping label is going to be, let's say, By carrier pigeon, and the price
01:49will be $6, and save.
01:52Now, let's go ahead and order something.
01:54To do that, I will go to my front page, and as it happens, I already have
01:58some things in the cart,
01:59so I'll take a look at the cart.
02:01We don't see the shipping here.
02:02Let's continue on to checkout.
02:04Scroll down a little bit, and take a look at our shipping method, and there it is.
02:07It actually has an option for charging twice the normal amount, which I will
02:10just leave blank, and it has this test field, which I will just put test in.
02:13Again, this is an Example Shipping method; it doesn't actually do anything.
02:17It's saved our billing information from the last time we ordered something, but
02:21now there's this new shipping information.
02:23I will fill it in with my information, and continue on, and there it is;
02:32now we have this Example shipping costs down here, right with the Subtotal, and
02:36the Order total, and of course, you could continue and finish up the order.
02:39Again, I just will do that; I will say Test, and Continue, and there it is.
02:43If we view our order, we see that it includes the shipping method right there,
02:48and everything is correct.
02:50So that's the example method.
02:51Now, let's try the flat rate shipping method, so you can see a little bit about
02:54how shipping methods can vary.
02:56Once again, we go up to Configure Store, and down to Shipping settings, and there
03:00you see Flat rate. We will enable that one,
03:04and once again, we'll edit it.
03:07We edit the action itself, and we have some slightly different options.
03:10I am just going to say that this is Flat Rate, Shipping rate is also $6, and we
03:16say whether it's per line item, per product, or I am going to say per Order;
03:20it's always a flat rate of $6. Go down, and save.
03:23Then if we go back into our order, we'll add something to the cart, and go
03:27through the same process. View the cart; checkout.
03:32Now we have a choice of Flat Rate, and as we click that, you will notice that
03:35that express rate disappeared.
03:36This is a very nice thing that Drupal Commerce does.
03:39It integrates a lot of JavaScript in, so that when you change your options, it
03:43automatically gives you the correct choices, and of course, I would continue, and
03:47we'd get the same sort of thing when we finished.
03:50At the time that I'm recording this, we only have a few modules out there for shipping.
03:54One of them that's very useful is called Commerce Physical Product, at
03:58drupal.org/project/commerce_physical.
04:02This lets you define the size, shape, and weight of a product, so that you can
04:06change to how much something cost to ship based on its weight, for example.
04:10Another one is Commerce UPS, which as you can guess, is the commerce method for
04:15the United Parcel Service in the United States.
04:17By the time you see this, there is a good chance that many others will be available.
04:21I expect Drupal Commerce to follow the lead of its predecessors, which
04:24was called Ubercart.
04:25Ubercart now has modules for several shipping methods, including FedEx, and the US
04:30and Canadian Postal Services.
04:32I do think that Drupal will have all those as well.
04:35In the meantime, there are several ways to control shipping costs.
04:38For example, you can create rules that add surcharges for shipping outside your country.
04:43In any case, the modules we have here for Flat rate Shipping and Commerce UPS
04:48are a good first step.
Collapse this transcript
Managing inventory
00:00Alas, nothing lasts forever, and for many types of salable items, it's possible to run out of stock.
00:07Certainly, that's true for physical items, like books, but it's also true for
00:10some non-tangible items, such as seats at a concert.
00:14Even if the item isn't truly limited, you might want to set an artificial
00:17limit to create scarcity.
00:20In any case, the way you do that is with the Commerce Stock module, which is
00:24available at drupal.org/project/commerce_stock.
00:30As usual, we'll go down, and download it, and enable it.
00:33You'll find the module in the Commerce (Contrib) group on your Modules page, and then save.
00:51Once you've done that, you'll notice a new setting when you click Configure store.
00:55It's the Stock management; let's go there.
00:58We'll enable it for the only product type we have, which is Product, then click Submit.
01:02Now once we do that, we have an option to check a box here to allow stock
01:06override for a specific product. That means we can vary it from product to product.
01:10I'm going to go ahead and say that yes, we want to do that, and submit again.
01:14Now before we go on, I'm going to go back and fill in a stock amount for all of
01:18those products that we already have.
01:20If we don't, nobody will be able to order them.
01:23I'll show you how with one, and then we'll just skip ahead,
01:25and I'll do those offscreen.
01:28To do so, go up to View products, and let's change Olive Oil.
01:32I'll edit it, scroll down a little bit, and there is our Stock.
01:35Now, you'll notice it's a required field.
01:37I'm going to say that we have 10 of those, and save.
01:41Now that a checkbox there, Disable stock for this product, would let you say we
01:45have an unlimited supply of this thing.
01:47That's where the override came in.
01:49Now I'll go ahead and add stock for all the other products we have.
01:53Okay; I've recorded that we have five of each product in stock.
01:57Now let's see how that affects the ordering process.
02:00To do that I'll go home.
02:01I'm going to go to the front page, view my cart, and empty it out first. Great!
02:07I'll go back, and I'll order something.
02:10Let's make at this Hand cream.
02:11I'll go through the whole process, view the cart, there it is, checkout; do all
02:17the usual stuff I would. I send it by Flat Rate, and my name, and continue on.
02:34Once again, we check everything. It looks good.
02:37My payment is right here, it's going to be my Test payment, and we're done.
02:41To see how that affected the inventory, we'll go and view products, then we'll go
02:45down to our Hand cream.
02:48As we look down, we see the Stock has been diminished to 4, which is exactly
02:51what you would expect.
02:52Now let's go back and order 4 of those hand creams, and see what happens.
02:57Add it to the cart.
02:58Let's try to buy 5, in fact. Update the cart.
03:02It's telling me that I can only purchase 4, and if I do go 4, and update the cart,
03:07and check out, if I were to go through the whole process, and complete it again,
03:11the next time that I went to that front page, it would tell me that it's sold out
03:15of that item, and the button wouldn't be available.
03:17So let's go through that.
03:19Flat Rate; enter all my information.
03:25Now when we go back to our front page, scroll down; out of stock, and we can't order it.
03:30We can still read about it, however.
03:32And here's an interesting thing:
03:34if you wanted to make your store really proactive, you might be able to do a
03:38little bit of Drupal magic, and put a link here saying, request this item.
03:41That way people could continue telling you that they want that thing.
03:44It's a good way to have a pull marketing, instead of a push marketing.
03:48If you want to go even further with Commerce Stock, take a look at this video by
03:52Randy Fay, who's one of Commerce Stock's main developers. His video is at
03:56commerceguys.com/resources/articles/216.
04:02He shows how to set up rules to send an e-mail when the stock gets below a
04:05certain level, so you always know how much to add to the warehouse.
04:09But be forewarned, it's kind of complicated. That is the nature of rules,
04:13which is almost like a programming language in itself, and to tell you the
04:17truth, the details of that are beyond the scope of this course, but even
04:20without writing your own rules for controlling inventory, the Commerce Stock
04:24module gives you what you need to keep track of what you have on hand, and
04:27will help you avoid overselling.
Collapse this transcript
Managing orders
00:00So, your business is going gangbusters. Your catalog has attracted visitors, and
00:05they're buying, but what now?
00:07You have to fulfill their orders, and later you'll need to audit the order record
00:11figure out your profit and loss.
00:13This video shows you how to do that, and tells you how to change settings to
00:17affect the purchasing experience.
00:19First, let's revisit what the order process is like with a critical eye.
00:24To do that I'll start buying something; let's say these Bath salts.
00:28Then as usual, I'll check out. I'll just skip the view cart process, and there.
00:37When we're complete, we have an order number, number 5 in this case, and as
00:41you know, you can view the order when you're logged in either as that user, or as an administrator.
00:46Now let's see what that looks like from the administrator's point of view.
00:49To do tha, click View orders, and we have a whole list of everything that's come
00:54in. That's something you'll probably want to do periodically.
00:57You can view them by clicking either on the Order Number, or on the View link,
01:01and of course, that gives you a screen that summarizes everything.
01:05You can change things in here, and you can look at the payment as well.
01:09Let's say that you fulfilled the order, shipped the widget, set aside the
01:12ticket, or whatever.
01:14Let's go back here to Edit, and scroll down to the bottom, and see what options we have.
01:18One of them is to change the Status from Pending, to Completed, or there are
01:23several other steps in the process.
01:25But let's just say that we change this one to completed.
01:28Mind you, some modules trigger a change in the status automatically, but that
01:32varies from module to module.
01:34I'll show you a way to force this change in the video Streamlining the checkout process.
01:39Now, I do want to mention that if there's more than one administrator on your
01:42site, this power to edit an order can be dangerous.
01:46Of course, you can take it away using Drupal's standard system of roles and permissions.
01:51To do that, go up to People, and then click Permissions.
01:55As we scroll down, you see that there's a group called Order, so you can change
01:59who's allowed to administer orders.
02:01You can also make it so that people are not able to order unless they are logged
02:06in to your site, but no need to go into all those details now.
02:09So that's how you see all the orders that came in; under View orders.
02:13That's just the way that Drupal Commerce comes by default.
02:16You can also create alternate ways of looking at these orders using Views.
02:20I'll show you how to do that in the video, Using Views to gain better oversight.
02:24While we are talking about orders, let's take a quick look at how you can
02:27change the order flow.
02:28We'll do that by going to Configure store, and Order settings.
02:34There are a few tabs up here, and we'll start with the first one: Order
02:36creation help text.
02:38I'm just going to add something here: Allow 48 hours for processing, and this
02:44will show up whenever somebody makes the order; very handy.
02:48If you click Manage Fields, you can change what people actually see when they
02:51order, and Manage Display changes the way that it appears on their screen.
02:56The reason this probably looks familiar is because orders, like products
02:59and nodes, are entities,
03:01so you work with them in very much the same way.
03:04You've learned about entities in the video, Understanding products and other entities.
03:09Now, I mentioned earlier in this video that you have to keep checking back to see
03:12whether orders have come in, but you can actually set up your store so that you
03:16also get an e-mail, so you know to take care of it.
03:19This site already sends an e-mail to the person placing the order;
03:22we're just going to piggyback on that action.
03:25To do that, we'll go and take a look at our rules by clicking Configuration, and
03:29then scrolling down, and clicking Rules.
03:33The one that we want to change is Send an order notification e-mail.
03:37So I'll go over, and edit it.
03:39The thing that changes is not what forces the thing to happen, or under what
03:43conditions, but the action itself, so we'll go in and edit that.
03:47When we look at the format of this action, it becomes clear what we have to do.
03:51First, there is a To area; that's who the mail is going to be sent to, and in our
03:55case, we're going to change this, so we also send an e-mail to the administrator.
03:59There is a Subject that we can change as we like, the body of the message, and
04:04who it's coming from. And in each case, we have a selection of replacement
04:07patterns, so we can put in tokens; for example, the site's name, the site's URL, and so forth.
04:14Now let's go back and add another action to send another e-mail.
04:18So I'll just go backwards here, and add an action.
04:23The action that we want is to Send mail, which is down toward the bottom.
04:28We then are faced with all of the selections that we had before.
04:31Now, for our To, we're going to send it to the administrator of the site.
04:35There is a token for that, site:mail, the administrative e-mail address for this site.
04:39So we'll paste that in.
04:43Then, of course, we could do the same for the Subject: An order has come through
04:48on the site. And of course, the Message of the body: Hurray!
04:53Go and check it out.
04:55Actually, the way we'd probably do this is by including a link to the order by
04:59using Replacement Patterns and so forth, but this is good enough for now.
05:02From, I'll just say once again, from the site e-mail, and save it.
05:08If we look down here, the rule now has two actions.
05:10The person who made the order gets mail, and the administrator of the site, and
05:15obviously you could keep on editing rules to do all sorts of things
05:18automatically when you get an order, and in fact, that's how a lot of people run
05:23their online businesses. An order comes in,
05:25the store sends the shipping department an e-mail, the data gets inserted into a
05:29bookkeeper's database, and so on.
05:32As with many other parts of Drupal Commerce, the process is open to just about
05:36any kind of customization that you could imagine.
Collapse this transcript
Managing customer profiles
00:00Usually when I wanted to show the purchasing process in this course, I just
00:04stayed logged in as the administrator, just because that's the fastest way.
00:08But there were a few times I did switch over to another browser, and show you
00:11what the process looks like to someone who's not logged in to the site.
00:14On completing the first order by a casual visitor, the store creates a customer
00:18profile for that person based on the e-mail address. That's so they can go back,
00:23log in under the new account name, and do such things as review the order.
00:27This video shows you a little more about how Drupal Commerce creates and
00:30manages customer profiles.
00:32We'll start by looking at the obvious stuff.
00:35Go up to Store, and Customer profiles.
00:37You'll notice that for each order, there is a Shipping information, and a Billing
00:42information, and that these profile IDs aren't related to users, or orders, or
00:47anything like that; they are their own thing.
00:49However, each one of these profiles is linked to a user.
00:53In this case, the admin for most of them, and then there's that one time when I
00:56ordered from somebody who was just visiting the site.
00:58That can be a little confusing, but the way I think about it is this.
01:02A user is a person, the customer profile is two snapshots of that person at the
01:08moment that he or she placed the order.
01:10We'll talk more about users, and how they relate to customer profiles, in just a minute.
01:15Now, if we go in to edit any one of these customer profiles, we get a warning up
01:19here saying that the profile is referenced by an order.
01:22So if you change any field values, it'll actually create a clone.
01:26That relates back to what I was saying about this being a snapshot at a moment
01:30in time, but let's take a look at the orders instead.
01:33Go up to Store, and Orders.
01:36If we go in and edit the Shipping address, lets say, for any one of these orders,
01:40we can do that, and it's just fine.
01:42Scroll down, and we see the Billing Information.
01:43This is one that we did before we had the Shipping module installed.
01:47If we make the changes here, it's okay, because it's not changing that snapshot
01:51of the user at that moment in time.
01:53The lesson here is to edit the address where it makes sense.
01:56If it's just to change the address on a single order, change it on the order
02:00itself. But anyway, let's get back to customer profiles.
02:04Go up to Store, and Customer profiles.
02:07Customer profiles are entities, just like nodes and products.
02:11We talked a little bit about entities in the video, Understanding products and
02:15other entities, but customers are a little different.
02:19Because they're so central to Drupal Commerce's functioning, your control over
02:22what you can do with them is a little more constrained.
02:25However, like other entities, each customer profile is based on a template of
02:29sorts, which you see here under Profile Types.
02:33One thing you'll notice is you can't add a Profile Type.
02:36There is no link up here that says add, like there is for some kinds of entities.
02:39However, you can manage fields, and manage their display.
02:42The only thing that's in here by default is Address, but if you wanted, you
02:46could add something saying, for example, you must put in your age, or something
02:50else like that; any other information that you want to collect at the time that
02:53you collect billing information.
02:55Let's take a look at that Address form.
02:56There are quite a lot of options on this page that are specific to addresses.
03:00For example, you could limit the countries that are available on this form.
03:05Since, we have none selected, that means that people can order from any country.
03:09You could add a default value, which by default, interestingly, is the United
03:12States, but you could remove that if you wanted, and then there's a few other things.
03:16We'll just leave it as it.
03:17So we've looked at Orders, and Customer profiles, but you might be asking, how
03:22does this relate to the people who are logged in to your site; your site's users?
03:26Well, the way we'll look at that is, once again, we'll look at our Customer
03:29profiles, and we see this User column.
03:33Let's take a look at this one: customer@example.com.
03:36If we click it, we can go in and edit all sorts of things here; the password
03:41that they use to log in.
03:42If they turn out to be a problem customer, we can block them. That will not
03:46block them from buying, but it will block them from taking part in the site.
03:49We could also give them additional permissions.
03:51If, for example, we've known them for years, and they've turned into a good
03:54customer, and we want to increase the level of involvement they're allowed
03:58to have in the site.
03:59As we scroll up to the top, we can also look at the orders that they've placed,
04:03and we can click through and look at all the details of the order.
04:07Now, if you're an experienced Drupal user, a lot of this part is old hat.
04:11Stores built in Drupal Commerce
04:13leverage Drupal's built-in user system.
04:16That's really good, because it means that you can integrate store activity with
04:19site activity really well.
04:21For example, you could create a site where people get credits for
04:25performing certain online tasks, and then buy things from the store using
04:29those credits, instead of money.
04:31Or you could do it the other way around;
04:33when somebody buys something, they get leveled up, for example, on the site.
04:37You could build a view to look at all of the users, or all customer
04:39profiles; all of this stuff in the normal way you do in Drupal, but those are advanced topics.
04:45The important thing to know as you launch your store is that your customers
04:49are protected by the same high-security system that's in use on over a million
04:53Drupal Web sites
Collapse this transcript
Using Views to gain better oversight
00:00What you're about to see might be the most powerful video of the entire course.
00:05That's because you're going to learn about one of the systems that underlies
00:08your entire store, and once you understand how it works, you will be able to
00:12change the organization of pretty much everything in it.
00:15This magical system is called views, and it's included as part of Drupal Commerce.
00:20Views is the single most popular extension to Drupal, and it's quite complex.
00:24This video gives you only a peek into its power, but it'll be enough to let us
00:28see at a glance how many of each product we have in stock.
00:31First, let's look at how we see products by default.
00:34To do that, we go to Store, and Products, or of course, we could just click View products.
00:40In the video about managing inventory, we added a module that keeps track of our
00:44holdings, but we don't actually see that in this list.
00:47We look at any particular product, say by editing Olive oil; there is our Stock field.
00:52But let's go back to our list of products.
00:55One thing you might not have noticed throughout this course is when you move
00:57your cursor over it, you see this little gear up here.
01:01This is what's called a contextual menu. It lets you edit the view
01:05that you're seeing here.
01:06You see, this list is actually just a simple view, which you can edit.
01:10So we go up, and click it, and Edit view.
01:13By the way, there is another way to get there.
01:15You would click Structure, and Views, and then find the view that you want.
01:19To tell you the truth, I prefer to do it through the contextual menu, because then I
01:23know exactly what I'm editing.
01:25The way we are going to add that field is actually fairly simple.
01:28We go down here to this Field section, and click add.
01:31I am then going to do a search for stock, and there it is; Commerce Product: Stock.
01:36Add and configure fields.
01:37I'll just leave it in its default, and then before you do anything else, you might
01:42want to see what it looks like.
01:44So we will scroll down, and look at the preview, and there's our stock.
01:47If we wanted, we could move it around by clicking rearrange.
01:51Let's say, move it up a little bit, and apply it.
01:54All sorts of things you can do in views,
01:57but before we go, we have to save it.
01:58So scroll up to the top, and click Save.
02:01Now as you see, we are here on our View products list, and there's our stock.
02:05The great thing is, you can do this on just about any screen in your store, and
02:10with views, you can do a lot more than just add fields.
02:13Here; I will show you with the order screen.
02:14We go to View orders, and then click this contextual menu to edit the view.
02:21Here I am going to change the filtering, so we are going to add an exposed filter.
02:26Click add, and add order total.
02:29Again, I just happened to know this, but you could scroll through and see
02:32which one you wanted.
02:35This is the one I want.
02:36So I will add and configure.
02:38I will expose this filter, and say that I only want to see those orders which are,
02:43let's say, greater than 10, and apply.
02:49By the way, I am doing a mistake here, which I will show you in a minute.
02:52If we scroll down to the bottom here, we see we now have this filter available to us.
02:57Let's go ahead and save, and see what that looks like.
03:00Again, if I click View orders, there it is.
03:03I can change the filter here, like let's say we only want to see things that are
03:06above 20. That should cut out this one that's $19, right? Oh!
03:11But it didn't.
03:12So I must've done something wrong.
03:14Let's go back in and check.
03:15Edit view, go down to our filter, and edit this particular one.
03:19Now, as it turns out, the thing that you need to know is that it's counting by
03:24pennies, not dollars.
03:25This is the kind of error that will drive you crazy when you go through it.
03:28The thing I would recommend is go and take a look at the documentation that's
03:32either on drupalcommerce.org, or drupal.org/project/views.
03:35I am going to change this so that it shows us $10 by default.
03:42Then I will go back up and save it.
03:44Now if I want to see only those things that are above $20, I'll enter 2000, and
03:49apply, and indeed, everything below $20 drops out.
03:54But you know what? I don't think I like having this available.
03:57Fortunately, I can revert it back to its factory settings.
04:00So once again, I'll go up to my contextual menu, and edit the view.
04:03Now, here I will notice, the name of the view is Orders (Commerce Order).
04:08In order to change this view, I have to go up one level to where it shows all
04:11the views, and then find that one.
04:14Orders, yep, that looks like the one.
04:17I will go back here, and choose revert.
04:20Yep, that's really what I wanted to do.
04:21Now if I go back and view orders, it's as it was before;
04:25there is no filter.
04:26I do have to warn you, though:
04:28you can't revert views that you specifically create, and as you can see, you can
04:32get yourself into a lot of trouble with them.
04:35If you really want to play around with them, I strongly recommend you watch my
04:38Drupal 7 Reporting and Visualizing Data series on lynda.com.
04:43It's really amazing what you can do with views, though.
04:45You can, for example, create a map of all of your customers' shipping addresses,
04:49add totals to the order page, and so much more.
04:53You don't need to do that to run a successful store, of course, but the
04:56flexibility that you get with views is worth the learning curve.
Collapse this transcript
Accepting other payment methods
00:00Early in the course I showed you how to accept payments through PayPal, because
00:04well, let's face it: that's pretty much the entry-level standard online.
00:08But if you plan to accept a lot of payments, or if what you're selling for some
00:12reason doesn't fit into any of PayPal's payment plans, then you'll need
00:16something heavier duty.
00:18This video introduces you to some of those payment methods, besides PayPal, and it
00:23goes through the full process with authorize.net, which is common in the U.S.
00:27First, let's take a look at what's available.
00:30To do so, go to drupalcommerce.org, and click Add-ons.
00:34Once there, you can sort it by Module Type.
00:36As you scroll down, you see that there are a lot of payment methods available:
00:41Adyen, Authorize.net, and so forth.
00:43We are going to use Authorize.net.
00:46As with all payment gateways, there are two parts to using it.
00:50First, you get the module, and install it.
00:53Second, you need to get authorization from the payment processor itself.
00:58Fortunately for us, Authorize.net gives out test accounts for us to play with.
01:02No money actually gets transferred.
01:04It's just so that you can learn their system.
01:07I found it by searching on Google, for Authorize.net test account, and there it
01:16is; the first link right there.
01:18The same works for many other payment methods. For example, Moneris test account,
01:22or CyberSource test account. Very easy to find.
01:25I've already signed up for a test account,
01:26so now we're ready to go.
01:28All I have to do is grab the module, and install it. Go down here,
01:34it opens a new window, scroll down, and install in the usual way. We then enable it.
01:47Like most commerce contributed modules, it's in the Commerce (Contrib) group.
01:52Enable it, scroll down, and save the configuration.
01:56Now we configure it, just as we did with the PayPal module back in the video
02:00about accepting PayPal payments.
02:03Go up to Configure store, and Payment methods, and then enable your Authorize.net
02:08payment method this way. We confirm; yes.
02:11And the last step is to go back and edit it so that it has all of the
02:14information for your Authorize.net account.
02:17Go down to Actions, and click edit.
02:20Scroll down, and here I will paste in some information that I got from my account.
02:25The next set of option is for Transaction Mode, and this takes a little bit of explanation.
02:29If you just got a developer account, as I did, you will want to do developer test
02:33account transactions.
02:35This has the lowest level of security, because no money is being transferred.
02:39There has never been any sort of authorization.
02:42If you've already signed up for Authorize.net, or whatever other payment
02:45processor you're using, you will be using one of the live account buttons. And
02:49of course, when you finally go online, and you want to actually receive the money,
02:53it'll be live transactions in a live account.
02:56There some other settings, but we can just scroll down and save.
03:00That's pretty much it.
03:01Now let's see it in action by making a purchase.
03:04We go back to our front page, and we will put something in our cart, and go
03:07through the usual process.
03:09View the cart, there it is, checkout, scroll down, and fill out the usual information.
03:19Then when it comes time to review our order, we see there is an extra
03:23option under payment.
03:24We could, of course, do our earlier payments, but let's go ahead with Credit card.
03:27I am going to enter a standard void credit card number.
03:31It's a 4, followed by twelve 2s: 4222222222222.
03:37Expiration will be sometime in the future, and for Security code, we can put
03:41any three digit number. Then we continue.
03:45Success!
03:46Just with the PayPal payment, or any other payment method, you can look at the
03:49order to get payment details.
03:51To do that, go up to View orders, and there it is; number 6.
03:55Let's go in and edit it.
03:57Click the Payment tab, and there you have it.
04:00It gives you all of the information that went out to Authorize.net and came
04:04back, including an ID.
04:06Now I want to remind you that the system I showed you here using a test account
04:10doesn't actually get you paid.
04:12For that, you have to go through quite a bit of paperwork with the payment
04:15service provider of your choice,
04:17so don't expect to set up your site today, and get paid tomorrow.
04:20Now, Authorize.net is one of only many, many payment processors, but there are
04:25others for which there still isn't a module available.
04:28The only way to know whether your preferred payment method is available is to
04:31look for it on drupalcommerce.org.
04:33If it isn't, don't give up hope.
04:36Drupal Commerce is open-source software, which means that anybody could make it
04:39better, including you, or if you're not a programmer, you could pay someone to
04:44create the payment module that you need.
04:46The programming interface is very open, and well-documented.
04:50That makes it easier for developers to work with,
04:52so you might be surprised at just how reasonable the price is to get exactly the
04:56payment module that you need.
Collapse this transcript
6. Organizing Your Store
Changing your store's look
00:00Up until now, we've focused mostly on how to make your store function well.
00:04We haven't paid much attention to its appearance.
00:07We touched on it very briefly in the video, Configuring your store's basic information,
00:11but that was really just to add this logo and favicon, and to add this
00:14gradient effect at the top.
00:16Now I'll show you how to take it a little bit further.
00:18We'll start by revisiting how we made our earlier changes.
00:21And by the way, I'm doing this in Firefox for reasons that will become
00:24apparent in a minute.
00:25But anyway, let's go back by clicking Appearance, and then clicking Settings next to Bartik.
00:30This is the active theme.
00:32You might remember that we can change all of those colors at the top, we see a preview here,
00:36and although we didn't go into it, you can add and remove certain aspects of
00:39your site's appearance by checking and unchecking the boxes here.
00:44There's our logo, and our favicon. Very good!
00:48We can also switch to a different theme entirely.
00:51We go up and click List to go back to this earlier screen, then let's take a
00:55look at what it would look like in Garland.
00:57We click Enable and set default, and then close out the overlay.
01:01Immediately it changes, and as you can see, our store functions the same; this
01:05is just the appearance.
01:06I can add an item to the cart, for example.
01:08It shows up over here.
01:10If I go and take a look at the cart, I can check out, and so forth.
01:13It's just the appearance that we're changing; not the functioning.
01:17The thing is, you can use any Drupal theme for a Drupal Commerce store.
01:21They won't have the CSS classes that are specific to Drupal Commerce, such as
01:25what you see in the Checkout page.
01:26I'll tell you more about those in a minute.
01:29But first, here's a very quick demonstration of how to use a pre-built theme
01:32to change your store's overall look, besides the ones that came with Drupal Commerce.
01:37To do that, we'll go to drupal.org/project/themes.
01:43As with modules, you have to filter out for the version of Drupal that you're using;
01:47in our case, 7.
01:48There are quite a few to choose from; 215 at the time that I'm making this recording.
01:54I'm going to look for one in particular called Danland, and there it is.
01:58We click through, and download, and install it.
02:06We copy the link location, go back to our site, then go to Appearance.
02:10And just like modules, you can install a new theme by clicking up here, pasting
02:13in the URL, and clicking Install.
02:16Once that's done, you can go back to the administration page for themes, and in
02:21the same way as we did before, you can enable it and set it as the default.
02:24Now when we go home, we see our site with a completely different look.
02:29You'll notice our shopping cart still has the stuff in it that we put in
02:32earlier, and as we go through, it has a different look. Very good!
02:36Those themes that I showed you on drupal.org, by the way, are all free.
02:41They're released under the GNU public license, which permits modification as well.
02:45So they're not only free, as in not having to pay any money, but you're free to
02:49do whatever you want with them.
02:51There are also some commercial themes available. For example, from
02:55Top Notch Themes, which you can get to at topnotchthemes.com.
03:00But let's go back, and change this back to our original Bartik theme.
03:04To do that, go back, and set it as the default.
03:06When we close our window, we see our changes.
03:10So that shows you how to change your entire site's appearance with one of
03:13these pre-built themes.
03:15But you don't have to accept any theme as it is.
03:18You can alter its appearance in pretty much any way you want by changing the CSS styles.
03:23If we look at the Drupal Commerce Showcase, you can see just how dramatically
03:27the different store sites can be.
03:29And to do that, we'll go to drupalcommerce.org.
03:33Then click on the Showcase.
03:34I'll just click around fairly randomly.
03:37It has a very different look from those that we've seen so far in the course.
03:40If we go back and click on a different one -- let's just try this one here in
03:44Israel. Also very beautiful, and quite different from the one that we just saw.
03:51What you need to change to make those small adjustments are in the themes'
03:54files, which are usually installed inside the sites/all/themes folder, inside
04:00your Drupal installation.
04:01Let's go back to our Desktop, and I'll show you.
04:04So here's our Drupal installation.
04:06Go to sites, all, and themes.
04:09And here we see the danland that we just downloaded.
04:13If we look in there, we see quite a few files that end in .css.
04:16Let's open one of those up.
04:19If you're familiar with CSS, this is all familiar.
04:22Of course, you could edit it either in a text editor as I'm doing here, or any
04:26other CSS editor that you like.
04:28You do have to be careful though.
04:29There are some important procedures to go through when you edit a Drupal theme,
04:33especially if you get outside of the CSS files.
04:36I provide a very bare introduction in my Drupal 7 Essential Training course, and
04:40lynda.com also has another course that's specifically on Drupal theming,
04:44but let's get back to our site.
04:47In order to edit the CSS, you first have to know what CSS you want to affect.
04:52I use a handy tool called Firebug for this.
04:55It's a plug-in for the Firefox browser that exposes a page's CSS structure.
04:59You can download it for free at getfirebug.com.
05:02I've already installed it, so let's get back to our site.
05:07I'll turn it on by clicking on its little button up here, and then start exposing
05:12things as I go around the page.
05:15One thing about using an existing theme is that you might want to change those
05:18Commerce specific classes.
05:20Firebug is great for figuring out which ones they are.
05:23For example, let's take a look at our Shopping cart page.
05:27These rows here are Commerce specific, and if we go on to our for Checkout page,
05:32we see some more Commerce specific classes here.
05:35One way that we know that they're Commerce specific is if you look down here,
05:38commerce shows up in the name of the class.
05:41You can find out more about theming for Drupal Commerce by going to
05:44drupalcommerce.org/faq/themes.
05:50Now obviously, we couldn't go very deeply into this subject in just one video.
05:54There's a lot to learn.
05:56But you do have three tricks now at your disposal.
05:59First, you can change the settings in the active theme's appearance settings, as
06:03I showed you earlier.
06:05Second, you can switch to a whole new theme by downloading it for free from
06:09drupal.org, or possibly by buying one from a commercial theme vendor.
06:13Third, you can build your own theme from scratch.
06:16That's a huge subject in itself, and one that's well covered by other videos on
06:20lynda.com, particularly those about CSS.
Collapse this transcript
Streamlining the checkout process
00:00The folks who developed Drupal Commerce had previously created another shopping
00:04cart system called Ubercart.
00:06That experience taught them a lot, and one of the things they learned is that
00:09there's a wide range of variation in how merchants want to set up their
00:13checkout procedure.
00:14For example, let's say you only offer one shipping method.
00:18You could make the checkout screen more sleek by removing that shipping method
00:22section, since there's only one thing for people to choose.
00:25We'll start with something that people often want to change.
00:28Way back in the video Managing Orders, I pointed out that by default Drupal
00:32Commerce changes an order's status to pending when it's done.
00:36You have to manually change it to complete it, presumably after you've actually
00:39shipped or delivered the product.
00:41We can see that by going up to View orders, and looking down here, we see that
00:45some are Pending; some are Completed.
00:47The ones that are completed, I specifically had to change to Completed.
00:50If we edit any one of these, we see where we do that down at the bottom of the page.
00:55But if you're selling an online product, you'll probably want it to
00:58immediately go to Completed.
01:00You can do that by changing the checkout rules.
01:02We'll go up to Configure store, and down to Checkout settings, and then
01:07click Checkout Rules.
01:08You'll notice the first one here: Update the order status on checkout
01:13completion. Go in to edit it,
01:16and as we've done before, we change the action itself by clicking edit.
01:20Now, you'll notice it has this Order State.
01:23Simple enough; we'll change it to Completed, and Save.
01:27Now whenever somebody goes through and orders something, it'll immediately say
01:30Completed when they've finished their order.
01:32Now, you could also have added some conditions up here so that, for example, the
01:36status goes to Pending if you still need to ship something, but Completed, if
01:40it's for a virtual good that's delivered immediately online.
01:43So that's one way you can adjust the checkout process.
01:47But you can also change the screens that people see when they check out.
01:50You can either remove screens entirely, or change what's on any individual one.
01:56To demonstrate these, I'll start an order in a separate tab.
02:00We already have an item in our cart, so I'll look at the cart.
02:03Yep, there it is, and go to checkout.
02:05Now let's go back to our example.
02:07Let's say you only offer one shipping method.
02:10So down here, you don't want to give them these options between carrier
02:13pigeon, and Flat Rate.
02:15The first thing I'm going to do is I'm going to take away that carrier pigeon
02:18one. I'll go back to my administrative screen here, go up to Configure store,
02:22Shipping settings, and I'll disable that example plug-in, which we've changed to
02:26that silly carrier pigeon one.
02:29Confirm it, and close out that window.
02:32Now if we go back to the screen where somebody is checking out, and reload the
02:35screen, we have this useless Shipping area.
02:38Obviously, someone can't change anything there.
02:40To make the change, and once again I'll go to my administrative screen, go up to
02:44Configure store, and then Checkout settings.
02:47Now, each section here: Checkout, Review order, and Payment, are separate pages.
02:52Each row here is a separate part of that page.
02:56You notice that we have a Shipping row on the Checkout page.
02:59Well, we can get rid of that.
03:00We'll just take it, and drag it into Disabled at the bottom of the page.
03:04We click Save configuration.
03:06Then I'll go back and look at what the checkout looks like.
03:09When I reload the page, Shipping has disappeared entirely. That's great!
03:14Now let's take another look at those checkout settings by going up to
03:17our Control tab here.
03:18Next to each one of these rows, you'll see a configure link.
03:22Let's take a look at the Shopping cart contents.
03:25The first set of options is how it's displayed on the page.
03:29If we go back to our Checkout page, we see that this is just in a simple pane,
03:34which is described here as in a non-collapsible fieldset.
03:37Let's say that we want to put it into a collapsible fieldset.
03:40We'll scroll down, and Save configuration, then go back and see how that changes things.
03:45When I reload the page, we see that people can now actually hide that part by
03:49clicking on this link here.
03:51Likewise, if we go back and configure it again, we can put it into a pane that's
03:56already collapsed, or we could have it not display that particular pane.
04:01I'm going to just return it to the way that it was.
04:03The other thing that's common under of these configure links is this Include
04:07this pane on the Review checkout pane.
04:10You might remember that as we went through this process, first you looked at the
04:13cart, then checkout, then there was review.
04:16By checking or unchecking these boxes for each of these panes, you can decide
04:19what's important for people to review before they actually submit the order.
04:23Finally, some of these things let you change specific settings, for example, to
04:27customize the message that people get when they've completed an order.
04:30I'll show you that by going back all the way to the list here, and then going
04:35down here to the Completion message.
04:37When I configure that, I can override the default message and say, for example,
04:43Thank you for your order! And save it.
04:46Finally, the last thing you can do is reset to defaults on any one of these panes.
04:51I do recommend that you test the checkout process in a few different ways, and
04:55most importantly, measure their results.
04:58Unfortunately, it's really common for customers to get almost all the way
05:02through a purchase, and then quit it at the last moment, because the checkout
05:06process wasn't what they expected.
05:09There's even a term for that.
05:10It's called abandoned cart syndrome.
05:12You'll never get rid of it entirely, but you can minimize it by removing as many
05:16unnecessary steps as possible.
Collapse this transcript
Launching your store
00:00Now we get to one of the hardest parts of the entire series:
00:03actually launching the store.
00:06Up until now, we've done all our development on our Desktop computers, but now
00:10we have to move this all to a Web server that's connected to the Internet.
00:14Unfortunately, there are literally dozens, if not hundreds of differences among Web hosts.
00:19I'll just show you how to do some of the basic steps using the database program
00:22phpMyAdmin, and the file transfer program Cyberduck.
00:26Along the way, I'll have to fiddle with some settings.
00:29Again, you probably won't have the same exact problems, but this procedure will
00:33give you an idea of the sorts of things you'll run into.
00:36In general, I'm hoping to give you the sense of how it works.
00:39If you have any problems, what you see here will give you enough knowledge to
00:43ask intelligent questions of your Web hosting provider.
00:46They're the ones who can explain the quirks specific to their system.
00:49I've already set up a place to put the site.
00:51It's accessible on the Web at tgeller .webfactional.com, and right now, I
00:57have nothing there.
00:59As you might know, your store, like all Drupal sites, is a combination of
01:03files and database.
01:05The way they're connected is slightly different on your Web host from your
01:08home computer, so we'll have to edit some folder names and text files to make it work.
01:13The whole process happens in four steps;
01:16the first step is to back up the database and files.
01:19Of course, this isn't actually necessary to get the files onto your other
01:23computer on the Web host, but it is necessary in general, because there's a very
01:27good chance that you'll need to roll back the first time that you do this.
01:31The second step is to specify how the files and database will connect to each
01:35other, and you do that in a settings.php file.
01:39The third step is to upload the files, the fourth is to upload the database, and
01:44if everything goes right, it should all work just fine.
01:47First, we'll make a copy of our site.
01:49I go to where I have it, in my case on the Desktop, and simply copy it, and paste it.
01:54I'll then give it an obvious name; let's say twotrees-BACKUP.
02:02I now have to back up the database.
02:04To do that, I'll go to Acquia Dev Desktop, which you'll remember is how we are
02:07developing our site on the Desktop.
02:10I click Manage my database.
02:12That brings us to the phpMyAdmin program.
02:14Over here, you see a list of databases, and if you click Databases, you see the same list.
02:19I am going to export the entire twotrees database by clicking Export, selecting
02:25twotrees, and then taking a look over at the options here.
02:30They get quite complex, and I won't go into any of them.
02:33If you have any problems with importing your database later, I'd suggest that you
02:37talk with your Web host.
02:38For example, the Web host that I am using doesn't allow me to actually create a
02:42new database on the server,
02:44so I'll have to go out and edit the file that this creates.
02:47Go down to the bottom, Save as file, and I'll save it as an uncompressed file.
02:53The file, as you can see, is now downloading.
02:55When it's complete, I go back to its download location, which in my case is the
02:59Desktop, and there it is.
03:01I am going to rename this as twotrees.
03:03Then I'll also make a copy of that.
03:06Copy it, and paste it, and call that twotrees-BACKUP. Great!
03:13So we now have our folder right here, twotrees, and twotrees.sql.
03:20So we now have our files and database ready.
03:23Now we'll move on to our next step;
03:25changing them to account for the new environment.
03:28You might have to change the name of the folder containing site-specific
03:31files if your host doesn't recognize the one twotrees, and there are
03:34typically two options.
03:36It could be the name of your site's domain, in this case
03:39tgeller.webfactional.com, or you can usually just use default in most cases.
03:44So that's what I'll do just to keep it simple.
03:46Inside of twotrees, in our sites folder, we have this default folder, which hasn't
03:51been used up until now. And then we have twotrees, which is where we have our
03:55actual settings.php file, and all of the files that we've been using so far.
04:00What I'm going to do is change default, to default-OLD, and then change
04:07twotrees simply to default.
04:11The next step is changing how our program files connect to the database itself.
04:15One big difference among hosts is how they handle databases.
04:19I've already created my database with the name tgeller_twotrees, and the password drupal.
04:26We'll also have to change how our program files connect to the database.
04:30One big difference among Web hosts is in how they handle databases.
04:34I've already created my database with the name tgeller_twotrees, and the password drupal.
04:41To tell Drupal how to find that database on the Web host, we change some text in
04:45the settings.php file that's inside the folder that I just showed you.
04:49So to go there, we open twotrees, and sites, and default.
04:53Before I make any changes, I am going to copy it, and back it up.
04:59The next thing I have to do is to unlock this file.
05:02Go to settings.php, and go down to Properties.
05:05On the Mac, you'll hit Command+I to change this.
05:08Turn off Read-only, Apply, and OK.
05:11Now we can edit it.
05:15There are a few places the database settings could be;
05:18one of them is fairly near the top.
05:20You have a listing here of all of the information on how database settings happen.
05:25Immediately after that is the database setting itself, but in this case, it
05:29doesn't show up there.
05:30So I am going to comment that out, and then scroll all the way to the bottom.
05:36This is where Acquia Dev Desktop puts it; at the end of the file.
05:40If you use any other sort of AMP stack, such as WAMP or MAMP, you'll find the
05:44database settings in that earlier place.
05:46Since we're in Drupal 7, we could comment out the Drupal 6 part, and then I am
05:50going to make a few other changes.
05:52First, I'll comment out this base_url, which is specific to the way that we were
05:56developing on our Desktop machine.
05:58You see it, that twotrees:8082.
06:01Next, I am going to change three things down here;
06:04the first will be the database.
06:06You might remember that the database I am using is called tgeller_twotrees.
06:13The username is also tgeller_twotrees.
06:17Of course, you're going to change this to whatever your Web host has, or however
06:20you set up your database, and the password is going to be simply drupal.
06:25Now I'll save this, and close it up.
06:29I mentioned a little bit earlier that I'd have to make a change to the database
06:32itself in order to make it work on my particular Web host.
06:36I'll open it up, and remove this CREATE line, because as I say, my particular host
06:42doesn't let me create databases directly.
06:44So I already created mine, and then I'm going to import all of this stuff in.
06:50I'll comment that out, and the USE line becomes tgeller_twotrees.
06:56That's a lot of stuff, and hopefully you won't have to go through all of this.
06:59I'm showing you all of this, however, because many of these steps are what trip
07:03people up when they go on to launch their site.
07:06However, now we can go on.
07:08We'll start by moving over the files.
07:10That's this folder here: twotrees.
07:12I've already downloaded an FTP program called Cyberduck.
07:16You can get it yourself by going to cyberduck.ch.
07:21It's free, and there's a version for both Mac and Windows.
07:24So I'll open that program up again, and I'm already at the place where I am
07:29going to put everything.
07:30I open my folder, and copy everything over.
07:34There is one thing that you have to watch out for, however.
07:37In some operating systems, you can't see any file that begins with dot;
07:41that's .htaccess, and .getignore.
07:45In general, that won't cause you a problem, but if you're able to show those
07:48files on your computer, do so, because you need to be able to copy them over to your server.
07:53So I've started that process, which is going to take a while.
07:58Now that the files are there, we'll move the database.
08:01Again, this is a step that varies tremendously from host to host.
08:05Fortunately, my host offers the same graphical database interface as the Acquia
08:09Dev Desktop we use on our home computer.
08:11That is phpMyAdmin.
08:13I've already logged in on my Web host, and we see here the databases that we have available.
08:18I've previously created tgeller_ twotrees, which remember is the database we
08:23specified in our settings.php file.
08:26If I click it, we see that there's actually nothing in that database; no
08:29tables found in database.
08:31That's fine, because that's exactly what we're going to import from our file
08:34that we saved earlier.
08:36So we click Import, we choose the file, we left it on the Desktop, and there it
08:43is. Open, and we make sure everything is okay.
08:47Now, in this case, there is an issue.
08:49You see that the maximum size for the database allowed is only 2 megs.
08:53This is a common problem on many Web hosts.
08:56If I go back to my Desktop, and take a look at my database file, it's actually 6 MB.
09:01There are several ways around this.
09:03One of them is particularly easy.
09:05You'll notice that phpMyAdmin on my Web host allows us to use compressed files; gzip, or zip.
09:10So what I'll do is I'll go back here, and I'll zip this.
09:14I have a program called 7-ZIP, which will let me do that easily.
09:21If I go over and look at the compressed file, it's less than a megabyte. Now, we can go.
09:26So I switch back to phpMyAdmin, choose the file, in this case, I want the ZIP
09:31one, open it, and go.
09:34This may take a while.
09:36Once our database has finished uploading, with all luck, our site should work.
09:40Let's go and take a look.
09:42You might remember it's at tgeller.webfactional.com.
09:46I'm afraid it doesn't.
09:47There are still a few more things to check.
09:50Let's go back to our phpMyAdmin screen, and see exactly what that might be.
09:56So what I'm going to do is look at my phpMyAdmin screen, and see if there are
10:00some settings that don't match between this, and the settings.php file.
10:04Remember, the settings.php file is what ties your database to your files.
10:09So let's take a look.
10:10You could look at this on your local machine, make changes in the settings.php
10:14file, and then re-upload it.
10:16I prefer to do it directly on the Unix server.
10:18I just find it faster.
10:19So I am going to use some Unix commands here to look at what I have.
10:23First, I'll see everything in my twotrees folder.
10:26This is my Drupal installation, and you'll notice that there is a sites
10:29folder right there.
10:30I'll go into it; cd sites.
10:33And the folder that we were using is default; cd default, and there's
10:37my settings.php file.
10:39I made some other changes while I was playing around.
10:42You might remember I made a copy of the settings file, but the one that Drupal
10:45actually looks at is settings.php.
10:48I'll open that up, and see what we have.
10:52Scroll all the way down to the bottom where our database settings are. Let's see.
10:56The driver is correct, mysql, database, and username, and password; we checked all those.
11:01The two that are still in question are host, and port.
11:04So let's take a look again at phpMyAdmin, and see what it says. Well, let's see.
11:08Ah! Here's something;
11:10instead of saying 127.0.0.1, it's localhost.
11:13So I'll make that change, and again, you might have to just do some of this
11:16playing around on your own, depending on what your host says, and then I want to
11:22see if that port number is correct.
11:24That's under the Variables.
11:26I'll click there, and search for port; 3306. Aha!
11:32You see, it was 33066.
11:34If I erase that, and exit, now let's see if it works.
11:39Go back to our site, and reload. We can see it!
11:43We're almost there.
11:45Obviously, it doesn't look the way that we want to.
11:48I am going to log in as the administrator, which remember in our course is admin, and drupal.
11:53And make one more important change;
11:55when we were on our local machine, Drupal made some assumptions about where
11:59files would be stored.
12:00Also, you might remember that we changed the folder we were using from
12:03twotrees, to default.
12:05In order to make it see all of the files, we have to go up and change that
12:09in the file system.
12:10You might not have to do this if you didn't make that change from twotrees, to default,
12:14but I'll just make that change here, and here, and then this is a Windows path.
12:20I am going to simply change it to temp, and save configuration.
12:23Now, if all worked correctly, when I close this overlay, it should look
12:27exactly as we want. Hold your breath.
12:31And indeed it is! Our site is back up, and it's working.
12:35So to recap, moving your site to the server is essentially a four-step process.
12:40First, you back up the files, then you make some changes to them, then you move
12:45the files, then you move the database.
12:47But the devil is in the details, especially in that second step; make some changes.
12:52So there's a good chance you'll have to fiddle with settings, and then fiddle
12:55with them again to make them work.
12:56Again, I'm sorry; there's no way we can cover the many variations here among the
13:00hundreds of Web hosts out there.
13:03If you're not able to work it out, your best bet is to contact your Web host provider.
13:07Good luck!
Collapse this transcript
7. Increasing Sales
Offering product discounts
00:00If you're an experienced business person, you already know that discounts
00:03really spur people to buy.
00:05Fortunately, creating discounts in Drupal Commerce is easy.
00:09Although, I have to say that I don't care for the way it works by default.
00:12So first I'll show you that way, but then I'll show you another that I
00:15think works a lot better.
00:17Before we begin, let's take note of the price of these Bath salts; it's $13.
00:22To reduce that, we create something called a product pricing rule. We saw rules
00:26in action in several other videos.
00:28If you want a refresher, watch the Understanding Rules video earlier in this course.
00:33To go there, we go up to Configure store, then Product pricing rules, and
00:37we'll Add a pricing rule.
00:39I'm going to call this Flat 20% discount.
00:46No need to add a tag; I'll just Save it.
00:48Now, when you do that, the Event is set up automatically; you don't actually have
00:52to touch it, and the rest of this is just a rule. It has conditions and actions.
00:56The thing that we're going to change is the actions.
00:59We add one, and then we have many options to choose.
01:03The ones that you're going to want are under Commerce Line Item, and there are
01:06several options here.
01:07For example, you could say, today everything in the store is a dollar, by just
01:12setting the price to a specific amount, or you can multiply it, or divide it, or
01:17subtract a dollar from everything; whatever you want, but what we're going to do
01:20is multiply the unit price by some amount.
01:23We'll do that, and the Value is going to be 0.8, because multiplying a price by
01:270.8 is the same as removing 20%.
01:31Under Value, there are a few different options. I'm going to choose Discount.
01:35There is some subtle differences among them, and you can read about that in the
01:37documentation, and then I'll say Save.
01:41Now let's see how that works from the buyers view.
01:44Go back to our front page.
01:45Aha; you see now it's priced to $10.40 instead of $13, so it worked, but let's
01:50go through the whole process.
01:52First I'm going to go to my cart, and remove what's their already, just to be sure
01:55that we're starting from scratch.
01:57Then I'll add this, we see it in the cart, it shows as $10.40; we checkout.
02:03Now this is where it gets a little weird, and why I prefer to use my alternate method.
02:07It shows that it's $10.40 here, but then the subtotal doesn't match.
02:11So even though people are paying the correct amount, they don't really know
02:14why they're paying it.
02:15What we're going to do is sort of a hack, but I think it works a lot better.
02:19It essentially applies a negative tax to the item. That will give your customers
02:23a discount experience that I think is more like what you're used to seeing.
02:27Before I do, I just want to take a moment to thank well-known Drupal Commerce
02:30administrator Randy Fay for uncovering and evangelizing this method, which has
02:34helped out a lot of people, including me.
02:37So the first thing we're going to do is go up and configure our store, and
02:40get rid of that product pricing rule. Flat 20 % discount; we'll simply delete, and confirm.
02:46Now if we go back to our cart, by the way, we see that it's updated.
02:51Go back to the front page, and the page shows correctly as $13. Very good.
02:55I'm just going to remove what's in the cart now, so we can start again from scratch.
03:00Now let's go on to creating that negative tax.
03:02We go up to Configure store, go down to Taxes, and under Tax Rates, I'm going to Add a tax rate.
03:12The Title will be 20% discount, I'll copy that and paste it in the Title as well,
03:18and then for the Rate, I'll make it -0.2.
03:22Remember, instead of multiplying by 0.8, we're subtracting 20%.
03:27Go down, sales tax is correct, and save.
03:31Now let's see what that looks like to our user.
03:33Close out the overlay, front page reloads, now we see this is $13; so far so good.
03:40Add to cart, view the cart, it's still showing as $13 and Checkout.
03:46Now at this point, we get the 20% discount.
03:50I think this is a better way to do it, because you could advertise 20% off of
03:54everything taken at checkout,
03:56and it's much easier for people to understand.
03:58Now I'd like to go one step further, and limit this discount, so it's only
04:01available for a limited time.
04:03We can do that by fixing up the rules a little bit.
04:06First, we'll have to step back a bit.
04:08We'll go up and configure the tax by going to Configure store, and Taxes.
04:13So far, I made this an ordinary sales tax. You might remember, we have two kinds
04:17of tax types: sales tax, and VAT, and I just sort of piggybacked on to the regular sales tax.
04:22I'm little uncomfortable about that, because now when I start to make changes
04:25to that tax type, it could get confusing, and it could affect our regular taxes, and so forth.
04:30So I'm going to create a new tax type.
04:34The tax type is going to be called 20% discount as well.
04:41And here you'll notice you have some other options as to what you can do to
04:44round dollar amounts. I'll Save that, and then go back and take a look at my tax rates.
04:49You could either click this tab, or just click Taxes over here.
04:53Now I'll go back into a 20% discount and edit it.
04:57Instead of being a sales tax, it will be a 20% discount type tax, and save it.
05:02Again, this is mostly just housekeeping, but it's the sort of thing you should
05:05be thinking of while you build your site, so you don't muddle up your different
05:07tax rates, but this works exactly as it did before.
05:11Now here is how you limit it by time.
05:14We'll go into Tax Types, into our 20 % discount, and this time we're going
05:18to configure the rule.
05:20I'll add a condition, and then we'll make a data comparison.
05:24We're going to say, we only want this to be true until, let's say, December 31st of 2012.
05:29So for our condition, what we want to do is compare today's date to the last date
05:34that we offer this discount.
05:36For that we need a data comparison.
05:38This is where it gets a little tricky, but we have some help under this
05:41Data Selectors link.
05:43We click it, and we see that we have all sorts of options here.
05:47The one that we want is date, so I'll do a search on my page for date, and
05:52that looks pretty good.
05:53We want to compare the current date to a specific date.
05:57So I'll copy that, go up to my Data selector, and paste it in, and then click what it offers.
06:06Scroll down to the bottom, and continue.
06:10Now we have the option of saying, what do we want to compare it to?
06:14We want it to be lower than 2012-12-31, and we could just leave the time however
06:25we want. I'm just going to change it to 23:59:59, in other words, midnight on
06:31that day, and then save. Great!
06:36Now let's go back and take a look at how that looks.
06:40If we take a look in our checkout again, just to go back and go straight to it;
06:44yep, we still have the discount.
06:46We can prove that this is working by going back, and changing that data comparison.
06:50Change it so that, for example, the sale ended yesterday, so let's do that.
06:55We go up to Configure store, down to our Taxes, to our Tax Types, and there
07:01is our 20% discount.
07:02When we configure this rule, we can just go back and change that data comparison.
07:06So we click edit to change the data comparison, and we scroll down to our data value.
07:11You'll notice something unusual here: even though I entered at midnight on New
07:16Year's Eve of 2012 going into 2013, it moved it ahead by eight hours.
07:22Why would it do that? Ah!
07:24You see, I made a mistake.
07:25This is the date in GMT, and it actually changes it based on whatever your time zone is.
07:31Since I'm recording this in California, eight hours away, it changed it.
07:35So watch out for that whenever you do one of these data comparisons with a date.
07:39Anyway, I'm going to change it back to 2010, which is definitely not happening anymore.
07:47We'll go back in; ah, and it removed the discount.
07:51Did you see that when the screen refreshed?
07:52It's now back to $13.
07:54Once you know about data comparisons, there are lots of ways you could limit
07:58purchasing opportunities.
08:00One of the most intriguing ways to provide discounts is by offering them only to
08:04people who are active on your website, or who perform certain tasks.
08:08You do that by installing the user points module, which is available at
08:12drupal.org/project/userpoints.
08:16Basically, any module that integrates with rules provides possibilities for
08:20discounts, and there are a lot of them.
08:23You can see how many there are by going to drupal.org/project/rules.
08:25Now once you're there, scroll down until you see, under Further resources, this
08:32Modules supporting rules.
08:34There is a huge list, and all of these give you opportunities for offering
08:39discounts, only based on certain comparisons.
08:42This is one of the better developed areas of Drupal Commerce.
08:45It was a real stroke of genius for them to use rules as the basis for
08:48things like discounts.
08:50In short, you can make pretty much any activity on your Web site the
08:54qualification for discounts.
Collapse this transcript
Gaining insight from Google Analytics
00:00The early days of the Web vexed traditional marketers, because they weren't able
00:04to measure the effectiveness of what they were doing.
00:06That changed in the early 2000s when Web analytics software started to appear.
00:11Then it solidified in 2005 when Google got in the game, and they pretty much
00:15owned it with Google Analytics.
00:17It's quite easy to install the Drupal modules if you need to use Google Analytics.
00:21Before you can use it, though, you have to have a Google account to receive the
00:25information that your site collects.
00:27I won't show you that part; you can learn about it from the lynda.com course,
00:31Google Analytics Essential Training.
00:33This video shows you everything else that you need to know.
00:36First, let's go to the Google Analytics site.
00:38You do that at google.com/analytics, and I'll just log in with my own account.
00:50That starts the Google Analytics part.
00:52Next, we'll need to get the Google Analytics module, which is the glue between
00:56your Drupal Commerce store, and Google.
00:58To get that, we'll go to drupal .org/project/google_analytics.
01:04We'll go down here, and we'll install it in the usual way.
01:25We then enable the module.
01:35You'll find it down toward the bottom under the Statistics group, and then you save.
01:41Once you've done that, you'll start to notice a warning as you go around your site.
01:45If we go to our Status report, we see what it is.
01:48Google Analytics requires that you enter your Google analytics code, which
01:52goes up right here.
01:54For that, we have to go back to our Google Analytics site, and get that code.
01:58Now, here I have to warn you about something.
02:01You won't be able to use Google Analytics on a site that you haven't yet launched,
02:05so we actually can't do it on our Two Trees site here, because it doesn't have
02:09an actual URL; it's just on our desktop machine, twotrees:8082.
02:13We'll try to do that.
02:15I'll go down to my gellerguides group here, and add a new profile.
02:19It asks me for the URL.
02:21If I were to say simply twotrees:8082, which is what we have back here, remember?
02:28And finish; it tells me that I have to correct the errors, because it
02:32wasn't able to find that.
02:33Now, it's actually asking, did you actually mean gellerguides?
02:36So let's try a new domain.
02:37Yup, and you see, URL ends with an invalid -- so it's just not seeing that.
02:42So instead of using this site, we're going to use the one that we uploaded
02:46earlier on in the Launching Your Store video. That one I happen to have at
02:50tgeller.webfactional.com, and once again, I have to install the module.
02:54So go to Modules, Install, and exactly as before.
03:11Now we can use it.
03:12To configure it, I go to Configuration, and again, I can follow these links
03:15through the Status report, or just click here on Google Analytics.
03:19Now I'll go back to Google Analytics, and get my code.
03:22I want a new domain; that's going to be tgeller.webfactional.com, and continue.
03:33Now I have my code.
03:35This is the part you actually need.
03:37You could ignore the rest of this stuff, because this is actually built into the
03:40module that you put in to your Drupal site.
03:41So I'll just copy this UA code here, go back to my site, yup, it's the
03:46webfactional one. Paste it, and save.
03:53Now, we're ready to go.
03:55Now, I skipped over an awful lot when I went through that.
03:58You have a lot of options down here at the bottom of the page.
04:01You can track according to domains, pages, roles, and so on.
04:07You'll notice that some of these exceptions are already built-in.
04:10It's set so that Google Analytics won't track the things that you do as the
04:13administrator, which is really good, because otherwise you'd find a lot of false positives.
04:17Oh, people are coming to my site;
04:19no it's just you administering the site.
04:21Let's go back to the Google Analytics page, and see what it's reporting back.
04:25Unfortunately, we're not going to see anything yet.
04:28It takes a little while for your site to talk to Google Analytics, and for Google
04:31Analytics to respond, but let's take a look anyway.
04:34We'll go back up to the top level, and see what's under our gellerguides group.
04:40There it is; tgeller.webfactional.com.
04:43Now as I say, it's not reporting it, but otherwise, you would see a report here
04:47showing exactly who's on your site, how much time they've spent, what pages
04:51they go to, and so forth.
04:52So to give you an idea of what that actually looks like, I'm going to show you
04:56the analytics from my own site, tomgeller.com.
05:04To do that, I'll go back up to Analytics.
05:06So, here you can see that Google Analytics shows you a lot of information.
05:10It tells you on a day by day basis how many people came to your site, shows
05:15geographically where they're coming from, and you can actually drill down in
05:17here, and see a closer report for any part of this. Very useful stuff.
05:22Again, for more information on this, see Google Analytics Essential Training from lynda.com.
05:27This whole field of analytics is just fascinating stuff, and with the Google
05:31Analytics module installed and configured on your store, you can see a lot about
05:35what on your site most interests people, and it's broken down by demographics, and
05:40you can use that information to increase sales and target your marketing.
Collapse this transcript
Making your site more visible to search engines (SEO)
00:00Now that your site is up, you want people to find it.
00:03Advertising takes you part of the way, as does participation in
00:07relevant communities,
00:08but a big part of online traffic is from what they call organic search. That is,
00:12through search engines like Google, and Yahoo!.
00:15The techniques I will teach you in this video will help you get higher on their listings.
00:20But let's be honest, the world of search engine optimization, or SEO as it's
00:24usually called, started out in pretty bad company.
00:28People used all kinds of dirty tricks to knock others out of the top places.
00:32But standards have emerged in the last few years that the search engine
00:35companies actually encourage.
00:36They improve your site's appearance, not just its ranking,
00:39so you can feel good about using everything you see in this video.
00:44First, there are a few modules that are must haves.
00:47The first module is called Token, and you can get it at drupal.org/project/token.
00:52What this does is let you put into your site information from the site itself.
00:57For example, you could put in a token that says name the current user, or
01:02name the current page.
01:03This is useful for SEO purposes.
01:06You would download and install this in the usual way by going down here, copying
01:09the link, and pasting it in through your modules page.
01:13The next one is called Path Auto.
01:15Like Token, it's at drupal.org /project, but then pathauto.
01:20What this does is it changes the path that shows up as the URL alias up here.
01:25If we go back to our site, you might remember that when we create something in
01:28our site, it gives it this path of node/21.
01:32That doesn't actually say anything about what's on the node.
01:35You can change it manually by going to the node, clicking Edit, and scrolling
01:39down to URL path settings, and setting it by hand.
01:43What Path Auto does is it automatically creates those paths for you based on the
01:47content of the node.
01:48Very useful, and it shows off your site a lot better to search engines.
01:52I am actually going to install this one.
01:54I will go down, copy the link, go back to the site, and as usual, it's just
02:00Modules, and Install new module. Then we enable it.
02:08To find it quickly, I will simply search on my page for pathauto.
02:12Ah, you remember that Token module?
02:13It's actually required by pathauto, so I will go back, and I will install that as well.
02:19Again, drupal.org/project/token.
02:36Now we can enable Path Auto, and when we do,
02:44by the way -- this is a nice feature of Drupal -- it automatically says, oh you also
02:48need to have Token enabled.
02:49So yes, go ahead and do that.
02:51You only have to enable the last one in the chain, so to speak.
02:55You can see how those URL aliases work by going up to Configuration, and then
03:00down to URL aliases.
03:03We now have this tab up here, Patterns, and this is how you define what that
03:07automatic path is going to be.
03:10You can define it by taxonomy, by user; all sorts of options in here.
03:14There's also some settings, a bulk update option, and so forth.
03:17If we go back to our node, we can see what that does for us.
03:21We go in and we Edit it.
03:24Scroll down to our URL path alias, and make it an automatic alias.
03:27Now, instead of being simply node 21, it gives us bath-salts-8-cubes.
03:34Very good for search engines.
03:36That's an important first step;
03:38possibly the most important thing you can do quickly, because that URL is so
03:42important to search engines.
03:44But now let's move on to some suggestions from the Drupal community.
03:48I've found a large list that I really like at groups.drupal.org/node/141519.
03:57There's a lot here, and this is a wiki page, which means people are always adding more to it.
04:02The good news is that an SEO expert named Ben Finklea created a Drupal module
04:07that takes this big confusing wiki page, and helps you apply its
04:10recommendations to your site.
04:12It's in a module called SEO Checklist.
04:15You go to drupal.org/project/seo_checklist.
04:21We will download and enable that.
04:43Then we can see what it does by going to Configuration, and down to SEO Checklist.
04:48I won't go into all of the details here, but as you can see, it gives you a lot
04:52of different choices of what you can check off.
04:55But the funny thing about this module is that checking these things doesn't
04:58actually do anything on your site.
05:00It really is just a simple checklist, as if it's on a piece of paper.
05:04But Ben Finklea and his folks at Volacci are always updating this,
05:07so it's a very useful thing for keeping up on all of your best search engine
05:11optimization practices.
05:13As you can see, there are a lot of ways to improve SEO for your Drupal store.
05:18But the truth is, even if you do none of these things, your site is going to be
05:22in pretty good shape already, because Drupal has several built-in SEO features.
05:27SEO is a competitive field, though, and every little bit counts.
05:32Earlier in the video I mentioned a few resources that will take you further
05:35within Drupal, but if you want to learn more about SEO in general, I recommend
05:39searching lynda.com for the phrase SEO to find several courses on the subject.
05:44Two of the biggest ones are SEO:
05:45Search Engine Optimization Getting Started, and Analyzing Your Web Site
05:49to Improve SEO.
Collapse this transcript
Encouraging customer buzz
00:00Nothing powers a store better than word- of-mouth. That's especially true on the
00:04Internet, where shoppers can multiply their opinions through social platforms such
00:08as blogs, forums, Facebook, and Twitter.
00:12That list names only a few. It's impossible to catalog all the ways that people
00:16spread opinions online, and their number will continue to increase,
00:20so this video introduces you to some that are fairly easy to implement, but that
00:24can have big payoffs.
00:26Let's start by talking about something very natural to your site.
00:29Whenever someone makes a purchase on it, Drupal Commerce creates a user, and
00:33if we go up to People, you'll remember that we have this customer@example.com person.
00:39This one was created when that person made a purchase.
00:42We can go in and edit their profile, and as we go down, you see that we can do
00:46things like let them add a picture, select their location, and also, if we go up
00:52to Configuration, and Account settings, we can add any other fields that we want
00:58to, so that people can express themselves through their profiles.
01:02What people do with those profiles, you can change by changing their
01:05Permissions settings.
01:06To do that, go up to People, and Permissions.
01:09There is a lot to go through here, and you can learn more about it in my Drupal 7
01:14Essential Training course, but the most important one is down at the bottom.
01:19In this User group, if you let people view each other's profiles, that's the
01:23beginning of community.
01:24There are a few other permissions on this page, which allow them to contact each
01:27other, and so forth, and as you add other modules, you might have more and more
01:32ways that people can interact with each other, but this is a beginning.
01:36Moving away from people, let's talk about one social feature that's built into
01:40your store, but is turned off by default. That's the Forums.
01:43Let's go and turn it on by going up to Modules, and scrolling through the Core
01:47group until we find Forum.
01:51Turn it on, scroll to the bottom, and save.
01:56That creates an entire bulletin board system on your site.
02:00We can see how that works by going up to Structure, and Forums.
02:04It starts already with General discussion group, and you could add subgroups if you
02:08like, but let's just go there.
02:11Once there, you can add a topic, say Favorite recipes, and if you had added other
02:17forums, you could put that into a recipes area, or an edible oils area, or
02:22whatever you want. You can change the taxonomy of this however you like.
02:25Let's talk about them. Scroll down, and save it, and as you can see, people can
02:32then comment on it, and so forth.
02:34Once again, you'll have to set the permissions correctly, but this gives you an
02:36idea of the power of Drupal behind your store.
02:40Now, there is a problem with forums, though.
02:42They can become hives for abuse, and trash talking, so you have to watch them carefully.
02:48However, if they're done right, they can become a reason that people keep
02:51coming back to your store.
02:54One place that I think does that really well is woot.com, at woot.com.
02:59Woot sells one item a day, and then they have special deals as well, but the
03:03centerpiece is the community, and you can see that there are lots of discussions
03:07about what's being sold, and how to win it, and that sort of thing.
03:10Very good use of community using forums, but let's get back to our site.
03:15Another way to keep people coming back is to write an interesting blog.
03:18There is a blogging system already built into your store, but like the Forums,
03:22it's turned off by default.
03:24To turn it on, go up to Modules, and in the Core group, it's simply Blog.
03:29Scroll to the bottom, and save.
03:33Blog posts are just ordinary pieces of content.
03:36You create them by going up to Content, Add content, and now you see you have Blog entry.
03:43Let me put something in here;
03:45I love olive oil, and let me tell you about it.
03:50Scroll down to the bottom to Save.
03:52I'm just going to take this off of the front page; let's say I don't actually
03:55want to have all of my blog posts on the front page.
03:58I'll save it, and there it is, and as with most blogs, people can then add
04:05comments, and so forth.
04:07One thing that's interesting about blogs is that they all get collected onto
04:10one page, so someone could just go to my admin's blog, and read all of my blog posts.
04:16Now, Forums and Blogs are just built-in features.
04:18You get them automatically with Drupal, but because your store is built on
04:22Drupal, you can also add all sorts of community features from the wealth of free
04:26modules at drupal.org.
04:28To go there, go to drupal.org/projects/modules.
04:33Once there, the first thing you need to do is filter it by compatibility.
04:36We're using Drupal 7, and modules for other versions of Drupal won't work.
04:41Then you can search by category, as well.
04:43For example, Community.
04:45There's over 100 modules available, which will help you build your community.
04:50So that covers a lot of the things that you can do to encourage people who are
04:54already existing customers to talk to each other, but if your goal is to
04:58increase business, you also have to make your store talk to other sites.
05:03We talked about one way to do that in another video in this series, Making Your
05:06Site More Visible to Search Engines. Now let's look at a few other techniques.
05:11One of those techniques is already built into your store, but it's not very well promoted.
05:15Let's go back to our store, and to the front page.
05:17Now, if you scroll to the bottom, you'll notice this little icon here. This
05:23leads to an RSS feed.
05:25If we click it, we see the contents of this page, and remember, this is a
05:29collection of nodes showing up in a format known as RSS.
05:34Other sites can subscribe to this, and show your content, and it appears
05:37immediately as you post it, or within a very short time.
05:41Now, I'm using Google Chrome.
05:43If I switch over to Firefox, you'll see that it shows the RSS information in a
05:47slightly more human readable form, but in either case, other computers can
05:51understand it, and that's important, because if some other site wants to show
05:55everything that's happening, let's say, in the olive oil world, they'll get your products.
06:00Finally, I want to mention a way that you can reach out to other sites where
06:03your customers already gather. That is, Facebook, and Twitter, and so forth.
06:08There are several modules that add buttons next to your products and blog posts,
06:12so that people, when they like them, can just click the Like, or the +1 buttons, and
06:15it will automatically count on Twitter, and Facebook, and so on.
06:19One that I've used a lot is called AddThis.
06:22You can get it at drupal.org/project/addthis.
06:23We'll install this in the usual way.
06:31Copy the link, go back to our site, and put it in the Modules.
06:51Once it's installed, you activate it by going to Configuration, and AddThis.
06:56I'm going to have the AddThis button show up in both node pages, and node teasers.
07:01I should mention, this username is if you want to track the activity on your site
07:05on the addthis.com site.
07:06Obviously, we're not going to go into that whole subject, but it is another way
07:10that you can keep an eye on what people are doing on your site, while still
07:13giving them their anonymity.
07:14Anyway, we'll save this, and then go back to the front page of our site, and you
07:20see now, next to every one of these listings, we have this little button where
07:24we can say, oh yes, I like this; I'm going to send information about it by
07:27e-mail, or I'm going to put it on my Myspace page.
07:30There are actually quite a few others available; over 300, in case you use any of
07:34these other social networks.
07:36I'm going to just change that configuration a little bit, because I don't like
07:40having this on the front page.
07:41As people scroll through, they tend to get tripped up by these buttons, but I
07:46want to leave it available on the individual products.
07:48So I'll go up to Configuration, back to AddThis, turn it off for the teasers,
07:53but leave it on the node pages.
07:54There is one last thing about this particular module. Although we can share
07:59these items, you have to turn on permissions for ordinary people to share them.
08:03We go to People, and Permissions, there's AddThis, and we let people view the
08:10AddThis widget, and save.
08:13A similar module, by the way, is AddToAny, and you can get that at
08:17drupal.org/project/addtoany.
08:22Now, I know that was a whirlwind tour of a big subject.
08:25As usual, lynda.com has several courses that will take you further.
08:29First, see more about Drupal's built- in features, such as Forums, by watching
08:33Drupal 7 Essential Training. Then consider looking at some of the business
08:37courses, such as Social Media Marketing with Facebook and Twitter.
08:41Not everything in those courses will be relevant to your store, of course, but
08:45every little thing you can do to encourage positive buzz will help you to
08:49increase your customer base, and improve retention.
Collapse this transcript
Conclusion
Goodbye
00:00Thanks for watching Create Your First Online Store with Drupal Commerce.
00:04You're well on your way to running an online store the way you want, free from
00:08the restrictions and fees of hosted services like Amazon, and eBay.
00:12I hope you're as excited as I am about all you can do with Drupal Commerce, and
00:15I can't wait to see the great things you do with it.
00:18If you're still hungry for more information, here are some resources.
00:22First, there is the Drupal Commerce homepage at drupalcommerce.org.
00:27There you'll find many discussions about all of the latest developments of the project.
00:31As you know, Drupal Commerce is built on top of Drupal, and for more information
00:35about that, visit the Drupal project's homepage at drupal.org.
00:39Of course, to promote your store, turn to lynda.com's courses in online marketing.
00:44Just go to lynda.com, and search for the word marketing.
00:48I hope this course helps you to become a happy and successful
00:50online entrepreneur.
00:51Thank you for watching Create Your First Online Store with Drupal Commerce.
Collapse this transcript


Suggested courses to watch next:

Drupal 7 Essential Training (7h 23m)
Tom Geller


Email Marketing Basics (56m 57s)
John Arnold


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,141 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

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.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

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

   
submit Lightbox submit clicked