Cart Icon And Popup Cart Display

  • Posts: 290
  • Thank you received: 5
  • Hikashop Business
2 weeks 20 hours ago #365578

-- Joomla version -- : 5

Hi,
I am wondering if there is a way to display a cart icon or menu link with image that when clicked displays a popup of the shopping cart whether empty or has product selected?

See examples of images of what I would like to do.

Thank you,
Charles

Attachments:

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

  • Posts: 4781
  • Thank you received: 649
  • MODERATOR
2 weeks 16 hours ago #365582

Hello,

It's possible, supposing that you want the icon to display the details of the cart when someone click on it, you want to enable the HikaShop cart module in the position of your template where you want the cart icon to display.
Then, you want to set the "mini cart" setting of the module to "dropdown cart".
And finally, you want to do a translation override in order to change the different texts displayed by the cart module 'mini' mode to display instead an image:
www.hikashop.com/download/languages.html#modify
So for example, for the "The cart is empty" message that you see when there is nothing in the cart.
You can add such translation override:

CART_EMPTY="<img src='http://mywebsite.com/link/to/empty/cart/image.png'/>"

That's it. There is no need for CSS or for PHP in view overrides.
Regards

Last edit: 2 weeks 19 hours ago by Philip.

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

  • Posts: 290
  • Thank you received: 5
  • Hikashop Business
2 weeks 8 hours ago #365586

Hi,
Thank you for your help. I did what you mentioned but having two issues:
1) Broken link to icon even though I have the url correct.

2) The cart module is behind other layers partially. Is there something I need to do so it shows in front?

Please see images.
Thank you,
Charles

Attachments:

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

  • Posts: 83303
  • Thank you received: 13467
  • MODERATOR
2 weeks 3 hours ago #365588

Hi,

1. In your override, you didn't use a normal single quote but another character, which looks like a single quote:
www2.cs.sfu.ca/~ggbaker/reference/characters/#single
Because of these, the browser doesn't recognize the character and considers that the value of the attribute doesn't have any quotes and actually uses the character as part of the URL, which makes the URL invalid:
i.imgur.com/5RMKTnp.png

Note that instead of translation overrides, the cart module now has a setting where you can provide the URL of the cart image, and it will be added automatically. I would recommend going that road. It's easier to setup.

2. This issue is caused by your template.
You need to add this CSS code to your template's CSS:

section#Header {
    z-index: 9999;
    position: relative;
}
It will fix the problem.

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

  • Posts: 290
  • Thank you received: 5
  • Hikashop Business
1 week 6 days ago #365596

You have helped alot, you all are amazing! However, I am still having a situation. I got the icon now to appear when cart is empty and also to get it to float above other modules. :)

1) Now that the CartIcon.png shows, it is no longer a clickable link. How do I get it to activate a response to the cart if empty when icon is clicked? So maybe atleast says cart is empty when clicked?

2) When the cart has something in it, the CartIcon.png goes away and only have a text link. How do I keep an icon active or a new icon?

3) Is there a way to have the cart link show quantity in cart like my image example.

Thanks,


Charles

Attachments:
Last edit: 1 week 6 days ago by fan4chevy.

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

  • Posts: 83303
  • Thank you received: 13467
  • MODERATOR
1 week 6 days ago #365598

Hi,

1. I think the best would be to add an alt attribute to your img tag:
www.w3schools.com/TAGs/att_img_alt.asp
That way, when someone hovers on your image, the text of the alt will automatically display next to the mouse cursor.

2. You would have to have another override for that text too:
www.hikashop.com/forum/product-category-...the-menu.html#302737

3. Your cart link already displays the quantity of products in the cart, as well as the price. So when you do the translation override, keep the %s next to the img tag to keep the quantity displayed next to the cart icon. And then you can use CSS code to move the quantity on top of the cart icon.

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

Time to create page: 0.108 seconds
Powered by Kunena Forum