How to get handle on shipping_type from checkout_pane

Posts: 73
Joined: 12/16/2007
Uber Donor

I am starting to work on a module to calculate freight charges. I've created a new shipping_type and checkout_pane.

How can I get a handle on the order's product's shipping_type(s) from the checkout_pane hook? I need to be able to check the all the products in the order, if none of them include the new 'Freight' shipping type then I will return the function without displaying the new pane.

Is this possible, or is there a better way?

Thanks for any help with this!

Posts: 2352
Joined: 08/07/2007
AdministratoreLiTe!

A new shipping type is good, but you don't need another checkout pane. Instead you need to make a shipping method which returns all of the rate information to the shipping quote pane that's already there. It sorts out the shipping types and figures out which methods are the best ones to use. If your "freight" type is lighter than "small package", the freight method will be used instead of UPS or FedEx. Since Flatrate and those like it can be applied to any shipping type, they'll always be used.

Take a look at the Weightquote and UPS modules and see how they do things. Those are (hopefully) the best examples for you to work from.

Posts: 73
Joined: 12/16/2007
Uber Donor

I am using the existing shipping pane for displaying the shipping prices. The new pane I created was to gather freight options from the customer (lift gate, residential/business). This freight option pane is where I wanted to get a handle on the shipping type to tell it to display or not. Is this possible? Or, is there another way to display the options to the customer?

Thanks for you help~

Complete Computer Care | The Cosmic Gift | Florida Fossils | Team Hope Evangelism

Posts: 2352
Joined: 08/07/2007
AdministratoreLiTe!

What I usually do is figure out all the different options the customer can choose, get the prices for them and return all of the quotes at once. The customer gets to choose which price they want, which corresponds to the option they need.

I believe that would be much easier than trying to get data from the checkout pane to the workflow-ng action for the quote.

Posts: 73
Joined: 12/16/2007
Uber Donor

I have taken your advice and am trying to generate the freight quotes strictly through a shipping_method (it's not as pretty as having the checkout_pane options).

My question: is there any way to add a title or description in the shipping charge options box?

Example

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A Title and/or description of the freight charges and options
Freight Shipping Option 1
Freight Shipping Option 2
Freight Shipping Option 3
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thank you for your help~

Complete Computer Care | The Cosmic Gift | Florida Fossils | Team Hope Evangelism

Posts: 2352
Joined: 08/07/2007
AdministratoreLiTe!

So far I've been able to use the "option_label", but I also added support for a "notes" field. I know I used it for something at some point, but I can't find the example now.