type:
snippet
category:
Multiple store
name:
Two stores, one URL
reference:
http://forum.foxycart.com/comments.php?DiscussionID=3090
tags:
snippets, multiple store, advance
date:
2011-05-27

Two stores, one URL

Two stores, one URL, separated by directory. Put that immediately after your foxycart_includes.js call. Notice the “/gear/” bit. That's the important part.

	<script type="text/javascript" charset="utf-8">
		function fc_CookieSet(sessionName, sessionString) {
			// get this domain with no subdomain
			domain = window.location.href.split('/');
			domain = domain[2];
			pos1 = domain.lastIndexOf(".");
			pos2 = domain.lastIndexOf(".",pos1-1);
			if (pos2 > 1) {
			    domain = domain.substr(pos2);
			} else {
			    domain = "." + domain;
			}
			document.cookie = sessionName + "=" + escape(sessionString) + ";path=/gear/;domain="+domain;
			return true;
		}
	</script>

Site Tools