Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ define([
*/
getShippingMethodTitle: function () {
var shippingMethod;
var shippingMethodTitle = '';

if (!this.isCalculated()) {
return '';
}
shippingMethod = quote.shippingMethod();

return shippingMethod ? shippingMethod['carrier_title'] + ' - ' + shippingMethod['method_title'] : '';
if (typeof(shippingMethod['method_title']) != 'undefined') {
shippingMethodTitle = ' - ' + shippingMethod['method_title'];
}

return shippingMethod ? shippingMethod['carrier_title'] + shippingMethodTitle : '';
Copy link
Contributor

@krzksz krzksz Aug 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, your code will return empty string if no method_title is found. Can we make it return carrier_title in that case? Then we would have e.g. Flat Rate instead of Flat Rate - undefined or empty string which is a best solution in my opinion.

},

/**
Expand Down