Closed (fixed)
Project:
Ubercart 2 VAT support
Version:
6.x-1.0
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2009 at 10:59 UTC
Updated:
4 Oct 2010 at 15:15 UTC
How can I use the vat price altered in a custom product template?
I was using $node->sell_price to display the price, but it doesn't have any tax alteration apply to it. Do I have to recalculate the price myself, or is it possible to call a variable that would have already have the right price?
Comments
Comment #1
longwaveYou need to call uc_price() as follows to obtain altered prices for a node (which includes VAT and any other module that might change the sell price):
A documentation note for this has been added to README.txt.
Comment #3
egill80 commentedI have e site where i want to display the price incl. VAT on a custom product.tpl by using $node->sell_price and $node->list_price.
i tried to use this code in VAT readme file but i need some more specific information on how to get it to work.
i have a template product.tpl.php and i added the line and the code
which gave me the following error:
Fatal error: Unsupported operand types in /mounted-storage/home40b/sub001/sc16032-XYBW/ssl/sandemo.dk/sites/all/modules/ubercart/uc_store/includes/uc_price.inc on line 96.
can anybody explain me what im doing wrong and how and where to implement the code so it works.
Thanks
EDIT: Sorry, i placed the context code after print uc_price so of course the database could read my $context, i changed it around and it works fine.
Comment #4
longwave