Add new pricing system (#65)
This commit is contained in:
@@ -30,7 +30,13 @@ def get_external_print_product(id):
|
||||
return external_product
|
||||
|
||||
|
||||
def get_cheapest_canvas_product():
|
||||
def get_cheapest_canvas_product(new_version):
|
||||
if new_version:
|
||||
# We simply return the smallest size, assuming that is also the cheapest.
|
||||
# It is technically possible that a larger size is cheaper, but unlikely, so we avoid the extra complexity
|
||||
# of calculating the guaranteed cheapest product.
|
||||
return 'canvas_200x300-mm-8x12-inch_canvas_wood-fsc-slim_4-0_ver'
|
||||
|
||||
sql = "select external_product_id from external_print_products where group_id = 2 order by price_sek limit 1"
|
||||
result = db.session.execute(sql)
|
||||
external_id = result.first()[0]
|
||||
@@ -38,7 +44,10 @@ def get_cheapest_canvas_product():
|
||||
return external_id
|
||||
|
||||
|
||||
def get_cheapest_poster_product():
|
||||
def get_cheapest_poster_product(new_version):
|
||||
if new_version:
|
||||
return 'flat_250x250-mm-10x10-inch_200-gsm-80lb-uncoated_4-0_ver'
|
||||
|
||||
sql = "select external_product_id from external_print_products where group_id in (7,8) order by price_sek limit 1"
|
||||
result = db.session.execute(sql)
|
||||
external_id = result.first()[0]
|
||||
|
||||
Reference in New Issue
Block a user