I am attempting to evaluate shipping methods and multiple shipping options for a order. The commerce_shipping module doesn't appear to add the shipping method into the order nor into the pane or page states.

This makes it very hard to determine the selected shipping method and run rules or evaluation state while calculating values for a pane, or the review page.

How can I reference the selected shipping method within the cart order?

CommentFileSizeAuthor
#3 Untitled-2.png30.73 KBdavidd07

Comments

googletorp’s picture

Shipping line items are added to the order with reference to the shipping method that created them.

googletorp’s picture

Status: Active » Closed (works as designed)

Closing

davidd07’s picture

StatusFileSize
new30.73 KB

I am also trying to do some logic on the shipping_method via the hook_commerce_checkout_pane_info_alter() hook. I need to figure out what shipping method was selected and hide the shipping pane if the "Pickup" option was selected on the previous pane. Although I can see the shipping_method handle via $order = commerce_cart_order_load($user->uid) it is deeply buried and makes no sense to me how I can properly reference this variable.

davidd07’s picture

A user on this post http://drupal.org/node/1285902 suggests using $order->data['shipping_method'] but this property is not available to me. Any help much appreciated.