Bright WooCommerce Integrations Actions And Filters

Override the order details block included in emails and the order details page

By default, when creating a license key, the # of available seats for each course in the order is equal to the quantity of the items purchased.

Use this filter to replace this logic. For example, this block will make the # of available seats be the SUM of all product quantities in the order:

add_filter('bright_woocommerce_determine_quantity', function ($quantity, $data) {
  $items = \Bright\extractFromArray($data,'items', array());

  $total_quantity = 0;
  foreach($items as &$item) 
    $total_quantity += $item->get_quantity();

  return $total_quantity;
}, 10, 2);