creating an e-commerce publications catalog with drupal commerce

22
Creating an ecommerce publications catalog with Drupal Commerce Bryan Mayjor Extension & Experiment Station Communications

Upload: bryan-mayjor

Post on 01-Dec-2014

134 views

Category:

Internet


1 download

DESCRIPTION

Creating an e-commerce publications catalog with Drupal Commerce

TRANSCRIPT

Page 1: Creating an e-commerce publications catalog with Drupal Commerce

Creating  an  e-­‐commerce  publications  catalog  with  Drupal  CommerceBryan  Mayjor  -­‐  Extension  &  Experiment  Station  Communications

Page 2: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 3: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 4: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 5: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 6: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 7: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 8: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 9: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 10: Creating an e-commerce publications catalog with Drupal Commerce

NETC  2014  -­‐  Tekkies  in  the  Little  Apple

Commerce  Kickstart  Demo

10

Page 11: Creating an e-commerce publications catalog with Drupal Commerce

NETC  2014  -­‐  Tekkies  in  the  Little  Apple

Catman  Demo

11

Page 12: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 13: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 14: Creating an e-commerce publications catalog with Drupal Commerce

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”

Page 15: Creating an e-commerce publications catalog with Drupal Commerce

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”

Page 16: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 17: Creating an e-commerce publications catalog with Drupal Commerce

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.

Page 18: Creating an e-commerce publications catalog with Drupal Commerce

NETC  2014  -­‐  Tekkies  in  the  Little  Apple

Code  examples:  hook_commerce_order_status_info()    Add  statuses  to  the  pending  order  state.

18

v

Page 19: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 20: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 21: Creating an e-commerce publications catalog with Drupal Commerce

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

Page 22: Creating an e-commerce publications catalog with Drupal Commerce

NETC  2014  -­‐  Tekkies  in  the  Little  Apple

Bryan Mayjor [email protected]

22

Source: http://http://www.marcandangel.com