Showing posts with label Drupal video. Show all posts
Showing posts with label Drupal video. Show all posts

Tuesday 11 June 2013

Using Calculation Rules to Add Per-Item Shipping in Commerce Shipping

Transcribed videos: -
[Drupal 7 / Ubercart video tutorial 7 of 10 showed how to use the default catalog module]
[Drupal 7 / Ubercart video tutorial 8 of 10 showed an alternative flexible method of showing a catalog]
[Drupal 7 / Ubercart video tutorial 9 of 10 shows how to use product kits, stock, and order states]
[Drupal 7 / Ubercart video tutorial 10 of 10 shows a simple checkout, reports, and suggests a theme] These videos are not related to the transcription below but may help anyone trying to get a Drupal ecommerce site running as quickly as possible.


Text introduction:
In this screencast I demonstrate how to do shipping charges per item in the cart. It shows using a loop in Rules and how to do something new and different with shipping.

We want to add $5.00 to the shipping charge for every item they have. So if the quantity is 5 for some line item, we'll add $25 to the shipping charge.

The technique is this:

    Add a shipping service. We're using a flat rate service with a $10 base rate.
    Add a new "Calculation rule" for that service.
    Add an action loop that loops through the line items in the order.
    Add an action "Calculate a value" & multiply the quantity times 500 ($5.00) & put the result in a named variable.
    Add an action "Add an amount to the unit price" that adds the named variable to the unit price of the shipping line item.


Using Calculation Rules to Add Per-Item Shipping in Commerce Shipping from Randy Fay on Vimeo.
Hullo! My name is Randy Fay. I'm [email]on Drupal.org, and I work with Commerce Guys on their Drupal Commerce Project, and I've been doing a series of screencasts showing how to configure shipping - Commerce_Shipping 2.0 - and I've demonstrated the new Commerce Flat Rate module, and also how to use Commerce UPS.

I want to show some more advanced rules techniques now.

I hope that if you aren't familiar with Shipping that you watch some of the other videos first because we are going to pretty deep into Rules this time. But lets just take a look at what we have for configuration, first of all.  If we go under Store>Configuration>Shipping , we have basically three things that we can configure, and we've looked at these in previous videos. [shows as three tabs on the screen]

|SHIPPING METHODS | SHIPPING SERVICES| CALCULATION RULES |

Under SHIPPING METHODS [tab] we have the provider, essentially. It could be flat rate, it could be UPS, it could be something else. And then each one of those can create SHIPPING SERVICES so we can create flat rate services for example, and I actually have a plain vanilla flat-rate service set-up here.  But the tab that we haven't looked at yet is called CALCULATION RULES. That's what we're going to do this time: we are going to demonstrate how CALCULATION RULES work.

Let's just take a look at what we have in the flat rate SHIPPING SERVICES right now: we don't have anything. It's just plain vanilla. And we have this - er - set up just for flat rate, and if we go back and look at the quick edit link here, we will see that this is the $10 base rate. And if we go to the checkout right now, every order would cost $10. - but..

Let's just say that we are actually going to charge per item that we put in the cart; that we do not want a flat rate. We want to charge per item with a minimum of $10. Let's say $10 plus $5 for each item that we add to the cart. Because each of these things costs us money to send. Let's go ahead and work on that. We'll use CALCULATION RULES to do that.

Again: our goal is to have a $10 flat rate, which we already have, and to add to that $5 for each item that they [the customer] have in their cart. So each item is not a line item; it is line item x quantity in that line item , so we have to do the calculation here.

We are going to go to CALCULATION RULES [tab]...

 |SHIPPING METHODS | SHIPPING SERVICES | CALCULATION RULES |

...we are going to say "add a calculation rule", and this is going to be [3'00"]
Name: "Add $5 for each product shipped", let's say.

When we do this calculation, what we have, is:
We are listening to the...
 Events EVENT Calculating a shipping rate
...event.
What we get passed into this rule is a shipping line item that is all ready-to-go; it has everything we need.
But when we see a line item here in this particular rule, it is the shipping line item and of course the shipping line item is associated with the order which can access the rest of the line items, which is what we are going to do.
So we have a shipping line item in our hands. Now we have to, under Actions, we have to  add a loop. We have to go through each of the line items and figure-out how much we need to add to the cost of shipping [4' 00"] for that line item.

We are going to add a loop here: +loop. The List that we are going to loop over is going to be
Add a new loop > List > Data Selector >

that is the list. So we are reaching out of our shipping line item out into the parent order , and from there we are getting the line items. So now in the current....
Now we have to name these things [by typing a name into the box], so I am going to call this
CURRENT LIST ITEM > Variable label> "line item"  and
CURRENT LIST ITEM>  Variable name>line_item

Now we have a way to examine every line item.
I am going to add an action...
Actions > OPERATIONS > Add action
Be careful to click the +Add action here [on the right, under OPERATIONS] under the loop rather than under the Actions [at the bottom left of the box in a blue stripe] [5'00"] or it won't be doing the right thing. You can drag these things around and place them in the right place. But this action needs to go under the rule.

What we are going to do is we are going to calculate data values
Add a new action > Select the action to add > calculate a data value
So we are going to multiply the quantity x $5.
We are going to say ... our commerce line item ... quantity : quantity is in there ...
INPUT VALUE 1 (the first input value for the calculation) > Data selector >

We are going to use multiplication

OPERATOR (the calculation operator) > Value > *
Down here we are going to put a value.
INPUT VALUE 2 (the second input value.) > Value > 500
In Rules we are always dealing with minor units, so 500 there for £5.
The result of this is going to be [types-in a name][6'00"]
Provided variables > CALCULATION RESULT > Variable label > "Calculated Line Item Shipping"
Provided variables > CALCULATION RESULT > Variable name >calculated_line_item_shipping

So this is the total shipping that we will add for this line item, which comes from multiplying the quantity of the line item times $5.

OK, so now we have that information.
Now we need to add one more action.
I will add an action here
Actions > OPERATIONS > Add action
Now what I am going to do (under "Commerce Line Item" among the options on the drop down menu) is choose
Actions > OPERATIONS > Add action > Add an amount to the unit price
Here we are adding to the shipping line item's price. We are all set here.

[7'00"]
The amount, though: I need to switch to
AMOUNT > Data selector and use the
AMOUNT > Data selector >

...which we have just created.
I am going to say that the Component should be flat rate.
PRICE COMPONENT TYPE > Value >
...
This isn't flat-rate shipping any more, but we'll call it that. um - so
What we are doing here is that we are adding another action that applies to this shipping line item that we have in our hands.  So. And..
We are going to add the amount that we calculated.
AMOUNT (specify a numeric amount to add to the unit price) > Data Selector >
..... to the existing amunt, and put it into the flat rate. So let's try that.
Take a look at the rule that we have. So this is just a standard thing.
We are listening for when calculating the shipping rate .
We don't have any conditions at all.
We create a loop.

Actions > ELEMENTS > Loop Parameter: List [commerce_line_item_order...
List Item [line_item]
> Calculate a value
Parameter: Input Value 1 [line_item_quantity], Operator:[*], Input Value 2: 500
> Add an amount to the unit price

And the loop is... the first thing it does is calculate... [8'00"]
It's a loop of line items, and for each line item, it calculates how much we should charge for that line item by multiplying the quantity - we have 500 here - and then add that amount to the unit price. And now we ought to have this. Let's go ahead and see what we've got.


I'll go out here [to a shopping page] and see what I've got. I've got some cheap products and some expensive products. I'll buy a Heavy Product and a Light Product
We expect that the shipping should be $10, which was our base rate for shipping, plus $5 for each of these line items. So we are expecting to ay $20. So we go to checkout. Order total is $100.  We go to the next step and calculate the shipping. And it shows $20. [9'00"] Which is what we expected. So lets go back and we will do that - lets change the cart where we have one light product, so that we have nine of these products. So now we have ten items in our shopping cart.  Ten items in our cart. So were are expecting to pay 10 x 5 + 10, so it should be $60. Let's try that. And the flat rate amount that we are expected to pay is $60. So that's working correctly. Let's go ahead and do that...

Oh I wanted to show you one little thing that I like to do when I am working on these things.
I should actually show you two things that I like to do when I am working on these things.

One is that I always edit the Views that I need to work on, to make them show the components;
I like to see what the components are, that are going-in to these. [10'00"] This [technique] is really useful with tax, and it's really helpful here as well. So you see that we have the flat-rate component. Anyway, I recommend changing the formatter on some of these fields to - Showing all the components, when you are working on something. The

Other thing that I recommend is:
Always turning-on the Rules debugging when you have any questions. So if you go to
Admin > Configuration > Workflow > Rules, and go to Settings
Turn on "show debugging information Never In case of errors  Always.
And then you will be able to debug - to debug quite a number of things. Let's go back here to our ordering [page]. I'll refresh it. [11'00"]. And here is our old [Rules] evaluation log. We can do down and we can see all of the things that we wanted to see.  And drill-down and study them very carefully. It takes a bit [of patience] to get used to this but you really have to do it; you have to understand how that works.

OK: sorry about that little diversion!

What we did is that we wanted to add $5 for every item in our cart.
What we did was we went to Store > Configuration > Shipping and we went to | CALCULATION RULES | this time, and we added a single rule which only had actions in it. It had a loop that went through the line-items and for each line-item it calculated the quantity x 500 (or $5).  Then it added that amount; it stored that amount in a variable. It added that amount to the unit price.
OK?
Well I hope that helped, and I hope you're doing well with shipping. Thank you so much for listening

If anyone is interested in stuff from the same person who transcribed this video, here is a series about Ubercart.


Sunday 9 June 2013

Introduction to Commerce Shipping by Randy Fay


Introduction to Commerce Shipping from Randy Fay on Vimeo.
Finally Commerce_Shipping [module] is coming of age!

I want to give you a quick tour of how to do some things with commerce shipping.
What we're looking at today is this
So that's what we are going to work with. (and) [50" fifty seconds into the video]
What we are going to do is, first of all,
  • we are going to create a flat rate shipping class; we are going to say that it costs $10 to ship.  Then, after we experiment with that,
  • we are going to create free shipping, for products that are within Colorado. So we'll just go and change the rules, and we'll have free shipping within Colorado, and $10 shipping outside Colorado. So lets' give that a shot.


First of all go and enable the modules. So we will go over and enable the modules here [from modules>list he uses a filter to find "shipping" and "flat rate" which are installed as part of the Kickstart distribution he's using]. OK. Well. I'd already enabled them, but those are the ones that you want, and you'll find them under Commerce (Shipping) [picking from a grey-backed column on the left side of a page] you'll want Flat Rate, Shipping, and Shipping UI. [Shipping User Interface]

Later on, in another podcast in another screencast, I will show you how to do UPS [United Parcel Service] and in a further screen cast we'll do some more complicated rules like "free shipping over $100" - that kind of thing. 

But in this one, we're just going to do two shipping rates, one for within Colorado and one for outside Colorado.  We'll give that a shot and see if we can make that work.

So the first thing we're going to do is: we'll go-over to Store>Configuration>Shipping, and we're going to take a look at what we have here: We have [three tabs] -

| Shipping Methods | Shipping Services | Calculation Rules |

All we are going to do today is we're going to look at | Shipping Methods |, which is just there [the visible tab] by default: Flat Rate [method] is what we've got [by default], and | Shipping Services |. We can have one or more Flat Rate Shipping Services. You could think of them as "shipping instances", or whatever you want to call them.
[3'10"]
I'm going to say "add a flat rate service", [does so] and I'm going to say... I am going to call it "Flat Rate", and it's going to be $10. And now we have a new shipping service, under the tab

| Shipping Methods| Shipping Services | Calculation Rules |

Display Title: flat rate... ... ... ...  so this is all set-up. It will automatically be available as a shipping method for any purchase that we make. So let's go ahead and make a purchase.  We'll buy "product three" - how about that! Checkout.  And [add] shipping information.-I'm going to be in Palisade Colorado. Fill this in here. Continue-on.  We see that we are offered Flat Rate Shipping. That is the only service that we have to find.  And we go for it. So, here we are [at the "review your order" screen] - it's done exactly as we asked: it has added flat-rate shipping $10 on to our charge.  and... I've got no payment required. I've got free payment. That's not something you'd want on any site but I can have free payment on this one!

OK - so, Now.
I want $10 shipping in the rest of the USA but in Colorado I want just free shipping.  So there is
What we need to do is create another "free shipping" type. We're going to Store>Configuration>Shipping, and we're going to add another flat-rate service. We'll call it "free shipping inside Colorado".  [copies text for display title. leaves description blank]. And... price is zero.  [presses "save"] And now we have another service: it's called "free shipping inside Colerado"

What we need to do now is remember that this is a Rules component [of the Rules module].  Every rule has an 
  • event, a 
  • condition [or condions] and an 
  • action.  [points to the Conditions and Actions sections of the screen].  
Events are what a rule listens to, conditions decide whether it takes the action, and actions which are things that we are going to do. We are already listening for the "rate shipping" event, and we are going to say "should this rule apply to us", in other words "should we select free shipping"

[5'19"]

...so I'm going to add a condition [from a long drop-down menu including "Commerce Order" as a subheading in bold], and it's going to be a Commerce Order address component comparison. So there we go. The value that I want to compare against: the address that I want to use is the shipping address.. The address component that I want to compare is, first of all, I want to compare the Country. I'll make sure we get the country in there. Otherwise, there might be a "CO" abbreviation in some other country. By the way, this is the two-character country code for the country that I was talking about.  So we have a condition for that.  Now we are going to add one for the State. We're going to do the exact same thing again - Add a new condition> ORDER>Data selector> commerce_order

It's the shipping address that we want... [on the same page further down]
ADDRESS COMPONENT>Value>Administrative area (State / Province).
VALUE>Value
The two-letter code for Colerado is CO.
Save.

So now we have - er - two conditions on there [in the Conditions ELEMENTS box] One is:
Is the country US? The other is
Is the state Colerado?
Then we're going to add that there [in the Actions ELEMENTS box below].

So now we are going to go back and fix the other one so that we don't offer free shipping.
So let's go ahead and do that: we're not going to offer free shipping anytime that they are not shipping to Colerado. So: Store>Configuration>Shipping>ShippingServices 
And now we have to edit the flat rate - and this we don't want to offer if they are outside Colerado.

So let's just say that we only want to offer shipping in the US, because that's [  ] a separate thing.  So lets just go ahead and say [on Add a new condition] ORDER>Data selector ...
and the value of the administrative area [options are = / not =  / contains] lets say "equals" CO. And then we're going to say [with a tick box just above the save button at the bottom of the page] "Negate":  [9'30"] This does not contain Colerado so don't do it. Save.

Lets go ahead and add the other condition, about the US.
Add a new condition > Select the condition to add > drop down menu
Commerce Cart > ?
...just in case there is some other sort of thing [that has a CO abbreviation]. We'd probably take care of this another way, by offering a different shipping [service] outside the US, [which would] just tell them that we couldn't do it.
DATA SELECTOR > Country >
OPERATOR > equals
...just for now I am going to say "equals US"
We are going to say that this [flat rate shipping rule] applies to shipping that is in the US, but is outside Colerado.
[...]

And so now lets go-see if that works: [10'35"]
...you'll see that it already thinks that I'm in Colorado. No - it just doesn't know yet. It didn't ahve any information. Now we know. Now lets try again. Lets try shifting the state to Kentucky. ...and now it's offering only the flat rate $10 ammount. So now it's doing what we told it to do. The first time we tried this, we didn't have a way to choose [where we are] at the checkout.

...Colerado: then we get free shipping.


Let's just take a look at what we've done. First of all we've used
Commerce_Shipping [module] 2.X . We've used
Commerce_Flat_Rate - (
not the older (what do you call it?)... not the older Commerce_Shipping_Flat_Rate, which is basically depricated now.
Using those two, we have gone-in to Drupal admin (with Drupal Commerce enabled and a Store menu on admin).
  • We have gone into Admin>Store>Configuration>Shipping
  • We have a flat rate SHIPPING METHOD.
  • We hae added two services. Let's take a look at the two services we added. The two services are
  • Flat Rate (Machine name flat_rate), which is the $10 one, and
  • free Shipping inside Colorado (Machine name free_shipping_inside_colerado), which would be $0.
  • And then we added a Rules component to make sure that they were chosen at the right time. So free shipping is chosen if we are shipping to the US, and we are shipping to Colerado.
  • And we did the opposite on the other one.
So that's the basics! That's the first and easiest configuration of flat rate shipping .
I will do a couple more screen casts. I'll do one on Commerce_UPS, which is now working, and I'll also do one on fancy rules. So, thanks for listening, and see you in the issue queue and everywhere else! Thanks - bye bye.



.

Friday 17 May 2013

Why is this difficult / videos v. forums v. blogs

A paid video about wordpress ecommerce mentions "so many people banging their heads against the wall in the forums" on some tricky point.

Free videos, made more quickly, do not even mention forums.

Forum posts cannot easily describe free videos either; they cannot write "the part about X at 6'32" doesn't make sense to me" because not many people would reply unless there is a transcript, and for some reason the videos such as Commerce Guy's videos on Vimeo do not have transcripts. This is a pity for
  • non-english speakers, who have trouble translating the less clear parts, and for
  • english speakers like me who have trouble asking for help in a forum and saying where stuck.
I have tried posting in Drupal Commerce forums and got no response. If I transcribe a video there, it looks a bit weird and out of place and probably gets deleted; if I post it here on a blog and link, it looks like an attempt at self publicity and gets ignored (or deleted). So the two ways of learning about Drupal Commerce do not interact; makers of videos do not know where their explanations are tricky, and writers on forums cannot help each other by referring to the right parts of videos.




 






Saturday 13 October 2012

Drupal 7 / Ubercart Video Tutorial 7 of 10: catalog



http://www.ubercart.org/docs/user/30436/ubercart_3x#S1E7
In this 7th of 10 drupal video tutorial on creating an e-commerce site, we continue by creating products including shippable products, purchased roles and downloadable products. Once done, we take a look at configuring the catalog which includes examining the taxonomy system in drupal.]


The next video 8 will show how to over-ride the default catalog module and write new product attributes, with a chance to expose a product filter to the shoppers...


[Drupal 7 / Ubercart video tutorial 6 of 10 showing how to set UPS, Paypal, and conditional taxes]
[Drupal 7 / Ubercart video tutorial 7 of 10 showed how to use the default catalog module]
[Drupal 7 / Ubercart video tutorial 8 of 10 showed an alternative flexible method of showing a catalog]
[Drupal 7 / Ubercart video tutorial 9 of 10 shows how to use product kits, stock, and order states]
[Drupal 7 / Ubercart video tutorial 10 of 10 shows a simple checkout, reports, and suggests a theme]



Hullo and welcome back to the seventh video tutorial in this ten part video tutorial series on creating an ecommerce site using Drupal [7] and Ubercart. I am P Yaworski the author of [? sturctural analysiing in Drupal ] and, like all the video tutorials in this series, this is brought to you in collaboration between myself and the Ubercart.org guys, who suggested it; thought it would be a good idea to get it out-there for new users of Drupal and Ubercart. So lets get - er: let's get started.

Hopefully you've already viewed the first six video tutorials so I'm not going to re-hash those. But we've got a site set-up; we've got it configured, and we're ready now to create some products.
..so..
There will be three different products, which we are going to create. Firstly there are
  1. shippable products, and
  2. purchasable roles, and then
  3. file downloads.
..but...
Before we do that we actually need to do is take a look at the product content type that gets set-up by default when we install ubercart.
..so..
To do that we are going to go-over to Structure>Content Type>Product
and we are going to take a look at Product to begin with.
(..so..you need to ignore these security updates: obviously some updates from Drupal have just come out)
..so..
Let's walk-through what we've got here on the Product. First thing's first: a product field which is actualy referred to as Name. ..so.. Why don't I call this a "product name"? Right. So you can change that . Preview before submitting. I'm going to change that to disabled, because I am going to be creating the products so I don't have to preview those, so that's fine. Publishing Options. I don't want mine promoted to the front page. What that actually does, is: by default if you're using Drupal, it will create a stream of your published front page nodes on your front page. So it just pulls those in, newest being the first. So we saw on the front page there at the beginning, it was the product there that was promoted to the front page. ..so.. I'm not going to use that. What you could do is create your own front page on another node of the site:  "checkout my store"  - that kind of thing, so you won't be necessarillly using that. If you want to: by all means: you'll see all your products on you're front page as you're adding them, but I want more control.

Another thing: I don't like to display the author and date on products; I don't think it's required. 
I also don't want any comment-things: I'm just going to close that.

My Title. Remember: we set this up just briefly  - pre requisiting that we have set up our page titles and configured our search engine optimisation, you can  see here that this will just pull-in the defaults, including our current page and then our site name. If we want to put something specific we can just do it, if we've got some seach-engine optimisation that we want to do. You can also control the fields and let it happen, or we can do it specifically for each product.

One thing we should note is that product and its derivatives are shippable. So, by default: all our products can be shipped...and..
The Product Image Field, if you have multiple images. By default the product just has one: we are just using the image itself.
My Sitemap is going to include all our products.
So I am going to save that product.


So with that, we are just going to talk about the actual fields. And I'm just briefly going to talk about these: I'm sure you know what we're talking about here. ..So.. Remember we've got our catalog set-up? We enabled that amongst our modules, so that is what we see here. [3'00"] The catalog is actually based on Taxonomy Terms, so we are going to walk-through that in a bit: the catalog  is actually a vocabulary, and you can add some terms to that. 

Additionally we've got the image here - that was what we were talking about before: you see product image. You could add additional fields if you wanted to. It's beyond the scope of this video tutorial series, but it's an option that I just want to make you aware of.

Before we move on, I'm just going to show you this select list here, because this is going to have some implications for your site. ..so... We go to the "widget type" for your product catalog. It goes to this little select list. So you get to pre-populate your different taxonomy terms for your catalog. .So, you know, if you have: - What we are going to do as an example here is: we are going to have pictures of my dog Baily, pictures of my dog Suzie and these are going to be different terms.  If we wanted to do free tagging so we are constantly adding new types of prodducts, what you want to do is choose that one, and type it in as you go: it will get added-in.  You can add multiple tags for one product. Or, with the select list, you just kind-of pre-populate that.  So just be aware of that when you go ahead and you are using that.


The next thing we're going to take a look at is just the Manage Display. The reason we're going to do that is that you can change your labels here. So you might not necessarilly want your labels for your image, so that could be hidden.
....uc_product...
this will actually scale your product to different sizes of images - so uc_product is what we are using.

So normally I would save my configuration,  because I have changed this to a hidden label, but I don't really care. An additional thing too - and I think we said that in a previous video tutorial - is that you have display price and price, so you see the price twice on your actual products. If you want to remove that, just remove the sale price or the display price, assuming that they are both the same: I have not shown you different prices yet, but that's an option there, so just be aware of that.




So let's go ahead and actually create some products. [5.00]
So the first product we are going to create is pretty easy, pretty basic; it's a shippable product. So, you remember, wev'e got UPS set-up ; we've got payments set-up as well, so with UPS we can add-in our weights and all that kind of thing. So lets go ahead and do that. So we'll call this - um -  you know: we actually going to make this a shippable product, so we will call it a "T shirt with Baily's photo".  [types text] "Buy your very own T shirt with Bayley's picture printed on it". Right? And So we will go ahead and we will choose a file. I've got one here with a nice big smile on it; it will probably take a bit of time to load.

Catalog menu
You'll see here a catalog [drop down menu left of screen towards the top].I've gone-ahead and I've added -er-  Baily [to the items on the drop-down] term. So: I'll have to show you how to add new terms. But that's why I could choose that. So my SKU is going tot be BAILY_SHIRT; sale price is going to be a whapping $9.99 . And here [a ticked box under "list price" marked "product is shippable"] I want my product to be shippable so that's going ahead. The weight is going to be 0.5 lbs and the length is going to be  - I've no idea - 24 inches? ; width 20 inches? Height 1 inch. Maximum package quanitity: so you can fit 50 [T shirts] in my boxes. ..So.. All of that is required information if you are going to be shipping with UPS. If you don't add this in, you are going to get problems. So if you are having issues providing [shipping or postatge] quotes, it's likely [to be] because you did not provide a weight or dimension for your product. ..So..

Shippping settings here.
Your "package type" is going to be dependent on what your shipping arrangement is with UPS so we'll just select "store default packaging" and leave that there. The "default shipping type" [selected]. Don't worry about that too often unless you're doing something special. I know that I only have small packages set-up, so, for a default [option], that's going to be fine.

Default Pickup Address. This is one thing to note. You'll remember when we were talking about shipping with UPS and recieving errors on your quotes if your default pickup address is not correct? So if you set that up and is wasn't correct, your first product would actually be picking-up your default settings. Then when you go to troubleshoot you change your default store settings. And you have to come back into this. So it's a little bit complicated, but if you are running-into issues with this, make sure to check that.

Weight Quote
Shipping by weight: if I want to change my weight quote, so that this is a $2 added, rather than a default, I can go ahead and do that.

Flat Rate Shipping Quote
...and my flat rate: if I want to make that product-specific: I can do ahead and do that as well. The other things that we have...

Metatags 
These were all already using our defaults, which we set-up previously when we were doing our menus. So we're good.

URL path settings
same as our url path settings which we've done already so we don't really need to customise that, so all that we really need to do is go ahead and press save our product.
---------------------------------------------------------------------------------
Right: so here's a pre-set [image ize of a dog]. Right. Actually I uploaded a huge image. It [ubercart] has resized it.
I've seen that it's cataloged in "Baily". You'll see that I've got my SKU ["Tshirt_with_bailey's_photo"] and my one - my two prices - you'll remember I left them there, so I've god display price and list price, and it shows all my dimensions and that kind of thing. So that's my new product. That's a shippable product: very easy to create, and if you click on my Catalog you'll see that I've got my catalog [of] "Bailey", and then I've got two product terms that are tagged as "Baily".
..so..
While we are looking at that, I'm just going to show you how we set up the Taxonomy Term, although I'm sure I've done this previously... but ..
STRUCTURE>TAXONOMY>PRODUCT 
...here. You will see that I've got the one [Product]Type. I've got Bailey. If I want to add additional ones I'll just go to +Add Term
NAME
Suzie
DESCRIPTION
Products related to Suzie.
Right. So
META TAGS
- meta tags: - er: the Suzie page will have its own meta-information. Remember when we were looking at the catalog for Bailey: we're looking at the catalog for Suzie. This is all meta-information.
URL PATH SETTINGS
- url path settings: we could change the url path. This will all be automatically done, so we are not going to do that.
IMAGES: Choose File
- images: If we wanted to add an image to the actual catalog that we saw there, we can find a good picture of little Suzie (from a linked directory of thumbnail sized photos). So let's see if we have a good one here.There we go. So I'll just upload that. So while that image is uploading we'll just go ahead and press
Save
- Save: so we've added a term now which we can see as it starts coming-in. If we go back to the catalog now you'll see that we've got "Bailey" and thenn we've got "Suzie".


..so...
let's go back and create a new Product, and we'll make this our purchasable role. ..so .. We'll call this a
Product Name
Site Membership.
Description (Edit Summery)
Become a member to ucwebdeveloper.com
Choose File
- so, we choose an image - whatever image we want - here: another image of Bailey.
Upload File
-we'll put this in the Suzie catalog this time.
SKU*
- we'll call that Membership. 
Sell price*
- Sell Price is a whapping $99.99
We don't have to worry about our shipping settings because it's not shippable.
We don't have to worry about our menus. So let's go ahead
Save and Continue
And we will save and continue.
So now, as a slight detour, what we are going to do is: remember when we did earlier tutorials, we enabled site roles to be purchased? And when we did that we created a "site member" role here? Well if you don't have that, you can just type in here. So you have that.

So now, when  we go to our actual product, what we are going to do is go to
Features (third button of three after product and attribute on the edit product menu)
Features.
And we are going to add a role assignment [from a drop down menu]
And this is going to be a
SKU
SKU: Membership
Role
The role is going to be "site member"
Shippable Product [tick box not ticked]
It's not associated with a shippable product

Default Role Exploration [tick box not ticked]
And we've not going to over-ride the default role exploration.
Save Feature
So we're just going to go ahead and save that feature.
And now this role - this assignment - is associated with our product "Membership".
If you don't have that configured already, you're going to have to go into
PRODUCTS
It should easily drop down but it didn't. And then you go into role assignment, where you can do every thing about your role assigment. Again, that was in...
ADMIN>STORE>SETTINGS>PRODUCTS>CONFIGURATION>PRODUCTS>ROLE ASSIGNMENT
Again: very simple to create.
We then go to our catalog
We go into "Suzie".
We have a site membership, with a SKU, a title; we can add that to the cart. I reckon that if you click into it you can actually check that out. So: very simple to creat roles.

And so our last thing we are going to do is that we are going to create a product that is associated with a file download. So we are going to go to
ADD CONTENT>PRODUCT
Product Name 
Product Name: product name is going to be "download of pictures".
Description (Edit Summery)
"download a zip file of amazing Bailey and Suzie pictures"
Right: so we are going to associate a photo with this again - if we want to.
Choose File
[chooses a file from a directory of thumbnail pictures]
Upload File
Product Information>SKU*
SKU: we'll call that "file upload"
Product Information>Product is Shippable [tick box]


Product is not shippable.
And we have all our metatags set-up so we'll go ahead and click
Save and Continue [12'52"]
So now, what we're going to do is that we are going to head back to the
Features
Features, as we did before.
Add
and we're going to add a file download.
So: a couple of things to note. Obviously our [demonstration] got into it properly here but you might have some issues. So, if you are having problems: go back to your
SITE CONFIGURATION>PRODUCTS
File Download Settings

Files Path
So you'll see [that] your products really exist in a specific folder. So you'll see that mine really exist. They're outside of the root, which is what Ubercart recommend you do for security reasons, so mine is "../private" .
[ ]Warn about purchasing duplicate files
It's going to warn about purchasing diplicate files
etc etc
And they have seven days to download their files.
So make sure that's all configured.
So with that set-up, you now have to go to

Products > View File Uplaods
And here is where you can actually perform file uploads. Right. So. You can manually upload files, through this interface. You go to Perform Action.You are going to choose whether to select a file and choose to select it.
The other thing you can do is that you can FTP into your site, and you can just upload the files. So Readme.txt happened to be in that folder. I went ahead and I uploaded via FTP backupandmigrate - the backup and migrate module - and ends-up showing up here. So that's a nice little time saver. You can upload fifteen different files that you want to download, and do it all at once.
..so...
SKU
SKU is associated with the file download [by using a drop down menu]
File Dowload
File Download: this is what we are doing. The file we want is called Backup... [chooses from list] Right: so if you can't remember the name, you can go back to File Download and you will see it.
Description
Description: "awsome photos of Bailey and Suzie." I've done a typo. Don't really care.
Not shipping.
And we are not going to over-ride any limits.
Save and Continue 
So we can go ahead and save that feature.
View 
And now we can go and View.
So now anybody who actually purchases this: they are going to have the ability to download products.
And we are going to see how that actually happens in a future video tutorial. Right now we're just setting everything up. We'll be testing later.
So those are our three different product types that we have created. The last thing we are going to do is we are going to it take a look at the Catalog, which we enabled.

Just a quick note here: I'm not a huge fan of the catalog. I prefer to do this all manually myself because that way I feel like I have a little bit more control. What the catalog does is essentially to create Views for you. It will create the Taxonomies for you, and it will create all your pages associated with that. One thing I don't like about the catalog (so if you remember, we chose or we got Catalog here slash Bailey. And the reason for that is, if we go to Configuration>Sytem... no: sorry. Go to search - meta - url aliases - patterns...

We've got our catalog/termname
But it's also a taxonomy
So it's a Vocab/termname.

And what ends up happening when we do that is that we get catalog/bailey which is appropriate for catalog, and if I go dash-zero [types -0 on the end] , I get a different look to the same page. Right? I get these three different products; it's a proper page. It's catalog slash bailey.


The reason for that is that catalog/bailey, as I said before, and catalog/bailey-0 is the taxonomy view, which by default comes with Drupal's taxonomy modules. So: a bit of a problem there. I like to avoid this myself so I just use taxonomies. In a future video tutorial - video tutorial eight - I shall show you the advanced way that I like to do this. But for now, I'm just going to walk you through using the catalog.

STRUCTURE>TAXONOMY>CATALOG
So, that said, when you checkout the taxonomy, we can go to catalog, and you'll see our terms - right - then we can go ahead and edit those.
Manage Fields tab
And also Manage Fields And so, you'll see here that I've got a Machine Name, and I've got Image. And so, you know that any time when we've got an image, we have to make sure that the display is going to be proper. So if we go over to Manage Display , you'll see here that I have "image style uc-catalog" by default.This is just the image itself, so that if you upload a massive one, you are going to get a massive one. So you want to change that. I chose uc_category which was automatically created for this purpose. So I am going to go ahead and update that.
Save 
And go ahead and save that.
Right. So you know how to add terms to your vocabulary and you know how to change images.
STORE>CONFIGURATION>CATALOG>EDIT CATALOG DISPLAY
Catalog Display: Table
Catalog Display: Grid

The other thing that's worth stating and of note is that when you go to Catalog, you can acatually change the catalog display to a grid from a table. And this is all based on Views. In the next video tutorial I'll show you how to create my own custom views. But - going back - if you wanted to manipulate this you would go here and you can just edit the view itself. And its all in the UC structure [from the admin drop down menu] Catalog. Catalog is what we see here. The catalog terms is actually when we go into here. You'll see the products. So if I went in to edit this view [by clicking on the top right of a rectangle round it] Right. You can see all the fields here. So if I wanted to add dimansions I could go ahead and just add the dimensions on the table; it's all available here.
..again..
Getting into the nitty-gritty of the change of the view view is beyond the scope of this tutorial. You will get a taste for Views in the next video tutorial when we go ahead and I show you the different system that I like to use. But Catalog does provide you with a nice option right out of the box, obviously, without much configuration, I go into Catalog and I see all of my products kind of lined-up nicely. The reason we have this empty bar here [18'30"] is that we have a table; we don't have a third - a third term to create. So if I did that, your table would look a lot cleaner. But if I go into Bailey, you will see that all the Bailey products are already listed. It's nice. It's clean. It's pretty simple. So: don't be afraid to use the Catalog, but I'll show you a little bit more of a powerful technique in the next video tutorial.

So: hope this helps. Please, as always, leave a comment or a thumbs-up on You-tube: that would be awsome; really appreciated. I've been getting a tonne of positive comments: keep them coming. Its always good to know that these help you. So: if you would like to see anything changed, please leave a comment and let me know. And with that, we will see you in the next video tutorial.


[Drupal 7 / Ubercart video tutorial 7 of 10 showed how to use the default catalog module]
[Drupal 7 / Ubercart video tutorial 8 of 10 showed an alternative flexible method of showing a catalog]
[Drupal 7 / Ubercart video tutorial 9 of 10 shows how to use product kits, stock, and order states]
[Drupal 7 / Ubercart video tutorial 10 of 10 shows a simple checkout, reports, and suggests a theme]


♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦

Tutorial 8 of 10: Overriding the Catalog and Creating Product Attributes

There is a better transcript on another page of this site.

https://veg-buildlog.blogspot.com/2013/10/drupal-7-ubercart-tutorial-8-of-10.html

I'll delete the page from here-on soon,
♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦


Sunday 22 January 2012

Building an awesome e-commerce site in 25 minutes (without losing your soul)

http://www.youtube.com/watch?v=ViS2xFvnZwc&feature=BFa&list=PLCDB80A0209EC71E1&lf=plpp_video


Hullo. My name is Andrew. I work for a company called Real World Technology. We do a range of different things, but I am here to talk about a wonderful thing in the Drupal ecosystem in my opinion, and that's called Drupal Commerce. So you're probably, or you might have heard other people speaking about it a little bit this weekend. It's come-up. It's been cursed in some talks; it's been praised in some talks. I think it's one of the best things that's come to the e-commerce community as part of Drupal.

We're going to have a chat a little bit about that, and we're going to have a go at making a working, ready, production, e-commerce website, in - pretty much on 25 minutes. So all being well; no computer and technical glitches, that should be all good.

What is Drupal Commerce? [screen]
  • A modular eCommerce framework
  • Designed to let you "build" new stuff
  • It's really cool

So before we actually get-in-to Drupal Commerce, I just want to do a quick show of hands:
how many of you have built an ecommerce site before? OK.
How many of you have enjoyed the experience? I've got two hands! And a half!
Who has used Drupal Commerce before now? OK: we've got a few people around.
How many people have used Ubercart? OK: a few more of you.
Magento? Yes.
OSCommerce? [two or three]
Who has written their own [holds-up his own hand]
Things not written in Drupal that do e-commerce?
Anyone used Shopify or any of those sorts of things? No: OK. One. That's good. OK.

Well,
Drupal Commerce is a little bit different to most other ecommerce distributions that are available on the market. Drupal Commerce is really a framework to allow you to build ecommerce stores and ecommerce platforms. Drupal Commerce in and of itself is a bunch of really really small modules that do a set of small, defined, contained things. And, out of the box if you just go to Drupal.org and grab the Commerce project and install it on your site, you're probably going to be finding that what you've got is something that
  • doesn't do a lot, is
  • pretty confusing, and a
  • little bit hard to get started with.
So,
We're going to talk a little bit about that today, but the thing about Drupal Commerce, that sets it apart from everything else, is that it is a set of components that allows you to build something big. And build something better. My background: I build e-commerce sites. I've been building them since I was about 15.  The first e-commerce site I built was a custom-built site. It lived in asp.net. Or I should say "asp": this was before .net even existed. It sold products for a store. I can't even remember what it did. It had a Microsoft Access database back-end because - you know - when you're 15, Access is cool. Then you grow-up and realise that it really wasn't, but that's OK! That was the first site that I built. Since then I've built sites on Magento; things built on Zend framework, some stuff built on Syphony, ran a very large website built in OSCommerce for around five years. So I've had a bit of an exposure to what's available in ecommerce platforms, and building different things. And together with my company we've built web sites for some very very small people, through to some very very large NGOs and other organisations that wanted to extend their business onto the internet.

The thing that I found, time and time again, is that when I go and I download something like Magento, or I go and I download something like Ubercart,  I discover that, provided that what I want to do works straight out of the box, the solution is absolutely perfect. But the moment that my customer comes to me and says "what I want is X and Y and Z", and I can't quite do it; the modules don't quite get there or I can't change what I want easily.... I end-up hacking something together and making changes and doing things that break my upgrade path. That in the end means that the customer gets a solution that they're not really happy with. It just becomes a bit of a mess.

Now,
I see that Drupal Commerce addresses a number of these issues, by - instead of trying to be something that is all things to all people out of the box - it tries to be building-blocks that give you pieces of the bigger puzzle. So: it's really cool like that.

So,
What does Drupal do? It does most of the things that you'd expect an ecommerce platform to do.

What can it do?
  • Manage products and display them
  • Manage orders
  • Take payments
  • Calculate tax
  • Give discounts
That's what it will do pretty much out of the box.  We can also handle shipping; we can do stock, we can do coupons and vouchers. Some of those things might not sound like very big business goals. But I started using Magento when it was a 0.9 release. It was the coolest php-based shopping cart system available on the market and probably one of the best that was available at the time. It had a nice UI (user interface); a nice customer experience that was only rivalled by some of the really really big ecommerce stores. But then we wanted to give coupons to our customers to allow them to buy on it. They only realeased that module into the community about 12 months ago. That's like three years after the product was there. But Drupal Commerce has it today there right now. So they are really quite good.

What are people using Drupal Commerce for?
  • Everyday online stores (eg ozonekites.com.eu)Today if you are online you can go and jump on there now. It's an Australian-based store. They sell kites. It's pretty cool.
  • Membership websites (eg subhub.com)Dries mentioned in his keyonote [speech] this morning Subhub.com. Subhub is an example which I've come accross which is really unique. They have a Drupal-based-web-site that sells Drupal-based-web-sites to sell stuff! Which is, kind of, a bit of inception, but it's pretty good! So you can go and you can buy a website from Subhub to sell subscriptions to your magazine. Or to allow you to download music from your music-band-thing that you play in or record for or something like that. It's pretty cool.
  • Discount style websites... is another unique thing. Someone has gone and built an entire clone of the Groupon website, in Drupal Commerce, packaged it up as a Drupal Distribution, and you can go, download that, install that on your web server, add a bit of theming and bits and pieces: and you've got your own Groupon site. And you can give your friends and family discounts to - I don't know: whatever it you want to give them discounts to. Or however that wants to work. But it's there. It works today right out of the box.
  • Donations (eg ioby.org)... and there's
  • Many more (see drupalcommerce.org/showcase) There's a long list there. That's only half of what Drupal Commerce is doing out-there in the wild today.
One of the things that I promised was that we were going to build and awesome Drupal Commerce website from scratch in only 25 minutes. So let's get-in and do that. We've only got 13 or 14 minutes left in this session!

Installing Commerce
  • So, we're going to Start with something called the Commerce_Kickstart install profile
    Commerce Kickstart is basically a full Drupal 7.10 (at the moment) distribution, with all of the Commerce bits and pieces ready to go, which you can download. Install on your web server [if it has the capacity which cheap ones don't: you have to install from a database]. Follow the install script. And have a functional working Drupal Commerce website.
  • But it's really designed for being used in the US. So what we're going to do, then, is: we're going to grab the Commerce_Australia module for some country specific configuration - which has some configuration for currency display and GST Time, and it just makes it easy to get them up and running, and install that, and taht's what we're going to do to start with.
  • Let the fun begin
[...] [8' 20 seconds]
I've pre - downloaded an installer module onto my machine, set-up a web host: all of those sort sof things

OK, it's going to run away and it's going to install all the modules. It's going to configure everything as a kind of a base starting point and get us ready to go, and when this is finished in just a few seconds we'll get to the configure site . I'll set some settings like you would if you were normally installing Drupal. And then we install some example stuff. And we wait. This is probably the most boring bit. If anyone feels like donating me a faster macbook pro I'll gladly accept.

The advantage that the Commerce Kickstart module has over downloading Drupal and adding the Commerce module is that there is a bunch of things that you need to get Commerce working. We'll talk a little bit more about some of those things in a minute but there's a lot of dependencies, which are normal things that you'd probably run on your Drupal website, but the Commerce Kickstart distribution has those things in it from day onee. So you don't need to worry about those sorts of things. You can install it in a Drupal site if you've got it up and running and add bits and pieces. We're just doing it this way because we have limited time, because I set  a rediculous time limit!

We're going to call the site... I think we're going to sell some Ferraris. [see screen] Save and continue.
We're going to put some example content in because it makes our life easier. In case you were wondering, we have now been running for three minutes out of our 25 minutes, and we now have installed Drupal Commerce, and we have a working functioning ecommerce store.

So
  • I can add products to my cart
  • I can view my cart
  • I can make the quantity five
  • I can update my cart
  • I can checkout
  • I can fill-in some details and go right through and it will work. We'll look at that a little bit more later.

But
What we're going to do is we're going to do a little bit more than that; there is a little bit more to be done.
So
This is what we're actually going to build. We are going to build the Drupal Downunder 2012 Farrari Store. We are going to sell Micky Mouse cars; we are going to sell Honda Civics and Farraris - maybe. We'll definately sell Farraris: I'm not so sure about the rest of them.
So
A couple of things that Commerce can do. One of the nice things is that it groups products together like this [attributes] so that we can have a yellow Farrari featuring red starbursts; we can have a lime green Farrari. You'll notice that as I do this it updates the displays and it changes the price and the text and you'll see that there's some features on some of these cars: I think the yellow car features starburst paint. They're all updating nicely in the background. As a website developer, and a themer (and bits and pieces) I've done nothing to get that working out of the box. It's just there. It just happens. It just works. No effort involved. Straight working, day one. [so why can't I do it?: because there are no instructions. Will the nice man explain?]

The other thing that we are going to do, if I actually add this car to my cart - we'll just jump across to the checkout. We've got our starburst Farrari here at $59.95 . We've got some shipping in here. There's no [?] doubledation on this. Whatever. We're not going to talk about that today but it can be done. We've got some shipping and we've got two different shipping rules. If you've got a product that you want to sell for less than $100 - or less than $50 in this particualr store - you'll get $15 shipping charged. And when your cart value is over $50 you get free shipping. So the idea is that you might want to give some particular shipping to some people, or if they are some kind of VIP customer or things like that: all sorts of things that we can do. We can go right through [as a customer], confirm, put in some payment details, and then magically checkout is complete. I can view my order, and see what I have bought. I can go into my account and see what I have bought before. I've got a few orders in there including one that's been deleted and one order that's been completed. I can come in here as an admin; view some orders. See what's been - ordered. I can delete an order. I can modify the payment details. These are some of the things that you can do with Drupal Commerce straight out of the box, mostly, without too much work.

Understanding the Workflow
Install Commerce>>Confirgure Currency>>Configure Tax Rates>>Build Product Types>>Add Sample Product(s)>>Build Product Display>>Configure Shipping / Payment methods>> Add more products and displays>> Test and Launch?

So
how to we go about actually getting from a base install to something that is relatively functional; which we can use to delivery an e-commerce product to our customers?

So the first thing that we do is that we
install Commerce. Relatively straightforward.
Then we
configure the currency settings. By default Commerce installs, running in $US. Not that that's really a problem, but you probably want your store, if you're in Australia, to be running in Australian dollars.
  • We set-up some tax rules and tax rates.
  • We build our product types - and I will explain a little bit more about what that is in a moment.
  • We add some sample products.
  • We build product displays.
  • We configure shipping and payment methods.
  • We finish populating our store.
  • We test it to make sure it's working right
  • Then we go live and we make lots of money because everyone makes lots of money when they launch an online store. [laughs]

Understanding Rules
Rules govern the operation of each element of the store - including calculating prices, discounts, checkout steps, add-to-cart rules, confirmation emails, user registration.
The first thing about Drupal Commerce is that it makes use of standard Drupal ways of doing things. So there are some key components of Commerce which live in the background and aren't immediately obvious. They make Commerce work and really really sing when it comes to Commerce being a good ecommerce tool. The first thing is Rules. Rules drive Drupal Commerce. Rules are your business logic that detirmines how your ecommerce store works. So you have Rules to calculate tax. You have rules to detirmine whether you can add a product to your cart. You have Rules that set what shipping method you can choose. You have Rules that detirmine whether or not the user is allowed to check-out. You have a Rule, and there's actually a screen-shot of one here, that detirmines what emails get sent to the customer when they purchase the item, and whether or not you as a store admin get the email. You have Rules which integrate Drupal Commerce with your back-end ERP system. So if you have something like AdEmpire [?] or you're making use of a financial package like, say, Zero or Sassuu or something like that, someone can write modules that interact with those Rules, so that, say, when you place an order it triggers the invoice to be created in Zero, the payment to be recorded, and all of those thing fit together very very nicely. Now: no-one has done that yet, but it is entirely possible within the way that Drupal Commerce works.

Understanding Views
Views display (almost) every part of the store - including order lists, the checkout, shopping cart and product listings.
The next thing to say about Drupal Commerce is that it relies heavily on Views. So Views is a way of representing data within your website. You can have Views that display nodes; you can have Views that display all kinds of different things. One of the neat things about Drupal Commerce is that pretty much whenever it displays a list of stuff, it is using Views. So if you want to change the columns that you see... One of the common things that customers say to me is that "We've got our web site, we've got our admin section; we've got our product listing, and we want to change the order of things". So: take something like Magento. You can print a picking-list out of Magento, which my default shows the product code, product name, price, and that's about all. And if you want to change that, you've got a change a bunch of stuff:
- you've got to change a bunch of XML files
- you've got to change a bunch of PHP files
- change the way that that all comes together. It's a little bit messy and a little bit nasty.
With Drupal Commerce you jump-in, you edit the View; you edit the column, and you're done! It's really nice. Really really easy. You want to display the SKU, so the part code appears in the shopping cart: you just go-ahead and you add the column. That's the way that it works. It's really really nice because it makes use of standard Drupal features, that people who are used to building and assembling Drupal websites use every day and night.

Understanding Products
A product is an item you want to sell, and is an "entitity". A product contains all the important details about an item, and there is generally one for each part code in the catalogue.
The next thing to say is that Products are not Nodes. If you are coming from a Drupal 6 mind-set, where everything is a node, it's really important to understand that products are not nodes. Products are products, and they are displayed using nodes. We'll talk about product displays in a minute. A Product is essentially a group of fields, which is a group of information about a product. So a Product must contain an SKU - which is a part code; a product must contain a name, and a product can (but doesn't have to) contain a price. Most products will contain a price. Although some people want stores where they don't actually want to sell anything - they just want to put products online. So those kinds of things are there. But say you wanted to record the colour of an item. You can add a field to your product type that has a colour in it, much in the way that you can add a field to your content type to record the information. But they're distinct from product types.

Understanding Product Displays
A product display groups one or more products together for display, and is a "node". Product displays usually contain descriptions and formatting rules.
Prouduct Displays groups products together into logical groups. So an example which I have been (kind of) thinking-through is... Say I was an Apple reseller, and I wanted to sell Iphones. There's currently eight or nine different models of Iphones you can get. But want I want to do is have someone come to my online store, and be able to pick-up, or go to the Iphone page and have all of the different options listed there together, so there is one page for them to go and see. I don't really want them to go to a page that has the 34gig Iphone, the 64gig Iphone, and black and white - and there's way more than six models I've just realised - I want them all grouped together in a single node. So that's what a Product Display is: it groups products together in a form for display. And you can add extra information there. You can add descriptions - in fact, any field you want to add to a product display, you can.

Understanding Currency
Multi-currency aware. Products can be priced in more than one currency. Currencies can be selected based on rules.
Currency is the next thing we are going to talk about. Drupal Commerce is actually is multi-currency aware. So if you wanted to sell products in Australian dollars and US dollars and  New Zealand dollars and British Pounds, and Yen, or whatever it is you want to do, Drupal Commerce on day-one out-of-the-box supports multiple currencies. By default it has not way of converting between currencies, so if you put prices in in Australian dollars, it won't go and work out what the price is in US dollars or something like that. But there's no reason why you could not do that, if you wanted to. Most people probably wouldn't want to do that because they want to sell in nice numbers, so they want to sell at $49.95 in Australian dollars and $199.99 dollars in the US or however that works.

Which currency people see can be selected using Rules. There are modules which will tell Rules what country someone is in. Rules will detirmine on the basis of that what currency someone should see when they look at your store.

Understanding Taxes
Taxes are very flexible. Consist of Tax Types and Tax Rates. Fully managable by Rules.
The other thing that we'll quickly touch on is taxes. In Australia taxes are relatively boring. There's just one single tax for everything and that's called GST (Goods and Services Tax). It's about 10% of the product price. Most of you probably deal with that when you deal with everything you buy. In other countries there are other tax rules. But say you wanted to sell houses using Drupal Commerce. In New South Wales where I am from, we have this thing called Stamp Duty. Stamp Duty is 1½% of the sale price. So you could have a tax rate for Stamp Duty within Drupal Commerce, know when to calculate that Stamp Duty using Rules, and correctly apply it to the products, using  Rules, all automatically, without having to do anything. So you can have mulitple tax rates, multiple tax types; you can display prices including, excluding: all those types of things. You can have taxes not on. In fact - a kind of self plug here - the Commerce Australia  module which you can download from Drupal.org, it has a rule in there which says "If you are in Australia, charge GST, and if you're not in Australia, don't charge GST", because if you ship the product outside of Australia then you don't charge GST on it. When I used to run a website in OSCommerce, that was a big pain whenever someone placed an order from New Zealand, because we had to take the GST off and modify it and a bunch of things like that, and it didn't do it well, and then we tried it in Ubercart and it was even worse. So it just works out of the box, day one. Great.
22
So lets actually get-in and do this. We've got 25 minutes from now. Maybe some time for questions. By the way, feel free to stop me at any time and ask questions on what we're doing.
  So
This is the website we've just installed.


The first thing we're going to do is actually not jump into configuration but jump into modules and the first thing I'm going to actually do is I'm going to install the module filter module, simply because it makes my life a lot easier. If you've worked with a site that has lots of modules and you've never found the module filter module : what it does is it changes the display of this page and puts all the modules down on the left hand side, which is really handy. It's kind of quick.
  So
The first thing that we're going to do is we're going to install the GST (Goods and Services Tax) module, and while we're at it we'll probably also install the currency display . They're part of the Commerce Australia module. What they do is the GST module sets-up the GST rules , and Currency Display makes it display Australian Dollars with a $ sign. That's pretty much all that they do. Basic but important.

Now we are going to
>>Configure our Store [from the admin menus].
  So
The first thing that we're going to do is: we're going to set the currency. We're going to jump-in here. We're going to change that to Australian dollars. You'll see the default is US dollars. Because we're in Australia. What that's done is that it has enabled the Australian currency in here. But we no longer want to have US dollars available for our store so we will just turn that off.

OK:
First step done.

The next thing that we'll do is we'll just have a look at the taxes. We don't need to do it because the Tax Rates have already set it up for us. We have a Tax type here: it is called "GST". We have a look at it. It displays taxes of this type already included in the price, it has got some rounding rules, it is called "Goods and Services Tax". And we've got a Tax Rate which is 10%, which is actually the GST because that's what GST is. We can make it 20%, 50%, 150%, -0.1%: all sorts of things. I don't know why you would ever want to do that but you can! I am sure there are countries in the world where that's an important option to be able to have.

OK: so
That's our basic Configuration.

The next thing that we're going to do is: we are going to
>>build our Products.  [product types]

We click on View Products and there's three default products in, because we clicked on Commerce Kickstart install and told it to intstall demonstration products.

Our Farrari store is going to sell cars, so we want to go and configure it to sell cars. So the first thing we are going to do is: we are going to add a product type. We're going to call [in the NAME box] it a car. We are going to make it [typing in the DESCTRIPTION box] "a really good car that we can sell". And we are going to save and add some fields [on the MANAGE FIELDS tab]. So you can see: by default we've got the SKU - that's the part code.  We've got the title. We've got the price which we could delete if we wanted to. We've got a status which is whether or not a product is disabled, or something like that, so you can just disable the product. And what we are going to do now is that we are going to add [ADD NEW FIELD] a field for colour.  It's going to be a list of text type: a select list. We'll save that. This is relatively manual, but we are doing it for real so we will go-through [with it]. An allowed value list. Here is one I prepared earlier (you've got to take some shortcuts!). Now we'll save that . And that's done.

The other thing that we're going to do is that we are going to add some features for our cars which we want to sell. So we're actually going to make it a text field and we are going to allow multiple values once we get through. [presses SAVE FIELD SETTINGS]. Ladada dada.  [NUMBER OF VALUES] Number of values: unlimited. And of course we want a photo of our cars here. There's an existing field which we can use called a product image [near bottom of the screen] which we'll just drag-up and we might actually put that there. We'll put it in after the price because we can. And we'll save it as an image. It doesn't have to be "required". OK. That will do. We can play with the settings a bit later.

OK: We've got a product type.

  So
Lets go and  
>>add some Cars.

So - There's a quick navigation-bar-thing here. I click on add a product. We've got two options. I could click on a standard product. Or we are going to use the product type car. Call it F1. We'll call this our red Farrari. We'll sell that for $49.95 including GST: a bargain Farrari. Get them while you can. Limited stock available. We'll go for our red Fararri [image]. We'll set the colour to be Ruby Red. And this one can have Magnesium Alloy wheels. And we'll save and add another. We'll repeat this. F2: this can be our pink Fararri. We'll sell this one for $59.95. In case you're wondering why we have a pink Fararri: I asked a bunch of people what colour Fararris they wanted and  and Donna Benjamin said she wanted a pink Farrari, so we got that. [select] Penultimate Pink. This is going to be just for Donna. We'll save and add another one. Product SKU: we are up to F3. I think - I don't know what colours I have left. We'll go for colours this way. We'll go for a lime green Fararri. This is because Peter said he wanted a lime green Fararri. We'll call this "Lime Green Farrari". We'll sell this for $199.95 - it's a bit of a preimum model. We'll upload the image because I forget to do that sometimes. It is lushiously good lime green. That is alliterarion for you, in case you didn't notice. This one has no features because it is boring. And the last one, which is actually my favourite: this is my yellow starburst Farrari. Sorry if you are a Fararri lover. We are going to sell this for $499.99. We're going to add my starburst Fararri. And you can see it there: beautifull! It's yellow with red starbursts all-over it. [COLOUR DROP-DOWN MENU] It is a Yamourific Yellow Farrari. [FEATURES MENU IS PLAIN TEXT WITH A + SIGN TO ADD EXTRA FEATURES] Features: Starburst Paint. And while we're here we'll add another feature. A four-wheel drive Fararri. That sounds great!

OK: We've got four products. They're in our store. But hang on a second. They are not showing-up. Does anyone know why they are not showing-up? Yet. Yes: that's right. Those Fararris are not showing up in a product display.

   So
We are now going to
>>add a Product Display
.[Add Pruduct display on the 2nd row of the menu]
We are going to call [TITLE field under Create Product Display] it a Fararri. [BODY field] "Fararris are cool you should buy one". (There's a reason why I don't write copy). And here [PRODUCT]: this is where we set-up our links to our products. So we've got an F1, an F2, an F3, and an F4. So you can put as many fields as you want in there, separated by commas. It's an auto-complete field. It's nice. It just works. You can have one; you can have 10. It doesn't matter. You can have 100 if you want it. I don't know what it performs like if you have 100. Probably still fine. And we'll save that. And we'll save that. Good. OK.

And here's our Fararri. It's red. I can choose "yellow starburst Farrari". I wanted to do this so that I could show you what the yellow starburst Fararri looks like in all of its glory. And I just selected that here: and you can see the features updated; the image updated, the colour updated. I haven't done anything particularly special to make that happen. We've just added the fields to the product type. We added them to the standard product display straight out of the box. And that's what happens and that works. OK? That's cool.

Now: we are going to do a couple of nice little things. We don't actually like the product image being that big. So we are going to format that a little bit. We are going to manage the display. The default display of the product image. Now: this is where it gets a little bit messy.

You modify the display settings for each field on the product-type display settings; not on the product display settings. There are some things you modify on the product display, but these ones you modify on the product type.

So we are make this one - image type - we are going to display a medium image because it fits nicely, and we are going to hit save. Close that, and the page refreshes. And there we go. OK? Alright so far? All good.

So the next thing that we are going to do is:
we are going to come-in here and we are going to modify our shopping cart a little bit. I mentioned that this was all built around Views. So I'm just going to give you a little example of what sort of thing we can do. We are going to edit the view here. And what I want to do is: I want to add the product code into the shopping cart. So that when I come to see the cart I can see what the model number is, at the shopping cart stage. So we are going to add a field. And we are going to add the SKU field. Hang-on: that's not on the list. This is the first little bit of magic which I am going to show you. We are going to cancel out of there. We are going to use the relationships [menu] to add a relationship to the Commerce - to the Product. Er - that's not actually the one I want. I want the car. Hang on. No: maybe that is the one I want.  Add and configure relationships. Apply. OK. So we've got a reference here, theoretically, to the product. So when I come in here and select a product and choose "add", I should now have an option for SKU. There we go. It's in there. Product is linked. That's where the relationship is. Create a label. We'll rearrange that. And we want it to appear first because that's a nice place for it to appear. We'll apply that. We'll save a View. Come back. And there we've got the SKU. Product F3 is in our cart. And if we want to show Features of our product plugged-in there, or anything like that, we just follow exactly the same process. So if you wanted to: if I come back and add a red Fararri to my cart, and I come across to the checkout, and I want to show the colour in here, I could do exactly the same thing: add the colour field in the column using Views and it all happens nicely, all straight away; no particular work to make that happen. OK.
That's pretty much what we need to do.


  So
The next thing we are going to do is we are going to play with  
>>Shippingand shipping is the first time when I'm going to show you a little bit about how Rules works to configure the logic of our online store.

The first thing we're going to do is we're going to jump-in to Modules.
We're going to grab the Commerce Shipping Module,
We're going to turn-on the flat rate module, and the base shipping module.
And the Shipping UI (user interface) because that's how we configure it.
And we're going to save these things: click save configuration....
...whenever you are ready...as I said: if anyone is willing to buy me a faster MacBook Pro, I'm all willing.
So we're going to configure our shipping we click on Configure Store, come-in: click on Shipping, and that's all relateively self-explanatory. [moves to second tab called shipping services]. And what we are going to do is: we are going to configure two shipping services. We are going to configure a shipping service that is [types in title field] Standard Shipping, which we will call "standard shipping" [in the Display Title field]. We'll sell it for $15 including Goods and Services Tax. We'll save that.

We are also going to add a service that is free shipping ; free shipping, $0 including GST, flat rate. 
It could be $0 including GST: it doesn't really matter.

And now when we come in here [to the cart?] all of a sudden we have got our shipping information - and we popped this [delivery address] in last time. And we've got options! We can choose our shipping costs. We can get free shipping or standard shipping. I don't know why I should ever want to choose standard shipping if I've got free shipping as an option, so let's now build some rules which detirmine when those should be displayed, and then we'll test them, make sure that they work, and go from there. So we'll click on shipping. Click on shipping services. And we are going to use this configure component link to modify the rules which detirmine when this gets displayed. So for free shipping, we are going to add a rate for shipping service to an order, but only when we do a data comparison, and we discover when we discover that the commerce order - commerce order total amount - is lower than (hang on: we are doing free shipping aren't we? We'll do it this way) ... is lower than: what do you reckon? $150? OK.

Worth knowing a little trick of the trade: when you do this dollar comparison it is done in cents; not done in dollars. Now, this particular rule isn't multi-currency-aware and that can be done but that's just too complicate dso we won't worry about that. So if the order is less than $150 we don't actually want to give them free shipping; we want to not give them free shipping. There is a reason why we did that. I'll explain in a moment.

We'll come-in and we will make the opposite rule for the standard shipping. Add condition. Data comparison. Commerce Order: Commerce Order Total. Amount. We are going to click Continue. "Is lower than $150": that's what we set it to - right? There we go. It's there. And we'll leave that there.
   Now.
The reason why we set one rule as "less than $150 - NOT" and one rule as "less than $150" is because there is no less-than-or-equal comparison for the data comparison rule. That's the only reason why we did it that way. So if someone buys $150-worth of something: if we set one [rule] to be less than $150, and one to be greater than $150, and you order something worth $150, there's no shipping available to you and that's just a bit of a pain. That's why you do it that way. You could have quite complicated rules. You could have multiple conditions; you can have "or"s, you can have "and"s. All of those sorts of things. You can nest the conditions against each other, and pretty-much anything can be compared, and Rules is way-complicated, and there's brilliant screen-casts online. If you are writing rules, go online: watch the screencasts. And then when you are thoroughly confused, jump on IRC (internet relay chat): that's the way to go.

By the way, while we are here: if you're looking for an IRC client and you're on a MAC and you haven't found one that you like: there's this great thing in the App. Store called Textual. I found it this week. It actually makes IRC usable in my opinion, so I really like it.
   So
We've now got shipping in our store. And lets just prove that that works. We've got free shipping on this order. So let's go back, and let's modify our shopping cart, which presumably I can do by clicking here and press cancel. And coming in here. And it was $150. So lets just cancel one of these. So they're going to charge me shipping on my Fararri: what a rip-off! Seriously. (I could have just changed the quantity but I removed a very expensive item from my cart). Now my order is only - whatever it was - $15: give it a go. Now we've got Goods and Services Tax on there; it's got shipping at $13.64 ex-GST. You can change the order of those fields. We''l talk about that later. Pop-in a payment. Continue to the next step: order done! We are actually done! We've built our online store. It's fully functional. Beginning to end in under 25 minutes.

Just hang on a second. We'll get the microphone.


Q: Can you configure the shipping cost based on the post code?
A: Yes you can make the shipping - built on any rule. So you can do
- instead of a quantity-based comparison -
you can do an
- address-based comparison -
much in the same way that we do an address-based comparison to detirmine the tax rate. So I'll show you what the rule might look like, based on the tax rule. Here's the other place you can get to rules: configuration > workflow > rules. So this is just using the Rules module that's built-in to Drupal. And so in here we have a "calculate taxes GST" rule, and it's a general rule. We have an addition that's an "order address component" comparison. In here we've got "commerce line item", "order address", "country", bla bla bla bla bla.

Keep in mind that you're using the flat-rate shipping module here. Most of the time if you're using postcode-based shipping, your shipping is probably calculated from an external service like Australia Post Shipping Calculator, or you're making use of (in Australia) Star Track Express, or TNT, or any of the other big shipping companies, and they can expose their APIs (application interface) which they can expose. Then someone can write a module, (whether that be yourself, or someone that knows stuff about writing modules - whatever that is) - to integrate those things together. There is an Australia Post module in sandbox on Drupal. I don't know if has been released. I don't know if it works.

Q:I just have two questions for you. A: Yes. Q: One is:
If you currently have an existing site in Drupal 7 and you want to turn it into a Commerce site, how relatively easy...? I mean from what I've looked at it looks pretty relatively easy to just drop the Commerce modules in there and then turn those nodes into products?
A:Yes. That's pretty much all you need to do. (Q - I'm sorry: go-on.) A: And then the thing to keep in mind is that there are dependencies for the commerce modules so you will also be running CTools, Views, Rules, and a bunch of things like that, which most people are probably be running anyway.

Q: And just one other question:
If you've got a site that is currently in Drupal 6 / Ubercart (A: I'm sorry!) (Q: Not as sorry as I am: I've got wo work with it!) What would your recommendations be for getting into Commerce? Just literally starting fro scratch again?
A: Yes. I'm talking about this with one of my clients at the moment who has a quite heavilly-hacked version of Ubercart running their website. It's running a slightly older version of Ubercart that hasn't had security patches applied to it for a little while which makes me a little bit nervous. So we are talking about the fact that we need to get to Drupal Commerce with them at some stage over the next year, and we are going to re-build it from the ground up.
Q: [inaudible: about transferring data from Ubercart to Commerce].
I imagine it would be a relatively trivial module to export from Ubercart to Drupal 7 Commerce end-of-the-world. No one has written it yet. I have spent a lot of time looking at the tables in Ubercart and they're not all that sophisticated, so it could be done, but it's not something that... - it's probably not something for the feint hearted.
We are going to re-input all the products; we are going to re-input all the data, re-create the users. And, you know, that is a problem with choosing to run your business logic out of a web-based ecommerce platform: what is the upgrade path?

The guys that wrote Drupal Commerce were also the guys that wrote Ubercart, and in one of the rist presentations they gave publicly on Drupal Commerce, the very first thing that they said was: "Sorry". Ubercart is great provided it does what you want. If it doesn't do what you want then it's a little bit messy. The migration path is not very nice. Same with Drupal Commerce though. There are a lot of things it doesn't do. I started using Drupal Commerce when the first RC (request for comment) or Beta was released about 12 months ago. We half buit a site and got stuck because we discovered that a bunch of things weren't working and we stopped. And a lot of people have started working with Drupal Commerce just a little too early. I think in the lst three months is when it's really got to a point when it's mature enough that most of the things that you want are mostly there and mostly working. But it is a work in progress and the community is quite happy to help, so: get online and contribute.

Q:So where is all the link to the payment stuff? Does it link to Paypal and where do you configure that?
A: I haven't turned-on any payment methods in this example store, except for the example payment method which is turned on by default. There is a Paypal payment method. There is an Authorize.net payment method. There is Securepay for Australia. There's a bunch of different payment gateways which developers have written and made available on Drupal.org. If you want a payment gateway that isn't there it's relatively trivial to write one to put in there - or find a developer. There's a few good Drupal developers in Australia that work with Drupal Commerce that are happy to write payment gateways if someone pays them, because they have to put food on their table.

I think that's about it.

https://web.archive.org/web/20130413095747/http://www.youtube.com/watch?v=MS2P7PYaZ6A&gl=US&hl=en
http://drupaltv.org/video/building-awesome-e-commerce-store-25-minutes
is another lecture from Real World Technology on how to set-up Commerce Kickstart very quickly. The catch with both lectures is how to install kickstart on a server before the clock starts ticking, or else how to convert a standart drupal installation from something like scritpulicious into a drupal commerce installation. If there's a quick way of doing that - I'd like to know if anyone wants to comment.