 Welcome to Commerce by Example. This is a lab. This is our two. We are going through and demoing how to add commerce to example fantasy sites. And at the end of the presentation, we're going to do a number more of Q&As and we'll even post where we're actually getting all of this content from that kind of thing. So Nick, go for it. All right. So hopefully everybody sees blog on the screen. If you don't, okay, great. All right. So we're going to talk about selling access to a blog and also doing donations or a tip jar or whatever it was, whatever you want to call it. And our goals, we have really two goals with paid content. So the paid content is what we're going to do first. The first thing that we want is we want to create content that can only be viewed by paid subscribers. So that's our goal. And we want to be able to provide a page where people can, can select their subscription link and then check out. So kind of what we talked about earlier, we're going to try to keep it simple. So those are our two goals. Now how we're going to accomplish that is using commerce and commerce license billing. We're going to configure commerce license billing to sell a license that grants or revokes a user's particular role. And we're going to enable role-based permissions for a content type. And then we're literally going to profit. So that's pretty awesome. So here we have a, here we have a blog, blogograma. And this is, this is, this is where we're going to go ahead and add our, add our stuff. It is not admin, admin, because I follow best practices. Josh? I stand corrected. Or maybe it is. I bet I changed it. No. Oh no. Oh well. All right. So the first step we're going to do is we're going to install the commerce core modules. And for anybody that's, that's unfamiliar with commerce core, commerce core is, I think it's basically three, three sets of modules. So the commerce package, which actually has several modules as part of it, rules and address field. Those, those, that, that in its essence is commerce core. On top of that, generally speaking, most sites are going to have C2, C tools and views. But that would also be considered kind of part of commerce core. We're also going to install required commerce modules and their dependencies. Now this is where things get a little crazy, because when you start talking about commerce license and commerce license billing, there are several other things that you need in order to make this work. And as much as I would love to try to simplify this in a presentation format, the best thing I can do is actually, what we're actually going to do is put a great little, little snippet in here that's going to kind of highlight the modules that need to be enabled. So we need node view permissions. Node view permissions is the module that, that I personally have chosen to make this work. I have in the past used taxonomy access. You could also use organic groups. There are several ways to skin this, to peel this potato. So I just happened to chose node view permissions. We're going to scroll. Okay, we need to enable all of these wonderful little commerce modules. Well, Nick is clicking lots of modules. The blog's design is actually designed by Mike Crittenden called me jump blog. And that will be in the follow up blog posts as well. And the book pal design that we were using is simply bootstrap three with a set of colors applied to it. All right, for our purposes, we're also going to install card on file. Card on file is a kind of a base API that, that for payment modules that support it allows for recurring information. So tokenized payment integration. And if you use card on file, you can use card on file with something called commerce recurring framework. But it also works with the commerce license and commerce license billing suite. And for anybody that didn't get to see it yesterday, boy on gave a really great talk about digital commerce and he covered a lot of those modules. David kitchen was there too. Sorry, David. If you watch this later. Oh, David's right there. Now, in this particular demo, I've also enabled something called commerce immediate login. This is actually a sandbox, but it's really great because it allows you to from an anonymous checkout allows you to automatically log in as that user once you've completed the checkout. Because commerce, when you have an email address that's associated with a with an order will automatically assign that order to that email email address and create an account. So we're just kind of simplifying that process here, which is a good idea if you're buying content. Yeah, you know, instead of having to make them go to their email and find that. So part of the secret sauce here is this commerce license role, which is included with commerce license. commerce license role allows us to sell a role. Pretty easy. Not much else to say about that. We need the date and the date API for commerce license billing. We need the entity bundle plugin for commerce license billing. We need the address field and the entity reference modules as well. Advanced queues for commerce license billing rules. This is our sample, our commerce recurring test payment gateway. Again, you could be installing something like a PayPal or Stripe or PayMill or any of any other payment provider that allows you to to that has a commerce card on file integration. And in fact, if you go to commerce card on file documentation page, you'll actually see a listing of things that provide it. So that should be all we need. Oh, I missed a couple of modules, but that's all right because triple is awesome. This is actually a really common use case that we get asked a lot in the community. How do I sell premium content? How do I sell streamable content? And the suite of modules that we're using to do this commerce license and commerce license billing allow you to not only sell access, but to control that access and to meter that access. These are the same modules we use for our new hosting platform where we will sell you actual metered data hosting. These are primetime ready and usable products that can help you make money while you sleep. Good luck. Who doesn't like to sleep and make money? All right. So the first step that we're going to do is we're actually going to create a new content type. And so we're going to create we have an article and that's what we've been using for content so far. We're going to add a premium article content type. There are other ways you could do this. You could put a field on a content type, but controlling access to an entire content type is a pretty straightforward way of doing it. Yeah. All right. So the next thing that we're going to do is we need to create a role. And this role is going to be the role that we give to anyone who comes to the site and checks out. And we're just going to call this bad boy subscriber role or subscriber because it's already a role. And we're not going to do any configuration of permissions just yet because there's actually one other thing that we need to do first. So we enabled this node view permissions module. And so what we need to do is under content authoring, we need to go to node view permissions and we need to select content types configurable by extra permissions. And we're going to do article and premium article. And all this is going to do is allow us to be a little bit more granular with which roles can access these individual content types. Now that we've done that, we're going to head back over to the permissions page. And we're going to configure us some permissions. So the first thing that we need to do is we need to make sure that all of the roles have access checkout. If you don't have access checkout, you cannot do anonymous checkout. The next thing that we're going to do is underneath the orders, we're going to allow customers to view their own order information. It should be in here somewhere. All right. Okay, now we're going to go to the, I'm sorry. Whoops, I don't think so. View own orders of any type. Yeah, it's kind of a close checkbox though. Yeah. All right. There's an affectionate name for this page in the Drupal community, the checkbox page of doom. Okay, so underneath for article, we want anonymous people to be able to see that as well as anyone else. We'll just click on that. But for premium articles, we only want subscribers and do administrators as well to be able to view premium articles. And we're going to go ahead and we're going to save that. Now, what we would normally like to do is go ahead and actually what we're going to go ahead and do next is we're going to create our product type. So I'm going to go over here and I'm going to add a product type called anyone description. And I'm going to save it. Now, what I need to do next is I need to configure my commerce license and my commerce license billing modules. So first we'll go to store configuration license billing cycle types. And we're going to add a billing cycle type. For those of you who don't know what a billing cycle type is, it basically defines how long it will take before that license gets paid again. So in this particular case, I'm going to create two types. I'm going to create a monthly type, which is a month. And I'm also going to create a yearly type. I could create quarterly, weekly, daily types. These are just the two types that I've chosen to create. All right. So I now have my two types. Next, we need to tell commerce license which products are going to be licensable. So I'll head back over to store and go to configuration, go to license settings. I'm going to choose my subscription product, save it. And so what this is going to do is this is going to add some basic fields to my product type that allow it to have a subscription information attached to it. I'm also going to click on the roll tab and tell it that I want to be able to sell a roll as part of a subscription. So now that we've done that, we can go back to the, we can go check out our products, check out subscription. We now have our license type, our license duration, our billing type. We also have this nice roll capability up here. And there's also some stuff here with dealing with how, if you change the way a license is billed during a billing cycle, kind of how that works. But for our purposes, we don't need to worry about that. So let's go back to our store and let's create a couple of products. We're going to create two subscriptions. We're going to have a monthly subscription, $9.99. And we're going to sell the subscriber roll. Our license duration is unlimited, meaning that this license does not expire after any given period of time. But we're also going to set up a monthly subscription billing cycle and it will be prepaid. So as long as the license is active, this billing cycle will be active and it will bill monthly. You could have a license that you could have a day pass that was non-renewable and you could actually say, okay, I just want this to be valid for one day. But we're going to have it be unlimited. We're going to also create a yearly subscription. It's interesting that the monthly subscription is more than Netflix. So this blogger's got some awesome content. That's right. Got a question? I believe that should be for Boyan actually, but I'm guessing it's from time of purchase. Yeah, it should be from time of purchase. The billing cycle stuff that has to do with when a billing cycle starts is really only about commerce license billing. The license, I believe, is from first activity. So I'm going to do my yearly subscription here, $99, a little bit of a discount, and we're going to save that. So prepaid would be I'm paying up front, postpaid would be I'm paying after my subscription. So for instance, if you, with commerce license, you can do a lot of really cool things. So for instance, if I wanted to have a license billing cycle where someone could post a bunch of content and be charged based on the amount of content they do, for instance, if I wanted to charge for people to leave comments on my site and I wanted to charge $0.50 a comment, I would use postpaid because I would want them to accumulate up to the month and then pay at the end of the month. But in this particular case, they're paying up front. Postpaid is kind of like cell phone charges when you pay for the month prior. Prepaid is your paying for the month ahead. All right. So the next step is we're going to create a product, a product display. So for this, this is going to be my subscription product. For those wondering, license billing also handles probation. So if they cancel their subscription, that next bill would be half or whatever at what point their cycle had ended. I'm just turning off a few of these things because for this particular page, we don't need comments. We don't want to display the author date information. And I do want it to be addable to the main menu. Addable. Is that a word? It is. Okay. Just making sure. So as Josh talked about earlier, all we really need after this is a product reference field. The product reference field. For some reason, my JavaScript ain't working. So that's awesome. Thank goodness, Drupal doesn't require JavaScript. That's true. So I'm going to actually do something a little different. I'm going to choose checkboxes. And because there, I'm going to actually have more than one option. So this subscription will actually be, I'm going to make that a required field. I'm going to only choose that subscriptions can be referenced. And then I'm going to change the number of values, in this case, to unlimited, because I want to be able to add multiple different types of script subscriptions. And I could, like I said, I could add a quarterly. I could add a daily. I could do just about anything. In David Kitchen's presentation yesterday, they talked about doing a moon phase subscription. So you get only build on the full moon. You could do that. You could be cute. Customers like cute. All right. So really, that's, that's all we need to, to, to create our subscription product. So I'm going to create a title here. It's going to be subscribed today, exclamation point. And we're going to put a couple of paragraphs of lips and text. And I'm going to choose both of these available subscriptions. And I'm going to create a menu link. And I'm going to save it. So now I have a subscribe link here inside of my main menu. And if you check out the subscribe page, there's a bunch of junk on the page, because I'm not using panels. And so we really ought to clean this up. To do so, we will go back to the content types. We'll go to the subscription product. And we will go to manage display. Now, as Josh mentioned earlier, we chose to, when you add that, that product reference field, you're, you're clicking on that checkbox that's essentially injecting all of the product fields into that product display. And so we really don't want is any of that. So we're actually going to come back in here and we're going to hide all of this junk. You want most, you want most only one thing, like the price. Right. We don't, they don't need to know what kind of rule is going on. We do, however, want the price, but we don't want the label on top of that. So let's save that. Let's go home. Oh, it's good to be home. Ah, so now we have here our price. We can change from a monthly subscription or we can do a yearly subscription. Now, this is great, but it probably would be a little bit better if we had some content to actually, you know, lure some people off. So I'm actually going to undo this promoted to front page. So it doesn't show up on the node page. So when you go here to the homepage, here's this. So we're going to go ahead and we're going to create some premium content. Very valuable Netflix quality content that your customers are just going to, they can't imagine living without. This is true. When you say tier, do you mean like different amounts of access? Yeah. So roles, you could do that with roles. Everything's a product. So if you had four different, four different length, license lengths and two different roles, that would be eight products. And you could do that on one page. You could, you could have that as a type. You could have it as a dropdown. You could have two different pages. But yeah, that would be a product per, per each type. And a lot of those questions to similar to that relate to license billing. Their David kitchen is in attendance and boy on was here earlier at the end. Save some of those questions because they might actually have some really great answers. That's a challenge, David. Okay. So I'm going to head over to my site now. Now I've changed browsers. I'm not logged in. As you can see, I can see my wonderful premium content when I'm an administrator and I cannot see it when I'm just logged in on the site. I'm sorry, when I'm not logged in, I'm just a visitor. So I need to do a couple of extra things here in order to get this really going. So I'm going to head over to my rules page. Well, let's see if I can actually do this over here first. I'm going to go to configuration. I'm going to go to payment methods. Now I have here this enabled payment method, for example, payment. I'm going to actually disable this initially. And I'm going to enable my commerce card on file test payment because I want it to be able to renew in this particular case. So here we go. I've got this and I don't think there are any configuration options for this. So I've got my payment method set up. Now I mentioned quite a few minutes ago that in order to better facilitate the user coming in and getting access to the content, I downloaded this thing called commerce immediate login. And I need to enable commerce immediate login so that it works. So I'm going to go to my rules page. And I'm going to check for the, I think it's just here at the bottom, it's create a new account for anonymous order. So I'm going to edit this rule. And I'm going to create a login user. It must have automatically added it this time. Occasionally it won't add it. But if it wasn't in here, you would want this to be set to login users. So now whenever I check out, when the checkout process has been completed and the order is paid in full, it will create the user's account and log them in, which is awesome for certain use cases, for certain use cases. Okay. So if I have done everything correctly, what I should be able to do now is click on subscribe. I want a monthly subscription. I'm going to head over to my cart. I'm going to check out. I'm going to put in, so you're going to get the email. Absolutely email me if you have questions. Josh loves my content. Easy street. There is actually an easy street built in Texas. Okay. So I wish it was this easy on every site to just put your card information in. Wouldn't that be great? That would be great. All right. So I've got my payment information here and I'm going to continue to the next step. And now I have, I can, here's my order number. I should be able to view. So here's my, my kind of my receipt page. I should be able to click over here. Wonderful premium content. So that's all right. Deal folks that you just saw that. You got a question. Oh, when you expire, you want to know as a user when I, when that expires, you should file an issue on the commerce license module that, that some of that functionality is not in there. And the truth is, is that a lot of businesses have different ways that they handle those types of things. And so there's, there's just not a standard way of doing it. But I mean, it would probably not be a lot of work to, Oh, David. Yeah. You could create a views block or something like that. You could create a views page that has default tab on the, my account page, for example. Oh, he created automatically out and using the commerce immediate log in module. So Josh, Josh has an email in his email account now with, with a username and password. And it sent it to him. It created an account for him. Yeah. And it didn't ask for a password. Yeah. Yeah. Just credit card number. All right. So before we go on to the next step, any, any questions about what just happened? Any, any other questions? Yes, ma'am. I mean, that would be, that would be something you just have to do on a site in this particular case. I mean, we're, we're just, we're just, yeah, issuing that for demo purposes. And part of, part of PCI compliance and dealing with payment gateways, depending on what kind of payment gateway you have, you may or may not even need HTTPS as, as a general practice, you should try to always have HTTPS. But for example, I believe real milk cheese.com Ryan's personal site that he uses commerce with doesn't use HTTPS because it just sends you off to PayPal for all payment information. So there's no need to encrypt it. Yes, sir. That would be handled by dunning. And so with Dunning, if I don't know if Dunning specifically handles if it, if it's expired, if the payment's expiring, but what it will capture is if there is a, if there was no payments able to be processed, it distinguishes between a hard decline and a soft decline. A soft one is, you know, positively speaking, you just went over your limit for the, for the day. Basically, there's no money. A hard decline means this card will never, ever work again. Right. And it will. What Dunning does is it sends notification out, and if it's soft, we'll schedule additional attempts. That's a good question. All been great questions. Yep. Yes. So it we're storing credit cards and a flat file that isn't encrypted. That's basically it. So in that particular case, we're storing tokens, which are not card data. So yes. And, and we set effectively kind of pushing that off to the payment providers, the payment gateways. According to the PCI report, you're allowed to have the name that's on the card, the last four digits of the card and the token that the payment provider provides you that represents that card directly from your site. So those three things are safe to store in your database unencrypted. It's from a particular payment provider. And so authorize.net does this and authorize owns those credit cards. Then they're going to make it really hard to export. And they're not, they're not transferable. So if you switch providers, you're going to have to send out an email saying, come put in your new credit card information because it won't work. Those things are not transferable. Yes, sir. So, right. So, so those user accounts that are created in this particular case, it's just a user with that role. Yep. And that role gets revoked. If my credit card gets declined. Yep. Because it's a license. And then I think there was one more in the back. It is, is any of the information that's put in on the form captured via Ajax if the user abandons the page? No. That's not part of commerce core. That would be a really scary security problem, particularly if you were putting in a credit card and it captured it somehow and stored on the database. That being said, if you're interested in capturing as much as you can before you take payment, put it in a secondary page when they click next, that is stored in their order. And when they log back in in three years, it should still be there. I think there is a module running around out there somewhere that actually will keep like a email address. Like if you sign up for your newsletter, it will attach the email address to the session. And so if they go to that page, it will fill that email address in. But that's generally speaking more attached to like, you know, if you were using like a mail chimp or a mail up or something like that module. Or if you were using the Lachis Automator to put names to anonymous traffic, because they've contacted you before for like a white paper. Okay. So one particular way you could do that is, yeah, I mean you could use like field permissions to show based on role or based on permissions. I mean, again, there's a lot of different ways that you could do that. You could do say a view mode, a different view mode per role. Yeah. Panels. Nobody likes panels. Panels is great because it allows you to do selection rules, which is similar to like putting an if before you do any display. So you can do a selection in the example bookpal website. There's actually two panels. One displays a book that has upcoming events. One doesn't. So that's an example you guys can actually look at. And you basically would change the entire page if they had that role. Yeah. Right. So the checkout process essentially is editing the entity order that has status of cart. It submits it to Drupal. Right. So yeah, it is kind of a tricky line to walk because you don't want to give them too many steps. Everyone wants that one page checkout experience. But yeah, so putting one or two steps in there does kind of help with the abandoned cart. Well, there might be a Drupal module that does that. Right. We've got one last demo. And then we'll do questions the rest of the time. So I actually went in here and because I'm a jerk actually revoked his license. And so what happened when I revoked his license was that he refreshed the page. And even though he still has an account, his role doesn't exist. So he no longer see that information. I think I can actually come back in here and change the status to active, I think. And now his role is active. And so when I come over here and refresh, there it is. So it kind of shows you how the role system works. So you set the period on which you base that license. So if it's actually a month, every 30 days, it will attempt to either authorize or deny you access to that license. So if your credit card goes dead in the middle of a month that either your prepaid or postpaid on, the next at the end of that point when it gets billed again, you don't want to try to authorize a card every day if you're on a monthly subscription. So every month you would write, oh, you're asking if you ask if you did revoke it, would it come back? Okay. Yeah. You'd have to that's an edge case. You'd have to handle that with like either, you know, some sort of commerce funds or something. Yeah. Yeah. Yeah. All right. So donations. I got, I got one goal. I just want your money. That's all I want. So that's the, that's, that's the goal here. And all we really need to do this, we already enabled the custom, custom customizable product, customizable product. And the other module that I need to make this happen is something called select or it's not there. What's up? It's up in Contraba, I'm guessing. I don't think it's, I don't think it's installed actually. Oh, really? Yeah. Other, maybe. Whoops. Oh, well, that's fine. Oh, there it is. Aha. You're right. And I want the select or other field. So, um, well, the select or other doves is provides a select box form element with an additional option other to give a text field, uh, pretty straightforward and really useful in our particular use case. We'll enable that. We'll elevator music. We're using the same kind of thing that we did for event registration, except instead of accepting names, we're actually asking you to provide a price that you would like to donate. So next step is I'm going to go ahead and create a new line item type. And I'm going to call this one a donation line item. We'll just ignore that, ignore the error message. And I'm going to add a field. My new field is going to be donation amount. And I want this to be an integer. Oops. I think. Yeah. Is it an integer? Yeah, that's a great. Oh, it's right there. I just didn't see it. Um, and I want to do a list, select or other list. So I want to give a couple of options, uh, for my donation amount, you know, maybe there's some really common amounts. So maybe, maybe there's, um, um, $5, maybe, you know, $10, you know, maybe, maybe $150, you know, whatever, whatever seems appropriate. Um, and I want to enforce a $5 minimum. So I don't want somebody to be able to select other and put a dollar because that would just be silly. And we're going to choose, well, the default value will, um, uh, will update when I refresh, but I want to add, to add this to the add to cart form. And then I'm going to have the number of values be one. Donation amount must be a valid. Oh, that's because this is set to required. And I need to save it first. I can. Okay. I didn't have this problem earlier. I didn't ask required. Yeah. Okay. Um, so, okay. So my default value is I'm going to set it to $5 because that's probably the most sane thing to put it to. Um, I could put it's $150. Yeah. Okay. Yeah. I'm really worth this much. Um, next thing I'm going to do is create a new content type for my, my product display called donation or tip jar or whatever you want to call it. Just because, uh, just because I love you, Josh. All right. We're going to turn off those, those things here because we just don't need them. We're going to add a couple fields to the tip jar. Anybody want to guess what kind of field we need to add to the tip jar? We've done it three times before product, product reference. Oops. Nope. That's not what I want. Our JavaScript has decided to go missing again. Yep. All right. So I've got my, my nice, my nice, uh, tip jar over here. Oh, I forgot to create a product. Whoops. Do you know what? We'll just, we'll just reuse product. And let's see. So now I need to create a product. Um, because we need something to be able to, to represent to that I'm actually going to purchase. So I'm going to create a product. I'm just going to call this donation, donation, and, uh, I'm going to put five in there, but it really won't matter what I put in here because it will be overridden with rules. And I have one last thing that I need to do, and that is that I need to take the, I need to go into my content type before my tip jar, go to, um, manage display. And then in my add to cart form, I need to change the line item type to donation. And now the, um, and I can hide my price because that won't be necessary. Okay. Go back into content. We will add a tip jar. And you can imagine for like, not nonprofits that have huge websites, but they don't have a way of taking donations online. You can give them donations in just a few minutes. Doesn't mean you have to charge them for minutes. It just means you can do it in a few minutes. Okay. So now I have a donate button link over here on the sidebar. I've got a page with, uh, some very bad English. I am from Texas after all. So I guess that makes sense. Um, and I have, um, my field up here. I can choose my donation amount. Maybe I'm crazy and I want to give 150 bucks. I can choose other. I miss, let's say I want to do only $25. So I'm going to add that to my cart, but that's wrong. So we need to do something else. We're going to use the power of rules. So what we need to do is we need to tell commerce whenever it's generating, when it's ever, it's calculating the price of the line item that we want to take the value that we've entered as part of the line item and use that as part of the calculation. So what we're going to do is we're going to create a new rule and it's going to be use the donation amount, uh, as the price of the line item. And the event we're going to be reacting to is commerce line item or no, commerce product, I think. Yeah. Calculate the sell price of a product. And for our condition, what we want to do is we want to see if the entity has a field. I suppose we could also just say entity is field as a type and it would be line item. But in this particular kit, whoa, hello there. What I really want is, maybe I need to do that. Nope, nope, nope, go back. Let's add the condition entity has field. We want our, we want the line item that we're looking at and the field that we want is the donation amount. And that's run here somewhere. Field donation. Isn't it? Ah, thank you. All right. So we, we want to make sure that our line item has the field donation amount. Now what we want to do is we want to take, we want to do a couple of actions. The first thing we want to do is we want to calculate a value. And while I'm doing this rule, Josh is going to tell you about major and minor units. Welcome to math 101. No, actually it's, it's pretty simple. When, when commerce is storing prices in the database, it stores them in what's called minor units. A minor unit for most of the world is a penny or a single piece that represents a certain amount of a dollar. So when we're talking about dollars or somebody were to say type and two in the donation field, that represents 200 pennies. And to the backend of commerce, that means we need to change the amount that the user has entered to minor units instead of major units. Because we think in major units, dollars and the database thinks in minor units sense. Thank you. All right. So we've, we've created an action here that says calculate a value. We're taking our field donation amount, multiplying it by 100. And we're storing that in the actual amount. The next action we're going to do is we're going to set the base price of a line item. So here we're going to set the, or set the unit price rather of a line item to a specific amount. And if we switch this to data selection, one of our options here will be somewhere. So this is, this is fantastic when the JavaScript stops working. Yeah. Rules is pretty hard to do without JavaScript. Set the unit price to a specific amount. Ah, jQuery update. Yeah. Okay. We can set. Yeah. Yeah. It's an easy thing to set. Okay. If you need it, we'll just set it to the actual amount. We're going to use the base price and then we're going to round the half up. Yeah, that's going to work. Do you want to fix the JavaScript real quick? It's one, it's one setting. No, no, I want this to just work. You might need brackets. Okay. So now we have, we have this over here. We'll go back over to, that was our 15 minute warning. I have to fix this. Donate some money to me. There we go. And I thought there was something else I was going to do while I was in here, but no. Oh, I was going to go back into the cart and I don't have a link to my cart and that's okay. I'm just going to go over here. Oh, hey, look, it worked. So the rule is already, already working because it's stored that information on the line item and now when it's calculating that sale price right now. So I entered in $25. It's now using $25 and now I can go and I can check out and people can give me money. Okay. We got some questions. Go for it. It was to take the field, the field that they filled out so they can select a price essentially or provide their own. It was to take that amount and then to put it into the actual price of the product, which was set when you created the product. When you create a product, it asks for a price and we set it to be $5. The rule is overriding that $5 with the value of that select or other field. Got that. There's going to be a test after this. It is kind of, it may take a second to fully appreciate what that's doing, but one of the things you do in rules when you're changing prices is you want to make sure you are always in the minor units. Otherwise, someone types in $25 and they've donated you a quarter. Yeah. So $3. So yeah, so if I go over here and do two, it should kick it back and be like, yeah, the value may be no less than $5. Since it's an integer field, it should not validate. Yeah. Yeah. It's not a valid integer. You can set it up to be that, but I don't think it will, this particular field type will support it. Oh yeah. Okay. You would need to use a floating point field. Yeah. And then select or other with that. There's a module called commerce multi currency that is almost always overkill, but there are certain use cases that works really well for it. You could do what Apple does and just use the same price. And if you're in Europe, just charge them the same amount, even though the exchange rate's totally different and make more money. Thank you, Apple. Yeah. That's commerce multi currency will do its best. There's lots of rule selections that can help you choose the correct currency. There's also, it's kind of like choosing a language. It's a drop down. You can choose which currency you want to see. I believe it even supports translating based on given exchange rates, but it may be more beneficial to not exchange rate it. So I'm just playing around here. If anybody has any questions, if you guys want to raise your hand real high and, and, or come and check out the mic while this while we just have a little bit of time, I'll, I'll poke around on here. So another kind of common thing is, you know, especially I've got one product, right? I don't want someone, you know, I don't want them to just have to click on the little cart link. So I can create a rule here that says after adding a product to the cart, I'm going to do a page redirect over to our cart and save it. So now if I were to say go to my donation page and choose $10 and add it to cart, it'll just forward me over to the cart instead of saying, Hey, you added to your cart. That's wonderful. And then just kind of leave me hanging. You could even add a condition that if the cart has certain products that that little message there at the top doesn't show up because that is also configured via rules. Yes. You guys made it to the end of Drupal cart. You're all kind of staring straight ahead. So until we get some more questions, this session technically ends in 10 minutes and we'll keep talking and entertaining you. But at 3.30, there's the closing session in the exhibit hall where all the keynotes were over the week. And trust me, you don't want to miss that because they're going to announce where the next Drupal con is, where you get to tell your boss where you're going to go next year. Yes. So commerce license, and I'll shamelessly, non shamelessly plug, there's a really great tech talk about commerce license that goes into some depth. It's aimed more towards developers who understand some of the, you know, development stuff, but don't don't know license. But the 10,000 foot view is that a license can be configured to be as long as you want or, you know, or it can be limited. It can be unlimited or it can be of limited scope. So you can you can change, you know, that particular type of thing, the whether it's, you know, limited or unlimited. The license billing sits on top of that and handles the billing for that license. It basically will will handle payments on a particular scale, but you would set it to unlimited the license link to unlimited and then just bill on top of that. And it would change that. Does that answer your question? Oh, yeah. Oh, yeah. Oh, that's yeah. They're all open. They're all open source. Yeah. Every in fact, not only the open source, they we encourage people to use them, give us feedback and submit patches with your feedback, because that's how this community grows. Yeah. And a lot of that a lot of the commerce license stuff, if you again, check out the, the presentation that David and Boyan gave yesterday, and they talk a little bit about how those how those models were made, because essentially it's us kind of eating our own dog food. We use those like those modules for our own things that we've released them to the, to the community way in the back. Okay. So payment methods, whether or not a payment method is displayed is a rule. So if you go to the store configuration and you go to payment methods, this is basically an interface on top of rules. And what I had done was I had disabled the example payment gateway that comes with commerce, and I had enabled this other test payment gateway that comes with the commerce recur, a commerce card on file. That, that particular rule was attached to a rule that it actually created the created a new account for an anonymous order. So inside of this rule, this rule was edited to have to have this log in user action take place at the very last step. Yeah, there actually is. In uber cart six, there were all kinds of configuration check boxes. But sometimes there wasn't the third option, which is you just don't even want to mess with it. You don't want to honor off. You just don't want it there. And so rules can be disabled completely. An example of that. I'm trying to remember. Ryan has a good one. My brain is fried. I think it's logging in an anonymous user. And what you want to do sometimes is just simply disable that functionality. And the easiest way to do that is to put that action in a rule. And then for you guys, if you don't want that action, you can disable commerce comes with something like 15 default rules, something to that effect, which you can edit, you can modify conditions around, you can add different actions. Say you want to send an email to your aunt every time some anonymous person makes an order, you can do that because it's rules and you can add things on top of it. It's essentially infinitely configurable. The buzzword we use is business logic. Anything that makes your business run the way you want it to run, you can do in rules. The other system in commerce that uses rules is called is the pricing system, which we used in this last example, but it handles discounts. So you could give a discount to somebody with a particular role. You could change a price to be a third of what it is on Tuesdays. Anything you can possibly imagine you can do with rules. And we've wrapped we've wrapped all of our systems around that kind of idea product reference. Yeah, yeah, that's the most structure. And all of this is in documentation on triple commerce.org under the user guide. There's lots of pretty pictures on the user guide to really, really good stuff. Yes, ma'am. Yeah. So for example, you asked for their email, how does that get sent to PayPal when they click checkout? That depends per gate payment gateway. And typically the configuration for payment gateways is when you go into the interface and you look at your list of available payment gateways, you can click edit. And there's a configuration form inside that rule where there are various options. Same thing happens for shipping to the shipping is a rule and you can configure it in there. Yes, sir. So there's really honestly and unlimited ways you can take the product entity and make it viable. And it doesn't always have to go through a node. So for your example, if you had 200 products and you wanted an add to cart form based on a view, for example, you just wanted to say all of these product types are on an add to cart form and they all have different attributes. They're all different colors, sizes, et cetera. There's a module called commerce add to cart extras. The commerce cart view is what I was talking about where it actually creates like a viewable page like a product display, but it uses views to come up with all the products instead of a product reference. I'll have to look it up. All right. So we're kind of coming to the end of this. It means a lot that you guys hung around. This is both Josh and I, our first DrupalCon presentation. So being that it was a lab, we're really grateful that you guys hung around and would really appreciate your feedback. And so you can use this link that will take you back to the DrupalCon page where you can add some reviews and we would greatly appreciate that. We want to make it better. Yeah. Please help us make it better. Real feedback. And of course, our information is on Drupal. It should be on the DrupalCon site. So if you wanted to shoot us something else, you're more than welcome to come up here afterwards. We'd be happy to stick around for a few minutes and talk to anybody else who's interested. But from the bottom of our hearts, thank you so much for being here. And I hope you guys got a lot out of it. Hopefully you can see the really cool stuff you can do with commerce and you can apply this in your daily Drupalings. So the module is called Commerce Views Display. Thank you guys so much. Stop by the booth as you're going on your way to the keynote. We're tearing down trying to get rid of swag. Thank you. Yeah. Well, I believe