You are here

function xquantity_stock_xquantity_availability_applies_alter in Commerce Extended Quantity 8

Implements hook_TYPE_alter().

Allows to check if stock support applies to the current product variation.

See also

\Drupal\xquantity_stock\XquantityStockAvailabilityChecker::applies()

File

modules/xquantity_stock/xquantity_stock.module, line 15
Contains xquantity_stock.module.

Code

function xquantity_stock_xquantity_availability_applies_alter(&$applies, $entity) {

  // Apply your own logic for checking.
  // if (($entity->id() == 123) || ($entity->bundle() == 'my_variation_type_name')) {
  //   $applies = FALSE;
  // }
}