Skip to content
Snippets Groups Projects
Unverified Commit 443eeb9f authored by Matthew Piatetsky's avatar Matthew Piatetsky Committed by GitHub
Browse files

Merge pull request #23581 from edx/REV-1123

[REV-1123] Modify the program dashboard to make it pass the bundle parameter which is necessary to see the program discounted price
parents 013b3238 68777a27
No related branches found
No related tags found
No related merge requests found
......@@ -638,6 +638,7 @@ class ProgramDataExtender(object):
applicable_seat_types = set(seat for seat in self.data['applicable_seat_types'] if seat != 'credit')
is_learner_eligible_for_one_click_purchase = self.data['is_program_eligible_for_one_click_purchase']
bundle_uuid = self.data.get('uuid')
skus = []
bundle_variant = 'full'
......@@ -688,9 +689,18 @@ class ProgramDataExtender(object):
# The user specific program price is slow to calculate, so use switch to force the
# anonymous price for all users. See LEARNER-5555 for more details.
if is_anonymous or ALWAYS_CALCULATE_PROGRAM_PRICE_AS_ANONYMOUS_USER.is_enabled():
discount_data = api.baskets.calculate.get(sku=skus, is_anonymous=True)
# The bundle uuid is necessary to see the program's discounted price
if bundle_uuid:
discount_data = api.baskets.calculate.get(sku=skus, is_anonymous=True, bundle=bundle_uuid)
else:
discount_data = api.baskets.calculate.get(sku=skus, is_anonymous=True)
else:
discount_data = api.baskets.calculate.get(sku=skus, username=self.user.username)
if bundle_uuid:
discount_data = api.baskets.calculate.get(
sku=skus, username=self.user.username, bundle=bundle_uuid
)
else:
discount_data = api.baskets.calculate.get(sku=skus, username=self.user.username)
program_discounted_price = discount_data['total_incl_tax']
program_full_price = discount_data['total_incl_tax_excl_discounts']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment