An introduction to Drupal Commerce & Real World Examples July 13 2013
May 10, 2015
An introduction to Drupal Commerce
&Real World Examples
July 13 2013
So!ware Architect
Email: [email protected]
John Robert Wilson
Twitter: @JohnRobertWilso
Drupal.org: LSU_JBob
The Basics
Commerce Entities
Products
• Something you’re trying to sell
• A title and a price
• Create product references on nodes for end users
Orders
• Start out with a status of “cart”
• Once a product is placed in the cart, a new order is created
• Contains Line Items, payment transactions
• Contains customer information and order metadata
Line Items
• An instance of a product in an order (or cart)
• Able to contain personalized options for that instance of the product
Payment Transactions
• Hold all detailed financial info and metadata
• Can have a status of accepted or declined
• Payload from Payment Gateways
Payment Gateways
Payment Gateways
• You don’t want to store actual credit card numbers ( compliance headaches, security headaches)
• Use 3rd Party Payment Gateways
• Send payment info over https to the third party and get accepted or declined
• Paypal, Payflow Pro, Authorize.Net, Amazon Payments, Bitcoin?!?
Checkout Process
Checkout Process
Commerce Rules
Commerce Rules
• Checkout process has Rules integrated into it
• Can be used to apply a tax based on state
• Can give a discount
• Much much more!
Shipping & Inventory
Shipping & Inventory
• Commerce Shipping contrib module!http://drupal.org/project/commerce_shipping
• For shipping physical products and creating customer shipping profiles
• Commerce Stock contrib module!http://drupal.org/project/commerce_stock
• Decrement stock as products are purchased
Hooks for Devs
Hooks for Developers
• hook_commerce_checkout_router - routes the default checkout url to an alternate url if neccessary
• hook_commerce_checkout_complete - Allows other modules to perform business logic when an order is completed
• hook_commerce_checkout_pane_info_alter - alter an existing checkout pane’s metadata
• MUCH MUCH MORE
Commerce Kickstart
Commerce Kickstart
• http://drupal.org/project/commerce_kickstart
• Nice quick configured drupal commerce site
• Includes latest version of core and all needed dependencies
A Real World Example
Diamond Reserve
Diamond Reserve
Diamond Reserve
Another Real World Example
Drupal Commerce
• Built from scratch with lessons learned in mind
• Extendable and flexible on many levels
• Blog post outlining this session
PHASE2TECHNOLOGY.COM