Developer forum

Forum » Development » Override PriceInfo object

Override PriceInfo object

Morten Snedker
Reply


Did you know that you can override the content of the PriceInfo object?
Well, you can by inheriting the ISupportPriceInfo:

 

 

using Dynamicweb.eCommerce.Prices;

namespace Dynmaicweb.eCommerce.Prices

{

    public class NettoPriceProvider : PriceProvider, ISupportPriceInfo

    {

        public PriceInfo FindPriceInfo(Dynamicweb.eCommerce.Products.Product Product, double Quantity, string VariantID, Dynamicweb.eCommerce.International.Currency Currency, string UnitID, Dynamicweb.Frontend.Extranet User)

        {

            if ((Product.ID.Equals("PROD2")))

            {

                Dynamicweb.eCommerce.Prices.PriceInfo info = new Dynamicweb.eCommerce.Prices.PriceInfo();

                info.Currency = Dynamicweb.eCommerce.Common.Context.Currency;

                info.PriceWithoutVAT = 1;

                info.PriceWithVAT = 1.25;

                info.VAT = 0.25;

                info.VATPercent = 25;

                return info;

            }

            else

            {

                return null;

            }

        }

    }

}

 

 


Replies

 

You must be logged in to post in the forum