0

I am carrying on with this project where we are supposed to ship for free for orders over €500. I have two rules; Free shipping and NL/BE. I make an address based comparison and role based comparison for NL/BE and amount based in Free shipping. Now, the problem is, when I test if the customer places an order for over €500 and the shipping address is in Belgium, I am still asked whether I want a free shipping or a NL/BE shipping. Obviously this shouldn't happen. What am I doing wrong?

Thanks :)

These are my rules:

{ "commerce_shipping_service_nl_be" : {
    "LABEL" : "Rate NL\/BE",
    "PLUGIN" : "rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "commerce_order", "rules", "commerce_shipping" ],
    "USES VARIABLES" : { "commerce_order" : { "label" : "Order", "type" : "commerce_order" } },
    "IF" : [
      { "commerce_order_compare_address" : {
          "commerce_order" : [ "commerce_order" ],
          "address_field" : "commerce_customer_shipping|commerce_customer_address",
          "address_component" : "country",
          "value" : "BE"
        }
      },
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "6" : "6" } }
        }
      }
    ],
    "DO" : [
      { "commerce_shipping_service_rate_order" : {
          "shipping_service_name" : "nl_be",
          "commerce_order" : [ "commerce-order" ]
        }
      }
    ]
  }
}
}

and

{ "commerce_shipping_service_free_shipping" : {
    "LABEL" : "Rate Free shipping",
    "PLUGIN" : "rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "commerce_shipping" ],
    "USES VARIABLES" : { "commerce_order" : { "type" : "commerce_order", "label" : "Order" } },
    "IF" : [
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "4" : "4", "6" : "6" } }
        }
      }
    ],
    "DO" : [
      { "commerce_shipping_service_rate_order" : {
          "shipping_service_name" : "free_shipping",
          "commerce_order" : [ "commerce-order" ]
        }
      }
    ]
  }
}
0

I at last managed to find out. I should have paid more attention to the video I've watched. What I needed to do was add the exact opposite condition to NL/BE rule, that is if the order's total amount is lower than €500.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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