Skip to content

Commit 600f140

Browse files
committed
Remove second discount event
1 parent 76a257a commit 600f140

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

docs/commerce/5.x/extend/adjusters.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ The rest of this page covers discount and shipping adjusters even though there i
2020

2121
## Registering a New Adjuster
2222

23-
You can register your adjuster class by including it in the `types` array attribute of the [`registerOrderAdjusters`](events.md#registerorderadjusters) or [`registerDiscountAdjusters`](events.md#registerdiscountadjusters) event model.
23+
You can register your adjuster class by pushing it onto the `types` attribute of the model emitted by [`EVENT_REGISTER_ORDER_ADJUSTERS`](events.md#registerorderadjusters):
2424

25-
::: code
26-
```php Order Adjuster
25+
```php
2726
use craft\commerce\services\OrderAdjustments;
2827
use yii\base\Event;
2928
use MyAdjuster;
@@ -36,22 +35,8 @@ Event::on(
3635
}
3736
);
3837
```
39-
```php Discount Adjuster
40-
use craft\commerce\services\OrderAdjustments;
41-
use yii\base\Event;
42-
use MyAdjuster;
43-
44-
Event::on(
45-
OrderAdjustments::class,
46-
OrderAdjustments::EVENT_REGISTER_DISCOUNT_ADJUSTERS,
47-
function(RegisterComponentTypesEvent $event) {
48-
$event->types[] = MyAdjuster::class;
49-
}
50-
);
51-
```
52-
:::
5338

54-
The order of the adjustments within the `types` array is important because adjusters will be called in exactly that sequence when an order is calculated.
39+
The order of the adjustments within the `types` array is important: adjusters are called in exactly that sequence when an order is calculated.
5540

5641
::: tip
5742
Even if you don’t add or replace an adjuster you might still use either event solely to change the order in which *existing* adjustments are applied.

0 commit comments

Comments
 (0)