TeaCommerce occasionally "forgets" the manipulated shipping
Hi all,
I have a custom event handler, that calculates shipping for an order based on the total weight of the items in the order. Generally it works as expected, but once in a while TeaCommerce seems to "forget" the manipulated shipping price. I don't have the exact steps to reproduce, but I have a gut feeling that it's got something to do with cloning incomplete orders, when a checkout flow is interrupted.
Have anyone experienced anything similar?
When I look into the TeaCommerce_Order table for these orders, I can see that the column "ManipulatedShippingFeeWithoutVAT" is set to the correct (manipulated) price, but the column "TransactionShippingFeeWithoutVAT" is set to 0. On the orders that go through without problems, the "TransactionShippingFeeWithoutVAT" column has the same value as the "ManipulatedShippingFeeWithoutVAT" column.
I hope someone out there has an idea, that can bring me closer to a solution.
I dont have the solution for this but it would be great if we could find the way to reproduce this error so we could debug it and fix it. The TransactionShippingFeeWithoutVAT is assigned when you generate the payment form - to "lock" the order. Try and check if the value is right at that moment. Then - if you go back to the shop and add another product - Tea Commerce will clone the order and give it a new id and will empty the TransactionShippingFeeWithoutVA. Try check if it does. Then try and go to payment again and see that the order is "locked" and TransactionShippingFeeWithoutVAT is set again.
This is one of those problem where we need to find the way to reproduce it to fix it :)
Hope it helps you in the right direction to reproduce the error.
This is exactly the behaviour, I see, whenever I try to reproduce the error. In other words, I haven't been able to reproduce it myself. I can only note, that on our test system, the error occurs in maybe one out of a hundred orders. And each time, the TransactionShippingFeeWithoutVAT is set to zero while the ManipulatedShippingFeeWithoutVAT has the correct value.
Sounds odd - could you try and do some kind of logging to see when it happens and maybe output some of the different shipping properties for the order to the log so you know what each value got?
I'll try to do some more aggressive updating of the order shipping price in my event handler to see if this does anything to fix the problem. I guess worst case I'll have to create an extension method that can be called somewhere in the checkout flow, to force an update of the shipping price.
At what point exactly does TeaCommerce set the value of TransactionShippingFeeWithoutVAT?
When you call the Base.GeneratePaymentForm, use the javascript API method goToPayment GetPaymentForm - this sets the TransactionShippingFeeWithoutVAT = order.ShippingFeeWithoutVAT.
When the order is cloned - only a thing the Tea Commerce base method does it clears the TransactionShippingFeeWithoutVAT= null; Thats it :)
Well, I'm not entirely sure it works just yet, but I'll close this thread anyway and hope my more aggressive approach will work. Thanks for the replies :-)
Can I ask what shipping calculator your using here and if you have any notes or documentation you could provide? We're looking to add a UPS shipping calculator to our site and would greatly appreciate anything you have.
Hey.... we simply wrote a custom shipping price calculator based on the Danish Postal Service list prices and the total weight of the items in the basket. No notes or documentation I'm afraid.
TeaCommerce occasionally "forgets" the manipulated shipping
Hi all,
I have a custom event handler, that calculates shipping for an order based on the total weight of the items in the order. Generally it works as expected, but once in a while TeaCommerce seems to "forget" the manipulated shipping price. I don't have the exact steps to reproduce, but I have a gut feeling that it's got something to do with cloning incomplete orders, when a checkout flow is interrupted.
Have anyone experienced anything similar?
When I look into the TeaCommerce_Order table for these orders, I can see that the column "ManipulatedShippingFeeWithoutVAT" is set to the correct (manipulated) price, but the column "TransactionShippingFeeWithoutVAT" is set to 0. On the orders that go through without problems, the "TransactionShippingFeeWithoutVAT" column has the same value as the "ManipulatedShippingFeeWithoutVAT" column.
I hope someone out there has an idea, that can bring me closer to a solution.
Regards,
Kenn
Hi Kenn
I dont have the solution for this but it would be great if we could find the way to reproduce this error so we could debug it and fix it. The TransactionShippingFeeWithoutVAT is assigned when you generate the payment form - to "lock" the order. Try and check if the value is right at that moment. Then - if you go back to the shop and add another product - Tea Commerce will clone the order and give it a new id and will empty the TransactionShippingFeeWithoutVA. Try check if it does. Then try and go to payment again and see that the order is "locked" and TransactionShippingFeeWithoutVAT is set again.
This is one of those problem where we need to find the way to reproduce it to fix it :)
Hope it helps you in the right direction to reproduce the error.
Kind regards
Anders
Hi again,
This is exactly the behaviour, I see, whenever I try to reproduce the error. In other words, I haven't been able to reproduce it myself. I can only note, that on our test system, the error occurs in maybe one out of a hundred orders. And each time, the TransactionShippingFeeWithoutVAT is set to zero while the ManipulatedShippingFeeWithoutVAT has the correct value.
Sounds odd - could you try and do some kind of logging to see when it happens and maybe output some of the different shipping properties for the order to the log so you know what each value got?
Kind regards
Anders
Hi again,
I'll try to do some more aggressive updating of the order shipping price in my event handler to see if this does anything to fix the problem. I guess worst case I'll have to create an extension method that can be called somewhere in the checkout flow, to force an update of the shipping price.
At what point exactly does TeaCommerce set the value of TransactionShippingFeeWithoutVAT?
Kind regards,
Kenn
When you call the Base.GeneratePaymentForm, use the javascript API method goToPayment GetPaymentForm - this sets the TransactionShippingFeeWithoutVAT = order.ShippingFeeWithoutVAT.
When the order is cloned - only a thing the Tea Commerce base method does it clears the TransactionShippingFeeWithoutVAT= null; Thats it :)
Oh. Should've mentioned; I'm not using the JS API - all TeaCommerce JS is disabled.
Ahh okay - but shouldn't make a difference - the SJ API is just an easier way to invoke the server side methods.
Kind regards
Anders
Well, I'm not entirely sure it works just yet, but I'll close this thread anyway and hope my more aggressive approach will work. Thanks for the replies :-)
Hope it works for you :) If you at a later point find a way to reproduce the error - dont hesitate to contact us again at this thread
Kind regards
Anders
Hi Kenn,
Can I ask what shipping calculator your using here and if you have any notes or documentation you could provide? We're looking to add a UPS shipping calculator to our site and would greatly appreciate anything you have.
Thanks!
Hey.... we simply wrote a custom shipping price calculator based on the Danish Postal Service list prices and the total weight of the items in the basket. No notes or documentation I'm afraid.
-Kenn
is working on a reply...