Skip to main content
All CollectionsTroubleshooting and FAQsFrequently Asked QuestionsGeneral
How to Display the Cart Icon on Small Screen Devices
How to Display the Cart Icon on Small Screen Devices

Learn how to use a Divi Child theme to customize the Header area to include the WooCommerce Cart icon on small screen devices.

Updated over a week ago

Ensuring a seamless shopping experience on your website is crucial, especially for users on small-screen devices. Displaying the cart icon prominently on mobile devices helps improve accessibility and convenience for your customers.

In this article, we will guide you through the process of displaying the cart icon on small-screen devices using Divi.

By default, the Add to Cart icon appears on small screens only if the Slider-In Header layout is used in the Header Format settings.

Display the WooCommerce Cart icon using a Child theme

  1. Install and Activated a Child Theme for Divi

  2. Use an FTP connection, the hosting File Manager app, or the Advanced File Manager plugin to access your website's files.

  3. Copy the header.php file from the wp-content/themes/Divi folder to the wp-content/theme/child theme folder

  4. Go to Appearance → Theme File Editor and open the header.php file from your Child theme folder

  5. Find this line of code:

    </div> <!-- #et-top-navigation -->

  6. Add this line of code after that line

    <?php et_show_cart_total(); ?>

  7. Add this CSS code to Divi → Theme Options → General Tab → Custom CSS

    @media screen and (min-width: 981px) {
    #et_mobile_nav_menu + .et-cart-info,
    #et-info .et-cart-info {
    display: none;
    }
    }

    @media screen and (max-width: 767px) {
    #et-info .et-cart-info {
    position: relative;
    left: 15px;
    }
    }

Note: The code works fine with the default header style. However, these changes might work differently with different header types, so if you see something that does not work the way you expect, please open a support chat to get some corrections in your case.

Display the WooCommerce Cart icon using Theme Builder

  1. Go to Divi → Theme Builder

  2. Create or edit the current Global Header layout

  3. Ensure you are using the Menu module

  4. Go to the Content Tab→ Elements → Show Shopping Cart Icon and enable it

    Divi Menu module Shopping Cart
Did this answer your question?