I have a Drupal Commerce site and was having an issue with the taxes not being applied to an order. After updating from 7.x-2.8 to 7.x-2.9, my issue with the taxes was fixed but then I noticed that my shipping services weren't being added to the shipping options. I enabled rules debugging and all my rules were being triggered the way I expected, however the shipping services still aren't being added. I even added an action to my rule to add a status notification at the same time the shipping service should be added. The notice fires but the shipping service is not added. This was working in 7.x-2.8, which I realize had issues with product pricing but it worked with my shipping services.

As far as I can tell, the issue seems to be isolated to Component Rule Sets. I'm able to add a shipping service in a basic rule, but unfortunately will not work for my site and the shipping rules we need. Without going into a lengthy description of my exact shipping requirements, I can recreate my issue in a simple rule set.

To recreate the issue, add a component rule set with one or more rules in it. For this test, only one is needed. In the rule, add a condition if you want, or not. Then add the action "Add a rate for a shipping service to an order". I'm using flat rate services so I selected a flat rate shipping service. This should finishing the rule set.

Next, create a rule (not in the rule set, just a basic rule) with the event "Collecting shipping rates for an order". Then add the action with the component rule set you just created. That should finish the rule.

With your rule and rule set finished, add an item to your cart and checkout to shipping. In my case, the shipping service(s) do not appear. I've only tested this with flat rate shipping, which may or may not make a difference.

I'm using the following modules.
Drupal Commerce 7.x 1.11
Commerce Shipping 7.x 2.1
Commerce Flat Rate 7.x 1.0-beta2
Rules 7.x 2.9

Any help on this would be appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scottAtRoot802’s picture

I'm still looking for help on this. Can anyone reproduce this issue and help. I attached a sample of a rule and rule set that are not working. This is a simple example and not the actual rules I'm using in hopes to eliminate any other factors that might be at play.

scottAtRoot802’s picture

After further testing, I discovered with a fresh session the shipping services are added correctly from the rules. However, if you make any change to your order or go to any part of the shopping cart and then back to the shipping options, the shipping services do not appear.

scottAtRoot802’s picture

Priority: Normal » Minor

I figured out the issue. I needed to pass the Commerce Order into the rule set as a variable and then use that variable instead of site:current-cart-order for the "Add a rate for a shipping service to an order" data selector. Even though I was able to find a solution, I'm leaving this issue open since site:current-cart-order is an available data selector and the data integrity checked out even though it doesn't work.

fago’s picture

Title: Component Rule Set not triggering "Add a rate for a shipping service to an order" action » "Add a rate for a shipping service to an order" does not work with site:current-cart-order

Thanks - thus re-titling. So I'm wondering this can be considered a bug of Commerce Shipping then?

TR’s picture

Status: Active » Closed (works as designed)

@signalScott:

As far as I can tell, the issue seems to be isolated to Component Rule Sets.

@fago:

So I'm wondering this can be considered a bug of Commerce Shipping then?

@signalScott:

I'm leaving this issue open since site:current-cart-order is an available data selector and the data integrity checked out even though it doesn't work.

site:current-cart-order is provided by Commerce as well. This really seems to be a problem for Commerce or Commerce Shipping. If you are still having this problem please open a new issue in the appropriate queue.

LukM’s picture

I'm having the same problem, but the solution doesn't work for me. I still get te message 'No shipping rates found for your order. Please continue the checkout process.'