How to show in mini cart only when there is at least one product in cart?Getting the product SKU in the header mini-cartMagento 2 - Is there a way to have Magento refresh the quote data in checkout on the frontend?Magento 2 Checkout mini-cart need to show reward point phtml blockMagento 2 : How can I upload files of dynamically added file input fields in the adminMagento 2: How to show the number of cart items in a custom blockHow to show credit card details, address and cart items before placing order?How to update checkout/cart/ orders total when promo code is applied dynamically without page reload

Check in to 2 hotels at same location

How can I watch the 17th (or last, if less) line in files of a folder?

How much code would a codegolf golf if a codegolf could golf code?

What magic extends life or grants immortality

What is wrong about this application of Kirchhoffs Current Law?

Is there a known non-euclidean geometry where two concentric circles of different radii can intersect? (as in the novel "The Universe Between")

Ask for a paid taxi in order to arrive as early as possible for an interview within the city

Fancy String Replace

When translating the law, who ensures that the wording does not change the meaning of the law?

Why were movies shot on film shot at 24 frames per second?

What to say to a student who has failed?

Sleeping solo in a double sleeping bag

How to compare two different formulations of a problem?

On the feasibility of space battleships

Do AT motherboards (286, 386, 486) really need -5V (besides redirecting it to ISA connectors)?

Why is 日本 read as "nihon" but not "nitsuhon"?

Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?

Can I switch to third-person while not in 'town' in Destiny 2?

Is there a limit on how long the casting (speaking aloud part of the spell) of Wish can be?

System to validate run time complexity requirements

Defense against attacks using dictionaries

Co-author responds to email by mistake cc'ing the EiC

Does an object count as "being moved" when placed in a Bag of Holding before its wielder moves, and then after moving they take the object out again?

How to refer to a regex group in awk regex?



How to show in mini cart only when there is at least one product in cart?


Getting the product SKU in the header mini-cartMagento 2 - Is there a way to have Magento refresh the quote data in checkout on the frontend?Magento 2 Checkout mini-cart need to show reward point phtml blockMagento 2 : How can I upload files of dynamically added file input fields in the adminMagento 2: How to show the number of cart items in a custom blockHow to show credit card details, address and cart items before placing order?How to update checkout/cart/ orders total when promo code is applied dynamically without page reload






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








0















I had to add a text from admin configuration( some custom fields) on the mini cart section in frontend.



I overrided minicart.phtml and in it I called the method from my Block which returns the configuration text. Everything fine.



But now I want to display that text only if the mini cart contains at least one product.



I overrided minicart.js in my theme too, because I thought there is a method which is called whenever mini cart is updated, but there isn’t.



I must deal with the knockout js because there are sections in frontend which adds to cart via ajax call and I really can’t figure it out how. Does anyone had to implement this before? Any help is apreciated.










share|improve this question
































    0















    I had to add a text from admin configuration( some custom fields) on the mini cart section in frontend.



    I overrided minicart.phtml and in it I called the method from my Block which returns the configuration text. Everything fine.



    But now I want to display that text only if the mini cart contains at least one product.



    I overrided minicart.js in my theme too, because I thought there is a method which is called whenever mini cart is updated, but there isn’t.



    I must deal with the knockout js because there are sections in frontend which adds to cart via ajax call and I really can’t figure it out how. Does anyone had to implement this before? Any help is apreciated.










    share|improve this question




























      0












      0








      0








      I had to add a text from admin configuration( some custom fields) on the mini cart section in frontend.



      I overrided minicart.phtml and in it I called the method from my Block which returns the configuration text. Everything fine.



      But now I want to display that text only if the mini cart contains at least one product.



      I overrided minicart.js in my theme too, because I thought there is a method which is called whenever mini cart is updated, but there isn’t.



      I must deal with the knockout js because there are sections in frontend which adds to cart via ajax call and I really can’t figure it out how. Does anyone had to implement this before? Any help is apreciated.










      share|improve this question
















      I had to add a text from admin configuration( some custom fields) on the mini cart section in frontend.



      I overrided minicart.phtml and in it I called the method from my Block which returns the configuration text. Everything fine.



      But now I want to display that text only if the mini cart contains at least one product.



      I overrided minicart.js in my theme too, because I thought there is a method which is called whenever mini cart is updated, but there isn’t.



      I must deal with the knockout js because there are sections in frontend which adds to cart via ajax call and I really can’t figure it out how. Does anyone had to implement this before? Any help is apreciated.







      knockoutjs






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 10 at 7:33







      eseries

















      asked Aug 9 at 15:18









      eserieseseries

      11 bronze badge




      11 bronze badge























          0






          active

          oldest

          votes














          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%2f285020%2fhow-to-show-in-mini-cart-only-when-there-is-at-least-one-product-in-cart%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          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%2f285020%2fhow-to-show-in-mini-cart-only-when-there-is-at-least-one-product-in-cart%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?