Discussions

Shipping

It seems like just about everyone has asked this question but there doesnt appear many answers.

Presumably some people are using DC in production now it has hit 1.0, what are these people doing for shipping?

Using Commerce Shipping Flat Rate I can create quite a complex shipping matrix satisfactorily however I dont see how this should work in the checkout flow.

If I put the Shipping on the Checkout Pane then the Shipping method options don't get updated as it is dependant on the destination (which is also on the Checkout pane).
If I put it on the review Pane then the customer doesnt see the shipping amount in their total when they submit.

How are people working this at the moment?

Cheers,
Sam

Posted: Nov 3, 2011

Comments

kim.pepper on November 7, 2011

I'm struggling with this also. Would like to hear how others are dealing with shipping.

We need to set up 2 flat rates: domestic and international, depending on the country selected. Not sure why, but the first shipping method is used regardless of country.

Kim

Prince Manfred on November 7, 2011

You could add a new page that comes after checkout but before review.

function YOUR_MODULE_commerce_checkout_page_info() {
  $checkout_pages = array();

  $checkout_pages['shipping_form_page'] = array(
    'name' => t('Shipping Page'),
    'title' => t('Shipping Information'),
    'weight' => 1,
    'status_cart' => FALSE,
    'buttons' => TRUE,
  );

  return $checkout_pages;
}

I honestly don't know where the documentation is for this hook. I'm a little uncertain on the 'status_cart' attribute too. I think it just marks the order state as being something other than in the cart (checkout?). It would be as simple as getting to the page you create and then looking at the database with phpmyadmin or something to figure that out.

Anyways, if it doesn't show up in the shipping configuration right away clear your cache and that should fix it. Change the weight value to move it's order in the process. I don't know what weight will put it where. 1 was found as an experiment.

rfay Randy Fay on November 8, 2011

@Prince Manfred, I've very much enjoyed seeing all your solutions on this site. I hope you'll consider participating in [Commerce Examples](http://drupal.org/project/commerce_examples). One of the next tasks there is demonstrating hook_commerce_checkout_page_info(). Wouldn't you have wanted to use hook_commerce_checkout_page_info_alter() here though?

[Documentation for both hook_commerce_checkout_page_info() and hook_commerce_checkout_page_info_alter()](http://www.drupalcommerce.org/specification/info-hooks/checkout) is here on this site. It's also (minimally) on [api.drupalcommerce.org](http://api.drupalcommerce.org/api/Drupal%20Commerce/ommerce--modules--ch...) Patches to improve Commerce hooks are happily accepted.

Prince Manfred on November 8, 2011

Did api.drupalcommerce.org just start working recently? It's given me an error from day one until now. Oh well. Thanks for the documentation links. hook_commerce_checkout_page_info_alter() is for editing existing pages, right? I was thinking adding a new page that falls in between checkout and review would help over come the shipping issue here. The examples project looks fun. I'll definitely start working up an example.

Cheers

rfay Randy Fay on November 8, 2011

api.dc has been going for a really long time. It was broken for a few days after we lost the server because I made a mistake rebuilding it. Please let me know about any issues you have it it.

Thanks for all your contributions!