Found the answer. Naturally, moments after I posted the question! The problem is that Mage::getModel('catalog/category')->getCollection() ...
However, this set's the sort order/position for all products to "1". I also have found this posting How to update product position (number) in specific category ...
I would like to set and save "manual sort order"s for some specific categories in a Magento 2.2 Shop programmatically. What is the best and ...
$parentId - it the category id for which we sort the children
... blog, How to Set Cart Page Items Custom Notice Message in Magento 2.
magento change sort order in category programmatically · magento 2 change default sorting order ...
is position followed by entity_id (sorted in ascending order).
For example, you want to change the sorting in 1-9 and a-z of the layered navigation attributes on the category page.
The first issue I have is that I'm not able to sort the attributes of configurable products on the product page. I have 3 attributes used on my ...
Set the page layout; Include static resources (JavaScript, CSS, fonts) in
; Remove static