You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/commerce/3.x/customers.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ If a customer chooses to register an account on order completion, a Craft user a
80
80
81
81
If any of the above fail, the user account will not be created; errors will be logged but not displayed or returned.
82
82
83
-
The Commerce [example templates](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/checkout/payment.twig) display a “Register me for a user account” checkbox at the payment stage—but only if a user account doesn’t already exist for the email address on the cart:
83
+
The Commerce [example templates](https://github.com/craftcms/commerce/blob/3.x/example-templates/dist/shop/checkout/payment.twig) display a “Register me for a user account” checkbox at the payment stage—but only if a user account doesn’t already exist for the email address on the cart:
84
84
85
85
```twig
86
86
{# Get a user account using the same email address as the cart #}
Copy file name to clipboardExpand all lines: docs/commerce/3.x/orders-carts.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ axios.get('', {
82
82
83
83
Either of the examples above will generate a new cart in the session if none exists. While it’s unlikely you would make this assignment more than once per page request, getting the cart more than once does not affect performance.
84
84
85
-
To see what cart information you can use in your templates, take a look at the [Order](commerce3:craft\commerce\elements\Order) class reference. You can also see sample Twig in the example templates’ [`shop/cart/index.twig`](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/cart/index.twig).
85
+
To see what cart information you can use in your templates, take a look at the [Order](commerce3:craft\commerce\elements\Order) class reference. You can also see sample Twig in the example templates’ [`shop/cart/index.twig`](https://github.com/craftcms/commerce/blob/3.x/example-templates/dist/shop/cart/index.twig).
86
86
87
87
<toggle-tiptitle="Example Order">
88
88
@@ -270,7 +270,7 @@ You can remove a line item by including a `remove` parameter in the request. Thi
270
270
```
271
271
272
272
::: tip
273
-
The [example templates](example-templates.md) include a [detailed cart template](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/cart/index.twig) for adding and updating items in a full checkout flow.
273
+
The [example templates](example-templates.md) include a [detailed cart template](https://github.com/craftcms/commerce/blob/3.x/example-templates/dist/shop/cart/index.twig) for adding and updating items in a full checkout flow.
274
274
:::
275
275
276
276
#### Options Uniqueness
@@ -577,7 +577,7 @@ This will set temporarily the order’s calculation mode to *Recalculate All* an
577
577
578
578
### Order Notices
579
579
580
-
Notices are added to an order whenever it changes, whether it’s the customer saving the cart or a store manager recalculating from the control panel. Each notice is an [OrderNotice](https://github.com/craftcms/commerce/blob/main/src/models/OrderNotice.php) model describing what changed and could include the following:
580
+
Notices are added to an order whenever it changes, whether it’s the customer saving the cart or a store manager recalculating from the control panel. Each notice is an [OrderNotice](https://github.com/craftcms/commerce/blob/3.x/src/models/OrderNotice.php) model describing what changed and could include the following:
581
581
582
582
- A previously-valid coupon or shipping method was removed from the order.
583
583
- A line item’s purchasable was no longer available so that line item was removed from the cart.
Copy file name to clipboardExpand all lines: docs/commerce/3.x/pdfs.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ You’ll need to enter a few details:
15
15
-**Name** is whatever you’d like to call the PDF in the control panel.
16
16
-**Handle** is a reference to be used in templates.
17
17
-**Description** is an optional note for explaining the template’s layout or purpose.
18
-
-**PDF Template Path** should point to the Twig template that should be used for rendering the PDF file. (Add the [receipt example template](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/_private/receipt/index.twig) here if you’d like to see one in action.)
18
+
-**PDF Template Path** should point to the Twig template that should be used for rendering the PDF file. (Add the [receipt example template](https://github.com/craftcms/commerce/blob/3.x/example-templates/dist/shop/_private/receipt/index.twig) here if you’d like to see one in action.)
19
19
-**Order PDF Filename Format** determines what the generated filename should look like. It can include tags for outputting order properties such as `{number}` or `{myOrderCustomField}`. (A `.pdf` extension will automatically be appended so you don’t need to add it here.)
20
20
-**Enabled?** can be used to quickly toggle the PDF and control whether it’s available and sent in emails configured to use it.
21
21
-**Default Order PDF** will appear only when you’re editing an additional or non-default PDF. Select this checkbox to make the current template the new default when you save it.
@@ -38,7 +38,7 @@ Create a new [order status email](emails.md) or select an existing one. You’ll
38
38
39
39
## Creating PDF Templates
40
40
41
-
It might be easiest to start by modifying the [example receipt template](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/_private/receipt/index.twig), previewing it in a browser for convenience until things are mostly as you’d like them.
41
+
It might be easiest to start by modifying the [example receipt template](https://github.com/craftcms/commerce/blob/3.x/example-templates/dist/shop/_private/receipt/index.twig), previewing it in a browser for convenience until things are mostly as you’d like them.
42
42
43
43
Avoid extending your regular site layouts for PDF templates, since your site most likely includes references to scripts and styles that may cause issues with PDF conversion.
Copy file name to clipboardExpand all lines: docs/commerce/3.x/tax.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -309,7 +309,7 @@ You would like to charge 10% tax on all electronic items and 5% tax on everythin
309
309
310
310
## Templating
311
311
312
-
It’s common to display tax information to a customer in the context of their cart, since applicable taxes may depend on order items and the shipping address. Check out the [cart](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/cart/index.twig) in the Commerce [example templates](example-templates.md), which includes taxable totals.
312
+
It’s common to display tax information to a customer in the context of their cart, since applicable taxes may depend on order items and the shipping address. Check out the [cart](https://github.com/craftcms/commerce/blob/3.x/example-templates/dist/shop/cart/index.twig) in the Commerce [example templates](example-templates.md), which includes taxable totals.
| `cp.commerce.discount.edit` | After discount detail view’s “Enabled” field.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/discounts/_edit.twig)</small>
10
-
| `cp.commerce.discounts.edit.content` | After discount detail view’s main content.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/discounts/_edit.twig)</small>
11
-
| `cp.commerce.discounts.edit.details` | After discount detail view’s existing right sidebar details column.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/discounts/_edit.twig)</small>
12
-
| `cp.commerce.discounts.edit` | Before discount detail view’s template blocks.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/discounts/_edit.twig)</small>
13
-
| `cp.commerce.discounts.index` | After discounts index view’s main content.<br><small>[promotions/discounts/index.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/discounts/index.twig)</small>
14
-
| `cp.commerce.order.edit` | Before order edit view’s template blocks.<br><small>[orders/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/orders/_edit.twig)</small>
15
-
| `cp.commerce.order.edit.details` | After existing order edit view’s right sidebar details.<br><small>[orders/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/orders/_edit.twig)</small>
16
-
| `cp.commerce.order.edit.main-pane` | After existing content within order edit view’s “Order Details” tab.<br><small>[orders/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/orders/_edit.twig)</small>
17
-
| `cp.commerce.product.edit.content` | After product detail view’s custom fields.<br><small>[products/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/products/_edit.twig)</small>
18
-
| `cp.commerce.product.edit.details` | After existing product detail view’s right sidebar details.<br><small>[products/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/products/_edit.twig)</small>
19
-
| `cp.commerce.sales.edit.content` | After sale detail view’s main content.<br><small>[promotions/sales/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/sales/_edit.twig)</small>
20
-
| `cp.commerce.sales.edit.details` | After sale detail view’s existing right sidebar details column.<br><small>[promotions/sales/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/sales/_edit.twig)</small>
21
-
| `cp.commerce.sales.edit` | Before sale detail view’s template blocks.<br><small>[promotions/sales/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/sales/_edit.twig)</small>
22
-
| `cp.commerce.sales.index` | After sales index view’s main content.<br><small>[promotions/sales/index.twig](https://github.com/craftcms/commerce/blob/main/src/templates/promotions/sales/index.twig)</small>
23
-
| `cp.commerce.subscriptions.edit.content` | After the last `.pane` in subscription detail view’s content block.<br><small>[subscriptions/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/subscriptions/_edit.twig)</small>
24
-
| `cp.commerce.subscriptions.edit.meta` | After the discount detail view’s existing right sidebar details.<br><small>[subscriptions/_edit.twig](https://github.com/craftcms/commerce/blob/main/src/templates/subscriptions/_edit.twig)</small>
9
+
| `cp.commerce.discount.edit` | After discount detail view’s “Enabled” field.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/discounts/_edit.twig)</small>
10
+
| `cp.commerce.discounts.edit.content` | After discount detail view’s main content.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/discounts/_edit.twig)</small>
11
+
| `cp.commerce.discounts.edit.details` | After discount detail view’s existing right sidebar details column.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/discounts/_edit.twig)</small>
12
+
| `cp.commerce.discounts.edit` | Before discount detail view’s template blocks.<br><small>[promotions/discounts/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/discounts/_edit.twig)</small>
13
+
| `cp.commerce.discounts.index` | After discounts index view’s main content.<br><small>[promotions/discounts/index.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/discounts/index.twig)</small>
14
+
| `cp.commerce.order.edit` | Before order edit view’s template blocks.<br><small>[orders/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/orders/_edit.twig)</small>
15
+
| `cp.commerce.order.edit.details` | After existing order edit view’s right sidebar details.<br><small>[orders/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/orders/_edit.twig)</small>
16
+
| `cp.commerce.order.edit.main-pane` | After existing content within order edit view’s “Order Details” tab.<br><small>[orders/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/orders/_edit.twig)</small>
17
+
| `cp.commerce.product.edit.content` | After product detail view’s custom fields.<br><small>[products/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/products/_edit.twig)</small>
18
+
| `cp.commerce.product.edit.details` | After existing product detail view’s right sidebar details.<br><small>[products/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/products/_edit.twig)</small>
19
+
| `cp.commerce.sales.edit.content` | After sale detail view’s main content.<br><small>[promotions/sales/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/sales/_edit.twig)</small>
20
+
| `cp.commerce.sales.edit.details` | After sale detail view’s existing right sidebar details column.<br><small>[promotions/sales/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/sales/_edit.twig)</small>
21
+
| `cp.commerce.sales.edit` | Before sale detail view’s template blocks.<br><small>[promotions/sales/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/sales/_edit.twig)</small>
22
+
| `cp.commerce.sales.index` | After sales index view’s main content.<br><small>[promotions/sales/index.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/promotions/sales/index.twig)</small>
23
+
| `cp.commerce.subscriptions.edit.content` | After the last `.pane` in subscription detail view’s content block.<br><small>[subscriptions/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/subscriptions/_edit.twig)</small>
24
+
| `cp.commerce.subscriptions.edit.meta` | After the discount detail view’s existing right sidebar details.<br><small>[subscriptions/_edit.twig](https://github.com/craftcms/commerce/blob/4.x/src/templates/subscriptions/_edit.twig)</small>
Either of the examples above will generate a new cart _cookie_ if none exists. However, Commerce will only create an order element when a change is made to the cart—this prevents runaway creation of empty carts for guests or bots who happen to request a page that displays some cart information like the current item quantity or total.
64
64
65
-
To see what cart information you can use in your templates, take a look at the [Order](commerce4:craft\commerce\elements\Order) class reference. You can also see sample Twig in the example templates’ [`shop/cart/index.twig`](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/cart/index.twig).
65
+
To see what cart information you can use in your templates, take a look at the [Order](commerce4:craft\commerce\elements\Order) class reference. You can also see sample Twig in the example templates’ [`shop/cart/index.twig`](https://github.com/craftcms/commerce/blob/4.x/example-templates/dist/shop/cart/index.twig).
66
66
67
67
<toggle-tiptitle="Example Order">
68
68
@@ -250,7 +250,7 @@ You can remove a line item by including a `remove` parameter in the request. Thi
250
250
```
251
251
252
252
::: tip
253
-
The [example templates](example-templates.md) include a [detailed cart template](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/cart/index.twig) for adding and updating items in a full checkout flow.
253
+
The [example templates](example-templates.md) include a [detailed cart template](https://github.com/craftcms/commerce/blob/4.x/example-templates/dist/shop/cart/index.twig) for adding and updating items in a full checkout flow.
254
254
:::
255
255
256
256
#### Options Uniqueness
@@ -600,7 +600,7 @@ This will set temporarily the order’s calculation mode to *Recalculate All* an
600
600
601
601
### Order Notices
602
602
603
-
Notices are added to an order whenever it changes, whether it’s the customer saving the cart or a store manager recalculating from the control panel. Each notice is an [OrderNotice](https://github.com/craftcms/commerce/blob/main/src/models/OrderNotice.php) model describing what changed and could include the following:
603
+
Notices are added to an order whenever it changes, whether it’s the customer saving the cart or a store manager recalculating from the control panel. Each notice is an [OrderNotice](https://github.com/craftcms/commerce/blob/4.x/src/models/OrderNotice.php) model describing what changed and could include the following:
604
604
605
605
- A previously-valid coupon or shipping method was removed from the order.
606
606
- A line item’s purchasable was no longer available so that line item was removed from the cart.
Copy file name to clipboardExpand all lines: docs/commerce/4.x/pdfs.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ You’ll need to enter a few details:
19
19
-**Name** is whatever you’d like to call the PDF in the control panel.
20
20
-**Handle** is a reference to be used in templates.
21
21
-**Description** is an optional note for explaining the template’s layout or purpose.
22
-
-**PDF Template Path** should point to the Twig template that should be used for rendering the PDF file. (Add the [receipt example template](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/_private/receipt/index.twig) here if you’d like to see one in action.)
22
+
-**PDF Template Path** should point to the Twig template that should be used for rendering the PDF file. (Add the [receipt example template](https://github.com/craftcms/commerce/blob/4.x/example-templates/dist/shop/_private/receipt/index.twig) here if you’d like to see one in action.)
23
23
-**Order PDF Filename Format** determines what the generated filename should look like. It can include tags for outputting order properties such as `{number}` or `{myOrderCustomField}`. (A `.pdf` extension will automatically be appended so you don’t need to add it here.)
24
24
-**Language** lets you designate the language to be used when the PDF is rendered. It defaults to “The language the order was made in”, and a dropdown first lists site languages and then those available to the system.
25
25
-**Enabled?** can be used to quickly toggle the PDF and control whether it’s available and sent in emails configured to use it.
@@ -43,7 +43,7 @@ Create a new [order status email](emails.md) or select an existing one. You’ll
43
43
44
44
## Creating PDF Templates
45
45
46
-
It might be easiest to start by modifying the [example receipt template](https://github.com/craftcms/commerce/blob/main/example-templates/dist/shop/_private/receipt/index.twig), previewing it in a browser for convenience until things are mostly as you’d like them.
46
+
It might be easiest to start by modifying the [example receipt template](https://github.com/craftcms/commerce/blob/4.x/example-templates/dist/shop/_private/receipt/index.twig), previewing it in a browser for convenience until things are mostly as you’d like them.
47
47
48
48
Avoid extending your regular site layouts for PDF templates, since your site most likely includes references to scripts and styles that may cause issues with PDF conversion.
0 commit comments