public function AdjustmentTransformerInterface::sortAdjustments in Commerce Core 8.2
Sorts adjustments by their type's weight.
For example, tax adjustments will be placed after promotion adjustments, because the tax adjustment type has a higher weight than the promotion one, as defined in commerce_order.commerce_adjustment_types.yml.
Parameters
\Drupal\commerce_order\Adjustment[] $adjustments: The adjustments.
Return value
\Drupal\commerce_order\Adjustment[] The sorted adjustments.
1 method overrides AdjustmentTransformerInterface::sortAdjustments()
- AdjustmentTransformer::sortAdjustments in modules/
order/ src/ AdjustmentTransformer.php - Sorts adjustments by their type's weight.
File
- modules/
order/ src/ AdjustmentTransformerInterface.php, line 49
Class
- AdjustmentTransformerInterface
- Provides common logic for processing and transforming adjustments.
Namespace
Drupal\commerce_orderCode
public function sortAdjustments(array $adjustments);