cb2004 Posted September 25, 2006 Share Posted September 25, 2006 Basically I want the script to do this. Add a price of say £150 which is the price with VAT. I want this to be displayed everywhere as the full price, but when it comes to checkout it shows how much VAT is going to be but still charge £150. Is this possible? Quote Link to comment Share on other sites More sharing options...
Guest bennyuk Posted September 25, 2006 Share Posted September 25, 2006 This is possible It depends on how good your basic php skills are. As a starter quick fix I'd suggest looking in includes/content/cart.inc.php and adding something along the lines of $vatpart = $subTotal - ($subTotal / 1.175 ); $view_cart->assign("VAL_TAX",priceFormat($vatpart )); would be better to maybe use the tax valus in the database which I think might be "$product[0]['percent']" maybe around line 520 just after $subTotal = $subTotal + ($price * $quantity); then add {VAL_TAX} into the cart template (skins/yourskin/styleTemplates/content/cart.tpl where you want it to appear. You'll need to know some basic editing to get this done, but it should be a quick fix until you find a proper solution. Ben Quote Link to comment Share on other sites More sharing options...
Guest Arild Posted September 25, 2006 Share Posted September 25, 2006 Or maybe this one..... This is for a flat tax of 25%, you may have to find the correct number for other values(0.8=25%) around line 540 change to this one. Find this line $subTotal = $subTotal + ($price * $quantity); And chang to this $subTotal = $subTotal + ($price * $quantity); $subTotal = $subTotal * 0.8; and a few line more down.. find this // work out tax if($config['priceIncTax']==0 && $taxCustomer==1){ $lineTax = ($product[0]['percent'] / 100) * ($price * $quantity); $tax = $tax + $lineTax; } And replace with this one // work out tax //if($config['priceIncTax']==0 && $taxCustomer==1){ $lineTax = ($product[0]['percent'] / 100) * ($price * $quantity); $tax = $tax + $lineTax * 0.8; //} As far as i can se it show the price include tax and subtotal ex tax + tax gives you the total includ tax again.. At least this fix it for me...no need to change in templates sins it corretly passes on the correct value.. Fright cost and tax is not fixed in this... Quote Link to comment Share on other sites More sharing options...
cb2004 Posted September 25, 2006 Author Share Posted September 25, 2006 I will see how I get on. Has anyone else managed this successfully? Quote Link to comment Share on other sites More sharing options...
cb2004 Posted September 26, 2006 Author Share Posted September 26, 2006 Didnt work unfortunately bennyuk. Quote Link to comment Share on other sites More sharing options...
Guest bennyuk Posted September 26, 2006 Share Posted September 26, 2006 sorry about that, when I get a chance I'll see if I can test it on my site and let you know. If you find a fix in the mean time, please let us know. Quote Link to comment Share on other sites More sharing options...
cb2004 Posted September 27, 2006 Author Share Posted September 27, 2006 Will do. Cheers mate Quote Link to comment Share on other sites More sharing options...
Guest Arild Posted September 27, 2006 Share Posted September 27, 2006 The fix i posted work as you first described. I have it working at my site. (http://bad.in.no) It shows the price inc tax on all pages. In checkout it show each product price inc tax. Subtotal is ex tax Plus tax on top of subtotal gives you the amount inc tax again. It have only been tested with Print Order Form, but sins it is calulated within the order checkout system it should behave likly on all payment gateways unless there is an extra tax check within them to. The only part that i havent got to work is the tax on the shipping part. Quote Link to comment Share on other sites More sharing options...
cb2004 Posted September 27, 2006 Author Share Posted September 27, 2006 Cheers Arild. Any ideas how I would make it work for 17.5% though? Quote Link to comment Share on other sites More sharing options...
Guest Arild Posted September 27, 2006 Share Posted September 27, 2006 Hi, You have to find the correct number for 17,5% (0.8=25%) (100/125 for 25% and 100/117,5 for 17,5%) Witch should be 0,8510638297872340425531914893617 (0,851064) for 17,5 Or use the correct calculation insted with the use of variables you have or create. Quote Link to comment Share on other sites More sharing options...
cb2004 Posted September 28, 2006 Author Share Posted September 28, 2006 Hi, You have to find the correct number for 17,5% (0.8=25%) (100/125 for 25% and 100/117,5 for 17,5%) Witch should be 0,8510638297872340425531914893617 (0,851064) for 17,5 Or use the correct calculation insted with the use of variables you have or create. Cheers for your help with this. It didnt work though unfortunately. With 1 product it does. Anymore and the tax throws a wobbly. Quote Link to comment Share on other sites More sharing options...
Guest Arild Posted September 29, 2006 Share Posted September 29, 2006 OK, thanks for telling.. I will check it up... Quote Link to comment Share on other sites More sharing options...
Guest Arild Posted September 29, 2006 Share Posted September 29, 2006 Try this one and se if it is better....looks better here now, but havent tested it so mutch.. Find this around line 630 Wrong number, should be 0.1489361702127659574468085106383 to show tax part And on line 650 find this code if($tax>0){ $view_cart->assign("VAL_TAX",priceFormat($tax)); } else { $view_cart->assign("VAL_TAX",$lang['front']['cart']['na']); Add this line just before this code $tax = $subTotal * 0.8510638297872340425531914893617; $grandTotal = $subTotal + $tax + $basket['shipCost']; and change to this $grandTotal = $subTotal + $basket['shipCost']; And change the langauga variable "tax" to show "herby VAT of" or somthing like that to show that this is the tax part of the total. 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.