diff --git a/lms/static/js/commerce/views/receipt_view.js b/lms/static/js/commerce/views/receipt_view.js index 07466d19c5..da18a49a57 100644 --- a/lms/static/js/commerce/views/receipt_view.js +++ b/lms/static/js/commerce/views/receipt_view.js @@ -109,16 +109,20 @@ var edx = edx || {}; purchasedDatetime: order.date_placed, totalCost: self.formatMoney(order.total_excl_tax), isRefunded: false, - billedTo: { + items: [], + billedTo: null + }; + + if (order.billing_address){ + receiptContext.billedTo = { firstName: order.billing_address.first_name, lastName: order.billing_address.last_name, city: order.billing_address.city, state: order.billing_address.state, postalCode: order.billing_address.postcode, country: order.billing_address.country - }, - items: [] - }; + } + } receiptContext.items = _.map( order.lines, diff --git a/lms/templates/commerce/receipt.underscore b/lms/templates/commerce/receipt.underscore index 08484d4be1..5abccd313c 100644 --- a/lms/templates/commerce/receipt.underscore +++ b/lms/templates/commerce/receipt.underscore @@ -61,16 +61,18 @@ <% } %> -
<%- gettext( "Billed to" ) %>: - <%- receipt.billedTo.firstName %> - <%- receipt.billedTo.lastName %> - (<%- receipt.billedTo.city %>, - <%- receipt.billedTo.state %> - <%- receipt.billedTo.postalCode %> - <%- receipt.billedTo.country.toUpperCase() %>) -
-<%- gettext( "Billed to" ) %>: + <%- receipt.billedTo.firstName %> + <%- receipt.billedTo.lastName %> + (<%- receipt.billedTo.city %>, + <%- receipt.billedTo.state %> + <%- receipt.billedTo.postalCode %> + <%- receipt.billedTo.country.toUpperCase() %>) +
+