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>

Related Forum Discussions

snippets/multiple_store/two_stores_one_url.txt · Last modified: 2011/11/17 10:36 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki