uCommerce produces just a single price for you so you'll have to do a custom XSLT extension to get the result you're after.
Assuming that we're working with option "Show prices with VAT" turned off.
To get the VAT you need a custom XSLT extension which can call a .NET class for you. The class you want is called TaxService. Your XSLT extension will take as an argument Sku and optionally VariantSku and will then call the TaxService to get VAT for you.
It could look a little like this:
public static XPathNodeIterator GetProductVat(string catalogName, string sku, string variantSku)
{
Product product = Product.SingleOrDefault(x => x.Sku == sku && x.VariantSku == variantSku);
if (product == null) return;
ProductCatalog catalog = ProductCatalog.SingleOrDefault(x => x.Name == catalogName);
if (catalog == null) return;
// pricing service always works with prices excluding VATvar pricingService = ObjectFactory.Instance.Resolve<IPricingService>();
PriceGroupPrice price = pricingService.GetProductPrice(catalog, product);
var taxService = ObjectFactory.Instance.Resolve<ITaxService>();
Money vat = taxService.CalculateTax(product, catalog.PriceGroups.Single(), price);
// Output vat variable as XML or do the code as part of a control
}
Product price without VAT
Hi Soren / others
I have a price group that includes VAT with prices, on product pages price is showing inclusive of VAT. Is there a way I can show price without VAT
current: GBP 117.5
desired: GBP 100 + VAT
How can I get the product price without VAT to display on product page?
Regards
Nauman
Hi Nauman,
uCommerce produces just a single price for you so you'll have to do a custom XSLT extension to get the result you're after.
Assuming that we're working with option "Show prices with VAT" turned off.
To get the VAT you need a custom XSLT extension which can call a .NET class for you. The class you want is called TaxService. Your XSLT extension will take as an argument Sku and optionally VariantSku and will then call the TaxService to get VAT for you.
It could look a little like this:
Hope this helps.
is working on a reply...