[contact-form-7 id="24078" title="Feedback EN"]

Featured templates

Magento. How to disable cart on mobile devices

Hello! This video tutorial shows how to disable cart on mobile devices in Magento templates.

Magento. How to disable cart on mobile devices

You may want to remove the cart from your mobile Magento store since it takes much space or you simply do not like it:

magento_disable_mobile_cart_1

Let’s learn how to get rid of it.

  1. Using Total Commander or any other file manager software use the search command to find the file which contains “header-minicart” class – in our case it is header.phtml file under /app/design/frontend/tm_themes/themeXXX/template/page/html/ directory (where XXX is your theme number).

  2. Open the file for editing and look for the following string of code:

	<div class="header-minicart">
	<?php 
	echo $this->getChildHtml('minicart_head');
	?>
	</div>

Simply comment out the code so it looks as follows:

	<!--<div class="header-minicart">
	<?php
	echo $this->getChildHtml('minicart_head');
	?>
	</div>->

Save the file and refresh the page to see changes.

You can see the Cart has been successfully removed from your mobile store:

magento_disable_mobile_cart_2

Let’s now stretch three buttons through the whole width of the mobile menu so it looks nice.

Use the Firebug extension for Firefox or the Developer tool of your favourite browser to find CSS rule that needs to be altered.

You can see the desired code is located in the styles.css file on line 15107:

magento_disable_mobile_cart_3

Open the file for editing and change the width property to 33.335%.

Again, save the file to apply changes. Navigate back to your front-end and refresh the page to see the result.

You can see the mobile menu looks nice now:

magento_disable_mobile_cart_4

This is the end of the tutorial. We have learnt how to disable cart on mobile devices in your Magento template.

Feel free to check the detailed video tutorial below:

Magento. How to disable cart on mobile devices