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.




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.




 






Wednesday 8 May 2013

Why is this difficult?

I thought Wordpress was the simplest fresh start, but found that there is trouble in paradise too -
Wordpress.tv/2013/02/18/justin-sainton-wordpress-e-commerce-2/
...tells me that at 4'49" "whatever e-commerce software you use, it's going to be awful in some way", but that e-commerce developing has the best rewards in happy customers when it goes right

The knack of combining various databases into a site for someone who wants to focus absolutely on shopping carts and not learn anything else is, well, asking for trouble when it gets complicated. In the US, tax is complicated for example.

In the UK, shipping is complicated. Royal Mail is not kind to plugin-writers, so any free ones are likely to become out of date. And UK shopkeepers are mercantile people in a little country, unlikely to rule-out selling to Australia or Germany if an order comes-in. All that's needed is a matrix quote system for prices or weights verses zones. Royal Mail has three or four world zones, and you can add more if your products to the UK have different volumes or you use a courier as well. I have a separate post about Royal Mail's zones and prices for ecommerce developers.

Even if I buy a textbook about a wordpress plugin or a good clear set of videos by  on how to use Wordpress for Ecommerce and watch patiently while taking notes, I'm likely to find an un-acknowledged gap where shipping options ought to be. Or an intended gap.

Wordpress has several ecommerce plugins jostling for trade, but all the ones I have discovered tend to charge for vital things like breathing or shopkeeping or posting objects via special essential modules. So these programs are open source crippleware, hoping to make money by charging you for something essential.


On the other hand, wordpress users seem a lot more recognisable as real low-budget people than Drupal users. There are plenty of plugins for hosting your pictures on flickr or plus.google to save bandwidth and disk space. This saves money. This saves the amount you have to sell in a recession to break even. This keeps you fed when others fail.



 
Magento is another easy option, or so I thought, because nearly all my stallholding shopkeeping rivals use it.
I bet a packet of biscuits that it will have some kind of stock reporting system that can be used for wholesale customers as an essential, and for stock control as a desirable option.
I bet one of my hadgehogs that Shipping will probably be sane compared to other carts. You just fill-in a configuration column about how many countries you would like to ship to, and I haven't finished the instructions but I guess that everything might be included in the core program with no ifs and buts and demands for £50 software. I don't know if zones will be allowed, or if every customer has to scroll through a list of countries starting with American Samoa, but something will be available.

Instructions exist, by the way. You type your version and language into a site and it emails you a 250 page .pdf book to read beginning to end, or to page 45 in my case.

A nifty .php file will check whether your test server suits Magento, and none of my 100% free accounts allowed it, but a nearly free one called Freehostia Chocoloate passed the test. (Freehostia Chocolate is free if you have a spare mainstream domain). Officially is allows 250MB equalling 262,144,000 bytes of disc space. Five hours later my attempted FTP upload stopped for lack of space after I tried uploading 6,396,182 bytes from Bitnami as a first experiment. This was just the relevant-looking files in a folder called Magento. This does not come-up in the easiest-to-find comparisons of shopping cart software.


Magento finds cheap servers a problem, as does Drupal. The programs are gross.
My fast UK web server that I want to use for real shopkeeping has these price breaks for disc space. It's smaller than some free but slower ones. Prices are per year (developers please note that servers can be priced per year as well as per month)
0200MB £050 + 20% tax
0400MB £100 + 20% tax
0600MB £150 + 20% tax
1200MB £250 + 20% tax

Further Googling finds that Magento likes to cache a lot. It has complex internal tables. And I haven't yet seen a free plugin that lets you host your pictures on a free website. So, basically, I can see why I am still in business and some rivals who use Magento have been struggling a bit in a recession. Maybe that's why some of them are on slower servers.

As with other shopping cart software, enthusiasts who sell support or blog about the product seem unaware of why it's difficult or even doesn't work for so many users.

I have another post called Free Fast and Pretty: which shopping cart? but it is has no clear conclusion yet.



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.

Wednesday 13 February 2013

Inline Entity Form Module

https://vimeo.com/40933753 - I hope this transcript is copied and improved by others. http://lbt.me/Wyw is another page on the same subject, mentioned on the module download page.

http://commerceguys.com/blog/commerce-module-tuesday-inline-entity-form


Hi!. I'm Bojan and I work for Commerce Guys.  This is Commerce Module Tuesday. Today I will show you the  Inline Entity Form Module. [included in some commerce kickstart installations]
It provides a complex widget for reference fields that allows to modify and delete reference entities inline, as well as at
For Drupal Commerce, this means that it solves two important use-cases.
  1. First of all it unifies the management of product-displays and products, allowing you to handle both, from the product display, and edit pages.
  2. Secondly, it also provides more flexible line-item functionality, giving you the ability to modify custom fields that you attach to the line items.

The management of Product Displays and Products

[there is a comment below which might make sense of this]

Let me show you what I mean. I have here a Commerce Kickstart 1 installation [the one with Product One, Product Two, Product Three on the front and a standard Drupal admin menu] , and I have already downloaded and enabled the Inline Entity Form module - the Beta 1 version. [which is included in Commerce Kickstart 2 by default].

Lets imagine for a moment that we are building a website for a  company that sells T shirts.

I already went-ahead and created a new
Store > Products
 + Add product type
product type called T shirt. Aside from the usual fields like Image and Price, it also has the Color and Size fields, which point to the vocabularies which hold the allowed colours and sizes for a T shirt.

In e-commerce language, a product can have several variations. So a sample T shirt can have a new variation for each of the combinations of Color and Size, and each of those variations has a different SKU [part number]. So in Drupal Commerce this means that for each variation, you create a new Product, and then you create a new Product Display that references all those variations, and allows the user to select the correct one. So I have four sizes and four colours. I need to go to the add product page [clicks "create T shirt"]
Store > Products
 Create Product
   a basic product type.
 Create T shirt
 ...and create sixteen different products. Then I would need to go to the...
Products > Actions > Add a product
  Add Product Display
...page, and reference the sixteen products that I have created.

The product display field looks like this, at the bottom of the product page.
I can't find it on the page though. This is where, for me, the video is ambiguous and I do not know how to follow it in order to set-up shop, even after transcribing it carefully. It is better than average among the videos transcribed here, but I guess that the people making the videos do not know where they make sense or don't make sense, and that's why there is often a bit that's impossible to follow for some people watching.

Product
Choose the product(s) to display for sale on this node by SKY. Enter multiple SKUs using a comma separated list.


I'm going to go to Structure > Content Types > Product Display > Manage Fields (which is 2nd tab) &
you will see here (4th line) that we have a Product Reference Field. I am going to edit it.

The first thing is that I am going to change the label to Product Variations because it is slightly more user-friendly in my opinion. We are going to delete the help text because it is not going to be shown anyway.

And I am going to limit the product types that can be referenced to T Shirts alone,
Product types that can be referenced
Product
T-shirt
[using a tick box under the help text field labelled "product types that can be referenced" and un-ticking "Product"]
and save that [using the grey save button at the bottom of the page]
Now I am going to edit it again [using the edit tab to change screens],
Structure > Content types > Product display > Manage Fields > Product Variations

and change the widget to the Inline entity form.
CHANGE WIDGET
Widget type

Done.

So:
36'36" Let's go ahead and add a new product display now. [does so on screen]

You will see when you scroll-down that, instead of having a simple product reference field, I now have the complex vision that is provided by the inline product entity form. I have a product-variation inline-form opened by default. And that form contains three groups for all  the product information. So,
in the first group, I have product atributes,
in the second group I have the SKU, [types on in] the price, and then any other custom fields that might be added under 'attributes', and
in the third group I have variation image. [uploads image]
So I click
...and the first variation is there.
Let me go-ahead and add a few more.
[does so]
So: all of my variations are now here.
I have added all of them from the same screen: not leaving the product display add-product page, and not needing to know anything about Drupal Commerce architecture underneath.

If I need to, of course, I can delete a specific variation. For example this one
And of course I can edit the ones that I have already added
Clicking the edit button opens a form right below the row being edited, and allows me to change the inforation that I want to change. [changes a price on screen as an example].

So, I go ahead and save that [using a button at the bottom of the screen]

5'32" And you will see that it now works!

And I also want to make it possible for the user to reference multiple product types. In which case they can go back and enable the...
Product types that can be referenced
Product
 ...product as well. And now when I go back, [clicking to another browser tab] you will see that the widget has changed.


Instead of just having an "add variation" button, I also have a drop-down option to select the appropriate product type. If I click "select product" and click "add", I will get an add form for this product type. Which for example does not have any attribute fields. Different product types have different attributes, which are not shown in the table itself. Instead I have the variation title. And this one is automatically generated by the ???? form, by taking the node title and appending any attributes, if they exist.
6'30"

Of course, you can turn this functionality off if you want to. So...
I can, once again, go to the INLINE ENTITY FORM field set, and disable auto-generating of the product title.

INLINE ENTITY FORM: COMMERCE PRODUCT
Auto generate the product title

press save

So now [going back to the previous page] I now get an actual Variation Title field on the add and edit screens, allowing you full control over the product variation type.

7'00"

We currently don't have a UI (user interface) for detirmining which columns should be shown in the table. There is an open issue in the issue queues (on the Commerce web site discussion board). Feel free to comment on that. And that's it for managing products!


modify custom fields that you attach to the line items.

Lets take a look at various cases.


So: these T shirts might have the customer's name printed on them.

So I have added a custom field to the line items called Print Name which allows the customer to enter the name which they want to be printed on the T shirt. [this shows to customers next to color and size. We act like a customer fill it in with the name Bojan, then press order buttons to take this T shirt through the shopping cart]

Now, the problem occures when the store administrator looks at the orders
Store > Orders EDIT Tab
So he sees one and goes to edit it [an edit link on the line leads us to tab two of three], but he has no way to edit the print name field, and if he tries to add a new T-shirt, he can only select the product, but not actually fill-in the print-name-field or other custom fields that might be added.

One again, the inline entity form helps-out here. So I can go to
Store > Configuration > Order settings> MANAGE FIELDS tab
[looking at a table ith columns LABEL, NAME, FIELD] - you will see that I have a line-item reference here, with the line item editor widget. [the last two columns are WIDGET and OPERATIONS, which included EDIT and DELETE]. [Clicking on "edit" leads to another tabbed page - EDIT, FIELD SETTINGS, WIDGET TYPE, DELETE. We click the WIDGET TYPE tab and see a drop-down menu.
and change the widget to the Inline entity form.
CHANGE WIDGET
Widget type

And now when I go back to the same
Store > Orders
page, you will see that the widget has changed it. [the culumns for each line shown under the EDIT tab are
LABEL, UNIT PRICE, QUANTITY, TOTAL OPERATIONS, with

showing in the last column. I now have a proper edit button allowing me to change all the information on this line item, including the print name field. I can also add new items, and fill-in all the relevant information.

So: that's it for the inline entity form [module of included in Kickstart 2]. Feel free to provide feedback with the issue queue, Internet Relay Chat - and see you next week!.
 

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]


Tuesday 25 December 2012

Happy winter!

The new Commerce Kickstart installation is OK with a few error messages "right out of the box" as they say on the videos, and seems to work very slowly. Ignoring the error messages, I know from using Drupal Core that there is a heading in the menus called performance for things like cache to turn-on and make it fast. How to turn them on in Kickstart?

  • Core Drupal 7: I can speed-up the program by turning-on the cache (but I can't follow instructions for adding a product which is tricky, so I'm not using this dashboard for my shop). In Core Drupal, I try menu options until Configuration: my speeding-up options are in a box there marked Performance. Once there, the path reads:

    Home » Administration » Configuration » Development 
  • Commerce Kickstart 7.2: I can begin to follow instructions for adding a product, but I can't speed-up the program by finding the cache setting and turning it on. Moreover, the jargon has changed. Core Drupal had nodes and now has content. Commerce Kickstart has - something I still need to get my head around, which uses other terms.

    Found the answer! There are two settings menus and the second hides a lot of tekkie stuff away somewhere where I thought I'd looked, but had missed it. It's easy to miss something called Development when you know you're not a great developer. Trying the Kickstart web site it turns-out that I have asked this question before and got an answer, suggesting that cache still does exist so I had another look.



I was going to post a great picture of a man in Pants to Poverty undies standing next to a decorated cow, but their Shopify site is down today.



Update: Pants to Poverty have a picture of a dressed-up cow back online today, and I have disabled the overlay module which helps according to guides like http://friendlymachine.net/posts/2011/5-ways-to-improve-performance-in-drupal

Update: Pants to Poverty are now on http://pantstopoverty.org.uk

Oh. That page doesn't mention disabling the Overlay module [done] and replacing Toolbar with Admin Menu as other googlable pages do. Do I loose the toolbar if I disable the Toolbar Menu? Probably. One thing I did notice is that the module list is most easily searched from the top left index to modules called "All". I used this to disable the Jiraffe module, which eats money.

A note for later is that the Boost module works on cheap shared hosting where Memcached doesn't.


https://www.youtube.com/watch?v=aJcJbKaCZJs is a Lynda.com video that shows pictures of the sites that speed-y-up modules come from, but doesn't say much about which work with which.