How can I sort collection items by publish date, not created date?

If anyone still looking for a solution, there’s no need for an app. Keep reading.

Here is a piece of code that will prepare the collection’s products in the correct order by publish date instead of creation.
This will work whenever someone will change the sort_by= parameter to either created_ascending or created_descending, or when these options are selected as the default sorting option for the collection in the admin panel.

{% if collection.sort_by == 'created-descending' or collection.sort_by == empty and collection.default_sort_by == 'created-descending' %}
    {% assign collection_products = collection.products | sort: 'published_at' | reverse %}	
{% elsif collection.sort_by == 'created-ascending  ' or collection.sort_by == empty and collection.default_sort_by == 'created-ascending' %}
    {% assign collection_products = collection.products | sort: 'published_at' %}	        
{% else %}
    {% assign collection_products = collection.products %}	        
{% endif %}

Then make sure to use the newly assigned variable in the for loop, i.e.

{% for product in collection_products %}

Hope this helps someone.
Will finish with the usual rant to Shopify - maybe you should listen to your valued customers and add features that are trivial to any normal ecommerce platform.