-
-
Save smoller/9053a7358bc77e733838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product(ShopifyResource, mixins.Metafields, mixins.Events): | |
def price_range(self): | |
#prices is a list of unicode strings not floats | |
prices = [variant.price for variant in self.variants] | |
f = "%0.2f" | |
min_price = min(prices) | |
max_price = max(prices) | |
if min_price != max_price: | |
return "%s - %s" % (f % min_price, f % max_price) | |
else: | |
return f % min_price |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment