You are here

public function CommerceCurrencyResolversRefreshTrait::checkOrderStatus in Commerce Currency Resolver 8

Check if order is in draft status.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: Order object.

Return value

bool Return true if order is not in draft state.

1 call to CommerceCurrencyResolversRefreshTrait::checkOrderStatus()
CommerceCurrencyResolversRefreshTrait::shouldCurrencyRefresh in src/CommerceCurrencyResolversRefreshTrait.php
Get refresh state based on path.

File

src/CommerceCurrencyResolversRefreshTrait.php, line 67

Class

CommerceCurrencyResolversRefreshTrait
Handle access where currency resolver can refresh order.

Namespace

Drupal\commerce_currency_resolver

Code

public function checkOrderStatus(OrderInterface $order) {

  // Only draft orders should be recalculated.
  return $order
    ->getState()->value !== 'draft';
}