- 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
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
//after doc.ready:
(function doPayGSetup(){
var _payg_data = {
"empty": {
"sl":"x",
"gl":"x",
"cid":"x",
"sp":"x"
},
"wyndham":{
"sl":"WYNDHAM2017WAVE1",
"gl":"WYNDHAM2017",
"cid":"af-pg-wh-zz-us",
"sp":"PAYG"
},
"cbp":{
"sl":"CBP2014",
"gl":"CBP2014",
"cid":"co-cbppayg",
"sp":"PAYG"
},
"riotinto":{
"sl":"INTL%20ASSIGNEE%2CRT%20EMPLOYEE",
"gl":"RIOTINTO",
"cid":"co-riotintopayg",
"sp":"PAYG"
},
"vodafone":{
"sl":"VODAFONE2012WAVE1",
"gl":"VODAFONEPAYG",
"cid":"co-vodafonepayg",
"sp":"PAYG"
},
"accessdevelopment": {
"sl":"AccessDevelopment2017",
"gl":"AccessDevelopment2017",
"cid":"af-pg-ve-1093",
"sp":"PAYG"
},
"employeenetwork": {
"sl":"EmployeeNetwork2017",
"gl":"EmployeeNetwork2017",
"cid":"af-pg-en-1093",
"sp":"PAYG"
},
"abenity": {
"sl":"Abenity2017",
"gl":"Abenity2017",
"cid":"af-pg-abenity-1093",
"sp":"PAYG"
},
"anyperk": {
"sl":"AnyPerk2017",
"gl":"AnyPerk2017",
"cid":"af-pg-an-1093",
"sp":"PAYG"
},
"fond": {
"sl":"AnyPerk2017",
"gl":"AnyPerk2017",
"cid":"af-pg-ap-1093",
"sp":"PAYG"
},
"benefithub": {
"sl":"BenefitHub2017",
"gl":"BenefitHub2017",
"cid":"af-pg-bh-1093",
"sp":"PAYG"
},
"perkspot": {
"sl":"perkspot",
"gl":"perkspot",
"cid":"af-pg-pk-1093",
"sp":"PAYG"
},
"beneplace": {
"sl":"beneplace",
"gl":"beneplace",
"cid":"af-pg-be-1093",
"sp":"PAYG"
},
"employeemall": {
"sl":"employeemall",
"gl":"employeemall",
"cid":"af-pg-ey-1093",
"sp":"PAYG"
},
"abenity": {
"sl":"abenity",
"gl":"abenity",
"cid":"af-pg-ni-1093",
"sp":"PAYG"
},
"ufw": {
"sl":"UFW2016",
"gl":"UFW2016",
"cid":"af-pg-fw-zz-us",
"sp":"PAYG"
},
"bestbenefitsclub": {
"sl":"BestBenefitsClub2017",
"gl":"BestBenefitsClub2017",
"cid":"af-pg-bc-1093",
"sp":"PAYG"
}
};
//debugger;
if( _satellite.getQueryParamCaseInsensitive('payg') ){
'console' in window && console.log('PAYG Program: Listening to cart_update on document');
var _payg = _payg_data[_satellite.getQueryParamCaseInsensitive('payg').toLowerCase()];
!!_payg && $(document).on('cart_update', function(e){
$('.oct_2016_addtocart_square').each(function(i,el){
var $el = $(el), pg = _payg;
//debugger;
var cartURLParts = ($el.attr('href') || '').split('?');
var cartbeginning = cartURLParts[0] + (cartURLParts[0].slice(-1) == '/' ? '' : '/');
var cartmiddle = 'cid/' + pg['cid'] + '/gl/' + pg['gl'] + '/sl/' + pg['sl'] + '/sp/' + pg['sp'];
var cartend = '?' + cartURLParts[1];
var newURL = cartbeginning + cartmiddle + cartend;
$el.attr('href', newURL);
//debugger;
});
});
}
})();