Skip to content

Commit fa3ba30

Browse files
authored
Merge pull request #654 from craftcms/commerce-5.1
Commerce 5.1
2 parents 00e449f + 7050b8b commit fa3ba30

22 files changed

+2879
-2721
lines changed

docs/.artifacts/commerce/5.x/product-query-params.md

Lines changed: 1430 additions & 0 deletions
Large diffs are not rendered by default.

docs/.artifacts/commerce/5.x/products-variants.md

Lines changed: 0 additions & 2619 deletions
Large diffs are not rendered by default.

docs/.artifacts/commerce/5.x/variant-query-params.md

Lines changed: 1035 additions & 0 deletions
Large diffs are not rendered by default.

docs/5.x/reference/twig/global-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Additional variables provided by Craft.
3636
Variable | Description
3737
--- | ---
3838
[_globals](#globals) | Get and set values on a globally-available store.
39-
[craft](#craft) | A <craft5:craft\web\twig\variables\CraftVariable> object.
39+
[craft](#craft-2) | A <craft5:craft\web\twig\variables\CraftVariable> object.
4040
[currentSite](#currentsite) | The requested site.
4141
[currentUser](#currentuser) | The currently logged-in user.
4242
[devMode](#devmode) | Whether Dev Mode is enabled.

docs/commerce/5.x/development/cart.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,16 @@ Craft includes a powerful [internationalization engine](guide:tutorial-i18n#plur
9393

9494
### Line Items
9595

96-
A cart’s contents are represented by _line items_. Line items are populated from [purchasables](../system/purchasables.md) when they are added to the cart (out-of-the-box, this will almost always be a [variant](../system/products-variants.md)), and have a quantity, description, notes, a calculated subtotal, options, adjustments (like tax and shipping costs), and other metadata. Most importantly, though, the line item retains a reference to its purchasable so that it can be refreshed with the latest information from your store while the customer is shopping.
96+
A cart’s contents are represented by _line items_. Line items are typically populated from [purchasables](../system/purchasables.md) when they are added to the cart, but [custom line items](#custom-line-items) can also be created on-the-fly. <Since product="commerce" ver="5.1.0" feature="Custom, ad-hoc line items" />
9797

98-
This section will cover displaying information about what is in a customer’s cart or completed order; to learn about working with an active cart, jump to [Managing Cart contents](#managing-cart-contents)!
98+
Out-of-the-box, line items [variant](../system/products-variants.md), and have a quantity, description, notes, a calculated subtotal, options, adjustments (like tax and shipping costs), and other metadata. Most importantly, though, the line item retains a reference to its purchasable so that it can be refreshed with the latest information from your store while the customer is shopping.
9999

100100
::: tip
101-
Even in the event a product or variant is altered or deleted after a customer checks out, enough information is memoized on each line item to reconstruct what was purchased, and how much was paid.
101+
In the event a product or variant is altered or deleted after a customer checks out, enough information is memoized on each line item to reconstruct what was purchased, and how much was paid. Some of this is recorded directly on the line item (like [prices](#prices) and its [physical attributes](#physical-properties)), and some is stored as metadata (like [options](#line-item-options-and-notes) and [snapshots](../system/purchasables.md#snapshots)).
102102
:::
103103

104+
To learn about working with an active cart, jump to [Managing Cart contents](#managing-cart-contents).
105+
104106
Line items are always returned as an array, even if there is only a single item in the cart. Loop over them to display information about each one:
105107

106108
```twig{2}
@@ -668,7 +670,7 @@ If the customer is a registered user, they may want to continue shopping from an
668670
When a guest with an active cart creates an account, that cart will be remain active after logging in.
669671
:::
670672

671-
You can allow a logged-in customer to see their previously used carts:
673+
You can allow a logged-in customer to see their previous (incomplete) carts:
672674

673675
::: code
674676
```twig
@@ -758,9 +760,11 @@ With that list of carts, you can build a form to switch between multiple carts:
758760
</form>
759761
```
760762

763+
While Commerce combines similar line items in the active cart, this simple form may list the same purchasable more than once.
764+
761765
### Forgetting a Cart
762766

763-
A logged-in customer’s cart is stored in a cookie that persists across sessions, so they can close their browser and return to the store without losing their cart. If the customer logs out, Commerce gives them a new cart.
767+
A logged-in customer’s cart is stored in a cookie that persists across sessions, so they can close their browser and return to the store without losing their cart. If the customer logs out, Commerce assigns the “guest” a new cart.
764768

765769
Removing all the items from a cart doesn’t mean that the cart is forgotten, though—sometimes, fully detaching a cart from the session is preferable to emptying it. To remove a cart from the customer’s session (without logging out or clearing the items), make a `POST` request to the [`cart/forget-cart` action](../reference/controller-actions.md#post-cart-forget-cart). A cart number is _not_ required—Commerce can only detach the customer’s current cart.
766770

docs/commerce/5.x/development/making-payments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ Like the [`commerce/payments/pay`](../reference/controller-actions.md#post-payme
169169
- [requireShippingAddressAtCheckout](../configure.md#requireshippingaddressatcheckout)
170170

171171
::: warning
172-
If you enable order completion without payment, completed orders will have the same status as any others. Don’t forget to make sure store managers are aware of the change and prepared to confirm payment before fulfilling orders!
172+
If you enable order completion without payment, completed orders will have the same status as any others. Make sure store managers are aware of this subtle difference and are prepared to confirm payment before fulfilling orders!
173173

174-
If you use these workflows, consider adding columns to the main Order [element indexes](/5.x/system/elements.md#indexes) for _Date Paid_ or _Amount Paid_ so that it is clear which orders need attention.
174+
If you use these workflows, consider adding columns to the main Order [element indexes](/5.x/system/elements.md#indexes) for _Date Paid_, _Paid Status_, or _Amount Paid_ so that it is clear which orders need attention.
175175
:::
176176

177177
### Checkout with Partial Payment
42.8 KB
Loading
-1.22 KB
Loading
346 KB
Loading
-49.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)