Can't remove or update orderlines (orderLineId is 0 for each line)
Suddenly orderLineId is always returning 0. Is this a result of us populating the site before applying the licence file? We've added a few thousand products recently, though only run through 4 test orders, so well within the demo limit of 20, but I can't think of another reason why this has started happening?
Shouldn't be anything to do with the license file at this point.
An orderLineId of 0 would suggest it's an order line that hasn't been persisted yet. Where exactly are you seeing the order line ids being 0? Whats your code?
thanks for the response. Sorry I couldn't reply earlier.
I'm using almost the exact markup that came somewhere in the distant past from either a starter or demo site of Tea Commerce, I've included the whole file below (commented out sections and all), but I did a diff compare with the original and don't see any significant differences.
Apart from adding products in preparation for starting to test the site we've added a few discount codes, purely using the UI. We wondered if they could be affecting this at all?
I'm seeing the orderLineId as 0 in the hidden fields (as well as when stepping through the code), but the rest of the order line details seem correct and all those output are populated as expected.
We're going to remove the discount codes in the meantime and I'll post an update if that's has any impact, or if I find out any other information.
Hmm, I can't spot anything in this that would appear to be the problem.
Do you have any event handlers or anything else affecting the order behind the scene? Like I say, the order line id would only ever be 0 if it is a new order line, but I don't know what would be causing it to recreate that.
The only code we have that I think could be linked is if your order is finalized, or has gone through to the payment gateway, it will be flagged as "uneditable" at which point if you try to modify that order, TC will clone it, so maybe those order lines are new, because it's been cloned?
Turns out there was an issue in a custom shipping calculation, which was related to when the order amount was more than a value which was also being set up in a discount code so it looked like it was related to the discount code. No ysod and nothing in Event Viewer, but I'll know next time something similar happens.
cheers
t
Can't remove or update orderlines (orderLineId is 0 for each line)
Suddenly orderLineId is always returning 0. Is this a result of us populating the site before applying the licence file? We've added a few thousand products recently, though only run through 4 test orders, so well within the demo limit of 20, but I can't think of another reason why this has started happening?
many thanks Tom
Hey Tom,
Shouldn't be anything to do with the license file at this point.
An orderLineId of 0 would suggest it's an order line that hasn't been persisted yet. Where exactly are you seeing the order line ids being 0? Whats your code?
Matt
Hi Matt,
thanks for the response. Sorry I couldn't reply earlier.
I'm using almost the exact markup that came somewhere in the distant past from either a starter or demo site of Tea Commerce, I've included the whole file below (commented out sections and all), but I did a diff compare with the original and don't see any significant differences.
Apart from adding products in preparation for starting to test the site we've added a few discount codes, purely using the UI. We wondered if they could be affecting this at all?
I'm seeing the orderLineId as 0 in the hidden fields (as well as when stepping through the code), but the rest of the order line details seem correct and all those output are populated as expected.
We're going to remove the discount codes in the meantime and I'll post an update if that's has any impact, or if I find out any other information.
many thanks
t
p.s. sorry for not formatting the code!
@using TeaCommerce.Umbraco.Web @inherits UmbracoTemplatePage @{ Layout = "CartStepMaster.cshtml";
IPublishedContent currentPage = Model.Content; IPublishedContent nextStep = currentPage.Children.FirstOrDefault();
//store id long storeId = long.Parse( currentPage.GetPropertyValue
Order order = TC.GetCurrentOrder( storeId, false ); } @if ( order != null ) {
Your cart
@orderLine.UnitPrice.WithoutDiscounts} @orderLine.UnitPrice.Value Unit price:@orderLine.TotalPrice.WithPreviousDiscounts} @orderLine.TotalPrice.Value Total price:@order.SubtotalPrice.WithPreviousDiscounts} @order.SubtotalPrice.Value@order.ShipmentInformation.TotalPrice.WithoutDiscounts} @(order.ShipmentInformation.TotalPrice.Value.FormattedWithoutSymbol != "0.01" ? order.ShipmentInformation.TotalPrice.Value.WithVatFormatted : "TBC")@order.PaymentInformation.TotalPrice.WithoutDiscounts} @order.PaymentInformation.TotalPrice.Value@order.TotalPrice.WithPreviousDiscounts} @order.TotalPriceYour discount codes: @string.Join( ", ", order.DiscountCodes.Select( d => "\"" + d.Code + "\"" ) )
}Have a discount code?
}
Hmm, I can't spot anything in this that would appear to be the problem.
Do you have any event handlers or anything else affecting the order behind the scene? Like I say, the order line id would only ever be 0 if it is a new order line, but I don't know what would be causing it to recreate that.
The only code we have that I think could be linked is if your order is finalized, or has gone through to the payment gateway, it will be flagged as "uneditable" at which point if you try to modify that order, TC will clone it, so maybe those order lines are new, because it's been cloned?
Matt
Turns out there was an issue in a custom shipping calculation, which was related to when the order amount was more than a value which was also being set up in a discount code so it looked like it was related to the discount code. No ysod and nothing in Event Viewer, but I'll know next time something similar happens. cheers t
Glad you were able to find a solution 👍
is working on a reply...