ok here is my story. I'm attempting to add a new shipping method. In our particular case we're charging based upon a shipment date that is added in via a custom module. I initially started off at hook_line_item adding in a custom line item. This led me into a deadend when I couldn't get the line_item to show up on actual checkout (charging of the credit card).

Next I went off to modify the flatrate module. Initially I want to just add in a new Quote method for the workflow_ng action but after reviewing the code this seemed impossible; which throughly confused me since the UI has a dropdown menu with only a single option.

anyhow. I finally resorted to copying the entire uc_flatrate module and modifying it. Unfortunately we I started to use it I noticed that uc_flatrate_quote wasn't receiving all of the products, only 4 of them we're making it over. Now I'm thoroughly confused.

My custom module implements hook_line_item and the $order array contains everything in the order.

My copied and unmodified version of uc_flatrate in the uc_flatrate_quote function $products doesn't contain the full cart rather only 4 items (if # of items in cart > 4).

My immediate question is
What's up with uc_flatrate_quote not receiving the full cart?

but what I really want is
How the heck do I create a new custom shipping method that looks at all of the items in the cart to come up with a total shipping fee?

Comments

Island Usurper’s picture

Status: Active » Closed (works as designed)

I finally had a thought that might be useful. The quote module only sends the shippable items to the quote methods, because the non-shippable items might not have a weight, and that would confuse most of them. Make sure all of your products are shippable. There's a checkbox both on the node form, and in its product features. Set them in both places.