function commerce_product_pricing_invoke in Commerce Core 7
Invokes the sell price calculation callback configured via the "Price calculation process" option.
Parameters
$line_item: The product line item used for sell price calculation.
3 calls to commerce_product_pricing_invoke()
- commerce_cart_add_to_cart_form_submit in modules/
cart/ commerce_cart.module - Form submit handler: add the selected product to the cart.
- commerce_cart_order_refresh in modules/
cart/ commerce_cart.module - Refreshes the contents of a shopping cart by finding the most current prices for any product line items on the order.
- commerce_product_calculate_sell_price in modules/
product_pricing/ commerce_product_pricing.module - Returns the calculated sell price for the given product.
File
- modules/
product_pricing/ commerce_product_pricing.module, line 501 - Enables Rules based product sell price calculation for dynamic product pricing.
Code
function commerce_product_pricing_invoke($line_item) {
$callback = variable_get('commerce_product_pricing_callback', 'rules_invoke_event');
// Defaults to rules_invoke_event if the specified callback doesn't exist.
if (!function_exists($callback)) {
$callback = 'rules_invoke_event';
}
$callback('commerce_product_calculate_sell_price', $line_item);
}