Install
Works with Drupal: ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
79.07 KB
MD5: d9850aa5505a0dedd86ab8747682ae1e
SHA-1: d339a4ee9599ea68b01d26b54e47377c1b9126b9
SHA-256: 0c8be52aa293978d7c49d4b2991726a2229d7b84cc27ca66d5904ded7a75fa0e
Download zip
122.2 KB
MD5: 0b80aa51f0f3da7f934e67caa5504f9b
SHA-1: d422a60c8be258bcdffd05883f37de506656a739
SHA-256: 6494134ac533230a7df9a0be3bebe3821cf7337eb63ae4229e2de34e38a8eb57
Release notes
1.1.0 is a feature release. It now requires Drupal 11 and PHP 8.4; Drupal 10 sites should stay on 1.0.x. After updating, run drush updb: three update hooks set the new settings and create a table.
Upgrade notes
- Requirements: Drupal
^11, PHP>=8.4, Commerce 3 and Commerce Shipping^3. Drupal 10 and Commerce Shipping 2.x are no longer supported. - Product reads return the full record. They used to send
brief=true; they now sendincludeAttributes=true, so each page is larger but still one request. Update 10001 turns this on and adds the "Include obsolete products" setting (off). - Cron syncs product changes only. To read the whole catalog, use the new
drush commerce_unleashed:sync:products:full(aliascu-sync-full), which runs as a batch. - The sales order status is a setting. Update 10002 sets it to
Placed, the status that was hard-coded before. - Stock warehouses are a setting. Update 10003 creates the
commerce_unleashed_warehouse_stocktable and the warehouse settings. While no warehouses are chosen, stock is the total across every warehouse, as before.
New features
- Stock per warehouse. Choose which warehouse codes count towards sellable stock, for example to leave out a retail shop or a quarantine store.
- Each warehouse is read on its own and the figures are kept per warehouse, so a delta read (the default window is 1 day) can be added up correctly.
- A full read runs on a configurable interval, daily by default.
- The write is all-or-nothing: if the read fails for any warehouse, or a full read comes back empty, nothing is written.
- Only one sync runs at a time, and API calls are retried with backoff.
drush commerce_unleashed:sync:stockgains--fulland--quiet-changes.- A new event,
UnleashedEvents::STOCK_CHANGED, gives the before and after quantity for each changed SKU, for reindexing, cache invalidation or back-in-stock notices.
- New submodule: Commerce Unleashed Invoice. It requires
drupal/commerce_invoice.- It copies Unleashed sales invoices and credit notes into Commerce invoices, with totals that match Unleashed to the penny.
- An invoice is read when its order reaches a configured state.
- Credit notes are read as changes since the last run, and are attached to their order.
- Drush:
commerce-unleashed:invoices:backfillandcommerce-unleashed:credit-notes.
- Product sync:
- a separate setting for the product type, which used to always match the variation type;
- an on/off setting for updating existing prices;
- a choice of price field, the default sell price or any sell price tier (useful for trade or customer-group pricing);
- separate page sizes for delta and full reads, clamped to what the API allows.
- Orders:
- a carriage code for each shipping method, read from a
field_unleashed_carriage_skufield on the shipping method and falling back to the site-wide shipping SKU; - a configurable sales order status;
- a warning in the log when an order's lines and tax will not add up to its total, which Unleashed rejects.
- a carriage code for each shipping method, read from a
- Customer event: the new
UnleashedEvents::UNLEASHED_ORDER_CUSTOMERlets a site choose which Unleashed customer an order belongs to, for example a trade account ordering on behalf of a venue. - Settings page: the settings form is now a tab, so submodules can add their own tabs beside it.
Bug fixes
- When a customer lookup failed, the module took it to mean "no customer" and created a duplicate. A failed lookup is now reported as an error, and no customer is created.
- Customer lookups took partial matches on the code. They now require an exact match and read every page of results; a match that differs only in case is accepted if there is no exact one.
- Customer list pages are now requested by page number in the URL path. A
page=query parameter is ignored by the API, which returned page 1 every time. - A query containing
+(for examplejo+shop@example.com) failed its signature check with a 403. - Syncing one product by SKU now reads the full record, and only that exact SKU. The
productCodefilter matches on the start of the code, so similar SKUs were picked up too. - A SKU missing from the stock table showed as out of stock instead of "not managed by Unleashed".
- The API credential getters failed when the settings were empty.
- A full product sync no longer recurses once per page, and the "last synced" marker is only saved after a complete, unfiltered read.
- The availability checker now handles purchasable entities that are not product variations.
API changes for developers
- New methods on
UnleashedManagerInterface, which custom implementations must add:syncProductPage(),getOrderCustomerCode(),getCustomerFromOrder(),getCustomerByCode()andgetProductsBySku();getProductType(),getProductsBaseQuery(),includeAttributes()andincludeObsolete();getProductsPageSize(),getStockPageSize()andgetStockWarehouses();syncPrice(),getPriceField()andgetPayloadPrice().
getShippingSku()takes an optional?ShipmentInterface $shipment.getCustomerByMail()is deprecated; usegetCustomerByCode().getCustomerFromOrder()returns an array with anerrorkey when the lookup fails.UnleashedClient::getCustomers(),getSalesOrders()andgetPurchaseOrders()accept a page number.- New services:
commerce_unleashed.stock_syncandcommerce_unleashed.warehouse_stock_ledger, plus thelogger.channel.commerce_unleashedlogger channel.