Showing posts with label Drupal 7. Show all posts
Showing posts with label Drupal 7. 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.



.

Monday 27 May 2013

Space Hog

http://www.freelock.com/blog/john-locke/2011-10/top-6-reasons-drupal-really-sucks-developer-edition

...teaches me that I'm not alone in finding Drupal a space hog for space cadets who do not pay for their own server space. Apparently this is a bad side to its good side - enough hooks for a knitting machine, each of which can open some memory-based function or other. I also read about its history. Recently a collection of modules which were sometimes supported or sometimes released as a favour to other savvy coders, then transforming into a platform for using Rules and Views modules. I was going to add a picture of a space hog, but that's a distraction and anyway it was mocked-up: the pig did not suffer. Do not send pigs into space.

Space Hog
By the way, why to americans say "sucks" for "bad"? Is this a macho thing? There's a strange convention that you search for X+sucks to find what's wrong with something.

On the same page I discover that a system called Code Igniter with a flexicart add-on is designed for cheapskate shopkeepers who play on their computers. Maybe in a week or two I will find another web page called "why code igniter is bad" (or kicks ass for bums or whatever americans say). Meanwhile there is a Bitnami windows stack of programs to run it so here goes: it should have downloaded by now.

http://bitnami.com/download/files/stacks/wampstack/5.4.15-0/bitnami-wampstack-5.4.15-0-windows-installer.exe?with_popup_signin=1

Oh: an hour later I am still making sense of Bitnami instructions. Apparently Code Igniter is not pre-installed in the same way as Wordpress or Drupal. There is some requirement to understand how these stacks of programs work in order to start it and see what it is, in order to understand how it works. Learning about software by trial and error is slow, sometimes.




Tuesday 26 February 2013

Ambiguous instructions and hidden costs

  • Ambiguous instructions
  • Hidden costs

These are the problems for Drupal, made better or worse by evangelical support from people who give lectures or go to groups. It seems rude to someone who is saying "straight out of the box" in a lecture that the thing does not even turn-on for some parts of the audience. It seems rude to parts of the audience that a product does not work from available instructions, and incurs hidden costs.

Just for now I will experiment with Wordpress E-commerce but hope to come back when the first textbook writer dares put instructions in print. I have paid my deposit.

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 8 April 2012

Drupal Commerce Product Display Module


Commerce Product Display Manager


Hi, my name is Pedro Cambra from Commerce Guys with another Commerce Module Tuesday, & I am here to talk to you about Commerce Product Display Manager, or short name Commerce PDM, which is really a great way to simplify the way that you manage product displays & products.
So you will probably find this module useful if you are managing an online store with Commerce because Commerce has a relationship with products & product displays that is 1:1, so you don't have or have not so many ???tomany ???ations in this scenareo. So if you are using a 1:1 relationship between product displays and products you will probably find this module really really useful. So lets demo[nstrate] it. (So) I have had Commerce Kickstart simple installed, just with the product display manager enabled. And - This module provides two different things.

1.Automatically creates a display.
The first one is that if I add a product in the screen of creating & editing products ...
[admin>commerce>products>add>product - screen headed "Create Product" with "View Products" highlighted]... you will see this widget here on the bottom. [below statuse active/disabled, Change History: widget is headed "Referenced By". It has two links: New display node | Existing Display Node] ... that allows me to create a new display node, or use an existing display node in the same screen that I'm [using for] creating the product.

So let's create a new product.
Give it the SKU 04, [call it] Product 4; that's $40. Suppose - I don't care about the content of the node: I just want a node to display this:  I could select any Poduct Display content type [that] I have [from the "type" dropdown menu]. So.

Just adding the detail: it will create - it has just create a new node, for referencing this product. So I just need to save the product. So I have the Product 4 [on the list]. And if I go to Content [from the top menu in admin] I have Product 4 displayed. It has the title and the product reference field filled-in. So if you have many fields you would probably need to edit this afterwards.

Also notice that this is "published" and not "published and promoted" so if you have Commerce Kickstart, as I do, you will need to go to "Content" to find this new node.

[from "View Products" on the second line of menu options in admin]
So you can also edit your products - say that is Product 4 - I will need, or I want a new node, so I can charge for the product. You can probably see the node ID but you can search for the details [that] you can reference, here. And delete, with a fancy javascript interface so, that's great.

2a.Store> Products> Display Manager tab ..
So the second thing, once you have installed this Display Manager Module, is  this stuff here in the product list. So if you go to Store>Products you'll see your product list and here, in the top, your Display Manager tab. 

And in this Display Manager, you will see a drag-and-drop interface. So you can change your products on display, and assign products, just with drag-and-drop. (And) You can delete both the Products, and the Product displays, add new products, etcetera. So it is a great add-on if you have a need to manage the Products this way, with a drag-and-drop and a javascript interface.

(So) when you save something, it is in a batch process and it is a really cool feature.

2b Using a rule instead of a module
(So) if you don't want to install this module, because you don't want this interface exposed or whatever, there is an issue in the Drupal Commerce queue, which is called "Rules to mirror product displays when products created/updated/deleted". It is self-explanatory. And here you will find a bunch of rules. Probably you will be looking here at the bottom. And I have just proposed one here. So when a Product is created, a display is created with the same information as the product. 

(So) you go back - sorry: - If you go back to your interface, and you access the Rules interface which is in 
Configuration>Rules, you can import one [rule]. So I just paste this code here, and import. (And) you will find your rule which is defined Create Event Display at the bottom here. (So) What is does is that after saving a new Commerce Product, it creates a new Entity. Let's see the details: it's a Node of the type Product Display, with the same title as the Product which we have just been creating, and with the same author. (And also) It relates the product to the product display with this ? add-an-item-to-a-list


With some filters here

the Commerce Display is filled with the Commerce Product. So - erm - you do not need to know a lot about Rules: just understand how the flow goes.

So this thing will do that. If I add a new product, which is SKY -05 (keeping in order)

product 5
[something about price]
I'm not adding a new reference or whatsoever. I save the product: product saved. And if I go to content, I have the Product 5 - ? - product 5 with the SKU related. So you will find in this - in this, er, issue : a bunch or fuyles will probably help you in this task. ? Also for date and delete.

And, also, if you want an interface with the product and the product display on the same page, and you are a little savvy at coding, you could take a look at this excellent post by Amitai on how to use the module Subform to use the interface of Product Display and the Product in the same screen http://www.gizra.com/content/commerce-product-subform
(So) I hope you enjoyed this Commerce Modules Tuesday with a little few extras on the end, and see you in the next one!



Wednesday 29 February 2012

Tuesday 21 February 2012

Drupal 7 doesn't work on cheap hosting. (This is a secret designed to annoy people when they discover).

This is the conclusion I have reached after loads of developer videos failed to tell me: they use dedicated servers or their own hard discs.

The problem seems to be memory limits which have risen by mistake for no particular reason. Just as a Ryan Schama talks about "project creep" in his lecture, Drupal 7 has a Server Memory Creep towards needing an expensive host which nobody advertised or planned: it just happened and caught a lot of people out.

For those on the borderline there are three cacheing products

I find this frustrating because I did a bit of research over a year ago, trying to find out how to make a low-magin, loss making business sell more and at the time Drupal 6 / Ubercart was the fastest-loading software and I searched for days to find the fastest cheapest host. Now the calculation is a different one which rules out this host and this whole school of software together, and probably Drupal software altogether. I have spent over a year trying to learn the XYZ thing while shopping carts have forked and re-built themselves. Now I discover that I should have gone with Virtuemart in the first place. Such is life. If you read about an american going crazy and shooting people in a shopping mall, maybe they had just tried to install Drupal. Or maybe it was looking at the awful overpriced stock in TKMAX that did it. One of the two.

What other annoying things are there in life? Youth is wasted on the young? Trades unions let you down when you get an unfair dismissal? Radio station editors don't like news or music? Maybe I should petend to be a Bonobo Monkey and live in a park where zoo keepers will feed me.


Monday 2 January 2012

installing products on Drupal Commerce Bulk Product Installer

Vimeo.com/34385004 - video -


Hi this is Pedro Cambria from Commerce Guys in another commerce module video. This week I'm going to show you how to use Commerce Bulk Product Creation Module. This was the first contrib[uted] module created for Commerce, and allows you to bulk-create products. Basically if you [...?...] of your SKU, or you can generate your SKU easily by tokens, this module is going to be ideal for you. It manages the creation of the product, but also, when the product variations are created, this module has also [got] options to manage the displays associated with these variations. What this module doesn't manage, as yet, is to edit or modify the products once created. [1']

OK. For this demo I have Commerce Kickstart installed, with these modules already installed: you need:
  • Commerce Bulk Product Creation commerce_bpc, and we see also the
  • [included but to be enabled - "Just to be sure: Did you enable the "Enable this field to function as an attribute field on Add to Cart forms." under "Attribute Settings" in the field settings of the taxonomy fields? This is currently required."] Taxonomy Reference Integration bpc_taxonomy
OK. I have also a couple of product types. If I go to Store>View Products>Product Types tab, I have a
  • Product with a single attribute, and a
  • Product with taxonomy attributes to demonstrate how this module works.[So how do I get one?]
OK. The first thing you need once you have installed these modules is to have a
Field (Store>View Products>Click on product created with a single attribute>manage fields) [2']
or some fields of list type . Also boolian. And if you have the taxonomy_bpc module installed you can do this with taxonomy fields as well. So I have this Genre field created here. It's a list of texts. And here [further down the page in a box] you will see Bulk Product Creation options. We are going to use this field for bulk product creation operations. And we have that field that's an attribute in the cart. So. We have three allowed values [in the allowed values box]

For Bulk Product Creation you have to go to
Store>Products and in the Product listing you will find [just before "add a product"] a link [3']
"Bulk Add Products".]
If you click here you are prompted to select one of the product types you have more than one that are eligible to be created by this massive operation. If you have a product type without any field that is eligible for this, it won't display and you won't be able to use this module. So if you don't have a list field, a boolean field, or taxonomy fields, you won't see the options here.

Let's select a simple one. You'll see the interface of the module. [headed "Bulk add Product with a single attribute" in white, and "Bulk Product Creation Form" in black] Let's go step by step.
  • First you have the Product Information. You can field [used as a verb meaning to fill-in the box or field] the SKU. This uses tokens to generate the values. Let's call it "PRODUCT". On the right side you will see ["example variant SKU PRODUCT --Action"] an example cocaffeinated [?] as an example. It gets these examples [Genres: Action, Comedy and Drama appear] from the combinations. You need to set a price - a fixed price - for each variation. And a Title. That works the same way as the SKU [in being a form field to fill-in]. So you can see an example of how a product is created. You can configure this and we will see that in a moment. 
  • Then you have the combinations. [headed COMBINATIONS in blue]. The combinations you can select. For example if you don't want to get Comedy generated you just fill this out and it won't generate it. Or you can select everything. [all options shown highighted in white on black]. 
  • You also have "STATIC VALUES" [a blue heading to a box at the bottom of the screen]. You have combinations, and if you have fields that you generate as static; it won't generate any combinations for that.
We have create products; we have create products and create product display. So let's create product display in a minute. If you click - this has actually generated three new products. There are the three products that are a combination of our fields.

You can configure how the bulk product creation module behaves. If you go to store>configuration>bulk product creation, you have some options here [on a page headed "PATTERNS" in black under "Bulk product creation" in white]
  • You can define the SKU pattern, [6] with whatever separator you want, or whatever.
  • The Title as well.
  • And you have Tokens support for this. Some of the tokens you can use - title; a combination of values, and also you have the  
  • display node settings.These are very interesting because here is where you decide if you want to create a display associated with the product. You can have the [radio] button "save and create display" [selected], and you will get into a pre-populated display form with the product generated. 
  • You can avoid [destracting attention] from the user with this. You can [as it says on the screen] silently create a display node automatically, so the user won't notice. An excellant way to start hiding the user's display if you don't want the user to see that.
  • You can also create a display for every product. [it says "create a display node automatically for every product created] These [top two radio buttons if either is selected] will create a display for all the products created in a work operation, but this one will create a node for each product; it will associate 1:1.
  • And you can hide the display node fortunately. [this is the last of the 4 radio button options]
Let's use this first option [of the 4]. [Going down the screen to settings for created display nodes] You can also select a content type for the node created.

[Going down the screen past Tokens to "after successful bulk creation, send the user to -"
There's you're redirection. By default you get redirected to the list of products [first radio button] but you can also select a custom location and set the path here. So let's select this and let's...
[8]
...take a look at our other product type. We have a second product type with taxonomy attributes. I created a couple of taxonomies - one for colour and one for size. Size and colour and associated term reference here. So they are exposed to the bulk product creation, and also exposed as attributes in the cart form. OK. So if I go to products>bulk add product with taxonomoy attributes , I will have the same product information here for the fields SKU, Price, Title. Here [appearing to the left of these fields on the form] are the examples of what it will look like. So you have the combination. And here [on two new drop-down select menus below] we have all the combinations we want. If we select all of them we are ending with nine products created, but you could also avoid to create a combination for a small size, or just create it for a small size. If you have many fields, all of the values are going to be displayed here, so you can safely select whatever you want.
[10]
So after the field creation settings, let's create the product and create the display.
I'm going to end. This is the Node form. It created [states "successfully created nine new products"] nine new products. We are in the product display creation form. When you are here you can fill all these fields for the display. And here in the product selection you will have [in a separated list] all the nine products that we have just created. So we save this [presses save; goes to the front page]. We have the product, we have the size, and we have the attribute form created.

So check the whole [node] page [on Drupal.org] for the latest changes because this module is in active development. [11] There is a 1.0 branch that is stable, and all the new features are committed to the 2.0 branch. Bug fixes are of course committed to both branches. Thank you to Sven Laeur for maintaining this module and keeping-up to the active development. And also, if you are using entity reference with Commerce, you may want to check this entity extension; this entitiy reference integration ... which allows you to create values based on the values of the entity reference field.

I hope you enjoyed this commerce sworay and see you in the next one.[answers on a postcard please]

Saturday 10 December 2011

Just in case somebody asks, these are the three ways to install Drupal and reasons they don't work for me. I'm writing this in case I need to brief someone to help.
  1. A one-click install from the control panel of a server.

    (a) Doesn't install the Kickstart version of Drupal Commerce Shopping Cart. This is a bit like a comfort blanket - I think I've learned to do without it - but as the program doesn't work without a lot of tweaking unless you have this installation profile, I'd like to be able to start from the Kickstart version every time I need to.

    (b) Puts too much strain on the server if I need to install extra modules. The program is a bit too big to do this on a middling sized server. So I would have to download it onto my hard disc somehow, do the updates and fixes, and them upload it to the server again. This is in fact what I want to do but starting on the hard disc. It comes to the same thing; I still need to back-up everything to my hard disc, tinker there, and upload again.
  2. Unpack Drupal on my hard disc, follow rather intricate instructions for file transfer to the server, and turning-on a the database to recognise all these files.

    With luck when I upload I get a welcome screen asking questions like "is your database called localhost?" and the thing installs itself. It's a bit of a black art the first few times but I think I've got the hang.

    Unfortunately Drupal 6 could almost work like this but Drupal 7 is just too big, and if I stick to older releases I will be missing-out on a lot of shopping cart modules. When I try to install, the server just says it's out of memory and the helpdesk says this can't be changed.
  3. Unpack a server onto my hard disc - a set of all the programs a server needs - and press the "import" button to import a version of Drupal, which could be Drupal Commerce Kickstart for the first stage of a shopping cart.

    This is the only system that could work and sometimes it does. I have managed once to install Drupal Commerce Kickstart onto a server program called Aquia Drupal Desktop, and from there managed a slightly laborious way of importing the data from its database to the one on my proper server that the world can see.

    Unfortunately my installation doesn't work. It finds error messages in every other thing it does. I guess this is because I should have updated or uploaded a load of files that go with Drupal's database onto the server, and I just deleted them thinking that the ones already there might do. Now I can't repeat the actions which worked in the past for this step three.
Even if I could get the thing installed there would be a bit of work laying-out the site using various layout themes or writing one, and I might be quite accident-prone at that.

Saturday 1 October 2011

http://www.vimeo.com/22748684 How you can build a taxonomy based catalog

https://vimeo.com/22748684 30/02/2011
Hullo everybody, this is Ryan Szrama with Commerce Guys. I wanted to show you today how you can build a taxonomy-based product catalog in drupal commerce as I have done on my demo website: http://demo.commerceguys.com/dc/


If you look over here in my sidbar you will see that I have a catalog Block that lists out ["coffee holders", "conference swag", and "wearables"]
catalog catagories that are actually  
taxonomy terms linking them to their 
taxonomy term Pages:
http://demo.commerceguys.com/dc/catalog/coffee-holders
[this shows differently on the video because it shows the site when logged-on as admin. For admin, the term page shows a coffee holder with two tabs, "view" "edit", a paragraph describing the coffee mug and an add-to-cart form with a drop-down list, that moves your page from the one about black mugs to white mugs]
Term Pages in Drupal 7 have been enhanced a little bit, allowing you to
  • specify custom urls, [eg coffee-holders] allowing you to 
  • display a discription on a page, and giving you 
  • both a view and a quick edit link here to edit the Taxonomy Term settings.
This particular one - Coffee Holders - has the description and it shows all of my -er different coffee holder products on the demo website.
This ["read more" link under the mug picture] is just a Node Teaser List of product display nodes. The product display node being a special node type that I've made that has both a
♦ Product Reference Field on it, that turns into this handy dynamic Add To Cart Form, and then it also has a
♦ Taxonomy Term Reference Field on it,
which you can see here lets me to tag this node with a particular taxonomy term and links it back to its term page.
http://demo.commerceguys.com/dc/catalog/coffee-holders/mug

1 Create a taxonomy vocabulary


Now if you wanted to build something like this yourself, the first thing you would need to do, is to create a taxonomy vocabulary for your catalog:
example.com/catalog/coffee-holders/mug#overlay=admin/structure/taxonomy
admin>structure>taxonomy>edit vocabulary [pictures at about 1'24" on the video]
So you can see here my catalog vocabulary, and if we look at the terms I've listed, my three terms are each present, and each one of them has
  • a name, 
  • a description, and 
  • a custom url alias that just provides a nice search engine friendly url for this term page on the front.

2 Go build a menu; enable a bloc


Once you've listed out each of your taxonomy terms, the next step is to go build a menu for this.
So I'm going to go to stucture>menus, and you can see here that I have a catalog menu, where I have manually added links to each of the term pages.
[screen shows remembered "search engine friendly url" typed into the box. This can be found by going back to >structure>taxonomy>edit vocabulary to cut-and-paste]
Er - Whenever you create these links you can actually use the search engine friendly path that you have defined, and whenever you save this menu link, it will be converted to the actual Drupal path that has been assigned to that taxonomy term.
Whenever you create a menu you automatically get a block, that you can then enable, to show that menu in any of your sidebars. Here ...
structure>blocks [first option on the structure tab]
...you can see my catalog menu block has been placed into the first sidebar. This is a region in the Corolla theme which now has to be installed after Adaptive Themes Core. Once installed it has a tab on the blocks menu. From that tab you see the options shown in the video, where shopping cart, catalog, user menu and user login are all selected for the first sidebar, and I've configured this bloc...
[from the "configure" link on the "catalog" line]
...to not appear on checkout pages - notice I've used checkout asterisk so it will block all of the checkout pages, so that whenever you go to checkout and are in any step of the checkout process, er you do not have a sidebar. I did this to reduce distraction and noise on the checkout form so that the customer doesn't have distraction and when they're trying to complete the checkout process and give you their nolas.
Once you have
♦ built the taxonomy vocabulary,
♦ the menu item,
♦ put your bloc in place...

3 Create a Product node type


the next step is to actually have nodes showing-up in your teaser lists. Drupal Commerce will install a default product type whenever you first enable everything.
store>products second tab is "product type"
On this demo site I also have a T shirt product type, um, for my T-shirt products, er: I'll discuss that in a different screencast [about sized products].
Once you have product types though, the next step is to create a product display node type. So I'm going to go to my Content Types menu.
structure>content type second option on the structure list
You see here I have a product display node type, and the reason being: even though I have product types in the back end, I can list out all the products on my website on the back end, there is no automatic point of display for them on the front end. We've separated-out the front end from the back end in Drupal Commerce, er so that you have a lot more freedom to detirmine how you want to display products to your customers. Whether it's through product display nodes as I am , or some other method involving Views, or Pagemanager and Panels, or something else entirely!
If we look at the fields that I have put on this product display node type, you can see both my product reference field, and my [Taxonomy] Term reference field.
I like the autocomplete textfield wiget...
https://drupal.org/project/autocomplete_widgets
...because it lets me enter products on this node, using the product SKU with the product title with an autocomplete. And I can have as many as I want to, without having to bother with the multi-select select list, or perhaps just an overwhelming checkboxes list if you have many products on the website.
I also have a catalog catagory term reference select list.
So what you do is:
whenever you add a term reference field, you have to choose which vocabulary this is for, and then of course the widget select list autocomplete radios [radio buttons] so that on the product page - which I'll go to this right now - um so that on its edit form, you get to specify how exactly... - I'm denoting which catalog catagory this belongs to. So you can see here my Product Reference Field with the autocomplete, my catalog term reference field with the select list, and again how this is presented on the front end, with an add to cart form, and a link going back to the term page.
Well those are all the things that you need to know, to build your taxonomy based drupal commerce product catalog. Let me pull-up a .pdf here that shows you the different steps: [the order is slightly different on the .pdf]
♦ Create a "Catalog" taxonomy vocabulary, with terms for each of your categories.
♦ Create a "Product display" node type using a product reference field and a term reference field, and create nodes for your products.
♦ Create a "Cataolog" menu and display its block.
♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦
forum thread