Overriding CustomerData/Cart.php removes Total from MiniCart Magento 2How to Override or Extend protected or parent function in Magento 2 using PluginOverriding protected function in Magento 2How to call rewards block phtml content into minicart section magento 2?Overriding MagentoCatalogModelLayer class not working in Magento 2Magento 2: Get Products in admin panel Using PluginNot able to remove shipping cost from grand total in Magento 2Magento2.2.2: Module override cause in Wysywig editor shows broken imageOverriding private method of Model file in Magento 2Unable to override account creation email templateGet Product info from afterAddProduct Plugin in magento 2

Am I legally required to provide a (GPL licensed) source code even after a project is abandoned?

Is a single radon daughter atom in air a solid?

LWC - Local Dev - How can I run the local server on HTTPS?

Do I have any obligations to my PhD supervisor's requests after I have graduated?

What happened to Steve's Shield in Iron Man 2?

Helping ease my back pain by studying 13 hours everyday , even weekends

Primes and SemiPrimes in Binary

Loss of power when I remove item from the outlet

Similarity score: Can Sklearn SVR predict values greater than 1 and less than 0?

Why does the Saturn V have standalone inter-stage rings?

I found a password with hashcat, but it doesn't work

Is it illegal to withhold someone's passport and green card in California?

DBCC checkdb on tempdb

Dates on degrees don’t make sense – will people care?

Is there any proof that high saturation and contrast makes a picture more appealing in social media?

Constitutionality of U.S. Democratic Presidential Candidate's Supreme Court Suggestion

Story about hunting giant lizards for hides on privately owned planet

`-` in tar xzf -

Why is it recommended to mix yogurt starter with a small amount of milk before adding to the entire batch?

Explain why a line can never intersect a plane in exactly two points.

Does the monk's Step of the Wind feature activate the benefit of the Mobile feat?

Is "Busen" just the area between the breasts?

Confusion over 220 and 230 volt outlets

Ruining the family name



Overriding CustomerData/Cart.php removes Total from MiniCart Magento 2


How to Override or Extend protected or parent function in Magento 2 using PluginOverriding protected function in Magento 2How to call rewards block phtml content into minicart section magento 2?Overriding MagentoCatalogModelLayer class not working in Magento 2Magento 2: Get Products in admin panel Using PluginNot able to remove shipping cost from grand total in Magento 2Magento2.2.2: Module override cause in Wysywig editor shows broken imageOverriding private method of Model file in Magento 2Unable to override account creation email templateGet Product info from afterAddProduct Plugin in magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have overridden




vendormagentomodule-checkoutCustomerDataCart.php




file in my custom plugin using di.xml using below code:



<preference for="MagentoCheckoutCustomerDataCart"
type="VendorPackageCustomerDataCart" />


It's working too. I can get SectionData defined in my custom Cart.php file in Minicart successfully.



but this removes Total from my Minicart which was working fine with default Cart.php.



Please suggest if i am doing something wrong in overriding file.



Reference image










share|improve this question




























    0















    I have overridden




    vendormagentomodule-checkoutCustomerDataCart.php




    file in my custom plugin using di.xml using below code:



    <preference for="MagentoCheckoutCustomerDataCart"
    type="VendorPackageCustomerDataCart" />


    It's working too. I can get SectionData defined in my custom Cart.php file in Minicart successfully.



    but this removes Total from my Minicart which was working fine with default Cart.php.



    Please suggest if i am doing something wrong in overriding file.



    Reference image










    share|improve this question
























      0












      0








      0








      I have overridden




      vendormagentomodule-checkoutCustomerDataCart.php




      file in my custom plugin using di.xml using below code:



      <preference for="MagentoCheckoutCustomerDataCart"
      type="VendorPackageCustomerDataCart" />


      It's working too. I can get SectionData defined in my custom Cart.php file in Minicart successfully.



      but this removes Total from my Minicart which was working fine with default Cart.php.



      Please suggest if i am doing something wrong in overriding file.



      Reference image










      share|improve this question














      I have overridden




      vendormagentomodule-checkoutCustomerDataCart.php




      file in my custom plugin using di.xml using below code:



      <preference for="MagentoCheckoutCustomerDataCart"
      type="VendorPackageCustomerDataCart" />


      It's working too. I can get SectionData defined in my custom Cart.php file in Minicart successfully.



      but this removes Total from my Minicart which was working fine with default Cart.php.



      Please suggest if i am doing something wrong in overriding file.



      Reference image







      magento2 mini-cart overriding customer-data






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 12 at 12:58









      KhushbuKhushbu

      17313




      17313




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I solved this issue by following method:



          File: di.xml



           <type name="MagentoCheckoutCustomerDataCart">
          <plugin name="CustomMiniCart" type="VendorPackageCustomerDataCart" sortOrder="1"/>
          </type>


          File:VendorPackageCustomerDataCart.php



          namespace VendorPackageCustomerData;
          class Cart

          public function afterGetSectionData(MagentoCheckoutCustomerDataCart $subject, $result)


          $result['customdata1'] = $customvalue1;
          $result['customdata2'] = $customvalue2;
          return $result;








          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278122%2foverriding-customerdata-cart-php-removes-total-from-minicart-magento-2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I solved this issue by following method:



            File: di.xml



             <type name="MagentoCheckoutCustomerDataCart">
            <plugin name="CustomMiniCart" type="VendorPackageCustomerDataCart" sortOrder="1"/>
            </type>


            File:VendorPackageCustomerDataCart.php



            namespace VendorPackageCustomerData;
            class Cart

            public function afterGetSectionData(MagentoCheckoutCustomerDataCart $subject, $result)


            $result['customdata1'] = $customvalue1;
            $result['customdata2'] = $customvalue2;
            return $result;








            share|improve this answer



























              0














              I solved this issue by following method:



              File: di.xml



               <type name="MagentoCheckoutCustomerDataCart">
              <plugin name="CustomMiniCart" type="VendorPackageCustomerDataCart" sortOrder="1"/>
              </type>


              File:VendorPackageCustomerDataCart.php



              namespace VendorPackageCustomerData;
              class Cart

              public function afterGetSectionData(MagentoCheckoutCustomerDataCart $subject, $result)


              $result['customdata1'] = $customvalue1;
              $result['customdata2'] = $customvalue2;
              return $result;








              share|improve this answer

























                0












                0








                0







                I solved this issue by following method:



                File: di.xml



                 <type name="MagentoCheckoutCustomerDataCart">
                <plugin name="CustomMiniCart" type="VendorPackageCustomerDataCart" sortOrder="1"/>
                </type>


                File:VendorPackageCustomerDataCart.php



                namespace VendorPackageCustomerData;
                class Cart

                public function afterGetSectionData(MagentoCheckoutCustomerDataCart $subject, $result)


                $result['customdata1'] = $customvalue1;
                $result['customdata2'] = $customvalue2;
                return $result;








                share|improve this answer













                I solved this issue by following method:



                File: di.xml



                 <type name="MagentoCheckoutCustomerDataCart">
                <plugin name="CustomMiniCart" type="VendorPackageCustomerDataCart" sortOrder="1"/>
                </type>


                File:VendorPackageCustomerDataCart.php



                namespace VendorPackageCustomerData;
                class Cart

                public function afterGetSectionData(MagentoCheckoutCustomerDataCart $subject, $result)


                $result['customdata1'] = $customvalue1;
                $result['customdata2'] = $customvalue2;
                return $result;









                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 13 at 4:50









                KhushbuKhushbu

                17313




                17313



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278122%2foverriding-customerdata-cart-php-removes-total-from-minicart-magento-2%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?