Commit fe1e659f by Matt Drayer

mattdrayer/rc/2016-05-17: Check for "code" on receipt line item attribute.

parent 1ba73efc
......@@ -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.
......
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