Class VatProvider
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
The VatProvider allows you to manipulate country VAT on a product in eCommerce using a class inherited from Dynamicweb.eCommerce.Orders.VatProvider.
- Inheritance
-
Vat
Provider
- Inherited Members
Examples
The following example demonstrates how to create a VAT on luxury products (a sign that the product is a luxury suite will be the presence of the 'LUX' word in MetaKeywords field).
using System;
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Orders
{
class VatProviderSample : Dynamicweb.Ecommerce.Orders.VatProvider
{
public override Double FindVatPercent(Double defaultVatPercent, Product product)
{
return product.Meta.Keywords.IndexOf("LUX") > -1 ? 20 : defaultVatPercent;
}
}
}
Remarks
WARNING: Calling an instance of a cart inside Find
Methods
FindVatPercent(double, Product)
Finds the vat percent for the product that should replace standard one.
Parameters
Returns
- double
Vat percent for the specified product