Hello everyone,

I setup the drupal commerce flate rate module with the shipping module. They are both the latest versions.
The problems that I have with the Flat rate module. I had the one page checkout page. But Since the flat rate shipping was not showing, I said it is fine , I am going to live with it, but I added one more step to the checkout page: The Order Review page. It shows everything correctly there.

BUT:

1. If a visitor or a user misses the required fields in the checkout page. The flat rate shows and the cost doubles. For example, it shows $5.00 when you come to checkout page, but If you miss any required fields you will get a red message on the screen and then the cost doubles on the in the Shipping Pane view in the checkout page. If a fills everything correclty and moves to the next page this does not happens.

2. If I fill everything and go the review page and come back the flat rate cost shows the double ammount. It shows $10.00 instead of $5.00.

Any help would be appreciate it.

Thank You

Comments

drupalizedworld’s picture

Hey guys !

I figured it out !!! In the configurations for the shipping add another action "Delete all shipping line items from an order" and once you get there add the line item that you created for example yourline_item:order and Save.

The problem: It was adding the shipping as a line item in the order. So the shipping was becoming the a line item in the order. Since we had loop, it was adding additional $5.00

I hope this helped.

Thank you

drupalizedworld’s picture

Now I have another problem.

I have setup two different rules that add $5.00 and $2.00 flat rate shipping. Now it doubles it too. I have the same "Delete...." action however.

I would appreciate any thought or suggestion on this problem.

Cheers !

mrP’s picture

Issue summary: View changes

I'm running into the same problem. My configuration was based on Randy Fay's Using Calculation Rules to Add Per-Item Shipping in Commerce Shipping screencast.

As a temporary workaround, I:

1. Modified the default rule "Delete shipping line items on shopping cart updates" and removed the second condition that prevented it from firing when the order was unchanged.

{ "commerce_shipping_cart_update_delete" : {
    "LABEL" : "Delete shipping line items on shopping cart updates",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "commerce_shipping", "entity" ],
    "ON" : { "commerce_order_update" : [] },
    "IF" : [
      { "data_is" : { "data" : [ "commerce-order:status" ], "value" : "cart" } }
    ],
    "DO" : [
      { "commerce_shipping_delete_shipping_line_items" : { "commerce_order" : [ "commerce-order" ] } }
    ]
  }
}

2. Modified the default rule "Collect rates: Flat rate" and added a condition to not fire the rule if a shipping line item already exists.

NOT Shipping line item exists
Parameter: Order: [commerce_order], Shipping service: Standard shipping (Flat rate)

Its not ideal, since the Shipping Service pane will read "No shipping rates found for your order. Please continue the checkout process." but it does prevent duplicate calculation.

rszrama’s picture

Category: Bug report » Support request
Priority: Critical » Normal
Status: Active » Closed (won't fix)

The Shipping module's default integration with checkout really doesn't expect you to be adding shipping line items to the order directly. As that is an unsupported use case (and this is quite old), I'm going to go ahead and close this out.