-
Notifications
You must be signed in to change notification settings - Fork 13
/
cart page summary html add.html
88 lines (46 loc) · 1.68 KB
/
cart page summary html add.html
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<script>
/*
begin cart page summary html add
License : < https://tinyurl.com/s872fb68 >
Version : 0.2.1
SS Versions : 7.1, 7.0
v7.1
Fluid
Engine
Compatible : Not Applicable
Dependencies : cart page observe changes
By : Thomas Creedon < http://www.tomsWeb.consulting/ >
*/
// initialize twc global if needed
if ( window.twc == undefined ) window.twc = { };
twc.cpsha = {
html : `
[ enter html here replacing square brackets ]
`
};
// do not change anything below, there be the borg here
( ( ) => {
const version = '0.2.1';
const s = `Cart Page Summary HTML Add v${ version }, ` +
'License < https://tinyurl.com/s872fb68 >, ' +
'Tom\'s Web Consulting < http://www.tomsWeb.consulting >';
console.log ( s );
} ) ( );
var twcCartPageSummaryHtmlAdd = ( node ) => {
const selector = '.cart-summary-container';
let b = node.querySelector === undefined;
if ( b ) return; // bail if no querySelector
node = node
.querySelector ( selector );
b = node === null;
if ( b ) return; // bail if no cart summary container
html = `
<div class="twc-csha">
${ twc.cpsha.html }
</div>
`;
node
.insertAdjacentHTML ( 'beforeend', html );
};
// end cart page summary html add
</script>