0

I need a Rule to apply sales tax to shipping on a sales order.

I tried the following code (borrowed from here: https://www.drupal.org/node/2307695) and it doesn't work for me:

{ "rules_apply_sales_tax_to_shipping" : {
"LABEL" : "Apply sales tax to shipping",
"PLUGIN" : "reaction rule",
"WEIGHT" : "5",
"OWNER" : "rules",
"REQUIRES" : [ "commerce_tax", "commerce_shipping" ],
"ON" : { "commerce_shipping_calculate_rate" : [] },
"DO" : [
{ "commerce_tax_calculate_by_type" : {
"commerce_line_item" : [ "commerce_line_item" ],
"tax_type_name" : "sales_tax"
}
}
]
}
}

Maybe there is a typo? There are only two tax_types on our site, sales_tax and VAT so I don't think so.

Do I need to add this as an Action onto our Sales Tax? I don't see how to do this... this does not appear in the drop down list of available Actions.

2
  • Do you have any conditions on the Rules component for the taxes in question? Nov 3 '14 at 16:55
  • No. At the risk of sounding stupid (again). There are no conditions in the Rule for Calculate Sales Tax on the product line items. Shouldn't I simply be able to clone -that- rule (CST) but point it to line items of type 'shipping'? I just don't know how to do it. FWIW: I can't figure out for the life of me how to address the variables through the UI. TIA --JC
    – jchwebdev
    Nov 3 '14 at 22:33
0

don't know if you solved this yet (hope so). The trick is to set your tax rate and THEN apply is a calculation rule to shipping. Not the most intuitive way to do it, but it works.

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.