Imagine an online furniture store with hundreds of SKUs, where each combination of fabric and legs is a separate product with its own price and stock. On WooCommerce, this would require a dozen plugins and workarounds. Drupal Commerce 2.x handles it out of the box. Architecture based on plugins and YAML configs lets you flexibly describe any product hierarchy. Drupal Commerce is not just a shopping cart; it's a framework for complex e-commerce logic.
Problems We Solve
Standard Drupal modules don't always cover complex e-commerce logic. For example, a product with multiple variations (color, size) and different prices. Or multi-level discounts based on order history. Clients often come to us after failed attempts to adapt WooCommerce to Drupal. When 1C integration is required at the order and stock level, Commerce 2.x performs better.
But that's not all. A real case: a client sells furniture with dozens of fabric and leg combinations. Each combination is a separate SKU with price and stock. In Commerce 2.x, this is handled via Product Variation and custom fields via Field API. Another example: you need to consolidate one order from products in different stores (multi-store). Commerce Stores natively supports separate carts and payment profiles. The development savings are clear: no need to write custom modules for each task.
Why Commerce 2.x Is Better Than Commerce 1.x?
Commerce 2.x was completely rewritten for newer Drupal versions and is incompatible with the first version. Key differences:
| Criteria | Commerce 1.x (D7) | Commerce 2.x (D8+) |
|---|---|---|
| Architecture | Rules + Features | Plugins + YAML config |
| State management | Rules | State Machine |
| Multi-site | Complex | Stores out of the box |
| API | Hook-based | OOP + Events |
If your project is still on Drupal 7, you'll either have to use legacy Commerce 1.x or migrate with a full redesign. Our experience shows that migration from Commerce 1.x to 2.x takes 2–4 weeks depending on customizations.
How We Do It: A Concrete Case
We worked with a furniture retailer that had 500+ SKUs and 30 fabric options. Each fabric variant had its own price and stock level. The client needed:
- Custom variation fields (fabric, leg type)
- Integration with 1C for inventory
- A faceted search for product attributes
- A two-step checkout (address + payment)
We built the solution on Drupal 10 and Commerce 2.x. Product variations were created programmatically, and we used the commerce_stock module for multi-warehouse inventory. The checkout flow was customized with two steps: shipping address and payment. The faceted search used Search API with Solr. Result: checkout time reduced from 4 steps to 2, product upload time cut by 60%, and inventory sync errors dropped by 90%.
Migration from Commerce 1.x? Here's What to Do
Migration is not just data transfer; it's a rework of business logic. Commerce 1.x and 2.x are incompatible: modules, hooks, database structure – everything is different. We develop a migration plan that includes: audit of current functionality, export data to CSV/JSON, writing migration scripts on Migrate API, setting up a new store from scratch. After migration, orders and stock are transferred, and custom checkout flows are rewritten for the plugin architecture.
Basic Installation via Composer
composer require drupal/commerce drupal/commerce_price drupal/commerce_store \ drupal/commerce_product drupal/commerce_order drupal/commerce_cart \ drupal/commerce_checkout drupal/commerce_payment drupal/commerce_tax drush en commerce commerce_product commerce_cart commerce_checkout \ commerce_payment commerce_tax commerce_order -y drush cr Additional modules
For payment gateways: `composer require drupal/commerce_stripe drupal/commerce_paypal`. For inventory: `commerce_stock`. For 1C: `commerce_1c`. For search: `search_api` + `search_api_solr`.Store and Product Type Configuration
Create a store at /admin/commerce/config/stores. Set the base currency, default country, and list of countries for shipping.
Products in Commerce are divided into product (card) and variation (SKU with price). Create product types and variation types via the admin. For programmatic creation, use code:
use Drupal\commerce_price\Price; use Drupal\commerce_product\Entity\Product; use Drupal\commerce_product\Entity\ProductVariation; $variation = ProductVariation::create([ 'type' => 'default', 'sku' => 'CHAIR-BLK-L', 'price' => new Price('1499.00', 'RUB'), 'field_color' => ['target_id' => $colorTermId], 'field_size' => 'L', ]); $variation->save(); $product = Product::create([ 'type' => 'default', 'title' => 'Office Chair', 'stores' => [$storeId], 'variations' => [$variation], ]); $product->save(); For the catalog, use Views. Set up filters by price, attributes, store. For faceted search, connect Search API and Solr.
Customizing the Checkout Flow for Your Business Logic
Commerce 2.x lets you customize the checkout process via Checkout Flows. You can add or remove steps: login, shipping address, payment, confirmation. If you need a non-standard field, like an order note, create a plugin:
/** * @CommerceCheckoutPane( * id = "custom_gift_note", * label = @Translation("Gift note"), * default_step = "order_information", * ) */ class GiftNotePane extends CheckoutPaneBase { public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form): array { $pane_form['gift_note'] = [ '#type' => 'textarea', '#title' => $this->t('Message to recipient'), '#rows' => 3, ]; return $pane_form; } } Connect payment gateways: Stripe, PayPal, YooKassa via respective modules. Configuration includes API keys and mode selection (test/live). We guarantee support for the latest Drupal versions.
Inventory Management and Taxes
Commerce does not include inventory out of the box – use the commerce_stock module. It adds a stock level field to variations and supports multiple warehouses.
use Drupal\commerce_stock\StockServiceManagerInterface; $stockService = \Drupal::service('commerce_stock.service_manager') ->getService($productVariation); $level = $stockService->getStockLevel($productVariation, $locations); $stockService->createTransaction( $productVariation, $locationId, [], 100, new Price('0', 'RUB'), 'RUB', TRANSACTION_TYPE_IN, [] ); Taxes are configured via the commerce_tax module. Create a tax type, set the rate and territories. For example, 20% VAT for Belarus. Commerce automatically applies the rate based on the customer's address.
What's Included in the Work
- Requirements analysis and technical specification
- Drupal and Commerce installation on hosting
- Store configuration, product and variation types
- Development of custom checkout steps (if needed)
- Payment gateway and tax setup
- Inventory integration
- Catalog setup with search
- Testing and administrator training
- System documentation
- 1-month warranty
Timeline Estimates
| Stage | Time |
|---|---|
| Installation and store setup | 2–3 days |
| Checkout customization | 2 days |
| Payment gateway integration | 1–3 days |
| Inventory management | 1–2 days |
| Catalog with faceted search | 2–4 days |
| Taxes | 1–2 days |
A basic working store takes 1.5 to 2 weeks. A complex project with custom logic takes 3 to 5 weeks. Get a preliminary estimate: we'll help you understand which modules are needed and how long development will take. Contact us to discuss details.







