1

With Drupal Commerce and the Australian GST calculation module, I have been trying to calculate taxes as early as possible.

Most of the customers to the site are Australian and will have to pay the taxes. Rather than give them a nasty surprise I'd like to add GST by default and then get rid of it if the person's shipping address isn't Australian.

I created a secondary OR condition in the GST rule as below:

enter image description here

If the country component of the order address is AU or if it is not set, then calculate GST.

The current effect is that GST never get calculated.

1

It looks like your problem might be caused by the incorrect usage of the "OR" (within your Rules Conditions). The logic you have in your "conditions" is like so:

  • Order address component comparison.
  • AND one of the next conditions in the OR group must be true:
    • Data value is empty.

Here is an attempt to translate your current Rules Conditions:

"Order address component comparison must be TRUE" AND "Data value is empty".

I doubt that is what you wanted to implement as Rules Conditions, but that is how Rules actually interprets them ...

I'm not sure which (at least 2!) set of Rules Conditions you wanted to combine with the "OR"-operator, but what is shown in your question for sure cannot be right. Maybe you want to try to see what happens if you adapt your Rules Conditions like so:

  • OR one of the next conditions in the OR group must be true:
    • Order address component comparison.
    • Data value is empty.

That is: move the "Order address"-condition below the OR, and also indent it (same indent as for "Data value is empty).

So if either (or both) of those 2 Rules Conditions are satisfied, then the Rules Actions will be performed. That should be pretty close to "*If the country component of the order address is AU OR (repeat: OR !!!) if it is not set, then calculate GST*" (as in your question).

For an interesting video tutorial about this, refer to "Combining conditions". Somewhere around '9:00' (near the end), it has a similar OR condition. Here is a summary of that tutorial:

  • How to be confused over the positioning of the AND and OR statements
  • How to combine conditions with AND requirements
  • How to combine conditions with OR requirements
  • How to combine AND and OR groups to create complex conditions
  • Some advice about the order of conditions
  • How to delete reaction rules
  • Why you shouldn't use the "send e-mail to all users in a role" action
  • Why it might be useful to have messages printed out when configuring complex rules
  • I forgot. Reverse polish kind of thing. OR a | b. – Interlated Nov 1 '17 at 23:40

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.