Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9f40263f
Commit
9f40263f
authored
Sep 09, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken callout to template partial from receipt page.
parent
48f867bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
lms/djangoapps/shoppingcart/models.py
+13
-1
lms/djangoapps/shoppingcart/views.py
+9
-3
lms/templates/shoppingcart/receipt.html
+1
-1
No files found.
lms/djangoapps/shoppingcart/models.py
View file @
9f40263f
...
...
@@ -204,7 +204,15 @@ class OrderItem(models.Model):
"""
The template that should be used when there's only one item in the order
"""
return
'shoppingcart/receipt.html'
return
'shoppingcart/receipt.html'
@property
def
single_item_receipt_context
(
self
):
"""
Extra variables needed to render the template specified in
`single_item_receipt_template`
"""
return
{}
@property
def
additional_instruction_text
(
self
):
...
...
@@ -373,6 +381,10 @@ class CertificateItem(OrderItem):
return
super
(
CertificateItem
,
self
)
.
single_item_receipt_template
@property
def
single_item_receipt_context
(
self
):
return
{
"course_name"
:
course_from_id
(
self
.
course_id
)
.
display_name
}
@property
def
additional_instruction_text
(
self
):
return
textwrap
.
dedent
(
_
(
"Note - you have up to 2 weeks into the course to unenroll from the Verified Certificate option
\
...
...
lms/djangoapps/shoppingcart/views.py
View file @
9f40263f
...
...
@@ -105,8 +105,14 @@ def show_receipt(request, ordernum):
receipt_template
=
'shoppingcart/receipt.html'
# we want to have the ability to override the default receipt page when
# there is only one item in the order
context
=
{
'order'
:
order
,
'order_items'
:
order_items
,
'any_refunds'
:
any_refunds
}
if
order_items
.
count
()
==
1
:
receipt_template
=
order_items
[
0
]
.
single_item_receipt_template
return
render_to_response
(
receipt_template
,
{
'order'
:
order
,
'order_items'
:
order_items
,
'any_refunds'
:
any_refunds
}
)
context
.
update
(
order_items
[
0
]
.
single_item_receipt_context
)
return
render_to_response
(
receipt_template
,
context
)
lms/templates/shoppingcart/receipt.html
View file @
9f40263f
...
...
@@ -19,7 +19,7 @@
<section
class=
"wrapper cart-list"
>
<
%
include
file=
"
_verification_header.html
"
/>
<
%
include
file=
"
/verify_student/_verification_header.html"
args=
"course_name=course_name
"
/>
<div
class=
"wrapper-progress"
>
<section
class=
"progress"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment