0

I have created a fee type. I set up a rule according to the steps on the module's front page. I have it set to add $5.50 to the order. However, it is only adding $0.06 to the order instead.

Here is my rule (it's disabled since it isn't currently working):

{ "rules_handling_fee" : {
"LABEL" : "Handling fee",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"OWNER" : "rules",
"REQUIRES" : [ "commerce_physical", "commerce_fees" ],
"ON" : { "commerce_fees_order" : [] },
"IF" : [
  { "commerce_physical_rules_order_is_shippable" : { "commerce_order" : [ "commerce_order" ] } }
],
"DO" : [
  { "commerce_fees_apply" : {
      "entity" : [ "commerce-order" ],
      "fee" : "handling",
      "amount" : "5.50",
      "currency_code" : "USD",
      "include_tax" : "0"
    }
  }
]

} }

1 Answer 1

1

I'd guess that 5.50 is cents, and is rounded up to $0.06. You probably need to multiple your value by 100:

  "amount" : "550",
1
  • Ah, weird. I would have thought that 0.06 would be 6 cents. I'll try that. Sure enough, that fixed it. Sounds like some helper text saying it's in pennies or whatever would be good. I would have never thought to put 550 for $5.50. Commented Jun 28, 2022 at 4:53

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.