+1-888-365-2779
Try Now
More in this section

Forums / Ecommerce / Discount being removed when calling ObjectFactory.Resolve().CalculateAndSaveChanges(cartOrder)

Discount being removed when calling ObjectFactory.Resolve<IOrderCalculator>().CalculateAndSaveChanges(cartOrder)

1 posts, 0 answered
  1. Jason
    Jason avatar
    2 posts
    Registered:
    03 Mar 2016
    17 Jun
    Link to this post

    I have been working on a e-commerce application written in Sitefinity and have come across a bug where the Discount is being removed from a CartOrder when trying to Calculate the order details.

    Everything is as expected with the correct shipping, tax and discount until ObjectFactory.Resolve<IOrderCalculator>().CalculateAndSaveChanges(cartOrder) is run regardless of when I run this. I have tried following your various blogs etc but have yet to find the correct solution.

    I used this blog to create the Discount (Although I changed it to be a CartDiscount) http://docs.sitefinity.com/for-developers-create-discounts-for-orders

    This blog for the initial setup of the Cart Order http://docs.sitefinity.com/for-developers-create-cart-orders

    I used this tutorial to add products to the Cart http://docs.sitefinity.com/for-developers-add-products-to-shopping-carts

    I am hoping there is one value I am not setting which will allow the discount to persist as it appears to in the Standard Modules.

    Please let me know if you have any questions or suggestions or if you need a sample project.

     

1 posts, 0 answered