cluster Posted October 12, 2015 Share Posted October 12, 2015 I have to use the EU VAT addon, therefore in backend I use exclusive TAX prices The checkout page adds TAX correctly, but the problem is all the product pages shows prices without my country or default TAX ... Is there a way to add my default TAX in the product templates? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 13, 2015 Share Posted October 13, 2015 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? 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 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? 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 (edited) 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 October 13, 2015 by cluster 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 (edited) 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 October 13, 2015 by cluster 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 13, 2015 Share Posted October 13, 2015 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. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 13, 2015 Share Posted October 13, 2015 {$product.pricing.minprice.price + $product.pricing.minprice.price * 15/100} try it this way {math equation="netprice + netprice * percentage / 100" netprice=$product.pricing.minprice.price percentage=15} 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 many thanks! that's the point, how to remove prefix, suffix from $product.pricing.minprice.price or how can it be used w/ rawpricing? $product.rawpricing.minprice.price 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 (edited) thank you guys, it works ;-) {math equation="netprice + netprice * percentage / 100" netprice=$product.pricing.rawpricing.annually percentage=15 format="%.2f"} {$currency.suffix} Edited October 13, 2015 by cluster 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 13, 2015 Share Posted October 13, 2015 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. 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 You've helped me a lot, many thanks! 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 (edited) 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 October 13, 2015 by cluster 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 13, 2015 Author Share Posted October 13, 2015 the replace:'€':'' does not work ... so I have disabled currency prefix in the panel, now it works {math equation="netprice + netprice * percentage / 100" netprice=$tldpricing.{$tld->tld}.register|replace:' EUR':'' percentage=15 format="%.2f"} 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 23, 2015 Author Share Posted October 23, 2015 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 ... 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 23, 2015 Author Share Posted October 23, 2015 got it, rawpricing work w/ upgrade.tpl {math equation="netprice + netprice * percentage / 100" netprice=$upgradepackage.pricing.rawpricing.annually percentage=15 format="%.2f"} 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.