Drupal commerce 2.x for Drupal 8

Preview:

Citation preview

info@agiledrop.com • +442081442189 • www.agiledrop.com

Drupal Commerce 2 for Drupal 8

Drupal Camp Munich 2016

@Iztok, AGILEDROP

info@agiledrop.com • +442081442189 • www.agiledrop.com

Do we even need Drupal Commerce?

info@agiledrop.com • +442081442189 • www.agiledrop.com

info@agiledrop.com • +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)

info@agiledrop.com • +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)

info@agiledrop.com • +442081442189 • www.agiledrop.com

What’s new?

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

info@agiledrop.com • +442081442189 • www.agiledrop.com

Currencies

• Currencies are now entities

• Import currencies from CLDR

• The price field stores amounts and their currency codes

• Multilingual support

info@agiledrop.com • +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 :(

info@agiledrop.com • +442081442189 • www.agiledrop.com

Stores

• Support for multiple stores

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

info@agiledrop.com • +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

info@agiledrop.com • +442081442189 • www.agiledrop.com

Variations

• Product variations represent individual SKU

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

info@agiledrop.com • +442081442189 • www.agiledrop.com

Attributes

• Attributes are entities

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

info@agiledrop.com • +442081442189 • www.agiledrop.com

“Fancy attributes”

• Fancy attributes in Commerce core

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

info@agiledrop.com • +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)

info@agiledrop.com • +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

info@agiledrop.com • +442081442189 • www.agiledrop.com

info@agiledrop.com • +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

info@agiledrop.com • +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

info@agiledrop.com • +442081442189 • www.agiledrop.com

Checkout flows

• Supports multiple checkout flows

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

info@agiledrop.com • +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

info@agiledrop.com • +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

info@agiledrop.com • +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 :(

info@agiledrop.com • +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

info@agiledrop.com • +442081442189 • www.agiledrop.com

What about Ubercart?

info@agiledrop.com • +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

info@agiledrop.com • +442081442189 • www.agiledrop.com

Q&AToo shy? Feel free to email me: iztok@agiledrop.com