How to make the cart module background color invisible on cart empty?

  • Posts: 224
  • Thank you received: 8
5 years 11 months ago #293191

Hello,
I have customized my cart to have a background color, and I want it to be completely hidden when it's empty.
The cart is being hidden, but I still see some of the background color.

I understand that this happens because even when hidden the cart module is still loading some divs, which have the background color applied to them as well as some padding.
My problem is that by inspecting the code I cannot find any div that is being showed only when the cart is full and that also contains the full cart, so that I can apply to that one the color.

.hikashop_cart_module_blue .hikashop_cart_module {background: #279fba;
    color:#fff;
    padding: 10px
  }

I ma not really an expert in CSS, so maybe you can suggest a smarter solution?
Or if there is none, the only way to go should probably be to hack the module and insert a new styled div around the part of code that is showed only on cart full?



Thank you!

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
5 years 10 months ago #293238

Hi,

You'll have to edit the file "cart" of the view "product" via the menu Display>Views to add your extra div / class when necessary.

Please Log in or Create an account to join the conversation.

  • Posts: 224
  • Thank you received: 8
5 years 10 months ago #293254

Thank you,
I didnt' realize the module tmpl file was there too :)

Here is the customization in case someone else need it

File Attachment:

File Name: cart.zip
File Size:5 KB


there is a new div in the template, that is showed only when the cart is full
<div class="hikashop_cart_custom">

you can then add style to the div as you prefer, for instance:
.hikashop_cart_custom {background: #279fba;
    color:#fff;
    padding: 10px
  }

Attachments:
The following user(s) said Thank You: Philip

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum