Commit 757083c1 authored by googletorp's avatar googletorp

Issue #2452835 by bgilhome: Access $form_state in shipping options hook...

Issue #2452835 by bgilhome: Access $form_state in shipping options hook (hook_commerce_shipping_service_rate_options_alter)
parent f9d347a0
......@@ -187,7 +187,7 @@ function hook_commerce_shipping_calculate_rate($line_item) {
*
* @see commerce_shipping_service_rate_options()
*/
function hook_commerce_shipping_service_rate_options_alter(&$options, $order) {
function hook_commerce_shipping_service_rate_options_alter(&$options, $order, &$form_state) {
// No example.
}
......
......@@ -629,7 +629,7 @@ function commerce_shipping_service_rate_calculate($service, $price, $order_id =
* An options array of calculated shipping rates labeled using the display
* title of the shipping services.
*/
function commerce_shipping_service_rate_options($order) {
function commerce_shipping_service_rate_options($order, &$form_state) {
$options = array();
foreach ($order->shipping_rates as $name => $line_item) {
......@@ -642,7 +642,7 @@ function commerce_shipping_service_rate_options($order) {
}
// Allow modules to alter the options array generated for the rates.
drupal_alter('commerce_shipping_service_rate_options', $options, $order);
drupal_alter('commerce_shipping_service_rate_options', $options, $order, $form_state);
return $options;
}
......@@ -814,7 +814,7 @@ function commerce_shipping_line_item_add_form($form, &$form_state) {
);
// Create an options array based on the rated services.
$options = commerce_shipping_service_rate_options($order);
$options = commerce_shipping_service_rate_options($order, $form_state);
$options['manual'] = t('Manually specify a shipping service and rate.');
$form['shipping_service'] = array(
......
......@@ -52,7 +52,7 @@ function commerce_shipping_pane_checkout_form($form, &$form_state, $checkout_pan
commerce_shipping_collect_rates($order);
// Generate an array of shipping service rate options.
$options = commerce_shipping_service_rate_options($order);
$options = commerce_shipping_service_rate_options($order, $form_state);
// If at least one shipping option is available...
if (!empty($options)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment