<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eclipse Creations &#187; Other</title>
	<atom:link href="http://www.eclipse-creations.com/category/blog/other/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eclipse-creations.com</link>
	<description>Fine Handcrafted Gifts</description>
	<lastBuildDate>Fri, 17 Jun 2011 01:46:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Collapsing Categories in WP e-Commerce</title>
		<link>http://www.eclipse-creations.com/blog/other/collapsing-categories-in-wp-e-commerce/</link>
		<comments>http://www.eclipse-creations.com/blog/other/collapsing-categories-in-wp-e-commerce/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 20:20:24 +0000</pubDate>
		<dc:creator>eclipse</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.eclipse-creations.com/blog/other/collapsing-categories-in-wp-e-commerce/</guid>
		<description><![CDATA[I built this site using WordPress and a shopping cart plugin called WP e-Commerce. WP e-Commerce is a great add on to an already terrific base, but sometimes there isn&#8217;t a pre-built solution to get it to do what you want it to do and you need to change some of the code yourself. Enough [...]]]></description>
			<content:encoded><![CDATA[<p>I built this site using <a href="http://wordpress.org">WordPress</a> and a shopping cart plugin called <a href="http://www.instinct.co.nz/e-commerce/">WP e-Commerce</a>.<br />
WP e-Commerce is a great add on to an already terrific base, but sometimes there isn&#8217;t a pre-built solution to get it to do what you want it to do and you  need to change some of the code yourself.</p>
<p>Enough people have asked me about how I managed to get the collapsing categories you see on the left sidebar to work, that I thought it would be easier to post my code here for any one that was interested.</p>
<p>If you&#8217;re interested, please read on&#8230;<br />
If you&#8217;re not interested in looking at some badly written code, visit our main site and check out the terrific hand crafted gifts we have for sale. <img src='http://www.eclipse-creations.com/shop/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span id="more-180"></span><br />
Ok .. if you&#8217;re reading this, I&#8217;ll assume you&#8217;re interested in the code, so here it is <img src='http://www.eclipse-creations.com/shop/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But first, a quick disclaimer .. I&#8217;m not a professional programmer and manage to do things by what I call &#8220;trial and error coding&#8221;. As such, there&#8217;s probably a better way to do this, but it works.</p>
<hr />
<p>in file category_widget.php (in your cart theme) &#8230; around line 4, find</p>
<pre lang="PHP">
<h4 class='wpsc_category_title'><?php echo $categorisation_group['name']; ?></h4>
</pre>
<p>and replace it with</p>
<pre lang="PHP">
<h4 class='wpsc_category_title menu_head'><?php echo $categorisation_group['name']; ?></h4>
<div class="menu_body"></pre>
<p>same file &#8230; around line 26, find</p>
<pre lang="PHP">		</ul>
</pre>
<p>and replace it with</p>
<pre lang="PHP">		</ul>
</div>
</pre>
<p>in file /widgets/category_widget.28.php &#8230; around line 25, find</p>
<pre lang="PHP">$selected_categorisations = array_keys((array)$instance['categorisation'], true);</pre>
<p>and place this before it</p>
<pre lang="PHP">
		$thisisa = "
<div id='firstpane' class='menu_list'>";
		echo $thisisa;
</pre>
<p>same file .. around line 50, find</p>
<pre lang="PHP">echo $after_widget;</pre>
<p>and place this before it</p>
<pre lang="PHP">	echo "</div>

";</pre>
<p>In your wordpress theme header.php &#8230; find</p>
<pre lang="PHP"></head></pre>
<p>and add this before it</p>
<pre lang="PHP">
	<script type="text/javascript">
		jQuery.noConflict(); 
		jQuery(document).ready(function()
		{
			//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
			jQuery("#firstpane h4.menu_head").click(function()
		    {
				if ( jQuery(this).next(".menu_body").is(":hidden") ) {
					jQuery("#firstpane .menu_body").slideUp("slow");
				    jQuery("#firstpane h4.menu_head").css({backgroundImage:"url(/images/site/16-square-blue-add.png)"});
					jQuery(this).css({backgroundImage:"url(/images/site/16-square-blue-remove.png)"}).next("div.menu_body").slideDown(300);
				}else{
					jQuery(this).css({backgroundImage:"url(/images/site/16-square-blue-add.png)"}).next("div.menu_body").slideUp("slow");
				};
			});
		});
	</script>
</pre>
<p>In your theme&#8217;s css file .. add this.<br />
You’ll need to modify it to fit your theme and preferences.</p>
<pre lang="PHP">
.menu_list {
	width: 185px;
}
.menu_head {
  background: url(/images/site/16-square-blue-add.png) center right no-repeat;
  padding: 5px 10px;
  cursor: crosshair;
  position: relative;
  border-bottom: dashed 1px #7cdfe7;
}
.menu_body {
	display:none;
}
.menu_body a {
  display:block;
}</pre>
<p>you&#8217;ll also need to change the jscript and css to point to the images you want to use for the + and  -</p>
<hr />
<p>Well .. that&#8217;s it.<br />
I hope you find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eclipse-creations.com/blog/other/collapsing-categories-in-wp-e-commerce/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

