I'm quite new to TeaCommerce, but I'm having difficulties sorting the Countries. When I try and sort by name, the list just becomes incredibly unsorted! I can't quite work out what it's sorting it by, but it's not quite right!
Hmm we use the sort code from Umbraco - but has copied it to TC - so if there was a bug in Umbraco that might be the case. Could you try and upgrade to latest Umbraco. Then if it still fails, we would have to look into it :)
You are right that there was a problem in older versions of Umbraco with sorting. Because we support 4.7 of Umbraco we need to leave this bug as it is. BUT of course when we finish the version for Umbraco 7 - we can fix it and dont support 4.7 and back.
If you can write a small sql script to update and then recycle your website (the cache is killed) - then your sorting will be good. But yeah - the UI cant sort correctly.
DECLARE @OrderSource TABLE(
newOrder int,
Id int
)
INSERT INTO @OrderSource
SELECT ROW_NUMBER() OVER (ORDER BY Name) as newOrder,
[Id]
FROM [TeaCommerce_Region]
WHERE IsDeleted=0 and StoreId=1
UPDATE [TeaCommerce_Region]
SET [Sort] = o.newOrder
FROM @OrderSource o
join [TeaCommerce_Region] t on t.Id = o.Id
Sorting Countries
Hello,
I'm quite new to TeaCommerce, but I'm having difficulties sorting the Countries. When I try and sort by name, the list just becomes incredibly unsorted! I can't quite work out what it's sorting it by, but it's not quite right!
This screen grab explains all :-)
http://screencast.com/t/pk8rQGaCW2qO
Maybe the issue is actually with Umbraco (6.1.3) as it seems to sort like:
1
10
101
2
20
201
etc
Hmm we use the sort code from Umbraco - but has copied it to TC - so if there was a bug in Umbraco that might be the case. Could you try and upgrade to latest Umbraco. Then if it still fails, we would have to look into it :)
Kind regards
Anders
Hey Anders, hope you are well.
I have upgraded to v6.1.6 (and cleared my cache), but I am still experiencing this sorting issue.
http://screencast.com/t/VmFpvwPY
Best wishes, Laurence :-)
Hi Laurence
You are right that there was a problem in older versions of Umbraco with sorting. Because we support 4.7 of Umbraco we need to leave this bug as it is. BUT of course when we finish the version for Umbraco 7 - we can fix it and dont support 4.7 and back.
If you can write a small sql script to update and then recycle your website (the cache is killed) - then your sorting will be good. But yeah - the UI cant sort correctly.
Kind regards
Anders
Hi Anders, would you have to hand the code required to sort the table? It's making my mind hurt a little today! Thanks, Laurence
I dont have the sql - so I would have to write it and that would take some time for me that I dont have the next couple of days :)
You will be writing a cursor that loops your data and then updates the sort number.
You can also loop them in code using PetaPoco (Use the DatabaseFactory to get a database instance using Autofac). Then use C# to update.
Kind regards
Anders
Credit goes to John C Scott, Thanks! x
is working on a reply...