You are here

function uc_stock_uc_checkout_complete in Ubercart 8.4

Implements hook_uc_checkout_complete().

Decrements stock if Rules is not installed.

File

uc_stock/uc_stock.module, line 189
Allow ubercart products to have stock levels associated with their SKU.

Code

function uc_stock_uc_checkout_complete(OrderInterface $order) {

  // @todo When Rules actually works, we can uncomment this conditional.

  //if (!\Drupal::moduleHandler()->moduleExists('rules')) {
  array_walk($order->products, 'uc_stock_adjust_product_stock', $order);

  //}
}