Posted on 20/11/2008 13:07:20
Setting a tag with a tag extender only changes the information merged to the template, not the information used for calculations. Use a FeeProvider to manipulate with shipping fee. Here's an example:
using System.Data;
using Dynamicweb;
using Dynamicweb.eCommerce;
using Dynamicweb.Extensibility;
namespace CustomModules.CustomModules.Classes
{
public class FeeProvider:Dynamicweb.eCommerce.Orders.FeeProvider
{
public override Dynamicweb.eCommerce.Prices.PriceRaw FindFee(Dynamicweb.eCommerce.Orders.Order Order)
{
Dynamicweb.eCommerce.Prices.PriceRaw ReturnFee = null;
if (Order.CustomerEmail != "")
{
IDataReader DR = Database.getDataReader(string.Format("SELECT TOP 1 * FROM EcomOrders WHERE OrderCustomerEmail = '{0}' AND OrderDate >= DATEADD(day, -1, GETDATE()) AND OrderComplete = {1}", Order.CustomerEmail, Database.SqlBool(true)), "Ecom.mdb");
if (DR.Read())
{
ReturnFee = new Dynamicweb.eCommerce.Prices.PriceRaw(0.00, Dynamicweb.eCommerce.Common.Application.DefaultCurrency);
}
}
return ReturnFee;
}
}
}