You are here

public function Order::removeAdjustment in Commerce Core 8.2

Removes an adjustment.

Parameters

\Drupal\commerce_order\Adjustment $adjustment: The adjustment to remove.

Return value

$this

Overrides EntityAdjustableInterface::removeAdjustment

File

modules/order/src/Entity/Order.php, line 367

Class

Order
Defines the order entity class.

Namespace

Drupal\commerce_order\Entity

Code

public function removeAdjustment(Adjustment $adjustment) {
  $this
    ->get('adjustments')
    ->removeAdjustment($adjustment);
  $this
    ->recalculateTotalPrice();
  return $this;
}