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;
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
add a comment |
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
add a comment |
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
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
knockoutjs
edited Aug 10 at 7:33
eseries
asked Aug 9 at 15:18
eserieseseries
11 bronze badge
11 bronze badge
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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