I have a rule which adds a percentage of the order amount to the shipping costs.

I use "commerce-line-item:order:commerce-order-total:amount" as the base price.

But unfortunately this amount has the tax (21%) in it.

How do I get the total amount in my rule without the tax in it?


I solved it using the commerce_price_components module. Some details about it (from its project page):

Extension to Drupal commerce that provides a price formatter to enable/disable price components such as discounts or taxes when displaying prices. This gives the admin absolute control over which components should be displayed and which shouldn't.

It also provides two Views handlers to display/hide price components in cart totals and order totals.

Additionally it has basic rules support that gives to the commerce administrators the ability to do conditions using price components such as discounts or taxes and react accordingly.

It gave me a new data selector, i.e site:current-cart-order:commerce-order-total:base-price:amount, which was exactly what I needed.

|improve this answer|||||

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.