I have created a rule which add the shipping methods on cart page. It works fine when we add or delete the items from cart. BUT there is no event available on rules which fire when we increase the product quantity and update the cart.

I already used the event "After updating an existing commerce line item" but it is also not doing the job.

Here is my rule:

{ "rules_auto_add_shipping_service" : {
    "LABEL" : "Auto-add shipping service",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [
    "ON" : {
      "commerce_cart_product_add" : [],
      "commerce_cart_product_remove" : [],
      "commerce_rules_extra_line_item_quantity_changed" : []
    "IF" : [
      { "commerce_order_compare_total_product_quantity" : {
          "commerce_order" : [ "commerce_order" ],
          "operator" : "\u003E=",
          "value" : "1"
    "DO" : [
      { "commerce_shipping_method_collect_rates" : {
          "shipping_method_name" : "flat_rate",
          "commerce_order" : [ "commerce-order" ]
      { "commerce_shipping_rate_apply" : {
          "commerce_order" : [ "commerce-order" ],
          "shipping_service_name" : [ "" ]
  • Can you further edit your question to explain the Rules Condition you have in your rule, and also explain that "commerce_order_compare_total_product_quantity" in it? Sorry if that's a silly question, but is that a field of some entity? If not what is it? Also, are you familiar with Rules Debugging (the typical approaches to do so)? Jul 30, 2016 at 11:27

1 Answer 1


Make sure you have the Commerce rules extra module installed. This module will provide, among other things, the extra Rules Event "Quantity of line item has changed" (as described on its project page):

Line item quantity has changed (occurs when adding or removing a product to cart and when an amount has been modified in the cart form).

That should help to achieve your goal.

  • Thanks Pierre,I used the "Commerce rules extra module" and also used the "Quantity of line item has changed" event,it is also not working.
    – fanatic
    Jul 30, 2016 at 11:07
  • @fanatic: can you edit your question by including an export of your rule you have so far (the one that "does not work")? Jul 30, 2016 at 11:13
  • Please check updated question with ""Commerce rules extra module"
    – fanatic
    Jul 30, 2016 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.