ScriptTags to popup windows on site when I want them to?

Highlighted
Shopify Partner
14 0 0

Hi guys,

I'd like to pop-up a window on the front end of a store once the user has added something to their shopping cart.  I can get the webhook notification in my app so that I know when something has been added, but is there a way (maybe using ScriptTags to insert some JS into the front-end) to tell the store-front that I want to show a pop-up?

(Sorry a bit new to all this!)

Thanks!

Matt.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
291 3 59

Hey Matt,

You bet! Scripttags would be your best bet IMO. You can use the AJAX API to listen for cart/add events clientside as well. 

 

- Jordan 

0 Likes
Highlighted
Shopify Partner
14 0 0

Thanks Jordan - is there are good examples of listening to events using the AJAX Api?

Thanks,

Matt.

0 Likes
Highlighted
Excursionist
73 0 12

@Jordan, I would also like to see some good examples of this Ajax API.

@Matt, if nothing else pops up, you could use the HTML5 Server-Sent Events.
https://www.html5rocks.com/en/tutorials/eventsource/basics/
Basically, you just subscribe on the server script and the script can send the data to your client when you receive something from a webhook.

 

https://apps.shopify.com/show-recent-orders ~ Show your visitors that others are buying from you!
0 Likes
Highlighted
New Member
4 0 0

Hey Matt!

 

Did you ever figure this one out? I'd like to be able to do something similar... yet I don't know-how.

 

I'm writing in ReactJS & can't seem to figure out how to add something to the client's front-end.

 

Best,

Tom

0 Likes