More in this section
Forums / Ecommerce / Order Total Incorrect

Order Total Incorrect

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 1 answered
  1. Geoffrey
    Geoffrey avatar
    24 posts
    05 Nov 2014
    19 Aug 2015
    Link to this post

    I am in the process of building a custom checkout widget.  I am running into two large issues.  As part of the build we are integrating the checkout widget with Avalara for calculating the tax.

    The main problem that I am having is that when I add the shipping and tax amounts to the order the Order Total is not updating.  With the tax the problem is even worse because the amount is not being saved to the database.

    Code snippet that  encapsulates what I am doing:

     cart.ShippingServiceCode = shippingMethod.ServiceCode;
    cart.ShippingServiceName = shippingMethod.ServiceName;
    cart.ShippingTotal = shippingMethod.ServicePrice.GetValueOrDefault(0);
    cart.Tax = 30; <--tax hard coded in this example.  amount really comes from avalara
    cart = CartHelper.GetCartOrder(this.OrdersManager, this.GetShoppingCartId());

    LiteralSubTotal.Text = order.SubTotalDisplay.ToString("C");
    LiteralOrderTotal.Text = order.Total.ToString("C"); 
    LiteralOrderDiscount.Text = order.Discounts.Sum(p => p.DiscountAmount).ToString("C");
    LiteralOrderShipping.Text = order.ShippingTotal.ToString("C");
    LiteralOrderTax.Text = order.Tax.ToString("C");


    The problem is that the order total does not include the shipping and the tax.  Worse is the fact that the tax amount is not saved to the database.

     I hope I am missing something obvious.

  2. Geoffrey
    Geoffrey avatar
    24 posts
    05 Nov 2014
    27 Aug 2015
    Link to this post

    This line ended up solving my problem:



    Disappointing how difficult it was to figure this out.

2 posts, 1 answered