You are here

function _commerce_product_batch_pre_calculate_sell_prices in Commerce Core 7

Calculates pre-calculation using the given range values and updates the batch with processing information.

1 string reference to '_commerce_product_batch_pre_calculate_sell_prices'
commerce_product_batch_pre_calculate_sell_prices in modules/product_pricing/commerce_product_pricing.module
Sets a batch operation to pre-calculate product sell prices.

File

modules/product_pricing/commerce_product_pricing.module, line 466
Enables Rules based product sell price calculation for dynamic product pricing.

Code

function _commerce_product_batch_pre_calculate_sell_prices($from, $count, &$context) {

  // Keep track of the total number of products covered and the total number of
  // prices created in the results array.
  if (empty($context['results'])) {
    $context['results'] = array(
      0,
      0,
    );
  }

  // Increment the number of products processed.
  $context['results'][0] += $count;

  // Increment the number of actual prices created.
  $context['results'][1] += commerce_product_pre_calculate_sell_prices($from, $count);
}