Order products by lowest product variant Currently using Craft Commerce 2. 

I was wondering if it's possible to order products by the lowest priced variant. I have tried something along the lines of this, but it doesn't do anything different with the ordering:

{% set products = craft.products.type('accommodation').all() %}

{% for product in products %}
   {% if product.getVariants()|length %}

        {% set variants = craft.variants ({
            product: product,
            orderBy: 'price asc'
        }) %}

        {% for purchasable in variants %}
            // Products Here
        {% endfor %}

    {% endif %}
{% endfor %}


I have also tried something else along the lines of this:

{% set products = craft.commerce.products({
    relatedTo: 'accommodation', 
    order: 'defaultPrice asc',
}) %}
I managed to resolve this using the supersort plugin and using 'defaultPrice' instead of 'price'. Example below:

{% set products = craft.products.type('accommodation').all() %}
{% set order = products|supersort('sortAs', '{{ object.defaultPrice }}') %}

{% for product in order %}

    // Products

{% endfor %}