Change the appearance of the shopping cart block

Created on 23 May 2017, over 7 years ago
Updated 4 November 2023, 11 months ago

Hello

I would like to add to the shopping cart block the total amount of orders and replace the logo with "font awesome".

How can I do this?

The shopping cart by default is not easily customizable and if I use it on a menu with a white background, the logo is invisible.

In the screenshot, it's the shopping cart I made on drupal 7, but I can not reproduce on drupal 8.

I must therefore:

- the total number of items of the orders.
- the total amount of the order.
- and a shopping cart logo with "make awesome"

💬 Support request
Status

Fixed

Component

Cart

Created by

🇫🇷France zenimagine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India Hetal chavda

    One thing to note is that most $build['content'] area keys correspond to their values in the commerce-cart-block.html.twig file. For example, $build['content']['#count_text'] corresponds to {{ count_text }}. Also, if you just want a number of items (without text) you can simply use {{ count }} in that twig file. The contents of the view are displayed within {{ content }} .

    Override template : commerce-cart-block.html.twig

    If you want to print only count of the product without text then add {{ count }} and add image of cart in this twig template.

Production build 0.71.5 2024