diff --git a/lms/static/js/commerce/views/receipt_view.js b/lms/static/js/commerce/views/receipt_view.js index c3c1fe7a71..9f8bc6b2ef 100644 --- a/lms/static/js/commerce/views/receipt_view.js +++ b/lms/static/js/commerce/views/receipt_view.js @@ -247,7 +247,13 @@ var edx = edx || {}; for (var i = 0; i < length; i++) { var line = order.lines[i], attributeValues = _.find(line.product.attribute_values, function (attribute) { - return attribute.name === 'course_key' + // If the attribute has a 'code' property, compare its value, otherwise compare 'name' + var value_to_match = 'course_key'; + if (attribute.code) { + return attribute.code === value_to_match; + } else { + return attribute.name === value_to_match; + } }); // This method assumes that all items in the order are related to a single course.