-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.php
34 lines (31 loc) · 942 Bytes
/
footer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script src="https://unpkg.com/@shopify/app-bridge@2"></script>
<script>
var AppBridge = window['app-bridge'];
var actions = window['app-bridge'].actions;
var TitleBar = actions.TitleBar;
var Button = actions.Button;
var Redirect = actions.Redirect;
var createApp = AppBridge.default;
var Modal = actions.Modal;
var app= createApp(
{
apiKey:'e6ab6265e31ce653ea02ad34560b08588845',
shopOrigin: '<?php echo $shopify->get_url(); ?>'
});
var titleBarOptions = {
title: 'efregf'
};
var myTitleBar = TitleBar.create(app, titleBarOptions);
const modalOpt ={
title: 'modak',
message: 'efe'
};
const examplemodal = Modal.create(app, modalOpt);
const redirect = Redirect.create(app);
var installbn = Button.create(app, {label: 'Install Script'});
installbn.subscribe(Button.Action.CLICK, data => {
examplemodal.dispatch(Modal.Action.OPEN);
});
</script>
</body>
</html>