{"id":2698,"date":"2024-12-31T20:26:01","date_gmt":"2024-12-31T20:26:01","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/solved-error-call-to-a-member-function-isclearshoppingcartenabled-on-null-after-upgrading-magento-2\/"},"modified":"2025-09-01T10:55:23","modified_gmt":"2025-09-01T05:25:23","slug":"error-call-to-a-member-function-isclearshoppingcartenabled-on-null","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/error-call-to-a-member-function-isclearshoppingcartenabled-on-null\/","title":{"rendered":"Solved: Error Call to a member function isClearShoppingCartEnabled() on null After Upgrading Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Upgraded your <a title=\"Magento (Adobe Commerce)\" href=\"https:\/\/business.adobe.com\/products\/magento\/magento-commerce.html\" target=\"_blank\" rel=\"noopener\">Magento<\/a> store and facing issues on the cart page? Here is the method to solve the <em><strong>&#8216;Error Call to a member function isClearShoppingCartEnabled() on null&#8217;<\/strong><\/em> on the cart page after the Magento upgrade.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Magento roll-outs regular system updates, including platform improvements and features. Sometimes, these version updates also include improvements in the core code, which can make the custom development incompatible. As a result, some of the features related to the custom development may not function properly. I recently faced one such issue after upgrading a store from Magento 2.3.3 to Magento 2.4.5.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the testing phase, we came to know that the cart page was throwing the following error:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><strong>Error: Call to a member function isClearShoppingCartEnabled() on null in \/home\/magento\/magento2_staging\/vendor\/magento\/module-checkout\/view\/frontend\/templates\/cart\/form.phtml:59<\/strong><\/em><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I inspected the error, researched a bit over the internet, and found a working solution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The cart page was custom developed, which overrode the default layout file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It came to my notice that Magento 2 had introduced a new argument for blocks in the Magento 2 core code from version 2.3.3 onwards. The argument was missing in the custom cart part, leading to the <em>Call to a member function isClearShoppingCartEnabled() on null in&#8230;<\/em> error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is what I did to solve the issue.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Solve Error Call to a member function isClearShoppingCartEnabled() on null After Upgrading Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can follow the steps below to solve the&nbsp;<em><strong>isClearShoppingCartEnabled() on null&nbsp;<\/strong><\/em>error after upgrading Magento 2.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Step 1:&nbsp;<\/strong>Search your custom theme for XML files where the <code>Magento_Checkout::cart\/form.phtml<\/code> is being used.<\/li>\n\n\n\n<li><strong>Step 2:&nbsp;<\/strong>Open the XML file, and add the following argument in the &lt;block&gt;:<br><code>&lt;arguments&gt;<br><br>&lt;argument name=\"view_model\" xsi_type=\"object\"&gt;MagentoCheckoutViewModelCart&lt;\/argument&gt;<br><br>&lt;\/arguments&gt;<\/code><\/li>\n\n\n\n<li><strong>Step 3:&nbsp;<\/strong>Save the file.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">And that&#8217;s it..!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The issue will be solved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I hope the above solution will help you solve &#8216;Error Call to a member function isClearShoppingCartEnabled() on null&#8217; after upgrading Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A solution to a similar error after Magento 2 upgrade:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a title=\"View Solution\" href=\"https:\/\/meetanshi.com\/blog\/uncaught-error-call-to-a-member-function-getsectionnames\/\" target=\"_blank\" rel=\"noopener\">Fatal Error: Uncaught Error: Call to a Member Function getSectionNames()<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you are still facing the same issue or any other problems after upgrading your store, it is advisable to consult a professional Magento 2 developer to help you. Meetanshi has a team of Adobe-certified Magento 2 experts who can help you solve any post-upgrade issues. You may also consider opting for our <a href=\"https:\/\/meetanshi.com\/magento-upgrade-service.html\" target=\"_blank\" rel=\"noreferrer noopener\">annual Magento upgrade service<\/a> to upgrade your store to the latest version throughout the year without any hurdles!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Upgraded your Magento store and facing issues on the cart page? Here is the method to solve the &#8216;Error Call to a member function isClearShoppingCartEnabled()&#8230;<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-2698","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=2698"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2698\/revisions"}],"predecessor-version":[{"id":21273,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2698\/revisions\/21273"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=2698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=2698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=2698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}