Skip to main content
20 votes

Magento 2, Change On hover instead of 'click' for mini cart

In the file magento\vendor\magento\module-checkout\view\frontend\templates\cart\minicart.phtml (or an override magento\app\design\frontend\Custom\YourTheme\Magento_Checkout\templates\cart\minicart....
omelandr's user avatar
  • 1,267
20 votes
Accepted

How to update minicart view using AJAX?

You can try the below code. require([ 'Magento_Customer/js/customer-data' ], function (customerData) { var sections = ['cart']; customerData.invalidate(...
Suresh Chikani's user avatar
17 votes
Accepted

How to add "Empty Cart" button to minicart

I have just created a proper module for your question: We need to declare the custom js component and html template: app/code/Vendor/MiniCart/view/frontend/layout/default.xml <?xml version="1.0"?...
Khoa TruongDinh's user avatar
16 votes

Magento 2 Open minicart when item is added

It can be done by simply modifying minicart.js file. Navigate to vendor/magento/Magento_Checkout/view/web/js/view/minicart.js Create override of the file by copy it in your theme folder. Under ...
Ajendra Panwar's user avatar
14 votes
Accepted

remove items from cart in controller - magento2

Your custom controller should be: namespace Gworks\Cart\Controller\Items; use Magento\Framework\App\Action\Context; use Magento\Checkout\Model\Cart as CustomerCart; class Remove extends \Magento\...
Sohel Rana's user avatar
  • 36.1k
13 votes
Accepted

Adding quantity increment button in cart and mini cart

app/code/Amsi/UserManagement/view/frontend/templates/cart/item/default.phtml I have added For both increment and decrementing quantity. You can add the button ...
aravind's user avatar
  • 1,854
12 votes
Accepted

Magento 2 show normal price with special price on minicart

You dont need to override Renderer.php file in core and you should never do in core. You can just changes in sidebar.phtml file and set your changes. You can get price from below method: $finalPrice ...
Rakesh Jesadiya's user avatar
10 votes

Magento 2 Add to cart frontend event listener

When something is added to the cart, the local storage information is updated and you can subscribe to a knockout observable in the cart section of the customer data to be notified when it's content ...
Quinten's user avatar
  • 331
10 votes

Magento 2 - How to show tax and shipping costs in mini-cart pop up

To show additional stuff or costs in the minicart (like taxes or shipping costs), you need to understand where the data in the minicart comes from. The Customer Data Section Pool If you add a ...
Giel Berkers's user avatar
  • 12.3k
9 votes

Magento 2 Get Cart Quote Total in minicart.phtml

We had a similar question from a client. where he wanted to show "[quantity] item [subtotal]" in a styled cart block instead of the default cart icon in the minicart. We found this question here but ...
Pascal Wientjes's user avatar
8 votes

Magento 2: Order Summary expanded on page load?

The full list of options for the collapsible widget can be seen on the dev docs here. Finding the code Navigate to vendor/magento/module-checkout/view/frontend/web/template/summary/cart-items.html ...
Ben Crook's user avatar
  • 15.7k
8 votes
Accepted

Magento 2 : Show cart items total to header cart link

You can display cart items sub-total to header minicart link. Add below code to minicart.phtml to display cart items total <span data-bind="html: getCartParam('subtotal')"></span> php ...
Suresh Chikani's user avatar
8 votes
Accepted

Magento 2 Minicart - Display line item subtotal rather than unit price

You can set line item subtotal using below way, You dont need to use of knockout js anyway you can just setup your goal using below way, You can get item qty using $qty = $item->getQty(); Now just ...
Rakesh Jesadiya's user avatar
8 votes

How to modify minicart.js Magento 2?

You'd better extend the minicart component. For example: app/code/vendor/module/view/frontend/requirejs-config.js var config = { 'config': { 'mixins': { 'Magento_Checkout/js/...
Quisse's user avatar
  • 860
8 votes

Magento 2.1.9 frontend font icon extend

You need open this website https://icomoon.io/app/#/select Click on Import Icon purple button on the top choose your Luma-Icons.svg file from luma them. You will get all icon Where you can add, edit ...
Vishal Baghel's user avatar
8 votes

Magento 2 How to show count 0 on mini cart when no product is in cart?

You need to override minicart.phtml in your theme on below path : Copy From vendor/magento/module-checkout/view/frontend/templates/cart/minicart.phtml Paste To app/design/frontend/{Vendor}/{...
Ankita Patel's user avatar
7 votes
Accepted

Magento2, echo product attribute in minicart

I found the answer to my question in this link DefaultItem.php <?php namespace Your\Module\Plugin; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product; use ...
Zinat's user avatar
  • 2,079
7 votes
Accepted

How to add Cancel/Ok button within Minicart and remove popup

First of all please override sidebar.js file in your custom theme. So In theme, add a js file sidebar.js to app\design\frontend\[NAMESPACE]\[THEME]\Magento_Checkout\web\js\sidebar.js if not exist ...
Aasim Goriya's user avatar
  • 5,454
7 votes
Accepted

Plus, Minus, automatic cart update on Magento 2.3.3

Override default.html from vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html to app\design\yourvendor\yourtheme\Magento_Checkout\web\template\minicart\item\...
Ranganathan's user avatar
  • 3,240
6 votes
Accepted

What does the Magento 2 ko scope: 'minicart_content' reference?

This is telling knockoutJS to use the minicart_content ui component as the base object. What this means is that data-bind="html: getCartParam('subtotal') resolves to the getCartParam method found in ...
Aaron Allen's user avatar
  • 9,029
6 votes
Accepted

Magento2 mini cart item delete alert

I you are still looking for an answer, the modal confirmation is created in vendor/magento/module-checkout/view/frontend/web/js/sidebar.js and it's a parameter named confirm: /** * @...
Korniow's user avatar
  • 96
6 votes

Magento2 catch ajax complete, add to cart

I found another solution that I added via a module block. This script catches ajax complete for "add to cart" and reads the data returned, like subtotal aso. require(['jquery'], function ($) { $(...
kaptenkrillo's user avatar
6 votes
Accepted

How to insert a UI component into the mini cart?

To anyone coming here with the same question, here's how I've done it in the end. I found no way to solve what I thought was the correct solution, using a DataProvider, instead I injected my message ...
Olivier Lance's user avatar
6 votes
Accepted

how to add quantity increment and decreament (+ and - button) in minicart magento 2?

app/design/frontend/Module/theme/Magento_Checkout/web/template/minicart/item/default.html <div class="product-item-pricing"> <!-- ko if: canApplyMsrp --> ...
Hitesh Balpande's user avatar
6 votes
Accepted

KnockoutJS Which Model does the Minicart use?

Open vendor/magento/module-checkout/view/frontend/layout/default.xml Now you can able to see how the minicart renders and how it binds with knockoutjs. Check the following code snippet. <item ...
Sohel Rana's user avatar
  • 36.1k
5 votes

Magento 2 Open minicart when item is added

Ajendra Panwar's answer is good but i wanted to point out that you can do this exact same thing without having to override the whole mini cart JS file. Doing this override can lead to upgrade problems,...
circlesix's user avatar
  • 4,333
5 votes

Magento 2: How to remove Paypal Logo from MiniCart & Shopping Cart Page?

You can remove logo using backend. Stores -> Configuration -> Sales -> Payment Method Paypal Express Checkout Tab Click Configure Button, Go To Basic Settings - Paypal Express Checkout ...
Rakesh Jesadiya's user avatar
5 votes

Magento 2: How to remove Paypal Logo from MiniCart & Shopping Cart Page?

Copy this file to your custom theme: vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html to app/design/frontend/PACKAGE/THEME/Magento_Checkout/web/template/minicart/...
Rafael Corrêa Gomes's user avatar
5 votes

Magento 2, Change On hover instead of 'click' for mini cart

This can be done using the native data-mage-init attribute's magento functionality. As long as you include the event you can define a number of other attributes such as: closeOnMouseLeave ...
Richard Cripps's user avatar
5 votes

I want to add popup notify after adding products Magento 2

You have to override vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js.. And you can add this below script in your override catalog-add-to-cart.js define([ 'jquery', 'mage/...
Chirag Prajapati's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible