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

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form