Hello, this seems to work fine for native properties, but using a product metafield doesn’t seem to work on my side, any thoughts? I tried adding a Date metafield, so the sort string is metafields.custom.published_date but it seems to not change anything even with a couple of products having values for said metafield.
Oh also you have a rogue space in the created-ascending sort by if check.