Best Affiliate program To Join In 2020


“; _cf_contextpath=””; _cf_ajaxscriptsrc=”/CFIDE/scripts/ajax”; _cf_jsonprefix=’//’; _cf_websocket_port=8575; _cf_flash_policy_port=1243; /* ]]]]> */]]>ShareASale

Affiliate Account Creation

Login Details

-1 || arrCountryNameWithStates.indexOf(countryValue) > -1); } //matchCountryForStates function getStateField(sEl){ const frm = sEl.closest(‘form’); if (!frm) return null; for (var i = 0; i -1) return frm.elements[i]; } return null; }//getStateField function createStateText (countryEl, stateEl, stateDefaultVal) { if(!stateEl) return; //remove state input pNode = stateEl.parentNode; pNode.removeChild(stateEl); var newEl = document.createElement(‘input’); newEl.type = ‘text’; newEl.name = stateEl.name; newEl.id = stateEl.id; newEl.required = true; newEl.value = stateDefaultVal; newEl.placeholder = ‘State / Province’; pNode.prepend(newEl); return; } //createStateText function createStatePullDown (countryEl, stateEl, stateDefaultVal) { if(!stateEl) return; //remove state input pNode = stateEl.parentNode; pNode.removeChild(stateEl); var countryValue = countryEl.value; if (arrCountryNameWithStates.indexOf(countryValue) == 0 || arrCountryNameWithStates.indexOf(countryValue) == 1) countryValue = ‘US’; else if (arrCountryNameWithStates.indexOf(countryValue) == 2) countryValue = ‘CA’; else if (arrCountryNameWithStates.indexOf(countryValue) >= 3) countryValue = ‘GB’; var newEl = document.createElement(‘select’); newEl.name = stateEl.name; newEl.id = stateEl.id; newEl.required = true; var frst = document.createElement(‘option’); frst.value = ”; frst.innerHTML = ‘ – State/Province – ‘; newEl.appendChild(frst); for(var x=0;x { addAddressFormListener(); }); function addAddressFormListener(){ var addressForms = findAddressForms(); for (var k=0; k { if (node.tagName === ‘FORM’) { var index = arrFrmNames.indexOf(node.name); if (index > -1 ){ $arrListenerAdded.splice(index, 1); $preserveOnSubmit.splice(index, 1); } } }); } catch (err) {} }//cleanUpListener function addressFromNameAsArray (){ var rtn = []; $arrListenerAdded.forEach((stc) => { rtn.push(stc.frmName); }); return rtn; } //Get valid address function validateAddress(){ try { var trg = ‘/_verify.cfm’; var frm = event.target; if (!frm || $AddressVerified) { $AddressVerified = false; return true; } $_activeForm = event.target; event.stopImmediatePropagation(); event.preventDefault(); var input = document.createElement(“input”); input.type = “hidden”; input.name = “blnAddyRequest”; input.value = 1; frm.appendChild(input); shrsl.xhr.post( trg, frm, userConfirmAddress, this); return false; } catch (err) { return true; } }//validateAddress function createAddressModal(arrAddress){ SAS.ux.pageMask.showInfo(buildAddressForm(arrAddress));//, ‘foo’ document.querySelector(‘.sas-page-mask’).style.zIndex = ‘999’; document.querySelector(‘#_btn_cancelAddress’).addEventListener(‘click’, function(){ $AddressVerified = true; addNotVerifiedInput(); _postConfirmation_action(); SAS.ux.pageMask.hide(); }); document.querySelector(‘#_btn_useAddress’).addEventListener(‘click’, useSuggestedAddress); return; }//createAddressModal function buildAddressForm (arrAddress){ var arr = arrAddress; var rtn = ‘Use Matching Address]]>’;
rtn = rtn + ”; if (obj.addressee) rtn = rtn + ‘

‘+obj.addressee+’

‘; rtn = rtn + ‘

‘+obj.delivery_line_1+’

‘; rtn = rtn + ‘

‘+obj.last_line+’

‘;
}
rtn = rtn + ”;

return rtn;

}//buildAddressForm

function createWarningModal(){
SAS.ux.pageMask.showInfo(buildWarningAlert());
document.querySelector(‘.sas-page-mask’).style.zIndex = ‘999’;
document.querySelector(‘#_btn_forceUseAddress’).addEventListener(‘click’, function(){
$AddressVerified = true;
addNotVerifiedInput();
_postConfirmation_action();
SAS.ux.pageMask.hide();
});
document.querySelector(‘#_btn_goBackToAddress’).addEventListener(‘click’, function(){SAS.ux.pageMask.hide();});

return;

}//createWarningModal

function buildWarningAlert(arrAddress){
var objMapped = mappFormElements();
var rtn = ”;

return rtn;
}//buildWarningAlert

function userConfirmAddress (rsp) {
try {
var rtn = JSON.parse(rsp.response);
var arrAddys = rtn.jsn;
} catch (err) {
try {
findAddressForm().removeEventListener(‘submit’, validateAddress);
} catch (err){}
_postConfirmation_action();
return false;
}

if (!Array.isArray(arrAddys) || ! rtn.blnUSA) {
$AddressVerified = true;
if (rtn.blnUSA)
addNotVerifiedInput();
_postConfirmation_action();
return true;
} else if (arrAddys.length == 0 && rtn.blnUSA) {
createWarningModal();
return true;
}

//Normailze sub data to root object for ease
arrAddys.forEach(function(item) {
item.state_abbreviation = item.components.state_abbreviation;
item.zipcode = item.components.zipcode;
item.plus4_code = item.components.plus4_code;
item.city_name = item.components.city_name;
if (!item.delivery_line_2)
item.delivery_line_2 = ”;
return item;
});
$arrSuggested = arrAddys;
//Check Response For Perfect match
if (! checkAddressForm(arrAddys))
createAddressModal(arrAddys);
else {
$AddressVerified = true;
_postConfirmation_action();
}
return true;
} //userConfirmAddress

function addNotVerifiedInput(){
var frm = findAddressForm();
if (!frm)
return;

var input = document.createElement(“input”);
input.type = “hidden”;
input.name = “USnonValidated”;
input.value = 1;
frm.appendChild(input);
return;
}

function checkAddressForm(arrSuggestions){
var arrAddys = arrSuggestions;
var blnMatch = false;

var objMapped = mappFormElements();
for (let x=0; x -1 ){
if( $F[propName].val != $S[propName] + ‘-‘ + $S[‘plus4_code’])
return false;
} else if ($S[propName].toLowerCase() !== $F[propName].val.toLowerCase()) {
return false;
}
}
return true;
}//matchAddressSuggestion

/* This function is checking forms for a ‘state’ input */
function findAddressForm(){
return $_activeForm;
}

function findAddressForms(){
var arrFrms = document.getElementsByTagName(“form”);
var _arrAddressForms = [];
try {
for(var i=0;i -1 && els[x].type != ‘hidden’) || isMerchantSignUp()) {//custom check for merchant signup page
if (! _arrAddressForms.find(f => f.id === arrFrms[i].id))
_arrAddressForms.push(arrFrms[i]);
}
}
}
} catch (err) {}

return _arrAddressForms;
}

function mappFormElements(){
var objFrm = {
//addressee : {val : ”, frmName : ”}, //Not validating addressee
delivery_line_1 : {val : ”, frmName : ”},
delivery_line_2 : {val : ”, frmName : ”},
city_name : {val : ”, frmName : ”},
state_abbreviation : {val : ”, frmName : ”},
zipcode : {val : ”, frmName : ”}
};

frm = findAddressForm();

try {
if (!frm)
return objFrm;
for (var i = 0; i -1) {
// objFrm.addressee.val = frm.elements[i].value;
// objFrm.addressee.frmName = frm.elements[i].name;
// } // ***Not validating addressee at this time
if (frm.elements[i].name.toLowerCase().indexOf(‘address’) > -1 && ! objFrm.delivery_line_1.val.trim().length && frm.elements[i].name.toLowerCase().indexOf(‘address2’) == -1) {
objFrm.delivery_line_1.val = frm.elements[i].value;
objFrm.delivery_line_1.frmName = frm.elements[i].name;
}
if (frm.elements[i].name.toLowerCase().indexOf(‘address2’) > -1) {
objFrm.delivery_line_2.val = frm.elements[i].value;
objFrm.delivery_line_2.frmName = frm.elements[i].name;
}
if (frm.elements[i].name.toLowerCase().indexOf(‘city’) > -1) {
objFrm.city_name.val = frm.elements[i].value;
objFrm.city_name.frmName = frm.elements[i].name;
}
if (frm.elements[i].name.toLowerCase().indexOf(‘state’) > -1) {
objFrm.state_abbreviation.val = frm.elements[i].value;
objFrm.state_abbreviation.frmName = frm.elements[i].name;
}
if (frm.elements[i].name.toLowerCase().indexOf(‘zip’) > -1) {
objFrm.zipcode.val = frm.elements[i].value;
objFrm.zipcode.frmName = frm.elements[i].name;
}

//Clear second address line.

}//for
} catch (err) {console.log(err);}
return objFrm;
}//mappFormElements

function useSuggestedAddress(){
frm = this.closest(“form”);

if (!frm)
return;
try {
var radios = frm.querySelectorAll(“.addressOptionRadio.cbx”);

var selectedVal = 0;
for (let r=0; r -1)
frm[frmMap[propName].frmName].value = objUse[propName] + ‘-‘ + objUse[‘plus4_code’];
else
frm[frmMap[propName].frmName].value = objUse[propName];
}
}
//if no second street value delete
} catch (err) {}

$AddressVerified = true;

_postConfirmation_action();

}//useSuggestedAddress

function getSavedListenerIndex(){
var addressForm = findAddressForm();

var pIndex = $arrListenerAdded.findIndex(function(post, index) {
if(post.frmName == addressForm.name)
return true;
});
return pIndex;
}

function getSavedListener (){
return $preserveOnSubmit[getSavedListenerIndex()];
} //getSavedListener

function _postConfirmation_action (){

try {
var addyFrm = findAddressForm();

var thisPreserve = getSavedListener();

if (thisPreserve){
addyFrm.addEventListener(“submit”, function(e){
e.preventDefault()
eval(thisPreserve);
return false;
}, false);

const domEvent = document.createEvent(‘Event’);
domEvent.initEvent(‘submit’, false, true);
addyFrm.dispatchEvent(domEvent);

} else {
addyFrm.removeEventListener(‘submit’, validateAddress);
addyFrm.submit();
}
} catch(err) {
console.log(err);
addyFrm.removeEventListener(‘submit’, validateAddress);
addyFrm.submit();
$AddressVerified = false;
}
try {SAS.ux.pageMask.hide();} catch (err) {}
//Remove from Listener arrays
if (thisPreserve){
var perserveIndex = getSavedListenerIndex();
$arrListenerAdded.splice(perserveIndex, 1);
$preserveOnSubmit.splice(perserveIndex, 1);
}

//Re-Set global var

$AddressVerified = false;

closeITPMode();
}//_postConfirmation_action

function closeITPMode(){
var itpModal = document.querySelector(‘#itpModal’);
if (!itpModal)
return;
itpModal.parentNode.removeChild(itpModal);
}//closeITPMode

let isMerchantSignUp = function () {
return document.querySelector(‘#frmMerSignup’);
}
/* End 3rd Party Validation */

/**** Merchant Address Confirm Nag *****/
function _merchantLoadAddressNag(){
try {
var modalEl = SAS.DOM.create(‘div’, {id:’itpModal’});
document.body.insertBefore(modalEl, document.body.childNodes[0]);
account.openEditWin(‘contactInfo’, 560, 500, ‘Confirm Address’);
document.getElementById(‘itpModal’).style.zIndex = ‘500’;
document.getElementById(‘modalEditWin’).style.zIndex = ‘501’;
SAS.DOM.get(‘gen7ClsAction’).addEventListener(‘click’, () => {
SAS.DOM.get(‘itpModal’).remove();
}, false);
} catch (err) { }
}//_merchantLoadAddressNag

SHAREASALE.COM, INC. 2000 — 2021

Source

Leave a Comment