ENT-1052 discount by enterprise catalog

This commit is contained in:
zubair-arbi
2018-06-27 17:15:39 +05:00
parent a95a2b91b7
commit bbdcf6de7a
6 changed files with 46 additions and 6 deletions

View File

@@ -111,9 +111,14 @@ class EcommerceService(object):
http://localhost:8002/basket/add/?sku=5H3HG5&sku=57FHHD&bundle=3bdf1dd1-49be-4a15-9145-38901f578c5a
"""
program_uuid = kwargs.get('program_uuid')
url = '{checkout_page_path}?{skus}'.format(
enterprise_catalog_uuid = kwargs.get('enterprise_customer_catalog_uuid')
query_params = {'sku': skus}
if enterprise_catalog_uuid:
query_params.update({'enterprise_customer_catalog_uuid': enterprise_catalog_uuid})
url = '{checkout_page_path}?{query_params}'.format(
checkout_page_path=self.get_absolute_ecommerce_url(self.config.basket_checkout_page),
skus=urlencode({'sku': skus}, doseq=True),
query_params=urlencode(query_params, doseq=True),
)
if program_uuid:
url = '{url}&bundle={program_uuid}'.format(