Changed notification system?

  • Posts: 96
  • Thank you received: 6
  • Hikashop Business
6 years 1 month ago #288241

-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.5

Hi There!
I have an override on the remove from wishlist method so that it shows a notification when an item is removed from the wishlist. When I developed this override HikaShop was using jQuery notify to show notifications and I just had to add this code to my javascript:

jQuery.notify({title:"Removed From Wishlist",text: jQuery(this).data('productName'),image:"<img src=\""+jQuery(this).data('productImage')+"\" alt=\"\"/>"},{className:'info'});

It's been sometime and I remember this was working fine, but currently the site does not load jQuery notify plugin and notifications seem to be using a different (and nicer system) with this call to update the cart:
window.Oby.fireAjax(cart_type+'.updated', {id: cart_id, el: el, product_id: product_id, type: cart_type, resp: resp});

Can you please point out the code to show a notification about product removed so that I can use the new notification system?

Thank you!!

Carlos.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 1 month ago #288248

Hi,

Well, it's basically the same as the adding.
HikaShop has the HikaShop cart notify plugin which handles the notifications for product adding.
So you can base yourself on it. The code you want to look at is the unobfuscated code in plugins/hikashop/cartnotify/media/notify.min.js

The following user(s) said Thank You: karendunne

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

  • Posts: 96
  • Thank you received: 6
  • Hikashop Business
6 years 1 month ago #288410

Hi nicolas,
I'm afraid that does not look quite right to me. I just need a simple way to handle the notification after calling:

window.hikashop.deleteFromCart(this,'wishlist','');

Previously I was using this:
jQuery.notify({title:"Removed From Wishlist",text: jQuery(this).data('productName'),image:"<img src=\""+jQuery(this).data('productImage')+"\" alt=\"\"/>"},{className:'info'});

Which is pretty close to what you have in the referred function for using notifications, but I get this message in console:

TypeError: jQuery.notify is not a function


Can you please provide any other clue? I see you are loading notification libraries and don't want to load any more libraries to make it work :(

Thank you!!

Carlos.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 1 month ago #288449

Hi,

I was not talking about the jQuery.notify.
If you get the error that jQuery.notify is not a function, it means that jQuery and/or the notify system of jQuery you're trying to use are not loaded where you have your code.
Since we don't know how and where exactly you added your javascript code, we can't help much on that.
What I would recommend is to load jQuery and/or the notify system of jQuery just before trying to call jQuery.notify and that will work.

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

  • Posts: 96
  • Thank you received: 6
  • Hikashop Business
6 years 1 month ago #288494

Hi nicholas,
that was my first thought, but if you go to any product as a user and try to add it to your wishlist, the notification works with no problem. The problem is when you try to call jQuery.notify outside of hikashop javascript.

This was working before one of the past updates, so something has changed in how you handle notifications or load jQuery that is making not possible for me to use the libraries Hikashop loads.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288496

Hello,

To call jQuery.notify you need to include the jQuery library which provide that "notify".
It's not related to HikaShop or else ; it's just that you're using some JS lib which has not been included.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 96
  • Thank you received: 6
  • Hikashop Business
6 years 1 month ago #288804

Hi Jerome,
as I stated, I am using the same javascript methods you use in hikashop.js but since last (or previous) update the javascript system stopped to work.

I see in your code you are using jQuery.notify, but weird enough it only works inside your javascript as if you are not loading jquery or jquery.notify globally.

I only demand a bit of help on the javascript method I need to use to show a message using your message system. That's all I need. please!!

Carlos

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288805

Hello,

Before using jQuery notify ; we load jQuery and we also load the "notify" lib.
If you do want to use the notifyjs lib ; best for you would be to download it and use it manually.
CF : notifyjs.com/
And don't forget to also include jQuery via the Joomla core before.

Please understand that you're asking for help for elements which are outside the limit of our support.
And, right now it's not that we don't want to help you a bit but...
How could we help you with the JavaScript if we do not know anything regarding what you have done nor we can see your plugin in action ?


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.069 seconds
Powered by Kunena Forum