Commit defb08e8 by Douglas Hall Committed by Matt Drayer

Include course price in course_about template context if either the ecommerce…

Include course price in course_about template context if either the ecommerce service is enabled or shoppingcart is enabled
parent fe1e659f
...@@ -510,7 +510,8 @@ def course_about(request, course_id): ...@@ -510,7 +510,8 @@ def course_about(request, course_id):
ecommerce_bulk_checkout_link = '' ecommerce_bulk_checkout_link = ''
professional_mode = None professional_mode = None
ecomm_service = EcommerceService() ecomm_service = EcommerceService()
if ecomm_service.is_enabled(request.user) and ( _is_ecomm_service_enabled = ecomm_service.is_enabled(request.user)
if _is_ecomm_service_enabled and (
CourseMode.PROFESSIONAL in modes or CourseMode.NO_ID_PROFESSIONAL_MODE in modes CourseMode.PROFESSIONAL in modes or CourseMode.NO_ID_PROFESSIONAL_MODE in modes
): ):
professional_mode = modes.get(CourseMode.PROFESSIONAL, '') or \ professional_mode = modes.get(CourseMode.PROFESSIONAL, '') or \
...@@ -519,11 +520,14 @@ def course_about(request, course_id): ...@@ -519,11 +520,14 @@ def course_about(request, course_id):
if professional_mode.bulk_sku: if professional_mode.bulk_sku:
ecommerce_bulk_checkout_link = ecomm_service.checkout_page_url(professional_mode.bulk_sku) ecommerce_bulk_checkout_link = ecomm_service.checkout_page_url(professional_mode.bulk_sku)
# Find the minimum price for the course across all course modes # We need to look up the price from the CourseMode only when the EcommerceService is enabled OR
registration_price = CourseMode.min_course_price_for_currency( # the legacy shoppingcart ecommerce implementation is enabled.
course_key, registration_price = 0
settings.PAID_COURSE_REGISTRATION_CURRENCY[0] if _is_ecomm_service_enabled or _is_shopping_cart_enabled:
) registration_price = CourseMode.min_course_price_for_currency(
course_key,
settings.PAID_COURSE_REGISTRATION_CURRENCY[0]
)
course_price = get_cosmetic_display_price(course, registration_price) course_price = get_cosmetic_display_price(course, registration_price)
can_add_course_to_cart = _is_shopping_cart_enabled and registration_price can_add_course_to_cart = _is_shopping_cart_enabled and registration_price
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment