Revert "add first purchase discount to courseware (#22058)"
This reverts commit 059b619794.
This commit is contained in:
@@ -213,3 +213,30 @@ def get_resume_block(block):
|
||||
if resume_block:
|
||||
return resume_block
|
||||
return block
|
||||
|
||||
|
||||
def get_first_purchase_offer_banner_fragment(user, course):
|
||||
if user and course:
|
||||
discount_expiration_date = get_discount_expiration_date(user, course)
|
||||
if (discount_expiration_date and
|
||||
can_receive_discount(user=user, course=course, discount_expiration_date=discount_expiration_date)):
|
||||
# Translator: xgettext:no-python-format
|
||||
offer_message = _(u'{banner_open} Upgrade by {discount_expiration_date} and save {percentage}% '
|
||||
u'[{strikeout_price}]{span_close}{br}Discount will be automatically applied at checkout. '
|
||||
u'{a_open}Upgrade Now{a_close}{div_close}')
|
||||
return Fragment(HTML(offer_message).format(
|
||||
a_open=HTML(u'<a href="{upgrade_link}">').format(
|
||||
upgrade_link=verified_upgrade_deadline_link(user=user, course=course)
|
||||
),
|
||||
a_close=HTML('</a>'),
|
||||
br=HTML('<br>'),
|
||||
banner_open=HTML(
|
||||
'<div class="first-purchase-offer-banner"><span class="first-purchase-offer-banner-bold">'
|
||||
),
|
||||
discount_expiration_date=discount_expiration_date.strftime(u'%B %d'),
|
||||
percentage=discount_percentage(),
|
||||
span_close=HTML('</span>'),
|
||||
div_close=HTML('</div>'),
|
||||
strikeout_price=HTML(format_strikeout_price(user, course, check_for_discount=False)[0])
|
||||
))
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user