Hey Magento Pals,

Everyone at MageComp wants to wish you the magical and marvelous Year ahead ?

Last, we have learned how you can Show Order Comments On The Invoice. Today, We will learn how you can show minicart in custom popup in Magento 2.

In Magento 2, generally, minicart shows in the header section of Magento, and whenever you click on minicart, it will show summary of your cart, but what if we want to show minicart in another place also, e. g. in popup, then don’t worry we have found solution for that too.

As always, we have developed the codes to achieve that in a matter of time. With the help of the below codes, you can display your minicart in custom popup, and you can set your popup design as per your requirement.

So, Let’s get into that and show how you can achieve that,

Step 1: To do this, create default.xml file inside,

app\code\Vendor\Extension\view\frontend\layout folder and add the below code:

Step 2: Next, create custompopupcart.phtml file inside app\code\Vendor\Extension\view\frontend\templates folder and add the below code:

Step 3: After adding these codes, the final step is to refresh the Cache.

So, this was it. Now you are able to show minicart in custom popup also. If you like this article, then share it with your Magento colleague and friends. Also, let us know if you want us to write about the problem you are facing in the comments below.

Lastly, If you found any problem while implementing the codes, then contact our Support Team. We will be happy to help you.

Happy Reading?

Click to rate this post!
[Total: 12 Average: 5]