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
829d0d5d
Commit
829d0d5d
authored
Sep 30, 2013
by
Jason Bau
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1174 from edx/jbau/fix/optional-enable-shopping-cart
make ENABLE_SHOPPING_CART truly optional
parents
16caf1cd
06cac195
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
lms/djangoapps/courseware/views.py
+2
-1
lms/templates/courseware/course_about.html
+7
-1
lms/templates/navigation.html
+1
-1
No files found.
lms/djangoapps/courseware/views.py
View file @
829d0d5d
...
...
@@ -609,7 +609,8 @@ def course_about(request, course_id):
registration_price
=
0
in_cart
=
False
reg_then_add_to_cart_link
=
""
if
settings
.
MITX_FEATURES
.
get
(
'ENABLE_PAID_COURSE_REGISTRATION'
):
if
(
settings
.
MITX_FEATURES
.
get
(
'ENABLE_SHOPPING_CART'
)
and
settings
.
MITX_FEATURES
.
get
(
'ENABLE_PAID_COURSE_REGISTRATION'
)):
registration_price
=
CourseMode
.
min_course_price_for_currency
(
course_id
,
settings
.
PAID_COURSE_REGISTRATION_CURRENCY
[
0
])
if
request
.
user
.
is_authenticated
():
...
...
lms/templates/courseware/course_about.html
View file @
829d0d5d
...
...
@@ -3,8 +3,12 @@
from
django
.
core
.
urlresolvers
import
reverse
from
courseware
.
courses
import
course_image_url
,
get_course_about_section
from
courseware
.
access
import
has_access
from
django
.
conf
import
settings
if
settings
.
MITX_FEATURES
.
get
('
ENABLE_SHOPPING_CART
')
:
cart_link =
reverse('shoppingcart.views.show_cart')
else:
cart_link =
""
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
...
...
@@ -26,6 +30,8 @@
$
(
"#class_enroll_form"
).
submit
();
event
.
preventDefault
();
});
%
if
settings
.
MITX_FEATURES
.
get
(
'ENABLE_SHOPPING_CART'
)
and
settings
.
MITX_FEATURES
.
get
(
'ENABLE_PAID_COURSE_REGISTRATION'
):
add_course_complete_handler
=
function
(
jqXHR
,
textStatus
)
{
if
(
jqXHR
.
status
==
200
)
{
location
.
href
=
"${cart_link}"
;
...
...
@@ -48,7 +54,7 @@
})
event
.
preventDefault
();
});
%
endif
##
making
the
conditional
around
this
entire
JS
block
for
sanity
%
if
settings
.
MITX_FEATURES
.
get
(
'RESTRICT_ENROLL_BY_REG_METHOD'
)
and
course
.
enrollment_domain
:
...
...
lms/templates/navigation.html
View file @
829d0d5d
...
...
@@ -84,7 +84,7 @@ site_status_msg = get_site_status_msg(course_id)
</li>
</ol>
% if settings.MITX_FEATURES.get('ENABLE_PAID_COURSE_REGISTRATION') and \
settings.MITX_FEATURES
['ENABLE_SHOPPING_CART']
and \
settings.MITX_FEATURES
.get('ENABLE_SHOPPING_CART')
and \
shoppingcart.models.Order.user_cart_has_items(user):
<ol
class=
"user"
>
<li
class=
"primary"
>
...
...
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