forked from CGM_Public/pretix_original
Fixed price calculation with restrictions
This commit is contained in:
@@ -1022,12 +1022,14 @@ class Item(Versionable):
|
|||||||
else:
|
else:
|
||||||
var['price'] = self.default_price
|
var['price'] = self.default_price
|
||||||
|
|
||||||
|
newprice = None
|
||||||
for receiver, response in responses:
|
for receiver, response in responses:
|
||||||
if 'available' in response[i]:
|
if 'available' in response[i]:
|
||||||
var['available'] &= response[i]['available']
|
var['available'] &= response[i]['available']
|
||||||
if 'price' in response[i] and response[i]['price'] is not None \
|
if 'price' in response[i] and response[i]['price'] is not None \
|
||||||
and response[i]['price'] < var['price']:
|
and (newprice is None or response[i]['price'] < newprice):
|
||||||
var['price'] = response[i]['price']
|
newprice = response[i]['price']
|
||||||
|
var['price'] = newprice or var['price']
|
||||||
|
|
||||||
self._get_all_available_variations_cache = variations
|
self._get_all_available_variations_cache = variations
|
||||||
return variations
|
return variations
|
||||||
|
|||||||
Reference in New Issue
Block a user