mattdrayer/rc/2016-05-17: Check for "code" on receipt line item attribute.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user