Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
ca7ca033
Unverified
Commit
ca7ca033
authored
5 years ago
by
Matthew Piatetsky
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #22768 from edx/REV-1080
add coupon code to discount banner
parents
c9fecb11
a47e6832
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/features/course_experience/tests/views/test_course_home.py
+1
-1
1 addition, 1 deletion
...eatures/course_experience/tests/views/test_course_home.py
openedx/features/discounts/utils.py
+6
-2
6 additions, 2 deletions
openedx/features/discounts/utils.py
with
7 additions
and
3 deletions
openedx/features/course_experience/tests/views/test_course_home.py
+
1
−
1
View file @
ca7ca033
...
...
@@ -443,7 +443,7 @@ class TestCourseHomePageAccess(CourseHomePageTestCase):
bannerText
=
u
'''
<div class=
"
first-purchase-offer-banner
"
role=
"
note
"
>
<span class=
"
first-purchase-offer-banner-bold
"
>
Upgrade by {discount_expiration_date} and save {percentage}% [{strikeout_price}]</span>
<br>
Discount will be automatically applied
at checkout
.
<a href=
"
{upgrade_link}
"
>Upgrade Now</a>
<br>
Use code <b>EDXWELCOME</b>
at checkout
!
<a href=
"
{upgrade_link}
"
>Upgrade Now</a>
</div>
'''
.
format
(
discount_expiration_date
=
discount_expiration_date
,
percentage
=
percentage
,
...
...
This diff is collapsed.
Click to expand it.
openedx/features/discounts/utils.py
+
6
−
2
View file @
ca7ca033
...
...
@@ -5,6 +5,7 @@ Utility functions for working with discounts and discounted pricing.
from
datetime
import
datetime
import
six
from
django.utils.translation
import
get_language
from
django.utils.translation
import
ugettext
as
_
from
edx_django_utils.cache
import
RequestCache
import
pytz
...
...
@@ -14,7 +15,7 @@ from lms.djangoapps.courseware.date_summary import verified_upgrade_deadline_lin
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
experiments.models
import
ExperimentData
from
openedx.core.djangolib.markup
import
HTML
from
openedx.core.djangolib.markup
import
HTML
,
Text
from
web_fragments.fragment
import
Fragment
from
openedx.features.discounts.applicability
import
(
can_receive_discount
,
...
...
@@ -119,7 +120,7 @@ def generate_offer_html(user, course):
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
'
[{strikeout_price}]{span_close}{br}
Use code {b_open}{code}{b_close}
at checkout
!
'
u
'
{a_open}Upgrade Now{a_close}{div_close}
'
)
message_html
=
HTML
(
offer_message
).
format
(
...
...
@@ -127,6 +128,9 @@ def generate_offer_html(user, course):
upgrade_link
=
verified_upgrade_deadline_link
(
user
=
user
,
course
=
course
)
),
a_close
=
HTML
(
'
</a>
'
),
b_open
=
HTML
(
'
<b>
'
),
code
=
Text
(
'
BIENVENIDOAEDX
'
)
if
get_language
()
==
'
es-419
'
else
Text
(
'
EDXWELCOME
'
),
b_close
=
HTML
(
'
</b>
'
),
br
=
HTML
(
'
<br>
'
),
banner_open
=
HTML
(
'
<div class=
"
first-purchase-offer-banner
"
role=
"
note
"
>
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment