Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Juhi Paunikar 8 posts 53 karma points
    Feb 05, 2014 @ 14:43
    Juhi Paunikar
    0

    Calculate VAT/Tax in uCommerce

    Hello,

    Is there any way to customize VAT/Tax in ucommerce. My requirement is , Apply 0 percentage VAT But,if customer has selected "Utah" state in shipping address then only apply the VAT. I have searched out for it and got following replies

    1. http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/24826-VAT-Calculation?p=0#comment126662
    2. http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/32141-No-VAT-on-orders-from-non-EC-countries
    3. http://blogs.thesitedoctor.co.uk/tim/CategoryView,category,TheSiteDoctor.aspx

    I have followed these three links , but it's can not full-fill my requirements. I have set VAT Rate in price group then trying to make it zero if "Utah" state is not selected. Please point me out where I'm misleading. Here is my code snippet,

    public class CalculateTaxService : ITaxService
    {
        public Money CalculateTax(UCommerce.EntitiesV2.PriceGroup priceGroup, Money amount)
        {
        //Not getting what to do here....
            var currency = UCommerce.Runtime.SiteContext.Current.CatalogContext.CurrentCatalog.PriceGroup.Currency;
            var taxRate = 0;//priceGroup.VATRate; Here i changed VAT Rate for test purpose.
            return new Money(amount.Value * taxRate, currency);
        }
    
    
        public Money CalculateTax(UCommerce.EntitiesV2.Product product, UCommerce.EntitiesV2.PriceGroup priceGroup, Money unitPrice)
        {
            //Not getting desired output by doing this also....
            var currency = UCommerce.Runtime.SiteContext.Current.CatalogContext.CurrentCatalog.PriceGroup.Currency;
            var incTax = unitPrice.Value;
            var taxRate = 0;// priceGroup.VATRate; Here i changed VAT Rate for test purpose.
            var tax = incTax * taxRate;
            return new Money(tax, currency);
        }
    }
    I have Changed basket.config as below
    <component id="TaxService"
        service="UCommerce.Catalog.ITaxService, UCommerce"
        type="MyNamespaceHere.CalculateTaxService,MyNamespaceHere"
        lifestyle="Singleton"/>
    

    Please help me out this problem.

Please Sign in or register to post replies

Write your reply to:

Draft