BLUE-BAG
GUY SCHNEERSON

DRUPAL: guy_schneerson

GUY@BLUE-BAG.COM
TWITTER: guy_schneerson
www.blue-bag.com
Established in 2000
Deconstructing Drupal
Commerce
blue-bag
Deconstructing Drupal
Commerce
This is going to be a non technical presentation
and no Drupal knowledge is required.
!
If I use words like “Contrib module” that don’t
mean a thing to you or I stop making sense then
do stop me :)
blue-bag
Commerce
Kickstart
A shop distribution
based on Drupal &
Drupal Commerce
Text
blue-bag
A shop with all the bells and whistles
A solution that competes with all the other
big players out there
Text
blue-bag
A shop with all the bells and whistles
A solution that competes with all the other
big players out there
blue-bag
The real power of Drupal
Commerce
Comes from the
components that
make up Drupal
commerce
blue-bag
why does it matter ?
What makes a framework based on distinct independent
components better then a highly featured solution?
blue-bag
why does it matter ?
What makes a framework based on distinct independent
components better then a highly featured solution?
• It is impossible to think up of every use case
blue-bag
why does it matter ?
What makes a framework based on distinct independent
components better then a highly featured solution?
• It is impossible to think up of every use case
• The more features, the more permutations – difficult
configuration & more prone to bugs.
blue-bag
why does it matter ?
What makes a framework based on distinct independent
components better then a highly featured solution?
• It is impossible to think up of every use case
• The more features, the more permutations – difficult
configuration & more prone to bugs.
• It is easier to focus on individual components than
on one large system
blue-bag
why does it matter ?
What makes a framework based on distinct independent
components better then a highly featured solution?
• It is impossible to think up of every use case
• The more features, the more permutations – difficult
configuration & more prone to bugs.
• It is easier to focus on individual components than
on one large system
• Individual components have more use cases – more
use cases more people using and testing – more
robust and flexible components :)
blue-bag
Take control
By understanding the components that make Drupal
Commerce you can:
blue-bag
Take control
By understanding the components that make Drupal
Commerce you can:
• Put them together in new ways, creating new and
unique products.
blue-bag
Take control
By understanding the components that make Drupal
Commerce you can:
• Put them together in new ways, creating new and
unique products.
• Customise to your needs
blue-bag
Take control
By understanding the components that make Drupal
Commerce you can:
• Put them together in new ways, creating new and
unique products.
• Customise to your needs
• Adapt - because things never stay the same
blue-bag
The Drupal building blocks
blue-bag
The Drupal building blocks
• Entities - Are data types that can be extended by code
and configuration
blue-bag
The Drupal building blocks
• Entities - Are data types that can be extended by code
and configuration
• Views - A visual tool for producing lists and reports on
any Drupal entity type (you can even extend it to work
on other databases you may have)
blue-bag
The Drupal building blocks
• Entities - Are data types that can be extended by code
and configuration
• Views - A visual tool for producing lists and reports on
any Drupal entity type (you can even extend it to work
on other databases you may have)
• Rules - A visual tool for building business logic using an
Event - Condition - Action
blue-bag
The Drupal building blocks
• Entities - Are data types that can be extended by code
and configuration
• Views - A visual tool for producing lists and reports on
any Drupal entity type (you can even extend it to work
on other databases you may have)
• Rules - A visual tool for building business logic using an
Event - Condition - Action
• Widgets - for data editing
blue-bag
The Drupal building blocks
• Entities - Are data types that can be extended by code
and configuration
• Views - A visual tool for producing lists and reports on
any Drupal entity type (you can even extend it to work
on other databases you may have)
• Rules - A visual tool for building business logic using an
Event - Condition - Action
• Widgets - for data editing
• Formatters - for displaying fields
blue-bag
The Drupal building blocks
Rules - A visual tool for building business logic using an Event - Condition - Action
My Silly discount
If the name of the user is Guy
Set the price to Zero
blue-bag
The Drupal building blocks
Rules - A visual tool for building business logic using an Event - Condition - Action
I love this site its
all free (as long as
your name is Guy)
blue-bag
Add to cart
blue-bag
Add to cart
blue-bag
The Drupal building blocks
blue-bag
The Drupal building blocks
blue-bag
The Drupal building blocks
blue-bag
The Drupal building blocks
blue-bag
Drupal Commerce Entities (Data Elements)
blue-bag
Drupal Commerce Entities (Data Elements)
blue-bag
Drupal Commerce Entities (Data Elements)
No need to
panic!
We will go
over this one
at a time :)
blue-bag
Drupal Commerce Functional Elements
blue-bag
Drupal Commerce Functional Elements
blue-bag
Drupal Commerce Functional Elements
This should
start making
some sense
blue-bag
Lets take a kickstart
Journey
Visiting our elements along the way
blue-bag
The Product Page
blue-bag
The Product
The product title
The Product description
All the elements of the
product that don’t
change
blue-bag
Product variations
Price
Colour and size
All the elements that vary
Image
blue-bag
Add to cart
blue-bag
Add to cart
blue-bag
Add to cart
Converts a product into a line item
blue-bag
Add to cart
Converts a product into a line item
copy info from
the product
variation
colour, size & price
blue-bag
Add to cart
Converts a product into a line item
Defined by the
line item type.
Quantity & custom
fields (Gift wrap)
blue-bag
Add to cart
Converts a product into a line item
The form submit will
kick this off
blue-bag
Cart page
blue-bag
Cart page
blue-bag
Cart page
blue-bag
The cart page
blue-bag
The cart page
Is a view
blue-bag
The cart page
You can add
fields to the
view
blue-bag
The cart page
Add a field
blue-bag
The cart page
Add a field
blue-bag
Checkout
blue-bag
Checkout
blue-bag
Checkout
blue-bag
Checkout
blue-bag
Checkout
blue-bag
Checkout
blue-bag
Checkout
blue-bag
Checkout
blue-bag
Checkout pane
blue-bag
Checkout pane
blue-bag
Checkout pane
blue-bag
Checkout pane
blue-bag
Checkout pane
blue-bag
Checkout pane
blue-bag
Checkout pane
blue-bag
The Profile & Address
So we almost
covered all
entities. only
Address and
payment to do.
blue-bag
The Profile & Address
So we almost
covered all
entities. only
Address and
payment to do.
blue-bag
The Profile & Address
So we almost
covered all
entities. only
Address and
payment to do.
blue-bag
The Profile & Address
We have two profiles on this page
Billing
blue-bag
The Profile & Address
We have two profiles on this page
Billing
blue-bag
The Profile & Address
We have two profiles on this page
Billing
blue-bag
The Profile & Address
We have two profiles on this page
and shipping
blue-bag
The Profile & Address
Lets expand the shipping details so we can see
both addresses
blue-bag
The Profile & Address
Lets look at how those are configured
blue-bag
The Profile & Address
Lets look at how those are configured
blue-bag
The Profile & Address
Lets look at how those are configured
blue-bag
The Profile & Address
We can add a new field
blue-bag
The Profile & Address
And it is now shown on the billing profile
blue-bag
Payment methods & transections
And finally
blue-bag
Payment methods & transections
And finally
blue-bag
Payment methods appear
inside the checkout Pane
Payment methods
blue-bag
New Payment
methods can be
downloaded from
drupal.org
Payment methods
blue-bag
and can be configured
using rules
Payment methods
blue-bag
That’s me adding a
condition to say:
Sagepay support will
stop on the 20th of Jan
Payment methods
blue-bag
are added to the order
whenever a payment
or other transactions
are made
Payment transactions
blue-bag
are added to the order
whenever a payment
or other transactions
are made
Payment transactions
blue-bag
are added to the order
whenever a payment
or other transactions
are made
Payment transactions
blue-bag
So lets recap
blue-bag
Drupal Commerce Entities (Data Elements)
blue-bag
Drupal Commerce Functional Elements
blue-bag
The Drupal building blocks
• Entities - Are Data types that can be extended by code
and configuration
• Views - A visual tool for producing lists and reports on
any Drupal entity type (you can even extend it to work
on other databases you may have)
• Rules - A visual tool for building business logic using an
Event - Condition - Action
• Widgets - for data editing
• Formatters - for displaying fields
blue-bag
A few examples of extending functionality
Using Contrib Modules
blue-bag
Contrib Modules
Commerce Shipping
by Jakob Torp (googletorp)
Part of the kickstart distribution
blue-bag
Contrib Modules
Commerce Shipping
by Jakob Torp (googletorp)
Part of the kickstart distribution
• Adds a new Line item type
blue-bag
Contrib Modules
Commerce Shipping
by Jakob Torp (googletorp)
Part of the kickstart distribution
• Adds a new Line item type
• Adds a customer profile + a checkout pane (Shipping
information)
blue-bag
Contrib Modules
Commerce Shipping
by Jakob Torp (googletorp)
Part of the kickstart distribution
• Adds a new Line item type
• Adds a customer profile + a checkout pane (Shipping
information)
• Rules integration - Activate relevant shipping options & work
out shipping costs.
blue-bag
Contrib Modules
Commerce Shipping
by Jakob Torp (googletorp)
Part of the kickstart distribution
• Adds a new Line item type
• Adds a customer profile + a checkout pane (Shipping
information)
• Rules integration - Activate relevant shipping options & work
out shipping costs.
• Extended by other shipping modules like Commerce UPS &
FedEx
blue-bag
Contrib Modules
Commerce Stock
by Guy Schneerson (guy_schneerson)
blue-bag
Contrib Modules
Commerce Stock
by Guy Schneerson (guy_schneerson)
• Adds a stock level field to the product variation entity
blue-bag
Contrib Modules
Commerce Stock
by Guy Schneerson (guy_schneerson)
• Adds a stock level field to the product variation entity
• Manipulates the add to cart, cart & checkout form
blue-bag
Contrib Modules
Commerce Stock
by Guy Schneerson (guy_schneerson)
• Adds a stock level field to the product variation entity
• Manipulates the add to cart, cart & checkout form
• Uses rules for checking stock availability
blue-bag
Contrib Modules
Commerce Stock
by Guy Schneerson (guy_schneerson)
• Adds a stock level field to the product variation entity
• Manipulates the add to cart, cart & checkout form
• Uses rules for checking stock availability
• Uses rules to control the Add to cart action - Disable &
repurpose.
blue-bag
Contrib Modules
Commerce Stock
by Guy Schneerson (guy_schneerson)
• Adds a stock level field to the product variation entity
• Manipulates the add to cart, cart & checkout form
• Uses rules for checking stock availability
• Uses rules to control the Add to cart action - Disable &
repurpose.
• Field formater - Under 5 display “Low stock”
blue-bag
Other modules
Product Pricing modules
blue-bag
Other modules
• Commerce Discount - by bojanz
Product Pricing modules
blue-bag
Other modules
• Commerce Discount - by bojanz
• Commerce Coupon - by hunziker
Product Pricing modules
blue-bag
Other modules
• Commerce Discount - by bojanz
• Commerce Coupon - by hunziker
• Commerce Multicurrency - by das-peter
Product Pricing modules
blue-bag
Other modules
• Commerce Discount - by bojanz
• Commerce Coupon - by hunziker
• Commerce Multicurrency - by das-peter
• Commerce price table (quantity pricing) - by pcambra
Product Pricing modules
blue-bag
Other modules
Others
blue-bag
Other modules
• Commerce Fancy Attributes - by Artusamak
Others
blue-bag
Other modules
• Commerce Fancy Attributes - by Artusamak
• Commerce Reorder - by ikos
Others
blue-bag
Other modules
• Commerce Fancy Attributes - by Artusamak
• Commerce Reorder - by ikos
• Commerce Customizable Products (allows the creation
of new line_item types) - by rszrama
Others
blue-bag
Other modules
• Commerce Fancy Attributes - by Artusamak
• Commerce Reorder - by ikos
• Commerce Customizable Products (allows the creation
of new line_item types) - by rszrama
• Commerce Google Analytics - by Cyberschorsch
Others
blue-bag
A few examples of extending functionality
Configuration and custom code
Using Contrib Modules
blue-bag
Develop a new custom checkout pane
blue-bag
Develop a new custom checkout pane
Oops it’s in Russian (Did I mention Drupal kicks
Localisation Ass)
blue-bag
Develop a new custom checkout pane
That’s better
blue-bag
Buying options - Using commerce stock
Configuration Only
!
Commerce stock
Provides powerful add
to cart configuration.
!
blue-bag
Image download - Using commerce stock
Using some custom code to
extend the commerce stock
functionality.
blue-bag
Cross selling using views
blue-bag
Link Blog posts to products
Add a reference
field to your blog
post type
!
Just one field
blue-bag
A use case - Store open state
We need to be able
to close the online
store at times
blue-bag
A use case - Store open state
blue-bag
A use case - Store open state
• For stock checking
blue-bag
A use case - Store open state
• For stock checking
• Financial audit
blue-bag
A use case - Store open state
• For stock checking
• Financial audit
• Payment configuration
and testing
blue-bag
A use case - Store open state
• For stock checking
• Financial audit
• Payment configuration
and testing
• Security emergencies
blue-bag
A use case - Store open state
blue-bag
A use case - Store open state
I have an idea !
blue-bag
A use case - Store open state
I have an idea !
I will create a simple
module called
“commerce store” with an
Open property
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
We can then use rules to
check for the store open
state.
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
Like so:
blue-bag
A use case - Store open state
Cool I think I got it -
I will be able to add another
condition that will allow
admins to use the store while
it is closed.
blue-bag
A use case - Store open state
blue-bag
A use case - Store open state
Yes you got it.
blue-bag
A use case - Store open state
Yes you got it.
give it a go
blue-bag
A use case - Store open state
Yes you got it.
give it a go
BLUE-BAG
GUY SCHNEERSON

DRUPAL: guy_schneerson

GUY@BLUE-BAG.COM
TWITTER: guy_schneerson
www.blue-bag.com
Established in 2000
Questions ?

Deconstructing drupal commerce