EU VAT and Drupal+Ubercart 2

I finally got some time to start working on a new homepage for linuxpusher.com and choose to use Drupal and Ubercart (among two shop-modules for drupal) for this job.

I need to be able to sell items without VAT to none-EU citizens, and the builtin taxes support didn't handle this, and the uc_vat module that improves upon the built-in support, didn't do the job either.

I have just fixed the code, with some tips from the author of uc_vat (longwave) so we were sure as how it should be done, so I hope he'll accept my code as an improvement for uc_vat.

My patch adds the following - that I hope anyone else creating a shop with Drupal/ubercart can use:

  • showing prices without VAT for countries outside of EU, and with VAT for people inside EU
  • Setting a default country based on the visitors IP (if ip2cc is installed) and thus showing prices as they most likely apply to the visitor (ie. without VAT to visitors from outside EU and and with VAT to people within EU) - changeable currently, only in checkout.
    There's one small snag to sort out - currently the items are put in the cart with VAT applied, if that's the "setting" while you add to cart - so the cart will show the wrong price - the checkout/order lines will be correct though. I'm hoping to fix this, with help from longwave if he agrees with me :)
  • i18n improvements, so the user-entered name for the VAT (moms, GST, VAT, MwST - etc.) is now translatable - even though it ment I had to pass the user-entered variable to t() which is bad - I have not found any information as to how user-entered data is supposed to be made translatable - read more in this bug report:  http://drupal.org/node/684222 - it seems i18nstrings is the "right" solution for d6 - even though the current solution "works for me" currently :) 
  • I added a uc_vat.ca.inc - which adds a condition for the conditional actions called "shipping country inside EU" - so you can simply test on that for conditional actions instead of having to manually mark the countries with the existing "country" check. It checks on ISO country codes - even those countries that you haven't imported into ubercat is thus supported if you add them one day.
  • This same condition can be used for shipping rules, to decide what the price is - makes my life a lot easier :)

I've also written a small patch to enable the "billing adress is same as shipping address" checkbox being checked by default (which is the normal user case) - so customers don't have to bother with checking that, unless they actually have a different billing address. I'll post a link soon - I've submitted it to ubercart devs (as it had to be a patch to ubercart/uc_cart) - but there seems to be problems in ubercart dev land currently :(

0 comments on EU VAT and Drupal+Ubercart 2