You are here

function hook_commerce_discount_free_product_context_alter in Commerce Discount 7

Alter the context that is going to be passed into a bonus product line item.

Use this to modify the display path.

Parameters

array $context: The context that is about to be passed into a new free bonus product line item.

object $product: The product that is being offered as free.

CommerceDiscount $discount: The discount containing this offer.

1 invocation of hook_commerce_discount_free_product_context_alter()
commerce_discount_free_products in ./commerce_discount.rules.inc
Rules action: Apply free bonus products discount.

File

./commerce_discount.api.php, line 100
Hooks provided by the Commerce Discount module.

Code

function hook_commerce_discount_free_product_context_alter(&$context, $product, CommerceDiscount $discount) {
  $context['display_path'] = 'any/page';
}