26
[email protected] • +442081442189 • www.agiledrop.com Drupal Commerce 2 for Drupal 8 Drupal Camp Munich 2016 @Iztok, AGILEDROP

Drupal commerce 2.x for Drupal 8

Embed Size (px)

Citation preview

Page 1: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Drupal Commerce 2 for Drupal 8

Drupal Camp Munich 2016

@Iztok, AGILEDROP

Page 2: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Do we even need Drupal Commerce?

Page 4: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Use cases for Drupal Commerce

● Using Drupal’s powerful platform as a base● Merging content and commerce together● Selling digital products (access to content, memberships, downloads)● Add ecommerce functionality to an existing Drupal website● All-in-one platforms (Multilingual, multi store, multi user roles platforms)● Using Drupal Commerce for front-end (leaving handling the logic to CRMs

and ERPs)

Page 5: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

What we need to know

● Depends on Drupal 8.2.x● Needs to be installed with composer● 8.x-2.0-beta4 released on 30 Nov 2016● Developed lead by Commerce Guys

○ Bojan Živanović (bojanz)○ Matt Glaman (mglaman)○ Ryan Szrama (rszrama)

Page 6: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

What’s new?

● Currencies● Tax● Stores● Products and variations● Attributes● Promotions● Orders● Checkouts● Payments● Shipping

Page 7: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Currencies

• Currencies are now entities

• Import currencies from CLDR

• The price field stores amounts and their currency codes

• Multilingual support

Page 8: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Taxes

• Territory-specific (EU, Canada...) rules

• Tax rates based on the date

• Tax resolvers for all major use cases

• No UI yet, in development.

• More on Commerce Guys blog: https://drupalcommerce.org/blog/31036/commerce-2x-stories-taxes

• Tax library by CG: https://github.com/commerceguys/tax

No UI yet :(

Page 9: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Stores

• Support for multiple stores

• Each store has its own settings line email, address and default currency.

Page 10: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Products

• Not tied to Node any more: product is its own entity type

• Product references Product variations

• Inline entity form

• Better in-line experience

Page 11: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Variations

• Product variations represent individual SKU

• One-to-one relationship, one variable can only be in one product.

Page 12: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Attributes

• Attributes are entities

• Attributes have an easy to use interface to edit multiple attributes.

Page 13: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

“Fancy attributes”

• Fancy attributes in Commerce core

• Instead of dropdown we can render any field (text, image) for attribute selection

Page 14: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Promotions

• Promotions = Discount + Coupons

• In Commerce core module

• No more rules, using Condition plugins API from Drupal 8

• Using adjustment API (no more saved as line items in order)

Page 15: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Orders

• Multiple types of order (commerce_order_types in D7)

• We can assign a views to an Order type

• We can assign a checkout flow to an Order type

• Line items are now Order items and can only be purchasable items

Page 17: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Order items

• “Add to cart” form is fully customisable (it’s a display for Order item)

• We can add custom fields to order types

Page 18: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Cart

• We can have different types of carts based on the order (eg digital cart and physical cart)

• Cart form and Cart blocks are Views and can be altered

Page 19: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Checkout flows

• Supports multiple checkout flows

• The default Multistep plugin has UX improvements based on best practices

Page 20: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Payments

• Reusing one payment plugin multiple times

• Payment configuration can be simply exported and secured offsite

• Example payment included

• Already support for Braintree and Authorise.Net

Page 21: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Modules now included in Commerce core

● commerce_order_types● commerce_custom_line_items● commerce_custom_product● commerce_cardonfile● commerce_checkout_progress● field_extractor (deprecated)● commerce_fancy_attributes

● commerce_addressbook● commerce_checkout_progress● commerce_checkout_login● commerce_login_step● commerce_checkout_login● commerce_coupon● commerce_discount

Page 22: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Shipping

• Flat rate included in the module (20k out of 26k 7.x installs use flat rate)

• Orders can have multiple Shipments (1 by default)

• Multiple shipments would be used for different stock location etc.

• Shipment is a fieldable entity

• Address is attached to the shipping

No UI yet :(

Page 23: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Product bundles

• Collects existing products together in a bundle

• Bundle, Bundle Type, Bundle Item, and Bundle Item Type

• In active development

• Detailed description: https://www.drupal.org/node/2799643

Page 24: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

What about Ubercart?

Page 25: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Ubercart 8.x-4.x

● Version: 8.x-4.0-alpha5● Direct port from Drupal 7.x-3.x● Out of the box functionality● Limited data structure

Page 26: Drupal commerce 2.x for Drupal 8

[email protected] • +442081442189 • www.agiledrop.com

Q&AToo shy? Feel free to email me: [email protected]