I want to add a class in parent div if minicart/cart is empty and remove same class if minicart/cart has an item(s).I made changes in minicart.phtml. below is my code for that.
<div class="block block-minicart"
data-bind="css: { emptyBag: !!getCartParam('summary_count') == false }
data-role="dropdownDialog"
data-mage-init='{"dropdownDialog":{
"appendTo":"[data-block=minicart]",
"triggerTarget":".showcart",
"timeout": "2000",
"closeOnMouseLeave": false,
"closeOnEscape": true,
"triggerClass":"active",
"parentClass":"active",
"buttons":[]}}'>
I have added data-bind="css: { emptyBag: !!getCartParam('summary_count') == false }" peace of code to check if cart is empty or not. but when i check console it's giving me an error of getCartParam is not defined. Please help, I have worked on magento but new in KO so facing problem in that