Skip to content

Commit

Permalink
fix: show price on all course cards
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Aug 16, 2023
1 parent 211775d commit c2a6697
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lms/lms/doctype/lms_course/lms_course.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"fieldname": "currency",
"fieldtype": "Link",
"label": "Currency",
"mandatory_depends_on": "paid_certificate",
"mandatory_depends_on": "paid_course",
"options": "Currency"
},
{
Expand Down Expand Up @@ -223,7 +223,7 @@
"fieldtype": "Currency",
"label": "Course Price",
"option": "currency",
"mandatory_depends_on": "paid_certificate"
"mandatory_depends_on": "paid_course"
},
{
"fieldname": "column_break_rxww",
Expand Down Expand Up @@ -254,7 +254,7 @@
}
],
"make_attachments_public": 1,
"modified": "2023-08-02 12:07:26.354119",
"modified": "2023-08-02 12:07:26.354110",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Course",
Expand Down
4 changes: 3 additions & 1 deletion lms/lms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ def get_courses_under_review():
"title",
"short_introduction",
"image",
"enable_certification",
"paid_course",
"course_price",
"currency",
"status",
"published",
],
Expand Down
2 changes: 1 addition & 1 deletion lms/lms/widgets/CourseCard.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

<div class="course-price">
{% if course.paid_course %}
{{ format_amount(course.course_price, course.currency) }}
{{ frappe.utils.fmt_money(course.course_price, 0, course.currency) }}
{% else %}
{{ _("Free") }}
{% endif %}
Expand Down
8 changes: 5 additions & 3 deletions lms/overrides/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def get_enrolled_courses():
"short_introduction",
"image",
"enable_certification",
"paid_certificate",
"price_certificate",
"paid_course",
"course_price",
"currency",
"published",
],
Expand Down Expand Up @@ -148,7 +148,9 @@ def get_authored_courses(member=None, only_published=True):
"title",
"short_introduction",
"image",
"enable_certification",
"paid_course",
"course_price",
"currency",
"status",
"published",
],
Expand Down
4 changes: 2 additions & 2 deletions lms/www/classes/class.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def get_class_course_details(class_courses):
"upcoming",
"short_introduction",
"image",
"paid_certificate",
"price_certificate",
"paid_course",
"course_price",
"enable_certification",
"currency",
],
Expand Down
2 changes: 1 addition & 1 deletion lms/www/courses/course.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
{{ Notes(course) }}

<div class="vertically-center mb-3 bold-heading">
{{ format_amount(course.course_price, course.currency) }}
{{ frappe.utils.fmt_money(course.course_price, 0, course.currency) }}
</div>

<div class="vertically-center mb-3">
Expand Down

0 comments on commit c2a6697

Please sign in to comment.