1 of 55

Doctor, Will My Drupal 7 Commerce Site�Survive the Upgrade?

Kevin Kaland

2 of 55

I usually joke about not forgetting to

tell you my name for the whole session

here, but DrupalCon made me put it on the previous slide.¯\_(ツ)_/¯

  • drupal.org: wizonesolutions http://drupal.org/u/wizonesolutions
  • Maintain FillPDF (fillpdf) module
    • ...and run FillPDF Service, https://fillpdf.io
  • Three other things about me
    • I like singing
    • I got #drupalradio to play Weird Al Yankovic�at DrupalCon New Orleans
    • I like languages

3 of 55

Site I’m upgrading

4 of 55

Pricing page

5 of 55

Profile page

6 of 55

Some context

  • ~40 subscribers
  • Currently on Commerce Kickstart 1 (Drupal 7)
  • Stripe + Commerce License + Commerce License Billing
  • Custom code:
    • Quota management
    • Metered billing
    • Upgrade/downgrade form
    • Page alterations (hooks)

7 of 55

Why upgrade?

8 of 55

How did I get here?

  • Ubercart (Drupal 6) -> Commerce Kickstart (Drupal 7)
  • Used Commerce Migrate for data
  • Ported code, wrote new code
  • Switched to Stripe
  • Colorized a stock theme

9 of 55

Why upgrade now?

  • Better tax and VAT support in Commerce 2.x
  • Drupal 8 to 9 upgrade
  • Wanted to do it last time, but...

10 of 55

Attempting an upgrade

11 of 55

Options for upgrading

12 of 55

Option 1: Hardcode something entirely

Difficulty level:

�Source: https://giphy.com/gifs/scary-daredevil-extreme-u7FMV5dMJjes8

13 of 55

Option 2: Write custom migrations with Migrate

Difficulty level:

Source: https://giphy.com/gifs/cheezburger-kids-exercise-uXGA9RmvWTyqA

14 of 55

Option 3: Use Commerce Migrate

15 of 55

Option 4: Mixed approach

Difficulty level:

Source: https://giphy.com/gifs/reaction-mrw-gpa-c7PcKQlOqZ8Ws

16 of 55

Contributed module progress

17 of 55

State of Commerce Migrate

  • Ready soon
  • Current focus (alpha2): Ubercart D6
  • But I’m on Commerce Kickstart D7

18 of 55

State of Commerce Migrate 2

  • Most core stuff is migrating OK
    • orders
    • products
  • Line items/orders not migrating properly
  • Needs work: fields, tax/VAT, profiles, order payments...

19 of 55

What’s changed in contrib?

  • Commerce Shipping: Drupal 8 beta release
  • Commerce Features: in Drupal 8 core (Configuration Management)
  • Commerce Addressbook: Almost in Commerce core
  • Commerce Discount, Commerce Coupon: in Commerce core as promotions
  • Commerce Message: in Commerce core

20 of 55

What’s changed in contrib? 2

  • Commerce AutoSKU: Port in progress
  • Commerce Migrate: yo dawg
  • Commerce Reporting: skeleton port, needs funding
  • Commerce Billy: replacement functionality in Commerce 2.1

21 of 55

What’s changed in contrib: Licensing ecosystem

  • Commerce License port in progress
  • Commerce License Billing recurring functionality -> Commerce Recurring (in progress)
  • Commerce Dunning: ¯\_(ツ)_/¯ probably also going into Recurring

22 of 55

What’s changed in contrib: Commerce VAT

It’s in Commerce core!

23 of 55

What’s changed in contrib: Commerce Stripe

  • Has a Drupal 8 version
  • other big names that are ready for Drupal 8:
    • Braintree, PayPal, Authorize.net, Square, Paymill, Klarna Checkout

24 of 55

Closing the gap

25 of 55

Planning

  • Are my contrib features necessary?
  • Commerce 2 may have a way that works
  • If necessary: Can I help?

26 of 55

Planning 2

  • Should I write/alter custom migrations?
  • (See “Resources” slide)

27 of 55

Planning 3

How should I port custom functionality?

28 of 55

Closing the contrib gap

  • Commerce Migrate: Help out with the port
    • but could also use custom migrations and scripts
  • Commerce License: Help out with the port

29 of 55

Closing the contrib gap: Recurring

  • Commerce License Billing, Commerce Dunning: Will most likely help with the port.
    • Alternative: import existing subscriptions to Stripe and use their infrastructure
    • Pros: don’t have to wait for Recurring
    • Cons: have to find or write API integration for Stripe Subscriptions anyway

30 of 55

Contrib gap: ¯\_(ツ)_/¯

  • Commerce Reporting: Can wait and use e.g. SQL queries in the meantime
  • Commerce Billy: Don’t need; can do something custom or add later
  • Commerce Addressbook: Nice-to-have, but not needed on a subscription site; can add later
  • Commerce AutoSKU: Not needed; can add later

31 of 55

Before porting stuff

  • Is it still necessary?
    • Does anyone even use it?
  • How long will it take?
  • Can it wait?
  • Patch tolerance

32 of 55

Porting custom functionality: License/recurring logic

  • Metered billing: Custom license type
    • D7 license types are basically still license types
  • Metered billing: Billing
    • → Commerce Recurring
    • too early to say how!
    • might even get a UI

33 of 55

Porting custom functionality: Plan management UI

  • Always fairly custom store-to-store
  • Implementation likely to be similar to now
  • Maybe new APIs will make this easier?

34 of 55

Porting custom functionality: Visual tweaks

Twig!

35 of 55

Porting custom functionality: Custom migrations

  • Still done via the Migrate module (now in core)
  • Migrations are plugins

36 of 55

Porting functionality: Examples of custom migrations

  • Assigning a custom role to migrated users
  • Migrating paying subscribers
    • although Commerce License or Recurring might handle this later
  • API keys
    • Migrate Upgrade already migrates custom user fields!

37 of 55

Porting custom functionality: 🍃R u l e s🍃

38 of 55

Porting custom functionality 🍃R u l e s🍃2

  • Events
    • order state changes, order created/updated/deleted, item added to cart...

39 of 55

Porting custom functionality 🍃R u l e s🍃3

  • Resolvers
    • determine price of “purchasable entities” (e.g. displayed products)
      • also tax and shipping

40 of 55

Porting custom functionality 🍃R u l e s🍃4

  • Order processors
    • determine adjustments to entire order

41 of 55

Porting custom

functionality

🍃R u l e s🍃5

  • Configuration entities, conditions
    • can a payment gateway be used?

42 of 55

Who should upgrade now?

43 of 55

It depends

44 of 55

Big/medium budgets

  • Contribute to Commerce Migrate and migrate now
  • ...or write custom migrations

45 of 55

Small budgets/individuals (like me)

  • Probably don’t migrate yet
  • Contribute to Commerce Migrate if possible
  • Wait for Commerce Migrate 8.x-2.x-alpha3
    • expected mid-to-late October

46 of 55

So, basically:

47 of 55

Be realistic

Upgrading might take a while.

48 of 55

Collaboration pays off

Upgrades will be easier; module compatibility will be better.

49 of 55

Use Commerce Migrate

Unless you’re in a rush, it’s worth waiting.

50 of 55

Frage? (Questions?)

51 of 55

Resources

52 of 55

Shoutouts (thank you’s)

  • Bojan Živanović (bojanz), Matt Glaman (mglaman), Lucas Hedding (heddn), Juan David Hurtado (Yaazkal)
  • Wolfgang Ziegler (fago), Amanda Gonser
  • and everyone else who answered my questions

53 of 55

JOIN US FOR

CONTRIBUTION SPRINT

Friday, 29 September, 2017

First time

Sprinter Workshop

Mentored

Core Sprint

General Sprint

9:00-12:00

Room: Lehar 1 - Lehar 2

9:00-18:00

Room: Stolz 2

9:00-18:00

Room: Mall

#drupalsprints

54 of 55

WHAT DID YOU THINK?

Locate this session at the DrupalCon Vienna website:

http://vienna2017.drupal.org/schedule

Take the survey!

https://www.surveymonkey.com/r/drupalconvienna

55 of 55

The end

drupal.org, Twitter, Drupal Slack, usw.*:

wizonesolutions

Are you a business card connoisseur?�Enjoy a vintage glossy (2011) on me

* etc.