Hikashop cart module

  • Posts: 54
  • Thank you received: 7
2 years 8 months ago #339751

Hi,

I got some questions about the Hikashop cart module.
1. When the cart is empty it becomes a non clickable image as shown in the attachment below. (When its not empty its a dropdown minicart) Is it possible to make the cart clickable even when its empty?
2. Im also trying to get a product counter next to the cart icon. Is this possible?
3. I removed the notification plugin and now whenever i add a product to my cart it instantly brings me to the checkout page. How can i remove this?

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 8 months ago #339757

Hi,

1. I suppose you could make clickable with a translation override but since you didn't provide the link to the website, I couldn't check the HTML of that area and thus I can't even say for sure that you're using the default cart module we provide.
But even if you do, you won't be able to make it display the dropdown minicart easily. That would require PHP/javascript modifications.

2. It's possible.
If you use the default cart module, you can do so easily with that plugin:
www.hikashop.com/marketplace/product/135...t-module-design.html
And it's also possible to do it with a few translation overrides and a bit of CSS :
www.hikashop.com/forum/checkout/897070-h...th-count.html#304609

3. The HikaShop cart notification plugin's role is to display the add to cart notification and to redirect or not to the checkout.
If you disable it, then the system has no way to display an message to the user on what happened with the add to cart without redirecting him somewhere, and thus it redirects him to the checkout.
So if you don't want to be redirected to the checkout, you need that plugin. So if you want that plugin back and you uninstalled it, you need to install again HikaShop's install package. That will add back the plugin in the Joomla plugins manager and you can then reconfigure it.

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

  • Posts: 54
  • Thank you received: 7
2 years 8 months ago #339783

Hi,

1. Link to my website ->

This message contains confidential information
, since i'm a developer capable of doing php and javascript could you guide me trough making the cart clickable when empty?
2. Il give it a try using css overrides.
3. I did not uninstall the plugin. The problem with the plugin is i dont want the notification popup of the cart. Is there a way to use the plugin but not get the notification?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 8 months ago #339784

Hi,

1. The website requires a user account to login to it so I couldn't see anything.
Normally, when the cart is empty, there is no icon. Instead, there is a text "the cart is empty".
I suppose that you used a translation override to change that text to an img tag of your cart icon.
In that case, in your translation override, you could add an A tag around the img tag with an onclick attribute which would call the window.hikashop.toggleOverlayBlock javascript function to display the dropdown of the cart module. You can see an example of that in the product / cart view file via the menu Display>Views.

3. In that case, you can keep the plugin disabled and instead add custom javascript to your pages to redefine the URL to use with such code:

<script>
if(window.localPage) window.localPage.cartRedirect = '<?php echo hikashop_currentURL(); ?>';
</script>

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

  • Posts: 54
  • Thank you received: 7
2 years 8 months ago #339993

Hi,

Could you be more specific with the code i need to add?

I tried:
CART_EMPTY="<a onclick="window.hikashop.toggleOverlayBlock"><img src=' cdn-icons-png.flaticon.com/512/263/263142.png '></a>"
But its not working.

This message contains confidential information

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 8 months ago #339996

Hi,

Since it's a translation override, you can't use double quotes for the onclick. Similarly to the src attribute of your img tag, you need to use single quotes.
And as I said before "you won't be able to make it display the dropdown minicart easily. That would require PHP/javascript modifications".
That's because the function toggleOverlayBlock requires as parameter the id of the cart module dropdown area's main div and that main div isn't output by the cart module when the cart is empty. So you need to modify the code in the view product / cart via the menu Display>Views to display that div even if the cart is empty and fill it with whatever you want.
I can't give precise instructions. First, I don't know what you want to display when the cart icon is clicked and there is nothing in the cart, and second, that's custom development work.
A simpler solution would be to not have an onclick on the link but only an href with the URL of a joomla article displaying information for example. That way, no need to modify the view file and just the translation override would do.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum