[Skip to main content](#vessel-content)

#   Alert sound with incoming order

##

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

4 years 6 months ago [\#341860](#341860) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Alert sound with incoming order](/forum/25-install-update/902868-alert-sound-with-incoming-order?start=20#341860 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.27 -- PHP version -- : 7.4  Hi,  Is it possible to get a sound &quot;pling&quot; :) when an order is placed on the website so when a vendor is logged in into his account and he is doing something else he gets an alert of incoming order. Something like this for woocommerce plugin.   nl.wordpress.org/plugins/woc-order-alert/  We don't like Woocommerce but this is a nice plugin extension for a webshop.  Thanks mark")*

Hi,

Again, I was not able to reproduce the problem:
[ i.imgur.com/hnz2llC.png](https://i.imgur.com/hnz2llC.png)
Whenever I was doing my tests I got the notification box directly and it worked great on your website.

So I run some more tests and at one point I was able to reproduce the problem. It didn't work when the developer tools area was closed (so that's why you got the issue and I didn't since I normally need the developer tools of the browser to understand what's going on and normal users usually don't have it open).

So I first thought that it might be a limitation of browsers blocking ajax requests in some cases to save resources. But I couldn't find any information on that online.

And while doing my tests, I noticed that for each "check" request, there was a second row in the network log of the developer tools with something coming from the file /pwa_maker_service_worker.js of your website.
At first, I thought it was another extension doing its thing on the side and didn't pay mind to it. Foremost, the javascript code in there is trimmed so it's hard to read so I didn't bother.
But since that was my only clue, I tried to look deeper into it. And it turns out this file has some code to catch all the AJAX requests made on your website and cache them on the browser so that they are not really made but the content is retrieved from the cache.
So that's the second problem you have there:
[ i.imgur.com/CRj7FIy.png](https://i.imgur.com/CRj7FIy.png)
This file prevents the notifications from poping because it gives a cached version of the check ajax request's response and thus it doesn't see the new order coming in.
Looking at the code, I can see that it does this only for GET requests. So I've changed the code in the plugin to do a POST request and now it works even with the developers tools closed on my end.
So I suppose the problem is fixed ( note that you need to clear your browser's cache to see the change). But really it was a hard one to find and I don't see why it needs to cache all the GET requests like that ![:/](/irritated.gif ":/")

Now regarding the refresh thing, to circumvent the problem, you can change the line:
window.last_interaction = 0;
to:
window.last_interaction = Date.now();
in the file plugins/system/ordernotify/media/notify.js and clear your browser's cache.
That way, it will start the check process when any page is loaded and thus it will work even if the page is reloaded and no one touches it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMjg2OC1hbGVydC1zb3VuZC13aXRoLWluY29taW5nLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

4 years 6 months ago [\#341868](#341868) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Alert sound with incoming order](/forum/25-install-update/902868-alert-sound-with-incoming-order?start=20#341868 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.27 -- PHP version -- : 7.4  Hi,  Is it possible to get a sound &quot;pling&quot; :) when an order is placed on the website so when a vendor is logged in into his account and he is doing something else he gets an alert of incoming order. Something like this for woocommerce plugin.   nl.wordpress.org/plugins/woc-order-alert/  We don't like Woocommerce but this is a nice plugin extension for a webshop.  Thanks mark")*

Hi Nicolas,

This works now like charme as far i can see during my tests.
Super..
But i now want to put it on our live site.. so where did you change this??

> Looking at the code, I can see that it does this only for GET requests. So I've changed the code in the plugin to do a POST request and now it works even with the developers tools closed on my end.

So then i can upload the plugin and make these changes also and put it to work.. ![:)](/media/kunena/emoticons/3.png ":)")

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMjg2OC1hbGVydC1zb3VuZC13aXRoLWluY29taW5nLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

4 years 6 months ago [\#341870](#341870) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Alert sound with incoming order](/forum/25-install-update/902868-alert-sound-with-incoming-order?start=20#341870 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.27 -- PHP version -- : 7.4  Hi,  Is it possible to get a sound &quot;pling&quot; :) when an order is placed on the website so when a vendor is logged in into his account and he is doing something else he gets an alert of incoming order. Something like this for woocommerce plugin.   nl.wordpress.org/plugins/woc-order-alert/  We don't like Woocommerce but this is a nice plugin extension for a webshop.  Thanks mark")*

Hi,

The modification has been added on our end too.
So if you download the install package of the plugin on our website, you'll get the fix.
Also, the file plugins/system/ordernotify/media/notify.js contains the fix so you could just copy it from one website to the other.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMjg2OC1hbGVydC1zb3VuZC13aXRoLWluY29taW5nLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

4 years 6 months ago [\#341950](#341950) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Alert sound with incoming order](/forum/25-install-update/902868-alert-sound-with-incoming-order?start=20#341950 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.27 -- PHP version -- : 7.4  Hi,  Is it possible to get a sound &quot;pling&quot; :) when an order is placed on the website so when a vendor is logged in into his account and he is doing something else he gets an alert of incoming order. Something like this for woocommerce plugin.   nl.wordpress.org/plugins/woc-order-alert/  We don't like Woocommerce but this is a nice plugin extension for a webshop.  Thanks mark")*

Hi Nicolas,

Super this works like a charme we are very happy.
Thanks a lot for the help..
Regards,
Mark

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMjg2OC1hbGVydC1zb3VuZC13aXRoLWluY29taW5nLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
