You are here

function commerce_discount_empty_price in Commerce Discount 7

Returns the default array structure for a price field for use when reinitializing discount line items.

Parameters

string $currency_code: The currency code.

Return value

array An initialized price array.

1 call to commerce_discount_empty_price()
commerce_discount_commerce_cart_order_refresh in ./commerce_discount.module
Implements hook_commerce_cart_order_refresh().

File

./commerce_discount.module, line 1440
Defines the discount and discount offer entities, bundles and functionality.

Code

function commerce_discount_empty_price($currency_code) {
  $price = array(
    'amount' => 0,
    'currency_code' => $currency_code,
  );
  $price['data'] = commerce_price_component_add($price, 'base_price', $price, TRUE, FALSE);
  return $price;
}