Jump to content

add standard tax in product templates


cluster

Recommended Posts

you can but will require hard work modifying multiple template files maybe, is it enough to notice the client that the VAT will be added?

 

I guess there is no other choice ... I need to edit product templates by adding the standard tax rate

There is a law that consumer prices must include the TAX, for the state or country where the company is registered.

Tax in EU states ranges from 15% to 28% ... so if I set including tax in whmcs admin the total prices for all countrys and states are the same ...

 

How can I add a fixed tax rate in product templates?

Link to comment
Share on other sites

maybe the problem is the VAT EU plugin, prices are calculated based on total price ...

but it should be calculated on net prices for countrys

f.ex.

net price + 17% for luxembourg = total

or for belgium net price + 21% = total

etc.

in the Cart it works, but all the product prices are shown as a net price

so the default product prices should be the company country default price incl. Tax

Edited by cluster
Link to comment
Share on other sites

that should dispaly the price in products.tpl ...

{$product.pricing.minprice.price}

 

but what is the syntax I can use to add f.ex. 15%

does not work

{$product.pricing.minprice.price + $product.pricing.minprice.price * 15/100}

Edited by cluster
Link to comment
Share on other sites

the problem is {$product.pricing.minprice.price} is a string, it will contain "€10 EUR" - so it's not a number and therefore you can't perform any calculations with it.

 

the usual two options would be to either use rawpricing as they are numbers and so you can do maths with them... or use {$product.pricing.minprice.price} but strip the currency prefix, suffix (and spaces?) from it - then you can calculate with it... though then you'd have to add the currency settings back to the result.

 

i'm pretty sure i've posted how to do both previously.

 

at the end of the products.tpl template, add {debug} and when you refresh the page, you should get a popup window of available Smarty variables and arrays.

Link to comment
Share on other sites

stripping the currency is relatively straightforward, e.g if $price variable is "£100.34 GBP", you could strip it by using {$price|replace:'£':''|replace:' GBP:''} - that would output just "100.34" - though I don't think you can use it that way to assign it to a variable, you might need str_replace

 

link below might help as it modifies billing cycle prices and might give you a clue with your solution.

 

http://forum.whmcs.com/showthread.php?85823-Tutorial-How-to-modify-the-Recurring-Billing-Cycle-text

 

in terms of rawpricing, and if I remember correctly, it doesn't give you the minimum price - you'd need to use another smarty variable to determine the minimum price cycle and then find the rawprice for that cycle... it will be a number that yo can then perform your calculation on.

Link to comment
Share on other sites

can this be used for domain prices in domainchecker.tpl?

{$tldpricing.{$tld->tld}.register}

 

I guess I have a syntax error here, no output

{math equation="netprice + netprice * percentage / 100" netprice=$tldpricing.{$tld->tld}.register|replace:'€':''|replace:' EUR':'' percentage=15 format="%.2f"}

Edited by cluster
Link to comment
Share on other sites

  • 2 weeks later...

I have a problem with it in upgrade.tpl

<option value="annually">{math equation="netprice + netprice * percentage / 100" netprice=$upgradepackage.pricing.annually|replace:' EUR':''|replace:' annually':'' percentage=15 format="%.2f"}</option>{

 

seems the sec. replace:' annually' does not work ...

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.

Guest
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated