When on mobile devices, I want to display the cart icon on the navbar but on clicking, it should go directly to the cart page.
Magento – Disable minicart dropdown on mobile devices
magento2mini-cartmobile-device
magento2mini-cartmobile-device
When on mobile devices, I want to display the cart icon on the navbar but on clicking, it should go directly to the cart page.
Best Answer
Managed to fix it by duplicating the .minicart-wrapper div inside of app/design/frontend/vendor_name/theme_name/Magento_Checkout/templates/cart/minicart.phtml
You also need to remove the "showcart" class from the tag immediately inside of #minicart-mobile. This will remove the dropdown functionality and redirect you to the cart page.
I've hidden the desktop or mobile minicarts (as required) using bootstrap's d-none classes but you can achieve the same result using traditional CSS media queries
Minicart Desktop
Minicart Mobile