knockout.js Uncaught TypeError: Unable to process binding

knockout.js Uncaught TypeError: Unable to process binding

我正在使用 Porto v2.2.0 – Ultimate Responsive Magento Theme 并显示类似

的错误
knockout.js:3012 Uncaught TypeError: Unable to process binding "css: function (){return { empty:cart().summary_count == 0} }"
Message: cart is not a function

我分三步解决了:

  1. 用核心模板替换主题 (app\design\frontend\Theme_namespace\Theme_module\Magento_Ch‌ eckout\templates\car‌ t) 中的 minicart.phtml 文件(vendor\magento\module-checkout\view\frontend\templates\cart‌ ).

  2. 从您的主题中替换 content.html 文件 (app\design\frontend\Theme_namespace\Theme_module\Magento_Checkout\web\template\minicart\content.html)使用核心模板 (vendor\magento\module-checkout\view\frontend\web\template\minicart\content.html)

  3. 删除所有 pub/static/frontend,删除 var 文件夹。 运行 再次部署静态内容:php magento setup:static-content:deploy

修复后结果小车: