using KnockoutJS to bind array for select element
HTML Namespace_Module/view/frontend/web/template/minicart/item/default.html
<select data-bind="attr: {
id: 'cart-item-'+item_id+'-qty',
'data-cart-item': item_id,
'data-item-qty': qty,
'data-cart-item-id': product_sku
},
value: qty,
options: $parent.qtyOptions"
class="item-qty cart-item-qty">
</select>
XML checkout_cart_sidebar_item_renderers.xml
<referenceBlock name="minicart">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="minicart_content" xsi:type="array">
<item name="children" xsi:type="array">
<item name="item.renderer" xsi:type="array">
<item name="component" xsi:type="string">Namespace_Module/js/custom-qty</item>
<item name="config" xsi:type="array">
<item name="displayArea" xsi:type="string">defaultRenderer</item>
<item name="template" xsi:type="string">Namespace_Module/minicart/item/default</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
JS FILE: Namespace_Module/view/frontend/web/js/custom-qty.js
define([
'ko',
'jquery',
'uiComponent'
],function(ko, $, Component){
return Component.extend({
qtyOptions: ko.observableArray([]),
initialize: function(){
this._super();
for(var i =0; i<= 10; i++){
this.qtyOptions.push(i);
}
return this;
}
});
});
The result
More info about bind options to select using KnockoutJS >> KnockoutJS Document
The HTML of register link is generated from block RegisterLink.php
so you need to override block and add new css class in function _toHtml()
vendor/magento/module-customer/Block/Account/RegisterLink.php
protected function _toHtml()
{
if (!$this->_registration->isAllowed()
|| $this->httpContext->getValue(Context::CONTEXT_AUTH)
) {
return '';
}
return '<li class="register-link"><a ' . $this->getLinkAttributes() . ' ></a></li>';
}
Now add new class in css file
li.register-link:before {
font-size: 22px;
content: '\e611';
font-family: 'luma-icons';
}
Best Answer
Override
default.html
to your themeFrom
vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html
TO
app/design/frontend/Vendor/theme/Magento_Checkout/web/template/minicart/item/default.html
Now change
To
Now flush cache and run static:content:deploy to see changes
OUTPUT: