Commerce 2.x for the business specific Feedback on a 2.5k person - - PowerPoint PPT Presentation

commerce 2 x for the business specific
SMART_READER_LITE
LIVE PREVIEW

Commerce 2.x for the business specific Feedback on a 2.5k person - - PowerPoint PPT Presentation

Commerce 2.x for the business specific Feedback on a 2.5k person days project Fa Fabien Clment Drupal contributor for more than 10 years. Core contributor Drupal 8. Core contributor Drupal Commerce 1.x and 2.x. Modules


slide-1
SLIDE 1

Commerce 2.x for the business specific

Feedback on a 2.5k person days project

slide-2
SLIDE 2

Fa Fabien Clément

  • Drupal contributor for more than 10 years.
  • Core contributor Drupal 8.
  • Core contributor Drupal Commerce 1.x and 2.x.
  • Modules contributor.
  • Lead Developer for 3 years at Commerce Guys.
  • Lead Developer on the project.

GozOo Goz

slide-3
SLIDE 3

Summary

slide-4
SLIDE 4

Su Summa mmary

  • Context
  • Customer requirements
  • Case study of business specific
  • Looking on the weaknesses of Drupal Commerce 1.x
  • Problems & Solutions
  • Improvments
  • Outcomes

Summary

slide-5
SLIDE 5

Context

slide-6
SLIDE 6

Context

&

6

We deliver your ambition.

Since 2001, Niji, focus it’s business in helping businesses make a success of the digital

  • transformation. We help our customers – e-retailers and public services – to make the

all-important switch to digital technologies in support of their strategies, multi-channel distribution and internal operations.

NIJI

750

employees

200+

international and local customers

+ 20%

growth revenue

Voice of customer Business disruption Digital Strategy Technological opportunities

100

CONSULTANTS

Customer & User eXperience Brand & content design Creative technology Business performance

100

DESIGNERS

Mobile, e-commerce & web Factory, Labelized Test center Agile & Scrum management Smart technologies

500

TECHNICAL EXPERTS

50 EXPERTS

DRUPAL

Architectes, Experts, Front dev, Project leaders More than 30 Drupal 8 projects

Our Drupal 8 Customers

A A pr project built built by by

slide-7
SLIDE 7
  • Drupal & Drupal Commerce experts
  • Back-end & Front-end
  • +10 years of experience in web & commerce
  • Lead teams
  • Drupal Commerce support and training
  • Help companies for pre-sales

Context

&

Su Support

  • rted by

by

slide-8
SLIDE 8

Th The pr projec ject te team

~2500 person days. Spread over the duration of the project:

  • 1 project manager
  • 2 architects
  • 1 lead developer
  • 4 front-end developers
  • 20 back-end developers Drupal & Symfony
  • 5 testers

Context

&

slide-9
SLIDE 9

Th The cu customer

  • A major player in car park in

France and Belgium.

  • Leader in train station parking.
  • 40 years of experience in car

park.

  • Provide on-street and off-street

parking management solutions.

  • 400 car parks in 185 cities.
  • 163 M€

Context

&

slide-10
SLIDE 10

Customer requirements

slide-11
SLIDE 11

Corp Corpor

  • rate si

site

  • Introduce the company
  • Introduce offers
  • Frequently asked questions
  • Display media images/videos
  • Multilingual site: EN, FR, RU

Customer requirements

slide-12
SLIDE 12

On Online parki king g sp spots s bo booking ng

  • Parking spot booking
  • By time or at flat rate.
  • Find the best booking price
  • By time.
  • Flat rate.
  • Flat rate + exceeded time.
  • All of them with promotions.
  • Take care of booking fees and automatic or manual discounts.
  • Subscribe to a car park subscription.

Customer requirements

slide-13
SLIDE 13

On Online parki king g sp spots s bo booking ng

  • From a dashboard, a customer can see and manage:
  • Multiple drivers.
  • Multiple vehicles.
  • See his bookings:
  • Current, past and future
  • Booked from the platform, on site or from a partner.

Customer requirements

slide-14
SLIDE 14

Da Data a re recovery fr from pr previ vious us si site

  • Data recovery for:
  • Users
  • Previous orders
  • Ongoing orders

Customer requirements

slide-15
SLIDE 15

Bu Business sp specifi fic needs needs

  • Rates and availability calculated according to criteria:
  • Options
  • Opening hours
  • Date/time range
  • Parking duration time
  • Discounts
  • Yield rules
  • Services available for partners.
  • Synchronization and data export.

Customer requirements

slide-16
SLIDE 16

Sy Synchronization wi with ER ERP and nd CRM

  • Data exports (orders).
  • Data synchronization (import/export) synchronous and asynchronous:
  • Orders
  • Users
  • Drivers
  • Vehicles
  • Prices
  • Opening hours
  • Car parks
  • ...

Customer requirements

slide-17
SLIDE 17

We Webservices

  • Rate calculation provided for partner.
  • Availability of a parking spot for a duration in a datetime range.
  • Search of parking nearby coords.
  • Order creation by partners.
  • CRUD:
  • Orders, Users, Drivers, Vehicles.

Customer requirements

slide-18
SLIDE 18

Case study of business specific

slide-19
SLIDE 19

Re Reminder of

  • f re

require rements

  • Multilingual website.
  • High editorial requirements.
  • Customizable back-office.
  • Online booking.
  • 2 checkouts (booking + subscription).
  • Customized checkout.
  • Specific product concept.
  • No fixed price per product:
  • Specific rate calculation.
  • Infinite possibilities.
  • Specific availability management.
  • Webservices and import/export.

Case study of business specific

slide-20
SLIDE 20

Mu Multilingual we website

  • Drupal is multilingual.
  • The commerce part can be segmented according to a language.

Case study of business specific

slide-21
SLIDE 21

Hig High h edit editorial ial re require rements

  • Drupal is a CMS : Content Management System.
  • Content is what Drupal does the best.
  • Use the Paragraph module:
  • Flexibility of the display.
  • Allows the customer to choose how to display its content from a catalog of

items.

  • Consistent display throughout the website.
  • Use the Media module:
  • Shared media library.

Case study of business specific

slide-22
SLIDE 22

Cu Customi

  • mized Ba

Back-of

  • ffice
  • Customized back-office dashboards to:
  • List orders (booking orders, subscription orders, payments state) with data,

filters and specific sorts thanks to views.

  • List of created entities with data, filters and specific sorts thanks to views.
  • Configuration of features in specific screens thanks to the form api and the

configuration management.

  • Several data exports.

Case study of business specific

slide-23
SLIDE 23

On Online bo booking ng

  • Using Drupal Commerce 2.x which already provides:
  • Concept of products
  • Concept of orders
  • Checkout
  • Promotions/Coupons/Discounts
  • Events for price calculation and availability
  • Events at each step of an order
  • Payment helper

Case study of business specific

slide-24
SLIDE 24

2 2 ch check ckouts

  • Booking and subscription are both order bundles.
  • Each has its own checkout process:
  • Entering several drivers for the subscription.
  • Different order summaries.
  • Different payment solutions (credit card and/or bank transfer).
  • Different emails and contents depending on the bundle of order.

Case study of business specific

slide-25
SLIDE 25

Cu Customi

  • mized ch

check ckout

  • No cart: 1 booking by checkout with direct access.
  • Simplify inputs during the process:
  • the driver(s) and their vehicle and reuse existing data.
  • Summary and highlights are specific to the current purchase.
  • Specific payment (payline / slimpay).
  • Display personalized information (access code, booking information).
  • Send personalized emails.

Case study of business specific

slide-26
SLIDE 26

Sp Speci cific pr produc duct co concept

  • A product is named here a pocket: a parking area in a given place.
  • The different booking possibilities lead to an infinite number of

possible products if we wanted to represent them all in terms of parking spots.

  • The booking will then be qualified according to different parameters:
  • The desired booking period.
  • Some time stayed.
  • Wished options.

Case study of business specific

slide-27
SLIDE 27

No No fi fixed pr price per per pr produc duct

  • A parking spot does not have a fixed price, but different prices depending
  • n many criterias.
  • The calculation of the price of a booking is based on:
  • The desired booking period.
  • The rental duration.
  • The wished options.
  • The ongoing promotions (automatic or via coupon).
  • The yield rules.
  • The data specific to our booking (period, option, etc) are directly stored in
  • ur order.

Case study of business specific

slide-28
SLIDE 28

No No fi fixed pr price per per pr produc duct

  • The calculation system is managed directly in Drupal (not
  • utsourced).
  • All the required data for the calculation of these rates are:
  • Daily imported from an ERP from CSV files.
  • Stored in entities related to the data models sent.
  • Commerce 2.x provides a service that allows us to integrate our own

price calculation rules.

Case study of business specific

slide-29
SLIDE 29

Th The pr price is is dy dyna namic

Solution

  • Using the Commerce

2.x service

commerce_price.price_resolver.

  • Storage of all data

relevant to the calculation in entities

  • Use of this data in

calculation rules

Case study of business specific

slide-30
SLIDE 30

Sp Speci cific av availability ma manageme ment

  • The availability of a parking spot depends:
  • The desired booking period.
  • Wished options.
  • Opening hours of the car park.
  • Possible capacity.
  • The number of parking spots already booked over the period according to the
  • ptions.
  • Each car park has its own capacity per period.
  • The number of parking spots already booked per option are stored in an

entity.

Case study of business specific

slide-31
SLIDE 31

We Webservices an and im import/ t/export

  • Bulk import via Migrate:
  • Orders
  • Promotions
  • Business data (prices, car parks, opening hours, etc.)
  • Expose and consume web services in Soap/XML and JSON
  • CRUD orders, users, drivers, vehicles
  • Availabilities
  • Rate calculation
  • Export of data file. About ten different exports in several formats: CSV and

proprietary formats.

Case study of business specific

slide-32
SLIDE 32

Looking on the weaknesses

  • f Drupal Commerce 1.x
slide-33
SLIDE 33

Whi Which wo would ha have e been been more e lab laborio ious (o (or im impossib ible) le)

  • On-the-fly price calculation.
  • Different checkouts.
  • Web services.
  • Cache management.
  • Import/export structure of entities via the features module.
  • Using Rules module instead of events.

Looking on the weaknesses of Drupal Commerce 1.x

slide-34
SLIDE 34

Problems and solutions

slide-35
SLIDE 35

Find Find th the e bes est t rate e / rate e ca calculation on

  • n t

the di displ play

Solution

  • Dummy order generation to use calculation commerce features from

an order:

  • Adjustments
  • Promotions
  • Price Resolver

Problems and solutions

slide-36
SLIDE 36

Ca Calls to

  • Dru

rupal and ex external se services s must not be be una unavailabl ble

Solution

  • Add an abstraction and retention layer via Symfony + RabbitMQ.
  • Drupal only provides and manages JSON.
  • Symfony application deals with the conversion between Drupal and

external if needed.

Problems and solutions

slide-37
SLIDE 37

Ca Calls to

  • Dru

rupal and ex external se services s must not be be una unavailabl ble

Problems and solutions Drupal RabbitMQ Symfony Website Queues ERP / CRM / Patners / Others

JSON XML CSV

ERP CRM Partners Partners Partners ERP

slide-38
SLIDE 38

Se Secu curi ring cr critical fea eatur ures es

Solution

  • Implementation of automatic tests via PHPUnit.
  • Manual functional tests by a team of testers.

Problems and solutions

slide-39
SLIDE 39

Qu Quality de devel elopm pmen ent in in lin line e wi with go good pr practices es

Solution

  • Systematic review of any code. Use of Gitlab and merge requests.

Development branch blocked and mandatory validation by the Lead dev.

  • Use of Code Sniffer:
  • PHPCS
  • Eslint and SassLint
  • Code audit via SonarQube.

Problems and solutions

slide-40
SLIDE 40

Th The tw two pa paymen ent ga gateways us used ed do do no not ex exist

  • n
  • n c

comme

  • mmerce 2.

2.x

Solution

  • Creation of two modules.
  • The commerce 2.x plugin and interface system
  • shortens the time required to create payment modules
  • helps to maintain consistency between different modules.

Problems and solutions

slide-41
SLIDE 41

Expo Expose se web b se services

Solution

  • Drupal 8.x offers by default a REST module to expose a CRUD of the

data in JSON format.

  • Commerce 2.x integrates its entities perfectly into this functionality.
  • Easy creation of new REST resources as needed.

Problems and solutions

slide-42
SLIDE 42

St Start rt be before co commerce 2.0 release

Solution

  • Follow the issues.
  • Talk with Commerce Guys to know what current state commerce 2.x

is in.

  • Help on required issues for the project.

Problems and solutions

slide-43
SLIDE 43

On Only lead lead de dev kn knew ab about t Dr Drupal al Commer erce

Solution

  • Training people.
  • Drupal Commerce is Drupal + Symfony. Easy to move on, knowing

both.

  • Reviews help a lot to improve skills.

Problems and solutions

slide-44
SLIDE 44

Ma Maintain co consistency be between een en envir vironm nmen ents ts

Solution

  • Use LXC to have containers by application.
  • First half of project, always install to get other people stuff back.
  • Second half of project, switch to update.
  • Everything has to be scripted: No changed has to be made manually.

Install and update:

  • Bash scripts to run commands and scripts.
  • Drush commands to install, update.
  • Import configuration with config_split and config filter.

Problems and solutions

slide-45
SLIDE 45

I I ha have e an an is issue ue / I I need need th this is mi missing fea eatur ure

Solution

  • Participate to issues on drupal.org.
  • Create patchs (or PR for commerce 2.x)
  • On core
  • On contrib modules

Problems and solutions

slide-46
SLIDE 46

Improvments

A personal thought about what we could improve.

slide-47
SLIDE 47

Pr Price ca calculation

  • Optimization of the price calculation engine to improve its

performance (cost and time).

Improvments

Se Secu cure de devel elopm pmen ent

  • Increase automatic functional tests to avoid regressions on critical

features.

  • Use of BeHat or equivalent to include the customer in the tests writing.
slide-48
SLIDE 48

Ba Back-of

  • ffice i

inputs

  • Management of paragraphs via a "library" more explicit than the

interface provided by default.

  • Improvment of the interface of nested paragraphs.

Axes d’amélioration

slide-49
SLIDE 49

Fr Front-Of Offi fice

  • More harmonious use of javascript when searching and calculating

prices for a better user experience.

  • Reduce page weight.
  • The integration of forms in the front-office is still the black spot for

front-end developers.

Axes d’amélioration

slide-50
SLIDE 50

Outcomes

slide-51
SLIDE 51

Ou Outcomes

  • A business e-commerce project outside the traditional online sales

sites.

  • Big points of business complexity.
  • Commerce 2.x more flexible and better designed than Commerce 1.x.
  • Commerce 2.x adapted to business commerce.
  • An online site with an ever-increasing number of sales.

Outcomes

slide-52
SLIDE 52

Questions ?