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

          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