Drupal Commerce Drupal camp

24
Drupal commerce An ecommerce framework Tuesday, February 14, 12

description

My presentation at Drupal Camp Copenhagen 2011

Transcript of Drupal Commerce Drupal camp

Page 1: Drupal Commerce Drupal camp

Drupal commerce

An ecommerce framework

Tuesday, February 14, 12

Page 2: Drupal Commerce Drupal camp

Who am I

• Jakob Torp - @googletorp

• Drupal developer ~ 3 years.

• Early adopter - First live site launched 31/12/2010

• Maintainer of Commerce shipping

• 3 sites created with Drupal commerce

Tuesday, February 14, 12

Page 3: Drupal Commerce Drupal camp

Nuts and bolts

Tuesday, February 14, 12

Page 4: Drupal Commerce Drupal camp

Core commerce entities

• Product

• Line items (reference to product)

• Order (reference to line items)

• Custom profiles

Tuesday, February 14, 12

Page 5: Drupal Commerce Drupal camp

Product

• Store product data

• One product per SKU - variant.

• No front-end exposure.

Tuesday, February 14, 12

Page 6: Drupal Commerce Drupal camp

Line items

• Used as wrapper in orders - quantity, unit price, total

• Important for product pricing system

• Fields can be exposed on product’s add to cart form

• Create custom line item types/bundles with hook_commerce_line_item_type_info

Tuesday, February 14, 12

Page 7: Drupal Commerce Drupal camp

Creating a line item

Tuesday, February 14, 12

Page 8: Drupal Commerce Drupal camp

How can entities be used?

• Sell something that’s not a product.

• You don’t want a traditional checkout.

• You tell me!

Tuesday, February 14, 12

Page 9: Drupal Commerce Drupal camp

Create an order

Tuesday, February 14, 12

Page 10: Drupal Commerce Drupal camp

Core framework features

• Product reference field.

• Price system - price field

• Clever tax handling - VAT and sales tax

• Views and rules integration

• Entity API integration

• Quickly growing community

Tuesday, February 14, 12

Page 11: Drupal Commerce Drupal camp

Product reference field

• Create front-end product displays

• Display products or get add to cart form. Create form for line item fields.

• Create your own formatter or overwrite the display.

Tuesday, February 14, 12

Page 12: Drupal Commerce Drupal camp

Price system

• Defined as a field for maximum flexibility.

• Amount, currency code and data

• Record price alterations

• Custom price components

• Support for currency conversion.

Tuesday, February 14, 12

Page 13: Drupal Commerce Drupal camp

Taxes

• Uses rules to apply.

• Custom line items can integrate by creating and invoking a rules action.

• Price component for each tax type.

Tuesday, February 14, 12

Page 14: Drupal Commerce Drupal camp

Rules and views

• Rules events for almost anything (hooks)

• Commerce specific actions and events.

• Area handlers to make your life easy

• Custom handlers for a lot of things

• Ability to create a cart form view.

Tuesday, February 14, 12

Page 15: Drupal Commerce Drupal camp

Entity API

• entity_metadata_wrapper is your friend, but use with care.

• Make fields act as entity properties.

Tuesday, February 14, 12

Page 16: Drupal Commerce Drupal camp

Community

• Shipping

• Stock

• Coupons

• File products

• Migration from Übercart

• 41 non payment modules

Usage statistics

Tuesday, February 14, 12

Page 17: Drupal Commerce Drupal camp

Drupal rooms

• Online booking with Drupal Commerce

• Conditional price alterations

• Missing price component integration

• http://www.drupalrooms.com

Tuesday, February 14, 12

Page 18: Drupal Commerce Drupal camp

Case studyPrint company

• Drupal 6 site with webform calculation => Drupal 7 + integration with Drupal Commerce.

• Upgrade custom webform module.

• Custom line item with reference to webform submissions.

• Allow users to create orders.

Tuesday, February 14, 12

Page 19: Drupal Commerce Drupal camp

Case studyPrint company

• Drupal 6 site with webform calculation => Drupal 7 + integration with Drupal Commerce.

• Upgrade custom webform module.

• Custom line item with reference to webform submissions.

• Products vs calculations

• Allow users to create orders.

Tuesday, February 14, 12

Page 20: Drupal Commerce Drupal camp

Webform page

Tuesday, February 14, 12

Page 21: Drupal Commerce Drupal camp

Order / line item form

Tuesday, February 14, 12

Page 22: Drupal Commerce Drupal camp

Backend

Tuesday, February 14, 12

Page 23: Drupal Commerce Drupal camp

The code

Tuesday, February 14, 12

Page 24: Drupal Commerce Drupal camp

Questions?

Tuesday, February 14, 12