I was looking for some information about Ubercart 3.x + Inclusive Tax all over the place but I didn't find much. Am I missing an option somewhere? Please help me and point me to the right direction. Thanks in advance.

#42 includevat.zip1.81 KBRyanm81
#39 uc_taxes-enter_sell_price_inclusive_of_tax-1333868-39.patch1.99 KBmitrpaka
FAILED: [[SimpleTest]]: [MySQL] 2,936 pass(es), 1 fail(s), and 0 exception(s). View
#36 uc_taxes-enter_sell_price_inclusive_of_tax-1333868-36.patch1.91 KBmitrpaka
FAILED: [[SimpleTest]]: [MySQL] 2,892 pass(es), 1 fail(s), and 0 exception(s). View
Members fund testing for the Drupal project. Drupal Association Learn more


longwave’s picture

Status: Active » Fixed

Configure a tax rate as normal and select "Include this tax when displaying product prices".

genox’s picture

Status: Fixed » Active

No, see, it is a swiss/european store. This means that all product prices are being entered into the price field already with taxes applied. When I check this option, I end up with VAT applied twice. Is there any info on how to implement European VAT models in ubercart 3 without hacking any modules? For ubercart 2 there is uc_vat. But this is nowhere close to a release for uc 3. Is there anyone out there with an European store based on uc 3 at all? If so, how did you solve the tax problem?

genox’s picture

Title: How to setup a store with tax inclusive prices? » How to setup an European store with tax/vat inclusive prices?

Changed title to be more specific.

longwave’s picture

Title: How to setup an European store with tax/vat inclusive prices? » Allow prices to be entered inclusive of tax
Category: support » feature

For now, enter your prices exclusive of VAT, then tax inclusive prices will be displayed and tax won't be charged twice. Changing this to a feature request.

genox’s picture

Ok thanks. I will also keep an eye in uc_vat development.

longwave’s picture

As I maintain both modules, I intend to merge most or all of uc_vat's features into Ubercart 7.x-3.x core sooner or later, unless someone else steps up to help out with uc_vat.

remus1’s picture

Can I please add my name to this feature request.
I spent last night trying to get Ubercart 3 to work with UK Vat, where we sell to the general public with vat included in the price and vat already included in the delivery/shipping price.
So as an example of whats needed at checkout/invoice

item inc vat 25.00
delivery 5.99

sub total 30.99

vat at 20% within this purchase 5.16

Total Due 30.99

I have two sites which could use Ubercart 3 if it would work for the Uk area.

stevieb’s picture

like remus1 the same formula is needed here in Germany

it is possible to use the display price throughout the ubercart process except in the billing where the prices of the line items only show without the vat.

Manurk’s picture

I would need this for a shop in Germany, too.

whizzkid’s picture

Certainly something needs improving in this area. I have configured UK VAT so that I enter prices excluding VAT but prices shown on the site include it and everything looks fine - the invoice is fine, showing the total and VAT. The only problem is the calculation of the total price:

If you are buying 750 items at £20 each you would expect the total to be £15,000.00 not £14,999.99 shown on the checkout page. Also slightly worrying is that the view cart page shows the total as £15,000.00 and the block in the payment method pane on the checkout page shows this:

Subtotal: £12,500.00
Free Shipping: £0.00
Subtotal excluding taxes: £12,500.00
VAT: £2,500.00
Order total: £14,999.99

Now that really does not add up!

AJen’s picture

I have a current project where entering prices tax inclusive is required - is there a workaround for this?
In Australia it is usual to enter prices tax inclusive.

etron770’s picture

There are problems when entering the prices excluding taxes. So it would be nice to add the feature asap.
1. Sometimes the taxes are changing but the total price should not change. the only solution is to change all articles :-(
2. sometimes there is a result of 4.01€ instead ob 4.00 Euro because of rounding issues.

it seems to be a major priority for some European countries. Like Ajen in Australia I am hardly able find user for an Ubercart shop here in Germany without that feature. Entering including Tax is required from the user here.

etron770’s picture

Priority: Normal » Major

As it its impossible to use for user in countries where included Taxes are common I would set it on major

tfranz’s picture

Me too (Germany), mainly because of rounding issues!

marameodesign’s picture

Subscribe. We are working on a big project in ubercart 3.1 and we are stuck on this issue - Very annoying for the clients and us stripping the tax out all the time, especially when we are talking of about 2000 products!

steve65140’s picture

I need this for a store in France.
As far as I can see Ubercart 3 is unusable in Europe because of the rounding errors.

longwave’s picture

What rounding errors? Please give an example.

etron770’s picture

The problem are not only rounding issues. In counties like Australia France Austria , Germany ans so on we are used to see the including tax prices. Additionally we have like most other countries prices near the next "border" means 9.99 4.99 and so on.
We must now calculate every price without tax so that there is the suitable price including tax - imagine this for hundreds of products.
try to get 9,99 including 19% tax:
you have to take an calculator 9,99/1,19 - more work
without tax 8.39495. If you insert in 8,39 you get 9.98 :-(
so you have to insert more than 2 digits - means more work
Additionally we have to recalculate those prices if the taxes are rising f.e from 19% to 20% .
If the taxes are rising the price including taxes will rise f.e taxes from 19 to 20%
8,39495 + 20% -> 10,07
After that the price is above the psychological border of 9,99
Imagine you have thousands of small products an you have to look for each product not to get unusual prices after rising the taxes. There is no way to deal with insert prices with taxes excluded for countries which are used (or forced by law like Germany) to show prices including taxes.

I hope I explained the problem

tfranz’s picture

For example a rounding-error:

Article is selling for 1.98 € inclusive 19% tax.
Price without tax should be 1.663865546218487 € , but value in the database is 1.66387 €

Selling 1000 pieces (for example screws):

1.98 € * 1000 = 1980.00 € with tax (should be)
1.66387 € * 1.19 * 1000 = 1980.01 € with tax (customer has to pay)

Problem is the restriction to five digits when calculation the price without tax.

remkovdz’s picture

Sorry to ask, but will this feature be implemented soon? I would like to know because otherwise I need to find another solution short term.

Dan Z’s picture

Ubercart is an open source project. It gets new features as the community writes them.

Nobody has supplied a patch or volunteered to write one. As such, there's no way to when (or if) it will be implemented.

If you would like to see this feature implemented soon, you can write it yourself or hire someone to write it for you. I would recommend updating http://drupal.org/project/uc_vat to work with Ubercart 7.x-3.x and/or integrating its features into Ubercart. You might even offer a bounty and get together with other people offering bounties to split the cost.

Some resources for getting this done are http://drupal.org/drupal-services, http://drupal.org/paid-services, http://www.ubercart.org/forum/bounties, and Google.

omnius’s picture

Please forgive if I'm stupid now, since I don't know my way around php.

In regards to making it possible to enter prices inclusive of whatever tax is associated with products. Would it be possible to hack some code to get a form field next to the sell price field that, with some ajax magic, just calculates what the price with tax included would be from the price field automagically? And also make it so that if the tax included price is entered the sell price field automagically calculates the price with tax excluded? Is it really necessary to dive deep into the code to do this?

If we take Sweden, what is required by law is to have the final tax amount clearly summed up on the final invoice (and during overview right before the order is confirmed). It would just be very convenient to be able to enter the price with tax included and have it automagically calculated into the actual sell price field. It's so much easier to decide on a price with tax included than having to sit there with a calculator to figure out what tax exclusive price I would have to write down to get the actual tax inclusive price that is shown when the customer views the product (if I have checked the button on the admin side to have that price shown for the customer, which would be normal in Sweden when dealing with private citizens and not businesses).

etron770’s picture

As the majority of Europe countries (EU: 500 million people) and Australia, include the tax into the sell prices, it would really be fine to get the functions of the D6 Vat module also in D7. I know there is a huge amount of work to adapt those functions into D7 but the majority of the EU user of ubercart must either use D6 or another commerces system if we do not have this functions. Maybe from the US point of view it is not necessary, but from the EU point of view it is.

to longwave:
I think you are the only one who is able to do that ....

Is it possible for you to adapt the D6 VAT module to D7?
Do you have already thought about to do that?
And at least do you have time for that?

remkovdz’s picture

What would it take ($$$) to achieve this (allow prices to be entered including tax).

DanZ’s picture

What would it take ($$$) to achieve this (allow prices to be entered including tax).

You'd have to find a contractor who can do this and ask him/her.

Some places to look: https://drupal.org/drupal-services, https://drupal.org/paid-services, and the ubercart.org bounties forum.

My guess is that you will be able to find other people to help pay for this.

etron770’s picture

Hhave a look to the the e-commerce community which is much more active for Europe as the Ubercart Community.
All issues f.e for German law are implemented.
After using Ubercart for a long time i decided to change my projects to e-commerce. There is also a module available to import from ubercart.

remkovdz’s picture

Any news here?

inmdk’s picture


#26 I dont like commerce system. It's just "too" complicated for something that should really be "that" simple.

Is it like a "major" task to implement a feature to make it possible to enter prices inclusive vat? By making this feature, alot of european countries could use Ubercart aswell.

remkovdz’s picture


ufku’s picture

I use a javascript workaround in one of my sites.
In your theme's template.php define hook_form_node_form_alter

 * Alter product node form
function MYTHEME_form_node_form_alter(&$form, &$form_state) {
  if ($form['#node']->type === 'product') {
    // Attach javascript to add a tax-inclusive price input
    $form['#attached']['js'][] = array('data' => '
      jQuery(function() {

        // Set tax rate
        var taxrate = 0.18,
        // Set new description for price field
        desc = "VAT included price",

        // Get sell price input element
        $el = jQuery("#edit-sell-price").eq(0), el = $el[0];
        // Make sure the input is a part of the product form and not manually hid before
        if (el && el.form && el.form.id === "product-node-form" && el.style.display != "none") {

          // Create the the input for the tax inclusive price
          var $newel = $el.clone(true);

          // Hide the sell price and change its id to prevent conflicts 
          $el.css("display", "none").attr("id", el.id + "-hidden");

          // Remove name attribute to prevent value submission
          // Insert into DOM
          // Set initial value and manually trigger the change event to update the summary
          .val(Math.round(el.value * (taxrate + 1) * 100) / 100).change()
          // Set a change event to update the sell price
          .change(function() {
            // By default the precision is 3 which usually results in precise conversions from sell price to tax-inclusive price.
            el.value = Math.round(this.value / (taxrate + 1) * 1000) / 1000;
          // Optionally change the description

          // Not trusting on the change event, we make sure the sell price is updated on form submit too.
          jQuery(el.form).submit(function() {
            el.value = Math.round($newel[0].value / (taxrate + 1) * 1000) / 1000;

    ', 'type' => 'inline');

- Replace "MYTHEME" with your theme's name
- Replace "0.18" with your tax rate
- Replace "VAT included price" with your description

I've also added some descriptive comments.
Hope it helps.

PS: If you use a core theme for node editing pages you should create a custom module in order to define the hook.

inmdk’s picture

#30 I will test it asap and repport back if it works as intended. Either way - thanks ALOT for taking the initiative to make/post a "temp fix". <3

Accually, the first post about this was made back november 2011. It took almost 2 years for someone to help out the european ubercart users! :(

edref’s picture

This is great - looking forward to hearing how it goes.
I need this fix asap, too.
Thanks for the work!

Nick2013’s picture

Priority: Major » Critical

Hi all,

Any news about this ?
I am also looking for a solution how to enter prices with tax included and show them excluding tax + tax on the invoice.

Appreciate any help!

mitrpaka’s picture

Created a small helper module for this (while waiting feature request to Ubercart release). Please have a look at https://drupal.org/project/uc_vat_prices

longwave’s picture

Priority: Critical » Major

Feature requests are never critical.

@mitrpaka: If you want to convert your module to a patch for uc_taxes that would help get it added as a feature :)

mitrpaka’s picture

Status: Active » Needs review
1.91 KB
FAILED: [[SimpleTest]]: [MySQL] 2,892 pass(es), 1 fail(s), and 0 exception(s). View

@longwave: Here is the patch for uc_taxes. Sell price will be shown in product edit view inclusive of tax (if tax rate applied for product type)

Status: Needs review » Needs work

The last submitted patch, uc_taxes-enter_sell_price_inclusive_of_tax-1333868-36.patch, failed testing.

JRussell’s picture

Actually, the first post about this was made, AFAIK, in 2008.


There are probably earlier posts, I just haven't found them.

mitrpaka’s picture

Status: Needs work » Needs review
1.99 KB
FAILED: [[SimpleTest]]: [MySQL] 2,936 pass(es), 1 fail(s), and 0 exception(s). View

Updated patch for uc_taxes (Fixes number format issue with amended prices > 999.99). Sell price will be shown in product edit view inclusive of tax (if tax rate applied for product type).

Status: Needs review » Needs work

The last submitted patch, uc_taxes-enter_sell_price_inclusive_of_tax-1333868-39.patch, failed testing.

Ryanm81’s picture

Hi all - any updates on this or did anyone find a workaround solution?

Ryanm81’s picture

Issue summary: View changes
1.81 KB

Not sure if this is the right place to upload this - but I have attached custom module that accomplishes this (well it does on my Drupal 7.3 Ubercart 3 site.)

Just install to /sites/default/modules and unzip and clear cache. It is setup for Australian GST (10% tax) but on line 84 of the .module file you can adjust the base calculation for any ONE tax rate. Code may need tidying but definitely works on my install in all sections of product display, cart, checkout and invoice to display amount entered in backend inclusive of the tax.

carlodimartino’s picture

Not working for me at all. Show label: Includes VAT but still added VAT and I get:
Notice: Undefined index: stored in uc_order_views_data() (line 660 of /.../sites/all/modules/ubercart/uc_order/views/uc_order.views.inc).
BTW, I'm using it for GST as well.

ghubika’s picture

Ryanm81 thanks! I'm glad I found this old thread, your solution works perfectly for me, I set it to Hungarian VAT rates and does the job splendidly! thx again!

Collins405’s picture

This causes an issue with views bulk operations, any product saved during a bulk operation will have its price saved EX VAT again.