TypeError: Cannot read property "currentHostString" from undefined (index.ssp$18814#82)
 
    1: function service(request, response)
    2: {
    3: 
    4: 	var SiteSettings
    5: 	,	parameters
    6: 	,	siteType
    7: 	,	Environment
    8: 	,	Language
    9: 	,	Currency
   10: 	,	Error
   11: 	,	cart_bootstrap
   12: 	,	login;
   13: 
   14: 	try
   15: 	{
   16: 		SiteSettings = Application.getModel('SiteSettings').get();
   17: 		siteType = SiteSettings.sitetype; 
   18: 		parameters = request.getAllParameters();
   19: 
   20: 		Environment = Application.getEnvironment(session, request); 
   21: 		Language = Environment.currentLanguage && Environment.currentLanguage.locale || '';
   22: 		Currency = Environment.currentCurrency && Environment.currentCurrency.code || '';
   23: 
   24: 		cart_bootstrap = true;
   25: 		login = false;
   26: 
   27: 		parameters.fragment = '';
   28: 		
   29: 		if (session.isChangePasswordRequest())
   30: 		{
   31: 			parameters.fragment = 'reset-password';
   32: 			login = true;
   33: 		}
   34: 		else if (
   35: 					(SiteSettings.registration.registrationoptional !== 'T' && !session.isLoggedIn())
   36: 				||	(!SC.Configuration.checkout_skip_login && !session.isLoggedIn())
   37: 				||	(parameters.is && (parameters.is === 'login' || parameters.is === 'register') && !session.isLoggedIn())
   38: 				||	(parameters.is && (parameters.is === 'login' || parameters.is === 'register') && session.getCustomer().isGuest())
   39: 				||	(SC.Configuration.checkout_skip_login && !session.isLoggedIn() && session.isRecognized())
   40: 				)
   41: 		{
   42: 			delete parameters.sitepath;
   43: 			parameters.fragment = 'login-register';
   44: 			login = true;
   45: 		}
   46: 		
   47: 		if (request.getParameter('paypalexpress') === 'T')
   48: 		{
   49: 			Application.getModel('LiveOrder').redirectToPayPalExpress();
   50: 			return;
   51: 		}
   52: 		else if (request.getParameter('paypal') === 'T')
   53: 		{
   54: 			Application.getModel('LiveOrder').redirectToPayPal();
   55: 			return;
   56: 		}
   57: 		else if (request.getParameter('paypal') === 'DONE')
   58: 		{
   59: 			Application.getModel('LiveOrder').backFromPayPal();
   60: 		}
   61: 
   62: 		cart_bootstrap = !login; // we dont want to bootstrap the cart in login/register page
   63: 	}
   64: 	catch(e)
   65: 	{
   66: 		Error = Application.processError(e);
   67: 	}
   68: 
   69: response.write("\r\n\r\n<!DOCTYPE html>\r\n<html ");
   70: response.write( Language ? 'lang="' + Language.replace('_', '-') + '"' : '' );
   71: response.write(">\r\n<head>\r\n\t<meta charset=\"utf-8\">\r\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\r\n\t<title>");
   72: response.write( login ? 'Sign In' : 'Checkout' );
   73: response.write("</title>\r\n\r\n\t");
   74:  if (siteType === 'STANDARD') { 
   75: response.write("\r\n\t<link rel=\"stylesheet\" href=\"");
   76: response.write( session.getAbsoluteUrl('checkout', 'skins/standard/styles-sitebuilder.css') );
   77: response.write("\">\r\n\t");
   78: response.write( getPageFullHead() );
   79: response.write("\r\n\t");
   80:  } 
   81: response.write("\r\n\r\n\t<script>\r\n\tvar SC = window.SC = { \r\n\t\tENVIRONMENT: {\r\n\t\t\tjsEnvironment: (typeof nsglobal === 'undefined') ? 'browser' : 'server'\r\n\t\t}\r\n\t,\tisCrossOrigin: function() { return '");
   82: response.write( Environment.currentHostString );
   83: response.write("' !== document.location.hostname; }\r\n\t,\tisPageGenerator: function() { return typeof nsglobal !== 'undefined'; }\r\n\t,\tgetSessionInfo: function(key)\r\n\t\t{\r\n\t\t\tvar session = SC.SESSION || SC.DEFAULT_SESSION || {};\r\n\t\t\treturn (key) ? session[key] : session;\r\n\t\t}\r\n\t};\r\n\t");
   84:  /* Define a function to load script at runtime
   85: 		The script can be removed of the generated html by the server seo, please see Starter.js. */ 
   86: response.write("\r\n\tfunction loadScript(data)\r\n\t{\r\n\t\t'use strict';\t\t\r\n\t\t\r\n\t\tvar element;\r\n\t\tif (data.url)\r\n\t\t{\r\n\t\t\telement = '<script src=\"'+ data.url +'\"></' + 'script>';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\telement = '<script>'+ data.code + '</' + 'script>';\r\n\t\t}\r\n\t\tif (data.seo_remove)\r\n\t\t{\r\n\t\t\tdocument.write(element);\r\n\t\t}\r\n\t\telse\r\n\t\t{ \r\n\t\t\tdocument.write('</div>'+ element +'<div class=\"seo-remove\">');\r\n\t\t}\r\n\t}\r\n\t</script>\r\n\r\n\t<!--[if lt IE 9]>\r\n\t<script src=\"");
   87: response.write( session.getAbsoluteUrl('shopping', 'js/utils/html5shiv.js') );
   88: response.write("\"></script>\r\n\t<![endif]-->\r\n\t<NG_HEAD>\r\n</head>\r\n<body style=\"background-image: url('/site/images/mb-park.jpg'); color : #000;\">\r\n\t<div id=\"wrapper\" class=\"container\" style=\"margin: 10px auto;background: #fff;padding: 10px;box-shadow: 0 0 40px #999;border-radius: 6px;\">\r\n\t<noscript>\r\n\t\t<div class=\"container\">\r\n\t\t\t<div class=\"alert alert-error alert-noscript\">\r\n\t\t\t\t<strong>Javascript is disabled on your browser.</strong><br>\r\n\t\t\t\tTo view this site, you must enable JavaScript or upgrade to a JavaScript-capable browser.\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</noscript>\r\n\r\n\t");
   89:  if (siteType && siteType === 'STANDARD') { 
   90: response.write("\r\n\t\t<div id='div__header' style=\"overflow: hidden;\" class='noprint' leftmargin='0' topmargin='0' marginwidth='1' >\r\n\t\t\t<table border='0' cellspacing='0' cellpadding='0' width='100%'>\r\n\t\t\t\t<NG_TOP_NAV>\r\n\t\t\t</table>\r\n\t\t</div>\r\n\t");
   91:  } 
   92: response.write("\r\n\r\n\t<div id=\"main-nav-wrapper\">\r\n\t\t<div id=\"left-nav\"></div>\r\n\t\t<div id=\"content\">\r\n\t\t\t<div id=\"main\"></div>\r\n\t\t</div>\r\n\t</div>\r\n\t<p style=\"font-size: 12px;text-align: right;padding-right: 15px;\">\r\n\t\t<a title=\"by NewGen Business Solutions\" href=\"http://conventionsuite.newgennow.com\" target=\"_blank\">Powered by <span style=\"color: blue;\"><em>Convention</em></span><span style=\"color: green;\"><em>Suite</em></span></a>\r\n\t</p>\r\n\r\n\t");
   93:  if (login) { 
   94: response.write("\r\n\t\t<script src=\"");
   95: response.write( session.getAbsoluteUrl('checkout', 'sc.environment.ssp?lang=' + Language + '&cur=' + Currency + (cart_bootstrap ? "&cart-bootstrap=T" : "") ) );
   96: response.write("\"></script>\r\n\t");
   97:  } else { 
   98: response.write("\r\n\t\t<script>\r\n\t\t\tloadScript({\r\n\t\t\t\turl: '");
   99: response.write( session.getAbsoluteUrl("checkout", "sc.environment.ssp?lang=" + Language + "&cur=" + Currency + (cart_bootstrap ? "&cart-bootstrap=T" : "") ) );
  100: response.write("&t=' + (new Date().getTime())\r\n\t\t\t});\r\n\t\t</script>\r\n\t");
  101:  } 
  102: response.write("\r\n\r\n\t");
  103:  if (Error) { 
  104: response.write("\r\n\t\t<script>SC.ENVIRONMENT.contextError = ");
  105: response.write( JSON.stringify(Error) );
  106: response.write(";</script>\r\n\t");
  107:  } 
  108: response.write("\r\n\t<script>\r\n\t\twindow.location.hash = !~window.location.hash.indexOf('login-register') && !'");
  109: response.write( parameters.fragment );
  110: response.write("' ? window.location.hash : '");
  111: response.write( parameters.fragment );
  112: response.write("';\r\n\t</script>\r\n\r\n\t<script src=\"");
  113: response.write( session.getAbsoluteUrl('checkout', 'js/Application-0149bee6bbfd.js') );
  114: response.write("\"></script>\r\n\t<script src=\"");
  115: response.write( session.getAbsoluteUrl('checkout', 'templates/Templates-0152ae228b9c.js') );
  116: response.write("\"></script>\r\n\r\n\t<script>\r\n\t\t");
  117:  if (login) { 
  118: response.write("\r\n\t\t\tSC.Application('Checkout').Configuration.currentTouchpoint = 'login';\r\n\t\t");
  119:  } 
  120: response.write("\r\n\t</script>\r\n\r\n\t");
  121:  if (siteType === 'ADVANCED') { 
  122: response.write("\r\n\t<link rel=\"stylesheet\" href=\"");
  123: response.write( session.getAbsoluteUrl('checkout', 'skins/standard/styles.css') );
  124: response.write("\">\r\n\t");
  125:  } 
  126: response.write("\r\n</body>\r\n</html>");
  127: }
  128: