Skip to content

Commit 79bbff8

Browse files
committed
commerce@f231d4a
Finish 5.5.0
1 parent 7258365 commit 79bbff8

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

docs/.artifacts/commerce/5.x/orders-carts.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
| [customerId](#customerid) | Narrows the query results based on the customer, per their user ID.
2121
| [dateAuthorized](#dateauthorized) | Narrows the query results based on the orders’ authorized dates.
2222
| [dateCreated](#datecreated) | Narrows the query results based on the orders’ creation dates.
23+
| [dateFirstPaid](#datefirstpaid) | Narrows the query results based on the orders’ first paid dates.
2324
| [dateOrdered](#dateordered) | Narrows the query results based on the orders’ completion dates.
2425
| [datePaid](#datepaid) | Narrows the query results based on the orders’ paid dates.
2526
| [dateUpdated](#dateupdated) | Narrows the query results based on the orders’ last-updated dates.
@@ -422,6 +423,42 @@ $orders = \craft\commerce\elements\Order::find()
422423
:::
423424

424425

426+
#### `dateFirstPaid`
427+
428+
429+
Narrows the query results based on the orders’ first paid dates.
430+
431+
Possible values include:
432+
433+
| Value | Fetches orders…
434+
| - | -
435+
| `'>= 2018-04-01'` | that were first paid on or after 2018-04-01.
436+
| `'< 2018-05-01'` | that were first paid before 2018-05-01
437+
| `['and', '>= 2018-04-04', '< 2018-05-01']` | that were first paid between 2018-04-01 and 2018-05-01.
438+
439+
440+
441+
::: code
442+
```twig
443+
{# Fetch orders that were first paid for recently #}
444+
{% set aWeekAgo = date('7 days ago')|atom %}
445+
446+
{% set orders = craft.orders()
447+
.dateFirstPaid(">= #{aWeekAgo}")
448+
.all() %}
449+
```
450+
451+
```php
452+
// Fetch orders that were first paid for recently
453+
$aWeekAgo = new \DateTime('7 days ago')->format(\DateTime::ATOM);
454+
455+
$orders = \craft\commerce\elements\Order::find()
456+
->dateFirstPaid(">= {$aWeekAgo}")
457+
->all();
458+
```
459+
:::
460+
461+
425462
#### `dateOrdered`
426463

427464

@@ -469,7 +506,7 @@ Possible values include:
469506
| - | -
470507
| `'>= 2018-04-01'` | that were paid on or after 2018-04-01.
471508
| `'< 2018-05-01'` | that were paid before 2018-05-01
472-
| `['and', '>= 2018-04-04', '< 2018-05-01']` | that were completed between 2018-04-01 and 2018-05-01.
509+
| `['and', '>= 2018-04-04', '< 2018-05-01']` | that were paid between 2018-04-01 and 2018-05-01.
473510

474511

475512

0 commit comments

Comments
 (0)