Skip to content

Commit 0b434b5

Browse files
committed
MAGE-901: showing title for empty recommendation issue addressed
1 parent 2ab76e3 commit 0b434b5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

view/frontend/web/recommend.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ define([
4343
}));
4444
},
4545
headerComponent({html}) {
46+
if (this.props.recommendations.length === 0) {
47+
return html
48+
}
4649
return recommendProductsHtml.getHeaderHtml(
4750
html,
4851
algoliaConfig.recommend.FBTTitle
@@ -76,6 +79,9 @@ define([
7679
}));
7780
},
7881
headerComponent({html}) {
82+
if (this.props.recommendations.length === 0) {
83+
return html;
84+
}
7985
return recommendProductsHtml.getHeaderHtml(
8086
html,
8187
algoliaConfig.recommend.relatedProductsTitle
@@ -116,6 +122,9 @@ define([
116122
}));
117123
},
118124
headerComponent({html}) {
125+
if (this.props.recommendations.length === 0) {
126+
return html;
127+
}
119128
return recommendProductsHtml.getHeaderHtml(
120129
html,
121130
algoliaConfig.recommend.trendingItemsTitle

0 commit comments

Comments
 (0)