Hide cart module if empty

  • Posts: 37
  • Thank you received: 0
7 years 4 weeks ago #5644

I would like to request a feature, as touched on in a previous thread.

I would like an option in the cart module options to allow you to hide the cart module if the cart is empty - instead of having the cart module showing with the text "Cart is Empty".

My reasons for this is that the shop is a small part of my site and will probably only appeal to a minority of users. If the user has items in their cart I want it to show in a prominent position in the sidebar of EVERY page to remind them to checkout - however I don't want a pretty much blank module displayed to everyone else (takes up space that could be better used).

Reading through previous posts I think I can hide the content of the module however the module itself will be displayed, therefore the header, container etc will be displayed.

Thanks
Simon

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

  • Posts: 60990
  • Thank you received: 8630
  • MODERATOR
7 years 4 weeks ago #5648

We will look at adding that in the near future.

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

  • Posts: 25
  • Thank you received: 4
6 years 6 months ago #23939

I am also interested in this future feature

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

  • Posts: 60990
  • Thank you received: 8630
  • MODERATOR
6 years 6 months ago #23943

Hi,

It's possible now. You can do it like explained on that thread, using Advanced Modules Manager: www.hikashop.com/en/support/forum/4-how-...as-something-in.html

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

  • Posts: 64
  • Thank you received: 0
6 years 3 months ago #29593

Hello,

I am using the advanced module manager to hide my cart when empty, but it still shows ... Any tips?

Thanks.

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

  • Posts: 60990
  • Thank you received: 8630
  • MODERATOR
6 years 3 months ago #29594

Did you override the empty message text in your translation file so that there is no text instead of "Your cart is empty" ?
You can do that as explained there:
www.hikashop.com/fr/download/languages.html#modify

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

  • Posts: 64
  • Thank you received: 0
6 years 3 months ago #29598

That did it thank-you. Great work btw!

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

  • Posts: 26
  • Thank you received: 0
2 years 4 days ago #230033

Hi all,
we have gone 4 Years into the future and unfortunately this solution does not work anymore with my version of hikashop and advance module manager pro. I removed the "cart empty message but that does not fix the problem.
I investigated on the nonumbers site (makers of advance module manager) and there is same question answered as you can read here: www.nonumber.nl/forum/advancedmodulemanager/9152-hide-if-empty
or in short: it does only work if no html output is made from the module - and - it need php strings to get rid of the cart if empty.
Unfortunately there seems to be another html output even if i only remove the "cart empty" message within my language strings as my cart still is shown. Hope there will be any chance to get this done in another way - best would be if the minicart himself would disappear with an option toggle :-)
thanks in advance for coming back to this thread!
regards
carsten

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

  • Posts: 13201
  • Thank you received: 2315
  • MODERATOR
2 years 3 days ago #230070

Hi,

Could you give us a link to one of the page with the issue ?
This will help us to see what could be causing this problem.

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

  • Posts: 26
  • Thank you received: 0
2 years 2 days ago #230274

Sure: you can see it here:
dev.iq-guru.com. Find the module in the menubar position located. And yes - that is not a menu item it is a module just in that position.
Thanks in advance
carsten

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

  • Posts: 13201
  • Thank you received: 2315
  • MODERATOR
2 years 2 days ago #230306

Hi,

I was thinking that your module was displayed as a common module, so on a side of the website.
In your case, it seems to be more specific as it is on the menu and displayed on hover.
So not a default Joomla comportment, but displayed via your template or another component and that's why it is not hiding as it should by default.

You should contact the menu extension provider or the template editor, or add some javascript to hide the menu if the content is empty thanks to code like:

if($('.cartmodule div').html() == ''){
	$('.cartmodule').hide();
}
(it require to add a custom class to the module)

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

  • Posts: 26
  • Thank you received: 0
1 year 11 months ago #230903

Hi Xavier,
thanks for the possible solution. As it is not possible to get this support from the template provider i now tried to move the cart module to sidebar a position but still have the same result - if the cart is emty and i remove the string within my translation still a block is shown with no content even it should not be there :-(
So i´d like to ask you again for support on this. YOu can check it here (secondd module on the right side):
dev.iq-guru.com/angebote/alle/alle-online-kurse
Thanks in advance
carsten

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

  • Posts: 60990
  • Thank you received: 8630
  • MODERATOR
1 year 11 months ago #230919

Hi,

That DIV comes from the template... It's really something the template provider should help with.

But you can try by adding such javascript in the template :
if($('.uk-panel-box').html() == ''){
$('.uk-panel-box').hide();
}

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

Time to create page: 0.108 seconds
Powered by Kunena Forum