cancel
Showing results for 
Search instead for 
Did you mean: 

Required 2 header cart throghout the website.

Required 2 header cart throghout the website.

Hello,

 

We are facing issues with header minicart. 

 

Have a bit complex header structure for desktop and mobile layout so we have prepared 2 division layout.

 

One for mobile and second for the desktop.

 

Now we have added 2 times below code. Inside first division for mobile layout and the second time for a desktop layout.

 

<?php echo $this->getChildHtml("minicart"); ?> 

Now the problem is on desktop layout header mini cart not showing because it was loading for mobile layout only because mobile layout div is loading first and after that desktop div loading.

 

When we click on the desktop header cart icon than it will be appending the cart summary and products data with mobile division only but it should append to desktop version div. 

 

Can anyone suggest how can we add 2 header cart throughout the website? 

 

Please suggest a solution.

 

Thanks

2 REPLIES 2

Re: Required 2 header cart throghout the website.

 

Hi Jignesh Chauhan,
Both mobile and desktop mini cart will have the same class name and it will affect the functionality. So you can use only one mini cart code in the header and you can adjust the position in CSS.

 

Hope this will help you.

Re: Required 2 header cart throghout the website.

@Ranipriyanka J Thanks for your advice.

 

Well in Magento 2 it is not working and as I mentioned that we have a complex header structure so we can not adjust with CSS. 

 

Due to the complex header, we have added mini cart 2 times. 

 

Please advice.