The HasCurrentFinalizedOrder just needs to use the GetCurrentFinalizedOrder and then check for null.
The bool that GetCurrentOrder takes is a bool that indicates if an order should be created if non i present. Mini cart will have false - but the cart flow would axpect an order is already there - so dont send the bool - as its optional.
Tc.GetCurrentOrder would in 2.2 actually always return an order because of a bug. It will be fixed in 2.2.1. So if this returns null - could you check if your have hit the limit for running in test mode? 20 orders.
Hi Anders, I actually had 19 orders but deleted a few and this did not make any difference. Does TC retain an internal count or should deleting orders work?
Issue with cart after updating to Tea Commerce v. 2.2.0
I have updated Tea Commerce from v. 2.1.3 to 2.2.0 because of a bug related to PayPal:
From revision history:
FIX: PayPal now only supports an interger for quantity instead of decimal
But in this version also HasCurrentOrder is removed and I should use GetCurrentOrder( storeId, false).
However I still got an error message:
Type 'TeaCommerce.Api.Models.Order' can not be implicitly converted to 'bool'
/Bjarne
Okay, I figured out that I just need to check for null as it of course not return a boolean now, but an Order object :)
and I needed to update the razor files which was using HasCurrentOrder or HasCurrentFinalizedOrder..
What does the true/false parameter in GetCurrentOrder do?
And when HasCurrentFinalizedOrder method in v. 2.2.0 is removed, how should I rewrite this in cart/view-order-line-overview.cshtml?
/Bjarne
The HasCurrentFinalizedOrder just needs to use the GetCurrentFinalizedOrder and then check for null.
The bool that GetCurrentOrder takes is a bool that indicates if an order should be created if non i present. Mini cart will have false - but the cart flow would axpect an order is already there - so dont send the bool - as its optional.
Kind regards
Anders
Okay, that works.. :)
So I will just have to use TC.GetCurrentOrder( storeId, false) in minicart and TC.GetCurrentOrder(storeId) in checkout flow?
/Bjarne
Exactly
I upgraded to 2.2 and I am working through the breaking changes but this does not work for me.
This line fails presumably because order is null. I can't seem to check whether it is null before calling this.
Thanks,
Mark
Tc.GetCurrentOrder would in 2.2 actually always return an order because of a bug. It will be fixed in 2.2.1. So if this returns null - could you check if your have hit the limit for running in test mode? 20 orders.
Kind regards
Anders
Hi Anders, I actually had 19 orders but deleted a few and this did not make any difference. Does TC retain an internal count or should deleting orders work?
Thanks,
Mark
You should reset the "CurrentOrderNumber" in the DB table TC_Store to 0 to get it to work again if you have 20 orders.
is working on a reply...