Discount being removed when calling ObjectFactory.Resolve<

Posted by Community Admin on 05-Aug-2018 09:56

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

All Replies

Posted by Community Admin on 17-Jun-2016 00:00

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) docs.sitefinity.com/for-developers-create-discounts-for-orders

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

I used this tutorial to add products to the Cart 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.

 

This thread is closed