creating an e-commerce publications catalog with drupal commerce
DESCRIPTION
Creating an e-commerce publications catalog with Drupal CommerceTRANSCRIPT
Creating an e-‐commerce publications catalog with Drupal CommerceBryan Mayjor -‐ Extension & Experiment Station Communications
NETC 2014 -‐ Tekkies in the Little Apple
Who is this guy?
• Bryan is a Technology-‐assisted education developer with the Oregon State Extension Service • Started hacking websites when Netscape 1 was new and and 28K dialup was cool • Has been working with Drupal since 2008 • Spends way too much time coding
2
Source: http://www.niola.net
NETC 2014 -‐ Tekkies in the Little Apple
Over the next 50 minutes …
• You’ll get an overview of Drupal Commerce and how it works • Endure a short story about Newman and Catman • See Drupal Commerce in action • Look at some code • Ask some questions • Become a better person (possibly)
3
NETC 2014 -‐ Tekkies in the Little Apple
What is Drupal Commerce?
Drupal Commerce is set of modules that provide core e-‐commerce functionality
• shopping cart • check out • payments • shipping and fulfillment • discounts • order management • all without writing any code
4
NETC 2014 -‐ Tekkies in the Little Apple
Newman “New catalog manager”
• Old, old, old Filemaker Pro database • Used by the pubs team to manage publications since the 1990s • E-‐commerce functionality developed by contractor using questionable design patterns • Archaic export process was developed for online catalog • Updating catalog is a multistep process that involves deleting the catalog database then reimporting
5
Source: http://article.wn.com
NETC 2014 -‐ Tekkies in the Little Apple
Catman History of the Catman project
• Contracted out to 3rd party vendor as I didn’t have time to do it • “Completed” project didn’t meet our needs • I still don't have time but took over development working closely with a pubs team member (Jennifer Alexander) • Used the contracted commerce site as a basis, scrapped the project management site completely
6
Source: http://fairlyoddparents.wikia.com
NETC 2014 -‐ Tekkies in the Little Apple
Catman Goals for new system
• Replace old system before it dies again • Combine project management and catalog site into one happy Drupal site • Integrate University approved payment gateway (used by current system) • Responsive design with emphasis on user experience • Flexible system to meet current and future needs
7
Source: http://fairlyoddparents.wikia.com
NETC 2014 -‐ Tekkies in the Little Apple
Getting Started with Drupal Commerce The easy way
Commerce Kickstart • Installation profile creates a fully functional store in minutes
• Pre-‐configured advanced functionality • Spiffy responsive design out of the box • Doesn’t require advanced Drupal knowledge • Can be difficult to modify to meet your specifications
• Provided theme (Omega kickstart) very complex and not simple to customize.
8
NETC 2014 -‐ Tekkies in the Little Apple
Getting Started with Drupal Commerce Not as easy but better way
Custom set up • Use KickStart as a reference • Backoffice modules are awesome and provide best elements of KickStart • Contributed modules do most of the heavy lifting • Create custom module(s) to override defaults and to add new functionality • Requires advanced Drupal knowledge !
9
NETC 2014 -‐ Tekkies in the Little Apple
Commerce Kickstart Demo
10
NETC 2014 -‐ Tekkies in the Little Apple
Taming the Beast Making Drupal Commerce behave
• Most customizations can be done without writing code • Rules can be easily created or modified • Create custom modules to override defaults and to add functionality • Features are your friend
12
NETC 2014 -‐ Tekkies in the Little Apple
Challenges and things that didn’t work as expected Drupal Commerce != ‘nirvana’
• Payment gateway provider changed • OSU Drupal hosting changed • Invoices • Purchase order / Index codes • Magic Links • Workbench
• Let’s look at some code … !
13
Source: http://macrobits.pinetreecapital.com
NETC 2014 -‐ Tekkies in the Little Apple
Code examples: hook_commerce_form_alter() Remove the “Country” drop-‐down list on checkout form
14
“Don’t show the list of countries, our shipping rates only apply to orders within the USA”
“Don’t show the list of countries, our shipping rates only apply to orders within the USA”
NETC 2014 -‐ Tekkies in the Little Apple
Code examples: hook_commerce_form_alter() Remove the “Country” drop-‐down list on checkout form
15
“Don’t show the list of countries, our shipping rates only apply to orders within the USA”
NETC 2014 -‐ Tekkies in the Little Apple
Code examples: hook_commerce_form_alter() Remove the “Country” drop-‐down list on checkout form
16
v
vv
v
NETC 2014 -‐ Tekkies in the Little Apple17
“We need more options than Pending and Processing, what about …”
Code examples: hook_commerce_order_status_info() Add statuses to the pending order state.
NETC 2014 -‐ Tekkies in the Little Apple
Code examples: hook_commerce_order_status_info() Add statuses to the pending order state.
18
v
NETC 2014 -‐ Tekkies in the Little Apple
Code examples: hook_default_rules_configuration() Rule to add customer user role when new account is created
19
NETC 2014 -‐ Tekkies in the Little Apple
Code examples: hook_default_rules_configuration() Rule to add customer user role when new account is created
20
vv
v
v
NETC 2014 -‐ Tekkies in the Little Apple
Resources
This presentation PDF will be posted on NETC conference site
Code examples used in presentation http://github.com/osu-‐eesc
Drupal Commerce http://www.drupalcommerce.org
Commerce Kickstart https://drupal.org/project/commerce_kickstart
Bootstrap http://getbootstrap.com/
21
NETC 2014 -‐ Tekkies in the Little Apple
Bryan Mayjor [email protected]
22
Source: http://http://www.marcandangel.com