Custom Collection creation sort order ignored

whitesoxrock
Tourist
4 0 6

Has any run into an issue when creating a custom collection with a manual sort order? I've developed an algorithm to  sort personal custom collections for our customers, but while they are sent in with positions, they don't appear in the proper order based on those positions. Seems like they end up in a random order. 

 

The JSON looks like this: 

"custom_collection": {
"id": xxxxxx,
"sort_order": "manual",
"collects": [
    {
       "product_id": xxxxx,
       "position": 1
    },

    {
       "product_id": xxxxx,
       "position": 2
    },

    {
       "product_id": xxxxx,
       "position": 3
    }

 ]
}

 

Most of the feeds are a couple hundred items, and while I would expect the ones that have position 1, 2, 3, etc to appear first, second, third, they don't. They're just in totally random positions. 

whitesoxrock
Tourist
4 0 6

Figured this out myself. But in case anyone runs into the same issue as me, the problem was when I was creating the custom collection, I was not setting the sort order type (which defaulted it to Best Selling). I was setting the sort order to manual when I actually added the items to the collection, but it wasn't taking effect on the items that I was adding at that time. Changing the sort order does not seems to have any effect if it's done in the same call as when you add items. 

0 Likes
Enroute_Ltd
Shopify Partner
2 0 1

Hi,

I am struggling with the same issue. Can you please let me know which API were you using for sending in the JSON?

 

EDIT: Never mind found it myself: POST /admin/api/2020-04/custom_collections.json

0 Likes