Skip to content

Commit ca8c75a

Browse files
#25375: Static tests fix.
1 parent 9b6c8d7 commit ca8c75a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,11 @@ define([
162162

163163
/**
164164
* Get cart param by name.
165+
*
165166
* @param {String} name
166167
* @returns {*}
167168
*/
168-
getCartParam: function (name) {
169+
getCartParamUnsanitizedHtml: function (name) {
169170
if (!_.isUndefined(name)) {
170171
if (!this.cart.hasOwnProperty(name)) {
171172
this.cart[name] = ko.observable();
@@ -175,12 +176,21 @@ define([
175176
return this.cart[name]();
176177
},
177178

179+
/**
180+
* @deprecated please use getCartParamUnsanitizedHtml.
181+
* @param {String} name
182+
* @returns {*}
183+
*/
184+
getCartParam: function (name) {
185+
return this.getCartParamUnsanitizedHtml(name);
186+
},
187+
178188
/**
179189
* Returns array of cart items, limited by 'maxItemsToDisplay' setting
180190
* @returns []
181191
*/
182192
getCartItems: function () {
183-
var items = this.getCartParam('items') || [];
193+
var items = this.getCartParamUnsanitizedHtml('items') || [];
184194

185195
items = items.slice(parseInt(-this.maxItemsToDisplay, 10));
186196

@@ -192,7 +202,7 @@ define([
192202
* @returns {Number}
193203
*/
194204
getCartLineItemsCount: function () {
195-
var items = this.getCartParam('items') || [];
205+
var items = this.getCartParamUnsanitizedHtml('items') || [];
196206

197207
return parseInt(items.length, 10);
198208
}

app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"
5757
translate="'Proceed to Checkout'"
5858
/>
59-
<div data-bind="html: getCartParam('extra_actions')"></div>
59+
<div data-bind="html: getCartParamUnsanitizedHtml('extra_actions')"></div>
6060
</div>
6161
</div>
6262
</if>

0 commit comments

Comments
 (0)