diff --git a/lms/static/sass/features/_first-purchase-banner.scss b/lms/static/sass/features/_first-purchase-banner.scss index 60bfe28214..b154ea76ad 100644 --- a/lms/static/sass/features/_first-purchase-banner.scss +++ b/lms/static/sass/features/_first-purchase-banner.scss @@ -25,3 +25,7 @@ #seq_content .first-purchase-offer-banner { max-width: $text-width-readability-max; } + +body.view-in-mfe .first-purchase-offer-banner { + display: none; +} diff --git a/openedx/core/djangoapps/courseware_api/serializers.py b/openedx/core/djangoapps/courseware_api/serializers.py index f9a70c9f61..060abad700 100644 --- a/openedx/core/djangoapps/courseware_api/serializers.py +++ b/openedx/core/djangoapps/courseware_api/serializers.py @@ -79,6 +79,7 @@ class CourseInfoSerializer(serializers.Serializer): # pylint: disable=abstract- media = _CourseApiMediaCollectionSerializer(source='*') name = serializers.CharField(source='display_name_with_default_escaped') number = serializers.CharField(source='display_number_with_default') + offer_html = serializers.CharField() org = serializers.CharField(source='display_org_with_default') short_description = serializers.CharField() start = serializers.DateTimeField() diff --git a/openedx/core/djangoapps/courseware_api/views.py b/openedx/core/djangoapps/courseware_api/views.py index a75e454588..19ac4639b3 100644 --- a/openedx/core/djangoapps/courseware_api/views.py +++ b/openedx/core/djangoapps/courseware_api/views.py @@ -18,6 +18,7 @@ from student.models import CourseEnrollment from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin from openedx.features.content_type_gating.models import ContentTypeGatingConfig from openedx.features.course_duration_limits.access import generate_course_expired_message +from openedx.features.discounts.utils import generate_offer_html from xmodule.course_module import COURSE_VISIBILITY_PUBLIC from .serializers import CourseInfoSerializer @@ -117,6 +118,8 @@ class CoursewareInformation(RetrieveAPIView): # TODO: TNL-7185 Legacy: Refactor to return the expiration date and format the message in the MFE overview.course_expired_message = generate_course_expired_message(self.request.user, overview) + # TODO: TNL-7185 Legacy: Refactor to return the offer data and format the message in the MFE + overview.offer_html = generate_offer_html(self.request.user, overview) course_key = CourseKey.from_string(self.kwargs['course_key_string']) overview.content_type_gating_enabled = ContentTypeGatingConfig.enabled_for_enrollment(