You are here

function commerce_free_shipping_variable_info in Commerce Free Shipping 7

Implements hook_variable_info().

File

./commerce_free_shipping.module, line 81
Implements hook_commerce_shipping_service_info_alter() to change the price of the shipping service, when it's needed.

Code

function commerce_free_shipping_variable_info($options) {
  $shipping_services = commerce_shipping_services();
  foreach ($shipping_services as $service) {
    $base = $service['base'];
    $variables[$base . '_free_shipping_gift_message'] = array(
      'type' => 'text',
      'title' => t('%base Free shipping message.', array(
        '%base' => $service['display_title'],
      ), $options),
      'description' => t('Display a message when the user get free shipping price for %base.', array(
        '%base' => $service['display_title'],
      ), $options),
      'default' => 'You have got free pricing on ' . $service['display_title'] . ', because your order total has raise %rate !',
      'group' => 'variable_commerce',
    );
    $variables[$base . '_free_shipping_rules_reject_message_display'] = array(
      'type' => 'text',
      'title' => t('%base Message if free shipping rules conditions failed.', array(
        '%base' => $service['display_title'],
      ), $options),
      'description' => t('Display a message when the user don\'t get free shipping price because of the rules conditions for %base.', array(
        '%base' => $service['display_title'],
      ), $options),
      'default' => 'You have got free pricing on ' . $service['display_title'] . ', because your order total has raise %rate !',
      'group' => 'variable_commerce',
    );
    $variables[$base . '_free_shipping_reject_message'] = array(
      'type' => 'text',
      'title' => t('%base Message if price threshold condition failed.', array(
        '%base' => $service['display_title'],
      ), $options),
      'description' => t('Display a message when the user don\'t get free shipping price because the order amount is below the price threshold for %base.', array(
        '%base' => $service['display_title'],
      ), $options),
      'default' => 'You have got free pricing on ' . $service['display_title'] . ', because your order total has raise %rate !',
      'group' => 'variable_commerce',
    );
  }
  return $variables;
}