I think you might be messing up the cache by deleting the current order in the cart. A simple app pool recycle should do the trick. This way the cache would be refreshed. Let me know if that solves the problem. Normally the current order wouldn't be deleted like that, so it shouldn't be a problem, but we might have to take a look at it.
Alternatively you can test it by switching browser, and thereby getting a new session.
Thank you for quick response. It was really helpful. Really, the problem was in session parameters, so when the session expired (and after changing browser too, of course), the issues disappeared.
But, to be honest, I still suppose that this issue as a bug. Because it is quite an easy to reproduce - you just need to delete all Cart orders from TeaCommerce while you are not finalized order yet, and after that you'll get a problem. If I was able to find that way, I absolutely sure that the users which will work with Order Admin system in TeaCommerce also will find that issue sooner or later.
So, could I ask you to do something with it in future releases of TeaCommerce?
An argument against it being a bug is that noone should delete the carts on a live webshop. You cannot be sure if someone is using that cart. You have to delete them, to be able to use the shop in demo mode, but on the live shop you can have all the carts in the database as you want.
I just talked to Anders about it, and we will test the scenario and fix it so the user won't get an error. If the order has been deleted somehow he should get a new empty order.
Bug with TeaCommerce.addOrderLine function in JavaScript
Hello,
I face the challenge with calling TeaCommerce.addOrderLine function. Problem appears when I do following actions:
1. Delete all orders from TeaCommerce via Admin part.
2. Then go to my shop page, choose the product and its quantity, and click "Add to Cart" button, which call TeaCommerce.addOrderLine function.
That function returns me an error at the error callback. I've looked into response of that function via FireBug, and found next error message inside:
MESSAGE:Exception has been thrown by the target of an invocation.STACKTRACE: at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at TeaCommerce.Presentation.TeaCommerceBase.RequestModule.invokeMethod(restExtension myExtension, Object[] paras)
INNEREXCEPTION:System.InvalidCastException: Specified cast is not valid.
at TeaCommerce.SessionController.get_CurrentOrderId()
at TeaCommerce.SessionController.get_CurrentOrder()
at TeaCommerce.SessionController.CheckCurrentOrderPaymentStatus()
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Nullable`1 orderLineId, Decimal quantity, Boolean isUnique)
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity)
The worst thing it that situation that I can make TeaCommerce operable after that crash only by re-install it...
Can you suggest me something?
I use:
Hi Alexey,
Welcome to the Umbraco forum.
I think you might be messing up the cache by deleting the current order in the cart. A simple app pool recycle should do the trick. This way the cache would be refreshed. Let me know if that solves the problem. Normally the current order wouldn't be deleted like that, so it shouldn't be a problem, but we might have to take a look at it.
Alternatively you can test it by switching browser, and thereby getting a new session.
/Rune
Hi Rune,
Thank you for quick response. It was really helpful. Really, the problem was in session parameters, so when the session expired (and after changing browser too, of course), the issues disappeared.
But, to be honest, I still suppose that this issue as a bug. Because it is quite an easy to reproduce - you just need to delete all Cart orders from TeaCommerce while you are not finalized order yet, and after that you'll get a problem. If I was able to find that way, I absolutely sure that the users which will work with Order Admin system in TeaCommerce also will find that issue sooner or later.
So, could I ask you to do something with it in future releases of TeaCommerce?
Thanks a lot for your help, Rune!
Hi Alexey,
We sure will take it up.
An argument against it being a bug is that noone should delete the carts on a live webshop. You cannot be sure if someone is using that cart. You have to delete them, to be able to use the shop in demo mode, but on the live shop you can have all the carts in the database as you want.
/Rune
I just talked to Anders about it, and we will test the scenario and fix it so the user won't get an error. If the order has been deleted somehow he should get a new empty order.
/Rune
Hi Alexey
This bug has been fixed in the next release of Tea Commerce
is working on a reply...