Nathan Pitmanhello, my name is
nathan pitman.

ExpressionEngine Plug-in: Add VAT Jan 08. 095

I’ve just written a new ExpressionEngine plug-in called ‘Add VAT‘. This plug-in takes any numeric value and returns the value plus VAT. You also have to specify the VAT rate obviously.

Typical usage is as follows:

{exp:np_add_vat price="120" rate="15"}

I’m using the plug-in on a website I’m developing where I need to be able to display prices inclusive and exclusive of VAT. Currently the Simple Commerce module does not provide a facility to specify VAT or taxes.

Download: pi.np_add_vat.php.zip

If you have any further ideas as to how the plug-in could be developed do let me know. :)

If it were me, I’d be tempted to convert it into an extension so that you could control the VAT rate from one central setting, rather than having to update it in multiple places whenever it changes. You could still leave the rate parameter in the tag as an override.

Also, I guess the natural way to extend the plugin would be to make it possible to specify and use VAT rates for other countries, maybe by specifying an valid ISO two-letter country code in the tag:

{exp:np_add_vat price=”120” country=”nl”}

Posted by Matthew Pennell on 08/01/2009 at 09:14 PM

That’s a great suggestion Matthew! I think I may take a look at doing that over the weekend though I’ve not written an extension before which has tags that can be parsed in templates… is that even possible?

Posted by Nathan Pitman on 08/01/2009 at 09:14 PM

I don’t know, but it can’t be that hard!

Posted by Matthew Pennell on 08/01/2009 at 09:14 PM

Ok, well after a little digging, it transpires that it’s physically impossible to add a settings screen to a plug-in, or make an extension callable from page templates like a plug-in. It seems the best solution is to port it to a module format, that way it can be called from page templates and also have a CP interface.

So, I’m thinking about how I can expand upon this to make it worth turning into a module, ie: ability to store multiple tax rates and associate those with country codes… thus allowing someone to possibly run a multi-currency simple commerce module based store???

Something to ponder…

Posted by Matthew Pennell on 08/01/2009 at 09:14 PM

The download link is broken (Add VAT plugin). Can you please look at this. I am unable to download plugin.

Thanks

Posted by Bhashkar Yadav on 02/08/2011 at 08:13 AM

Speak your mind

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?

Submit the word you see below: