Jump to content

No option for tax inclusive pricing? - Answer: There is.


Recommended Posts

The Question:

Is there an existing solution for tax-inclusive pricing throughout cubecart?

Prompted by:

In the downloadable 6.1.13 store, the test product is priced at $6.99, the subtotal is $6.99, and the total is $7.69.  This is un-Australian.


Found the "Tax inclusive" flag in the product definition Pricing page.


I have been running a heavily modded 4.3.4 for far too long, and it is time to update.  My store is like walking into a Dickensian haberdashery, which is charming in its own way, but the kiddies today demand polish and sheen and html 5 and good phone behaviour, and we must deliver.  God forbid that they should discover what real life is like...

To my great surprise, when I search the Cubecart fora for "tax", I find nothing.  Either CubeCart's tax handling is perfect, or we are all avoiding it (boom-tish!)

Here in the civilised paradise of Australia, there is a law that says that if you hand over the price marked on a product, it is yours.  None of this "How much is it?"  "Five pounds, guv." "Excellent, my man, I'll take it."  "That'll be five pounds anna 'arf, guv"  nonsense.  We feed people to their worst nightmare out of sharks, spiders, snakes or murderous outback hitchhikers for that kind of behaviour.

There were, in fact, actual riots about it when the government (which promised at the election before the election before the tax was proposed "We will never, ever introduce a GST" but explained after the more recent election that everyone, ob-viously knew that this meant "never, ever within this current term" - true!) surprised us all with the concept.  We didn't really care how much we paid.  We just really, really cared that we knew how much it would be.  

All retailers that turn over more than pittance must, by law, list tax inclusive prices everywhere that Joe Public and Mrs might see them, and also point out that $x.yx of GST is included in the total value of the invoice.  Joe and Mrs accepted this as a fair compromise, furled up their banners, drank their Molotov cocktails and retired to the beer garden for some not-yet-craft beer. 

Anyhow, I sorted all this out in the 4.3.4 store by declaring that prices included tax all the way through the food chain. In the cart, export orders (i.e. for delivery abroad) had the tax shaved off all prices and the total.  The scope of the change was limited to the cart itself - the tax is  x/(100+x) (i.e. 1/11th) of the invoice total, and for export orders, all prices at 100/(100+x)th of the quoted price.  Because of this tax-inc display, we calculate the tax-inc price then round it to the most appealing number (so naturally, the Test Product above will be rounded to .. $7.49?  Nah, make it 7.99!  However the tax is still 1/11 of the displayed price.)

In a perfect world, customers that log in with an account that has an export delivery address by default should probably see tax free prices through-out, but if they don't want to live in the land of sunshine, surf and sharks then they can just be pleasantly surprised by the lower prices at the end.

Has this sort of thing made it into cubecart these 8 years hence?  I cannot see a setting labeled "Prices are tax inclusive", but it may be labelled something else.

Edited by ploughguy
Link to comment
Share on other sites

Thank you for your reply.

I already found the checkbox for pricing, but the cart logic is all based on ex-tax pricing:

if ($product['tax_inclusive']) {
                        // Remove tax from the items by default, everything internally should be sans-tax

The prices, extensions and subtotals presented to the customer in the cart and the invoice are ex tax by default.  If there is an existing plug-in that displays all numbers inc-tax, it will save me a lot of work.

In particular, I am expecting that ex-tax calculations will result in rounding errors in the line extensions so the invoice potentially totals lose a cent per line. The problem arises because the ex-tax price is rarely a whole number of cents because the "presentation price" that is made attractive to the customer is the tax-inc price.

This was a problem with 4.3.4 too.  I have not yet dug in to 6.1 to find the full extent of the horror, because I am hoping someone else has already done it.

Link to comment
Share on other sites

  • 2 weeks later...

Suffin' cats!  How did I miss that?  Good ole Noodles.  What a great guy.

I have this image in my head of Noodleman at work, sitting on a sheet of cardboard outside a tube station, Staffordshire terrier wearing a red bandana at his side.  Noodles is wearing an ex-army greatcoat, Doc Martins with holes in the soles, an ancient red tea-cosy as a hat, and worn woollen fingerless gloves.  He is typing on a battered Dell laptop with a faded Windows XP label under the keyboard, plugged into ... something.  The X keycap is missing. A gravy-stained paper plate with some coins on it has the words "Developing CubeCart Plug-ins - Please Help" scrawled around the edge in black ash from discarded cigarette butts.  Periodically, man and dog take a slurp from a large foam cup of instant pot noodles, their sole source of nourishment.  The dog looks much healthier than the man because people pat him and give them the last of their pies.  Noodleman, however, is not that attractive.  But at least he occasionally has a shave.

It is amazing that a starving man can write such good code.  Probably all due to the love of a good dog.

Edited by ploughguy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...