 It is one o'clock. You are in commerce by example. And we're glad that you guys have decided to choose us for your last session at DrupalCon. We're going to try to keep this as light and as lively as we possibly can. And we're really glad that you've joined us today. Just so you know, this is a lab. It's a two-hour session that we will have a break in the middle where you can go to the bathroom, but we're going to try to keep it to five minutes in the middle. So two-hour sessions are good for working through the problems as we go along. So if you can, and we'll go through this in the presentation to try to follow along with what we're doing, you're going to get the most out of this. So I'm Nick. I am a sales engineer at Commerce Guys. I've been a droopler for about over nine years. And I also happen to be a Magento certified developer. But I'm back from the dark side, and I'm here today to talk about Drupal Commerce and how much you can do with commerce and how commerce is very different from a lot of other systems. And I'm Josh. And I've been working with Commerce Guys now for going a little over two years. I work on the R&D team with Ryan's Rama and Chris Merritt. And a big part of what I do at Commerce Guys is trying to help people understand how to use commerce and do everything I can to answer your questions throughout the year on DrupalCommerce.org, on IRC, on Twitter, and just about anywhere else we might run into each other at camps and so forth. So don't be afraid to ask questions because both Nick and I are very used to running point on a lot of the community questions that come up. But that's enough about us. What about you guys? Who here is, this is their first DrupalCon, and you would say they're, and you would say your new, or first DrupalCon. Okay, like half of everybody. How many of you are new to Drupal, like past six months? Okay, maybe about half of those people, all right. Who here has used Commerce Kickstart? Okay, maybe a little under half. How many of you have used regular commerce, no Kickstart, just installing commerce modules? Okay. Wow. Okay, excellent. And out of anybody here, just show of hands, who's with like an agency? Who does work for other folks? Most of you. Yeah. And then folks who just work for yourselves, work for a company, building sites? Oh wow, the other half, okay. All right, well that's great. So what are we gonna do today? The first thing we're gonna do is we're going to cover some instructions. Josh is gonna cover those instructions and as best we can. Then we're gonna talk a little bit about best practices, really kind of cursory overview, something everybody here should know, but we're gonna go over it one more time. Then we're going to do the catalog and registration hands-on. We're going to take an existing catalog site, and we're going to add commerce onto that catalog site. And then along that inside of that site as well, we'll enable the ability to have kind of an event registration, check out process or flow. Depending on how long that takes, we should have some time for Q and A, or we can break a little early if we have some extra time. And then when we come back from the break at 2.15, we'll do the blog subscription, and then the donation or tip jar hands-on, and then the remainder of our time we will use as well for Q and A and wrap up. All right, Josh. Okay, so we're gonna be talking, we're on how to fall. Okay, so this link right here, if you type it into your browser. Oh wait, that doesn't work. Oh, I updated it. It's just your version isn't updated. Imagine that link says Drupalcommerce.org slash commerce-by-example. So that's the title of our presentation. The domain is Drupalcommerce.org. That particular link will take you to a quick post that if you're following along before the presentation, I put up all the files that we're gonna be using for the various demo sites that we have. So these demo sites, what we've done is we've built two kind of fantasy sites that don't really exist but could and often do actually come to us as commerce guys and say, people will say, hey, I've got a catalog site. I'm a book publisher. I list a lot of books, but I really wanna start selling them. Or I've got a blog and I really wanna sell premium content. So we have some example sites for you guys to get started with so you can see what it feels like to actually add commerce to a website. Next, what you could do, I'm not saying you have to, if you're not familiar with this, it's okay, we're gonna be doing this all on the screen. But if you wanna follow along at home and you have the Drush ARB, this example's good for our, I think it's called the Bookpal export. The Drush ARB will take that file and will actually create, if you give it the right path name for your database, will actually create an up and running site on your system in about two minutes without you having to do anything. If you're unfamiliar with Drush and you're unfamiliar with what ARR or ARB is, that's okay, because we've also provided in that file, if you just open it up, it's a tarball. It actually has the site files and an export of the database. So if you're just familiar with databases, you can do this later. Also, we've been informed this has been recorded. It's being recorded right now. So maybe follow along now and go home and do this as an example later on. The next slide we have Drush Make. Again, with the Bookpal version, we have a make file where, and this is a best practice and we're gonna get into some best practices before we actually jump into the demos. And what you can do is you can run a Drush Make command on the make file and it will download all of the modules to your system and set you up with a site that could actually do this with all the commerce modules and all the dependencies that we're gonna be using. It's also a good self-documenting thing. If you're looking for which modules we used, it's all in that make file. So as we're going over the best practices, try to use this time to maybe grab a copy of the site, get it up and set up on your system. Since it is a lab, we're trying to get you guys to work through this as well with us. And like Josh was saying, if you can't, this is being recorded and likely there will be blog posts that follow after DrupalCon that will go into a little more detail about the specific instructions. But if you've got a laptop and you wanna follow along, go ahead and while we go through the best practices, go ahead and set it up. Otherwise, don't worry about it. We're gonna take you start to finish through that. It'll be recorded and it'll be made available to everyone. Show of hands. Can everybody hear us? Yes? In the back? Okay. So let's talk about some best practices. So first and foremost, you wanna do yourself a favor and plan ahead. Commerce is in itself, it's its own ecosystem of modules. And there are a lot of ways that you can get things done. And there are in some cases, multiple ways to do certain things. Even in this particular demo, we've chosen certain paths of things in order to come to a specific conclusion. Generally speaking, this is not the only way to do it. However, it is the way that we've chosen to do it and it's a way that if you are looking to get started is a way for you to get started and it's not considered a hack. It's just one way of doing something. But so in terms of actually planning ahead, that's doing things like reading documentation of modules, looking at the issue queue, getting comfortable with what a module does and what your particular need case is. And then actually solidifying in your mind knowing what you wanna do and knowing what your final goal is. Another really great thing is do not do anything in production. Just don't do it. You're not the most interesting man in the world. And if you are, then the side does not apply to you. But if you are not, then go ahead and make a copy of everything which is actually the next slide. Make a copy of your database, make a copy of your site, play around with it. Don't be afraid. If you back up your stuff, if you're utilizing a copy of your code, then the worst thing that may happen is you have to go back, restore from it back up and try again. Which leads into the next one, use get. I know this sounds like a best practice and there are probably people going, well, duh. But we still run into people who don't use get, don't use some sort of a source code or a version control system. At a minimum, learn how to use get and use get. It will save you time and frustration and hair. Again, back up your stuff. There are a couple of great modules out there. One called demo, if you're really just wanting to do it on a local machine, there's a demo, it's just, if you go to dgo.to slash demo, there's a module you have to download the dev version, but it will allow you to make database snapshots so you can actually move all your modules in and test configuration, capture the database and then try it again over and over, reverting back to the database and trying things over again. And probably one of the biggest things is not to overcomplicate things. Like I said earlier, there's a lot of ways you can do things and in many cases, each have their own pros and cons, but you don't have to overcomplicate things and I can't stress this enough. Yes, there are probably three modules that will make a really fancy way of accomplishing one particular task. Do you need those three modules? Do you need to expend the potentially hours trying to figure out how those work and all those types of things? Probably not. If you're just trying to get commerce going on a site and for a lot of folks, that's what they wanna do. They just wanna get commerce going and they wanna be able to iterate quickly. They wanna be able to try things out. Don't overcomplicate things. You don't need everything and all you need is really something that is functional and works. As Josh mentioned also, there are some best practices that are being documented as far as, not even just Drupal commerce, but Drupal in general. Things like utilizing makefiles, which are really great ways of capturing groups of modules that need to be enacted on a site. In fact, if you've used commerce kickstart, commerce kickstart at its core is an installation profile, but it's built from a makefile and it makes things a lot simpler and we really encourage you, if you haven't started using makefiles, they're a really great way to jumpstart the building of any site because you have all of your standard modules there. You can pull in, get repositories, all that kind of stuff, but definitely do that. So now without any further ado, we're gonna turn it over to Mr. Josh over here and Josh is going to run you through the publisher site. Okay, so can you guys see my screen because I actually can't. Should see some slides there. So the first demo that we're gonna do today is called buying books and I'm gonna take you through looking at a publisher site, it's a fantasy site, but a publisher site that has a listing of books and a listing of events and we're going to first show you how you can easily install commerce and then start buying books within about 10 minutes. And then our next demo is going to be event registration. In event registration, we're going to do the same kind of thing, but we're going to set it up so that you can actually register for say a book signing for this publisher site. So for the first demo, we're going to follow best practices. What you see right here is an impromptu demo of Commerce Guy's new hosting service called Platform. Platform similar to Pantheon or Aquia in that you can do a dev site, a test site, a staging site and a live site. What we've done to kind of turn it on its head is you can do hierarchical copies of your site. So what we have right here is a master environment and I'm gonna add commerce to our site. So I've created a branch which is very easy to do with Platform. You simply click the branch button, give it a name, push the button and it makes a complete copy of your site and it's not just the database and the files, it's also making a copy of the solar server that's running the backend, the Redis server that's handling the caching, all of that, which allows you to quickly make a copy which is what we're talking about best practices. I think sometimes the reason best practices aren't followed is because they're hard to do. This makes it really easy to do. So for every branch, you get a link up here called View This Website. So that's the master's, the live site, commerce is the one we're gonna be playing with today. This is our first example site. It's a publisher called Bookpal. I believe Nick's daughter actually put all the books in for this. So I think that was a punishment which I don't know how I feel about that. But we have a bunch of books listed here. You can use the filters to find various kinds of books, the availability Drupal. We're using Views to do this and we're using, actually we're actually using Views here to create kind of a menu where you can fast it down into this catalog. Now the publisher that built this site basically was just trying to show off a catalog of products that they have and they expected you to phone call in and order something or maybe go to Amazon and buy it. But they really would prefer if you could just click add to cart and purchase these things. Now this is a pretty common example and it's a pretty simple example of how commerce will work. So the first thing we need to do is we can click login. And once we've logged in with the right password. Ah yes, if you actually have it up and running that was a test to see. It's admin, admin. Which I did that so that I could say that is not a best practice. Never name your site admin, admin. Okay, so once you've logged in you've got the website here and what we need to do first and I'm gonna keep referencing my notes partially for your benefit, partially for mine because I've done this enough that I'm gonna forget a step. So the first thing we need to do is install all of commerce and its dependencies. So it's just a typical Drupal site and I think commerce sometimes in our minds cause it's changing the way our website works. It's no longer putting up dynamic content. It's actually allowing people to buy stuff. It kind of feels magical in a way. Like we're worried about installing commerce on an actual site. But for our purposes basically we're just going to enable all the commerce modules. Now I went through this a couple of times when I was planning for this and I was kind of impressed cause I always start with kickstart one. I never actually have to click all these. Each one of these modules that commerce comes with is encapsulated and a couple of them are dependent on each other but not very many. They also have user interfaces which means by default commerce can be as little or as much as you want it. And for this demo site we're gonna go ahead and turn all of the core commerce modules on which means we're gonna be clicking for a fair bit. Okay, once we've done that there are two other modules that I did not click as dependencies on here because commerce already requires them and we're gonna be using Drupal. And Drupal helps us often times when we most need it. And this is the same, this is no exception. We have rules and rules UI which is used for pricing and taxes and we have the address field which is used for apparently the payment UI but also customer address field and a number of other places. So we're gonna click continue. And as this is loading cause enabling a number of modules can be slow at times plus we're depending on the internet right now which thankfully for this conference is doing well. We have what's going through here is it's adding commerce, it's adding payment APIs and it's gonna add absolutely nothing to the front end of your website. So even if you were to have commerce installed on a site ahead of time it's not necessarily going to change the front end at all. Once it's loaded you get if you're using admin menu a new menu item here at the top called store and it gives you access to all the customer profiles it gives you access to orders, products and store configuration. So we've got the modules just simply commerce installed. The next thing we need to do is we're going to make the first product type that it comes out of the box with we're gonna kind of change it. So it helps our store administrators. So for the product type product we're gonna click that and it's going to give us just a really quick thing. If you're used to content types this is the same thing. I'm going to call this a book because we are selling books on this site. So I'm going to save product type and we have a fantastic error. Cool. The demo gods are unhappy with us. This one. Cool. Since we have a backup of the site I'm gonna do it live as Ryan's Rama likes to put it. We're going to do this same step real quick again on the live site. Yeah, best practices people. I'm a shining example of what you should not do right now. Josh is a trained professional. Don't do this at home. Don't do this at home. Really this should be safe to do on any site. Don't tell them that. One of the things that I would do normally to make my life a little easier is I would use Drush, Enable and have a couple of modules picked out and just type it. So same thing that's happening here. What we're gonna do next is we're going to add a field to our content type. And this is classic commerce. So what you do is you add a reference field to your content type so that you can add products to those book pages that we were looking at earlier. So basically what you wanna do, I'm just trying to help you get in the mind of what we're trying to add to the site. We wanna add an add to cart button to a book page. So to do that, we're gonna add a field to a book page that references products that you can add to your cart. Okay, so quickly going to change my product type. We'll see if this produces the same error. I sure hope not. Click edit and I call it book save, cool. So we now have a book product. Before we go and add that field I was talking about, I wanna go ahead and add a quick product. So we have a number of books on this site. We have about 70 or so. But the one that I'm interested in is the one by Mike Crittenden. He recently released a book called Responsive Theming for Drupal and it's a fantastic read. You guys should pick that up. I think it's published by O'Reilly. I'm gonna save that product. So we now have a product in commerce that's on this publisher's site. And that took maybe three minutes if you take out the cool error that I just found randomly. So we have a product but how do you sell it? How do you view it in fact? Because if you click the title it takes you to the edit page. So what you do to view it is you go and add a field to the content type that you want that cart button to show up on. It's gonna be real easy. We're just gonna call it by this book. And it's going to be one of these amazing fields that we have here. It's called the product reference field. It comes default with commerce. Selectless is fine. There's a number of formatters that are out there. If you've used Kickstart too, I saw a number of hands go up. It uses the formatter called inline entity field which lets you edit the products in the page. When you're adding a reference field you wanna make sure you have render fields from this reference product when viewing this entity which is a really fancy way of saying I want the price to show up when I look at this particular node. So we'll click save. All right, now the trick is now we just need to connect a product with a book so that we can buy the book. So we get to find the book that Mike created. I know it was a theming book. It's called responsive theming for Drupal and we're gonna go ahead and click edit. So this is just a standard node page and we added one field at the bottom here. It's called buy this book and we've selected a product to buy the book. Now when I click save, one of the things that's cool about this kind of fantasy site is we're running panels. So we have total control over what's actually happening here. We can do some cool stuff like add reviews, five star reviews, that kind of thing. That's something the publisher has already figured out and got it working for us. But how do you add commerce to a panel controlled page? It's very simple. You just click edit panel and then we add a field like any other field to our panel page. So I wanna have the add to cart button show up on the sidebar of this page. So I'm gonna click add content and under node we have all of the fields that you could possibly add here. The one we're looking for is called buy this book. That's the add to cart button that we're looking for. So I'm gonna go ahead and click that. And you can select a format or the one that's default is the one you want, add to cart, click continue and I'm just gonna go ahead and click finish. So if I just update and save this right now, it'll take us back to the page and I can add this to the cart. But we're missing a few things. For example, we don't have a price. So to show a price, you can go back in there, repeat the same steps just by adding another field. You go into node and you want to add product price. You could also show off the skew. You could have fields attached to this product like different images so that when they choose various attributes like if they're gonna choose hardback or paperback or ebook, it would load all the various attribute fields. So we're gonna select price, click finish. I'm going to do one quick thing. We're using the bootstrap theme here and one of the things you can do with bootstrap that I've just absolutely fallen in love with is you can use classes that come straight out of bootstrap to kind of design in the interface. So I'm gonna make this look like a well in bootstrap three. I'm making it a lead so it makes the text a little bit bigger and I'm also making it green by telling it that it's successful. So you click save, update and save again and we now have an add to cart and a price field. So just to show that off, we can go ahead and click add to cart. It's been added to my cart. I don't see it over here. There's no cart block. So should you want to add a cart block to your site? You can go to your blocks like any other website demo. I'm looking for the shopping cart right there. I'm gonna put it in the primary sidebar, click save. What that'll do for us is on pages that have a sidebar, it'll now bring in our shopping cart and the stuff that's been added. And to complete the full round demo, you can actually go through checkout. I'm gonna fill this out with my fake address. Next step, it's the example payments already filled in, the payment information. This might be a big question for you guys. How do you take payment on a website? And there are tons and tons of payment gateways out there and there are a number of payment gateways that we recommend on DrupalCommerce.org, PayPal's one of them, PayMill, Stripes a Good One. There's just a number of various payment gateways and you kind of need to pick one that works for your use case. For my use case, the example payment works really well. Okay, so I've just ordered a book and it only took just a few minutes to do. The next demo. And I just got the email. Oh, did you? Awesome. Oh, it's the order completion email. Cool. Let's see here, present. Okay, so the next demo is gonna be event registration. In event registration, on this website, we are actually allowing people to view all the book signing events that are happening recently and upcoming. Before we go on with that. Oh, any questions? Any questions? So that was a lot and I think there's a microphone over here. I don't know. Yeah, there's just one microphone over here. Go ahead, we'll repeat the question. Right. Yeah. Oh, okay, so how do you download this version? Is that what you're asking? Yeah, I mean. Oh, right, so if. The original. Right, right. So what this should be is an exact copy of what I was doing with originally. So my guess is the error wasn't actually with the files. It was with the actual server that had been spun up for that particular example. I'm not able to follow along in here. You should be able to follow along with me unless you had the same, did you have the same error? Oh, did you really? Right. Cool. So that means it's actually on the site. We will be posting an updated set of files so you guys can follow along at home. And it would be in, go ahead. By the way, right before that error, there was a small line at the bottom about rules. And it may be was installed. Could you just, you keep using the word commerce and commerce kickstart, like sort of, I don't know if it's interchangeable. Could you tell me the difference between those two things is just one grouping of the modules and the other one? That's a good question. If you guys are familiar with it, Drupal is kind of a framework and it has modules and themes. And one of the ways you can access Drupal and get started with it is with a thing called distributions. And commerce kickstart is a distribution, which is just a collection of modules and a theme. And it usually has an installation profile that kind of sets it up with an example content. So kickstart two is, did you switch the monitor? Okay, so what you're seeing right now is the module page for kickstart two. And that comes with a bunch of example content, a great setup for your administrative interface, et cetera. It's really designed to show kind of the potential that commerce has. Now, Drupal commerce itself, whoops, is just a series of modules. So commerce kickstart is kind of a use case for commerce where you have a theme, sample content, that type of stuff, shows you a lot of configuration, kind of how-to configuration stuff. Drupal commerce would be kind of the approach if you have an existing site and you're wanting to implement something with commerce on top of it, the commerce core modules are what you would start with. Yeah, that's a good point. Each one of our demos is all about adding commerce to a site. You can't start with a distribution. So that's why we're going through and literally clicking all the check boxes on all the modules. Okay, any other questions? Okay, come on up to the mic. And if you've got one, might as well cue behind her. Say, okay, so you have your product, that's a physical product of the book. What if you had a e-book of the same content? So it could be email, or it could be downloaded or it could be mailed. Would that be an attribute or would you set up a new product for that? It could be an attribute, but you'd probably want to set up a different kind of product type. And then have a field of some sort to... Right, what you would do, the way commerce works when you use multiple product types on a product display. So let's say you have a product type called e-book, that's actually a file and it's managed by commerce file. And commerce license and all that. If you had that, that would be one product type and maybe a physical product type called book, right? And they're both displayed on this page. What commerce will do, because it can't understand attributes that way, it'll give you a list of the various products. And yeah, and so you would just select the e-book. Okay, good. Any other questions? Using the example you're showing here with the books already existing, is it possible to make the SKU an already existing field or would you, in this example, have to go through each book and say... As you're creating products, you will have to fill in the SKU. There are ways to automate existing content, which is something that would be a really cool lab where we talk about migrate or we talk about just simply running some custom scripts that would copy field data over from one content to the other. But the real trick is, at least for our examples, we're just creating products from scratch. It would even be possible with rules and views bulk operation to be able to create a product and then copy a field. Boyan looks up at me because it's a little strange, but it does work. You could automate stuff like that with rules and VBO. And auto SKU. And auto SKU, yeah. And auto SKU, yeah. All right, we're gonna do one more and then we're gonna keep going, so come on. How well does commerce do with multiple vendors? So something like an Etsy or an Amazon where you're buying this product from Seller A and these three products from Seller B and it's all in one order, but different people are getting paid. So commerce out of the box, there's actually a module called commerce marketplace. And actually, I take that back, there are two. One written by a guy named Farhad and one that is a sandbox written by Machik, who's a commerce guy. The Machik installation, the sandbox that's available and I'm, let's see. Anyway, right over here there's this sandbox, but it can accommodate that need and that would be something that, if you want more information on that, just come talk to either this guy over here or myself afterwards and we'd be happy to. Yeah, the Etsy situation can take some thinking through because, for example, you have to split payment and there's ways to do that with commerce funds and so forth. Okay. I had a really funny question. Sure. It's called platform and if you wanna learn more about it, it's called platform.sh is the website and you can fill out a form there and request some more information. All right, back to you. All right, so it's my screen again. Okay. All right, so our second demo is going to be event registration and we find ourselves again on the module page because we need to enable just a couple more modules and let's see, let's make sure I've got it right here. We've got, we're gonna enable the stock module for commerce so that we can keep track of how many tickets are left for this event and we're gonna enable commerce customizable products and that's gonna allow us to create fields that the customer fills out when they add something to cart. Okay, so let's get going. To install commerce stock, you, once you've downloaded it and put commerce stock module in your site, you'll see a number of various options. The one we're gonna wanna do is called simple stock and I'm gonna enable simple stock rules, the stock API and I'm gonna stock UI. Let's see, what was the other one? It was customizable, so it's under commerce contrib. Customizable products is really cool. It allows you to treat line items like content types and product types where you can create a brand new line, a brand new line item type. Now you might be sitting here thinking like what the heck's a line item type? It is, shipping is a line item type so if you create an order and you add something that has a price to an order, it is definitely some type of line item. So shipping's an example, discounts an example, product is an example. So we're gonna create a custom line item type that has a bunch of information that's stored directly on the order and the idea behind that is, let's say you're buying an iPhone from Apple and you wanna engrave your name on it, that's not a specific skewed product. Your name is not something that makes that product unique. Your name is what makes it unique for that order. So you would wanna store that information on the order. So now that the modules are enabled, it's called commerce customizable products. Yeah, awesome name. Okay, so our next step is to create a new product type. We're gonna call this event tickets. So we're gonna start selling event tickets on our site and to create a product type, sorry, similar to renaming one, you just go to product types, add product type and we're gonna call it event tickets and we're gonna save product type. We next are going to configure the stock module so that it can track the events ticket purchases. So you go into store under configuration and it's under stock management. Since you have simple stock enabled, it's simply telling stock which content types it wants to track or which product types it wants to track and what it's gonna do when I click submit is it's going to add a field that the rules that it came bundled with understands which will block the purchase of this product once the tickets are sold out. So once we've enabled it for the event tickets, we can go back to our event ticket product type and look at the fields and we have a new field on here called stock and I'm gonna go ahead and change this to available tickets. Available tickets kinda helps the store administrator understand what stock means in this case and it will also help us in the interface once we start taking orders for tickets. Okay, now that we've got simple stock configured, we're going to create an event ticket. Now, continuing on with my love for Mike Crittenden and all things responsive theming, we are going to create a product and now this time if I click add a product, I now have two kinds of products I can create on this site that just 20 minutes ago was not having any kind of products at all. So I'm going to call this responsive to and buy a book by a signed book from Mike and we're gonna make this thing slightly more expensive and we're gonna say that there's only 60 of these available and we're gonna just click save product. Once we've done that, you're now gonna see we have two products. We have by a signed book from Mike which is a set of event tickets and we have responsive theming was an actual book. The next step, if you recall when we were adding books was to add a product reference field to our content type. Now to look at these real quick because we're kind of in the back end, I wanna show you the front end again. We have a book listing of course and you go in here and you look at the book listing and you'll see content, et cetera. You can also look at the Meet the Authors section which has a couple of authors that are gonna be at DrupalCon and they're signing books and you should go and buy those. So when you go and look at this book signing event, that's what it looks like. Even we even have a listing here showing the books by the author. So what we need to do is get an add to cart button to show up on this event page so that they can register for the event. To do that we go into content types. This particular content type is called event and we're gonna add a product reference field. And I have names for these so that they make sense later on. So we're going to call it, ticket. Okay, and the product reference field, same kind of reference field we have before. I'm just gonna use select list. Again, Kickstart 2 uses inline entity. There are other kinds you could do an autocomplete. That's what Kickstart 1 comes with by default. Let's see here, anything I'm missing. We want only event tickets to show up and we do want the price field to show up, click save. Okay, so what I've done now is I've made it possible for you to add an event registration to the actual event. So if I go to meet the authors, Mike Crittenden, and I click edit, I can now go here and select a set of tickets that are available for this particular event. Click save. Now, again, we're using panels so it's not gonna show up right away. And that's fine because we actually haven't set up the registration portion of this yet. So far we've just redone exactly what we did the last time. To set up the event portion, we want to go into the configuration under store and go under line item types. So we have one line item type that comes with commerce by default called product. If you have shipping, you would also have a shipping line item, et cetera. So we're gonna go ahead and add a product line item type and we're gonna call these event registration. Now, if this is a little confusing, the line item types, there's actually, if you go to Drupalcommerce.org, there is a user guide under documentation. And there are a couple of really great pages under the user guide that talk about the relationship of products and line items. And it would really encourage you if you're, even if you're familiar with commerce and you've used it a little bit before, but you haven't done, say, custom line items, check out the user guide. There's some great diagrams that kind of explain this a little bit more and can kind of shed some light on more of the details of what's going on under the scene. Thank you, Nick. Just checking the time right now. Okay. So we are looking at a line item type which looks strikingly similar to a list of product types and a list of content types. You have the standard manage fields, manage display, et cetera. So for manage fields, this is where we can add the event registration information. So pretend this is like a web form where you're adding name, email, phone number, lunch option, because, you know, at book signings, we give you food. So I'm gonna go ahead and add name, just a text field, but you could install any modules you wanted to in this. So like, for example, email or a phone, whatever you wanna collect for your event. The trick is, go ahead. It's just a fieldable entity. I mean, that's basically all it is. The trick is once you've added this field, if you want it to show up before someone clicks add to cart, you wanna click include this field on add to cart forms. Click save. I'm gonna go ahead and ask for their lunch option, lunch preference. That's what I call it. And this, for this one, I'm gonna go ahead and use a list text field. Click save. And so for lunch, we have awesome food and less awesome food. Suppose if you really want less awesome food, you can. I'll leave you to judge which exactly kind of food that is. And we will click again, include this on the line item. Click save. Okay, now that we have the fields for our event registration, we need to go ahead and add that new content, new line item type to the entity. So when we go into content types and event manage display, this is the default display. This is, as I was going through this the first time, this kind of tripped me up because I was using panels. And panels circumvents these settings, but to get the line item to actually save, you actually have to go into these settings. I'd probably file an issue for that. When you go to the manage display tab of the product type, the event type, the book type, whatever you're doing, you can click the widget next to the product reference field and you can choose a line item type. So we're gonna change it to event registration. I'm gonna click update. And then I'm gonna go directly to our event page. Now the event page, meet the authors page. We're, of course, we really wanna meet Mike. We've already added the event to it, but it's not showing up here yet. So we're gonna go ahead and click edit panel. When we're editing the panel, this time I'm gonna go ahead and put the content in the bigger pane, just because it just makes sense to me to do that. You can go to the node section and you can choose any of the fields. For us, we're going to allow them to register for an event using tickets. So I'm gonna choose that and select the form matter. We're gonna go add to cart. I'm gonna click continue. And here's the other trick. Here you choose the line item type as well, event registration, and we can click finish. Now, since we did this before, I can skip the, oh, where's the price question? Just go ahead and add the price. So we're gonna go into node again. There's a product price. We're gonna add that. And there's another field we added to this product. And that is the stock or the available tickets. So if we go in here and we add available tickets, we'll click finish. And one of the things you get when you do panels is you get a lot more control over how things are displayed pretty easily with drag and drop and so forth. So I'm gonna go in here real quick. Gonna override the title and I'm gonna call this event registration finish. Finish. And I'm going to turn off the, now we'll keep the title for price, why not? And the title for tickets. Okay, we'll click update and save. So yeah, go for it. Yes. Yeah, that's a, it should be a filed bug for, I'm not sure what it would be for. It's necessary. If you don't do that, you can still get to this point and start taking event registrations, but it won't save any of the event registration information. Yeah, I was like, why isn't it showing up? Two more questions. Yeah. Right. If you're using display suite, it circumvents the display. No, actually it wouldn't, would it? Because it's using display modes, so you should be fine. Last question. Yeah. Yeah. You could treat those as skews. There are lots of other options that you could do as well. I'm getting one commerce guy up front here like you're crazy for saying that. Get back to me on that. I'll think through that as we're going through the second demo, see if there's a better way to do that. For now, yeah, general admission tickets because we're only signing books. Okay, so when you've added that to your panel page, you now have an event registration section, the available tickets 60.00 and the price is $25. And here we go, I'm gonna go ahead and sign up for this. And of course I want the awesome food, not the less awesome food, click add to cart. Now, once we've added this to a cart, you can see that I'm buying a ticket where I can get a signed book from Mike and I can show up to this event. The trick is you don't really see my name, you don't see my lunch preference, you wanna give them this kind of information. And to just kind of demonstrate what you can do with commerce, everything in commerce is a view and is some sort of entity that's fieldable. So you can actually go into your cart and add fields that you've added to your line item. So for example, I forget what I called it, so I'm just gonna look through the list. The name. Yeah, I can just type the name. Yeah. Thank you. Late night last night. Was it lunch as well? Yeah, lunch preference. Okay. So we're gonna add those two fields to our cart, which I don't know if it's advisable or not, but we'll go for it. Lunch preference and name. And since it's a table, I'm gonna go ahead and drop all of those new fields into one of the columns. So lunch preference will go in the title column as well as my name. So we'll click save. Or apply, and then we'll click save. And it should take us back and we should see additional information showing up. We'll try it again real quick. Josh, awesome food at the cart. It's not showing up. Go to the page, go to the view cart page. Yeah, but I edited the actual. So, and we are adding those. Yeah. So what's happening is this is the same bug that I saw before. Let's go into, I may have edited the wrong type. Let's go into, yeah it is, but I typed in the same name and lunch preference. So that potentially could be what's happening there. But it was a vent and we're going into managed display. That was the problem. I changed the add the line item type to the wrong display. Gotta love demos for that reason. So that's a demonstration of the bug after we talked about it for like five minutes. So here we go. Mike Crittenden, I'm going to register for the event. You're gonna see this information magically appear on my cart after I click add to cart. There it is, awesome food and Josh. Now this is just a demo, but you can imagine if it were an image field that you're asking for people to upload some sort of fancy image or if you had a great designer who can fit tons of information in a really small space, there's ways you could do this that would make it look a little bit nicer. But as a demonstration, not bad. We can go ahead and check out for our different products. Check out without accidentally invoking the swipe. We go backwards and this is gonna look exactly the same as it did when we were buying the books. Example payment, Nick will get an email and that's the event registration for our book site. Do we have any additional questions? Yeah, I don't think that's a problem. I'm not really sure off the top of my head why it has the decimal. I'm pretty sure that's just a four-matter setting. Can I do what? Oh, the new version allows you to tweak it. So I must be running a non-dev or a non-beta or something like that. That's good feedback. That's good feedback. The other thing we're trying to do is we're trying to fit a lot into two hours. So unfortunately we'll try to slow down and we'll try to give you guys time to click. Yes sir. It's all recorded, it'll all be on YouTube where actually YouTube has a school setting now. You can do one and a half X or half X so you can make it last four hours listening to our awesome voices. Yes, exactly. Two more questions, go for it. Okay, so how do you set up payment basically is your question? Right, right. So if you were to enable, say, Express Checkout by PayPal, what you would have in the checkout form, I'm just gonna buy a ticket without any lunch preference, click checkout. If I had Express Checkout, I could, I was even one further out. If you had Express Checkout, you could replace these two buttons right here where you see our cart with Express Checkout by PayPal and it would literally redirect you to PayPal and that keeps you in PCI compliance bracket A. And I knew this would come up so if you guys are unfamiliar with, is it Drupal PCI? Yeah, Drupal. Drupal PCI compliance. I forget the URL so we're gonna have Google help me out here. It's DrupalPCIcompliance.org and when you're enabling various payment gateways you're putting your website and the people who buy stuff from you at risk and there is a standardization on how much risk and what that means and who is actually responsible for that risk. That's called PCI compliance. This is a great paper, white paper, that walks you through what all of those mean. It even lists the various payment gateways for Drupal and what kinds of risks are associated with that. So DrupalPCIcompliance.org Any other questions? Yeah. I didn't notice when you... You could potentially make a rule that would, you could change the rule that disables the product. That's what stock does. It lets you not buy it but it still shows it. You could add an action to that to unpublish it or to literally disable it. So that, right, right. It deactivates the product. What it does is it changes the add to cart button to not in stock or there's some string that it says, not available. And it also, if you somehow manage to add it to your cart or you've added it and you've come back and they've run out, if you try to check out with that, it will throw an error as well. Stock module for the win. All right. Be thinking of any other questions you might have. We're going to take a quick break along with everybody else. And when we get back, Nick will walk us through a blog, selling content and taking donations. Thank you guys.