@spree/docs 0.1.266 → 0.1.268

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,7 +41,8 @@ On top of that, meaningful business moments get their own events:
41
41
 
42
42
  | Event | Meaning |
43
43
  |---|---|
44
- | `order.placed` | A customer completed checkout |
44
+ | `order.placed` | An order was placed — one per order, so a checkout that split across several sellers publishes one per seller |
45
+ | `order_group.completed` | A checkout that split finished — one event for the whole purchase |
45
46
  | `order.paid` | Payment is settled in full |
46
47
  | `order.canceled` | The order was cancelled |
47
48
  | `order.fulfilled` / `order.delivered` | Everything has shipped / arrived |
@@ -137,7 +137,9 @@ Writes a discount on each fulfillment covering its delivery cost. The row is kep
137
137
 
138
138
  ### Free items (`CreateLineItems`)
139
139
 
140
- Adds specified products to the cart when the promotion is eligible, checking stock first. Items are not removed automatically if eligibility is lost — customers remove them manually.
140
+ Adds specified products to the cart when the promotion is eligible, checking stock first, and discounts them to zero. A customer who already has the gift in their cart gets theirs free rather than a duplicate; any further copies they bought stay paid for. The gift is taken back when the promotion stops applying.
141
+
142
+ No second action is needed to make the gift free — pairing this with an order discount set to the gift's price discounts it twice.
141
143
 
142
144
  **Use case:** "Free gift with purchase", "Spend $100 get a free sample".
143
145
 
@@ -271,6 +271,14 @@ curl -X PATCH https://your-store.com/api/v3/admin/orders/or_UkLWZg9DAJ/complete
271
271
  ```
272
272
 
273
273
 
274
+ ### One confirmation, and it describes the purchase
275
+
276
+ The customer made one purchase, so they get one confirmation email — sent from the group, not from any of its orders. Each child order is placed silently.
277
+
278
+ If you replace the confirmation email, replace it at the group level too: the email a customer receives for a split checkout is `Spree::OrderGroupMailer`, reacting to the `order_group.completed` event, and a re-send from any child order in the admin sends the purchase's email rather than that child's. A checkout that doesn't split is unaffected and still sends the ordinary order confirmation.
279
+
280
+ > **NOTE:** **Orders and deliveries are different counts.** Three seller orders do not mean three parcels. When several sellers' goods ship from one warehouse, the checkout quotes one delivery charge, and the split divides that charge between the orders rather than charging for it again — so one box arrives. Ask the group for `fulfillment_groups` to get the parcels that really ship; each one knows its delivery method, its cost, the goods it carries and who is sending it. Counting child orders instead promises the customer deliveries that will never arrive.
281
+
274
282
  ## Commission
275
283
 
276
284
  Commission is what the marketplace charges for the sale — configured as **rates**, and recorded per sale as immutable **commission lines**.
@@ -375,6 +375,14 @@ A handler receives the workflow (so it can read `order`, `items`, `created_by`,
375
375
  - **Customers are emailed their download links** when the order is placed, from the new `Spree::DigitalAssetMailer` in the optional `spree_emails` gem. Hosts that already send their own download email should either suppress it (`send_consumer_transactional_emails`) or drop their own. The dashboard's order page can re-send it.
376
376
  - **Digital assets are managed through the Admin API and dashboard**, and signed-in customers can list everything they have bought at `GET /api/v3/store/customers/me/digital_links`.
377
377
 
378
+ ## Free-gift promotions price their own gift
379
+
380
+ The `Create line items` promotion action now discounts the items it adds down to zero. It used to add them at their full price and leave the discounting to you.
381
+
382
+ > **WARNING:** **Delete the second action if you paired one with it.** The old guidance was to add a whole-order discount set to the gift's price to pay for the gift. That discount still applies, so a promotion configured the old way now discounts twice — the gift is free *and* the order discount comes off. Open each promotion using `Create line items`, and remove the accompanying `Create whole-order adjustment` that exists only to cancel out the gift.
383
+
384
+ Two further changes come with it. A customer who already has the gift variant in their cart now gets theirs free rather than a second copy being added, and the promotion applies where it previously did nothing at all. And a gift is only taken back out of the cart for promotions actually applied to that order, so a customer who bought the gift variant themselves without qualifying keeps it.
385
+
378
386
  ## Dependency injection changes
379
387
 
380
388
  6.0 introduces `*_workflow` keys for the flows that graduated to the workflow tier. The old `*_service` keys **stay settable and readable one release so applications don't crash at boot — but a legacy write is stashed, not applied**: a class written against the old service contract is not interchangeable with the workflow the new call sites consume. Reads return your stashed class (legacy code calling its own override keeps working), falling back to the workflow. Removed in 6.1.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spree/docs",
3
- "version": "0.1.266",
3
+ "version": "0.1.268",
4
4
  "description": "Spree Commerce developer documentation for AI agents and local reference",
5
5
  "type": "module",
6
6
  "license": "CC-BY-4.0",