When I run this script, the items are associated to the category correctly but in a different order each time I run the script. I can successfully order the items in the category
by hand using the Clover web app so I suspect the functionality is there to order them. I just can't figure out from the docs how to do this. I assumed that ordering the association array would do the trick but no joy.
this code as a reference. Thanks for the help!!
The order that you associate the items is reflected in the current ordering. That is, when you associate Item 2, Item 3 and then Item 1 with Category A, then the list of items will appear as [Item 2, Item 3, Item 1]. The only way to change this order is to manually hand sort them (as you've pointed out) or to completely clear the items and re-associate them in the "correct" order. Clearly not efficient, but that list is only meant to keep track of the item associations themselves, not to be directly viewed or user-friendly.