Craft Commerce: Sort Products By Price Trying to sort products by price. 

Since the price of a product in Commerce isn't a textual custom field it's attached to a variant, I'm having trouble working out the syntax to make this happen.

{% set products = craft.commerce.products({
     relatedTo: (category), 
     order: defaultPrice,
}) %}


This seems close but delivers "Variable "defaultPrice" does not exist"

Appreciate any direction.
Close!  This should do it:

{% set products = craft.commerce.products({
    relatedTo: (category), 
    order: 'defaultPrice',
}) %}


With the quotes it's a string.  Without the quotes, Twig is expecting a variable you've defined called defaultPrice that doesn't exist.