Skip to content

Commit 5f0b50e

Browse files
ENGCOM-5691: Correction in the shipping method if it is empty it no longer shows t… #24265
- Merge Pull Request #24265 from wbeltranc/magento2:shippmetundef - Merged commits: 1. 10f880c 2. 775eab4 3. d8c8574 4. 86228e9
2 parents e56640c + 86228e9 commit 5f0b50e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ define([
2828
* @return {String}
2929
*/
3030
getShippingMethodTitle: function () {
31-
var shippingMethod = quote.shippingMethod();
31+
var shippingMethod = quote.shippingMethod(),
32+
shippingMethodTitle = '';
3233

33-
return shippingMethod ? shippingMethod['carrier_title'] + ' - ' + shippingMethod['method_title'] : '';
34+
if (typeof shippingMethod['method_title'] !== 'undefined') {
35+
shippingMethodTitle = ' - ' + shippingMethod['method_title'];
36+
}
37+
38+
return shippingMethod ?
39+
shippingMethod['carrier_title'] + shippingMethodTitle :
40+
shippingMethod['carrier_title'];
3441
},
3542

3643
/**

0 commit comments

Comments
 (0)