Manually updating collection sort order doesn't trigger webhook

Thresher
Shopify Partner
20 2 24

The webhook does get called when I use the "Sort" dropdown to switch from an automatic sort to manual sorting, but when I drag an individual product to manually re-order, the webhook doesn't get called.

 

Is this a bug? I want to know when the manual sort order of a collection has changed, but it doesn't seem to work.webhook-error.png

Replies 9 (9)

Alex
Shopify Staff
1561 81 341

Changing the sort_order property of the collection is updating the collection object itself, leading to a webhook being fired. Changing the order of the products in the collection manually when the sort_order is already manual does not lead to a change of the collection object itself, which is why you're not seeing webhooks firing. The value being changed (position in a collection) lives on the collect, which at this time does not have a corresponding webhook unfortunately.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Thresher
Shopify Partner
20 2 24

Thanks for the response @Alex. I would expect both sorting methods to fire the webhook. What is the best way to make an API feature request?

Alex
Shopify Staff
1561 81 341

Right here is just fine! If you have more to add to your use case feel free to do so. I'm cataloging that information on my end.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

wb1
Shopify Partner
61 2 15

+1 on this feature request

It would also be nice to have the `updated_at` field respect sort order change as well. Maybe this is a given in order to generate the new webhook entry...

blimpmason
Tourist
4 1 1

+1 — I'm also hoping for webhooks to fire when collection products are manually re-ordered. 

wb1
Shopify Partner
61 2 15

@Alex , any update if we might be able to get the `collection/updated` webhook fired when a collection product sort order is changed?

It seems like the the Collect entries are 1:1, i.e. product to collection, so the only way to know if a sort order has changed in a collection, would be to monitor every single Collect for a collection. Am I misinterpreting this? If I'm reading it correctly, that's a massive amount of lifting in order to know if the product sort order of a collection has changed.

Mete
Shopify Partner
132 0 37

+1 we need to have a webhook here as well.

Co-Founder / Developer at: merchbees
Merchbees Low Stock Alert - Keep track of your low stock items by email and slack
Merchbees Inventory Value - Know your inventory value and quantity in real-time
Push Down & Hide Out of Stock - Move out of stock products to the bottom of the collection to improve SEO & hide/ unhide automatically
Mathuraju
Shopify Partner
13 0 2

+ 1.

We are also looking for collection/update event should fire if we sort the products manually.

123221
Shopify Partner
3 0 0

Yes, Shopify does not trigger Webhook when the order of the products is changed.

 

But rather than pulling data for all the collections there is a smarter way to sync data.

This is useful when the store has several collections.

 

When you change the order of the products "updated_at" parameter of the Collection Object is updated. Use this to identify the collections that need to be synced.

 

Use- https://STORE/admin/api/2023-01/smart_collections.json?updated_at_min=2023-10-17T20:01:07-07:00

 

Store the updated_at_min in your database at the time your sync starts.