<?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>My Quick Fix &#187; WordPress</title>
	<atom:link href="http://myquickfix.co.uk/category/computers/web-development/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://myquickfix.co.uk</link>
	<description>Quick fixes for little problems...</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:11:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Remove Links menu item in WordPress</title>
		<link>http://myquickfix.co.uk/2012/01/remove-links-menu-item-in-wordpress/</link>
		<comments>http://myquickfix.co.uk/2012/01/remove-links-menu-item-in-wordpress/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 11:45:43 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=220</guid>
		<description><![CDATA[Problem: I&#8217;m customising a WP install for a client, adding some Custom Post Types and wotnot, and they aren&#8217;t going to have any need for the Links thing. Fix: Adding this to your theme&#8217;s (or child-theme&#8217;s) functions.php removes the page and the menu link: function nuke_menu_items&#40;&#41;&#123; remove_menu_page&#40; 'link-manager.php'&#41;; //remove_menu_page( 'upload.php'); //remove other items etc etc [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> I&#8217;m customising a WP install for a client, adding some Custom Post Types and wotnot, and they aren&#8217;t going to have any need for the Links thing.</p>
<p><strong>Fix:</strong> Adding this to your theme&#8217;s (or child-theme&#8217;s) functions.php removes the page and the menu link:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> nuke_menu_items<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
remove_menu_page<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'link-manager.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//remove_menu_page( 'upload.php'); //remove other items etc etc</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'nuke_menu_items'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">999</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2012/01/remove-links-menu-item-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding category depth tag to Shopp 1.1.*</title>
		<link>http://myquickfix.co.uk/2012/01/adding-category-depth-tag-to-shopp-1-1/</link>
		<comments>http://myquickfix.co.uk/2012/01/adding-category-depth-tag-to-shopp-1-1/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 17:14:08 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Shopp Plugin]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=206</guid>
		<description><![CDATA[Problem: I needed to display sub categories of a category in category.php but only one level deep. Using: &#60;?php if&#40;shopp&#40;'category','hascategories'&#41;&#41;: ?&#62; &#60;?php while&#40;shopp&#40;'category','subcategories'&#41;&#41;: ?&#62; //display stuff &#60;?php endwhile; ?&#62; &#60;?php endif; ?&#62; &#8230;displays all subcast AND their subcats. Fix: I decided to add a new tag, called shopp(&#8216;subcategory&#8217;, &#8216;depth&#8217;) that would return the category depth. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> I needed to display sub categories of a category in category.php but only one level deep. Using:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'hascategories'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'subcategories'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    //display stuff
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>&#8230;displays all subcast AND their subcats.</p>
<p><strong>Fix:</strong> I decided to add a new tag, called shopp(&#8216;subcategory&#8217;, &#8216;depth&#8217;) that would return the category depth. That way in the loop above this would show only immediate children:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'hascategories'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'subcategories'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
    <span style="color: #000088;">$depth</span> <span style="color: #339933;">=</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'subcategory'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'depth'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'return=true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$depth</span><span style="color: #339933;">!=</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
      <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   //else display stuff
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Adding the new tag:</strong> Open the theme&#8217;s functions.php file and add this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shopp_tag_category_depth'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'return_cat_depth'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shopp_tag_subcategory_depth'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'return_cat_depth'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> return_cat_depth<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Category</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">return</span> <span style="color: #000088;">$Category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">depth</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p>&#8230;once that&#8217;s added, shopp(&#8216;subcategory&#8217;, &#8216;depth&#8217;) can be used anywhere in the Shopp templates.</p>
<p><strong>Note:</strong> In Shopp 1.2 the hook is created differently. Thanks to Jon Davies for pointing out that the hook would now be shopp_themeapi_{object name}_{property} and defined in defined in shopp/api/theme.php.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2012/01/adding-category-depth-tag-to-shopp-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting subcategory totals [shopp(&#039;subcategory&#039;,&#039;total&#039;)] to work in Shopp Plugin 1.1.*</title>
		<link>http://myquickfix.co.uk/2012/01/getting-subcategory-totals-working-in-shopp/</link>
		<comments>http://myquickfix.co.uk/2012/01/getting-subcategory-totals-working-in-shopp/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 17:01:53 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Shopp Plugin]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=201</guid>
		<description><![CDATA[Problem: Pulling the total number of products from a subcat in Shopp doesn&#8217;t seem to work out the box. For example, this code WON&#8217;T return the total even though the correct tag shopp(&#8216;subcategory&#8217;,'total&#8217;) is used: &#60;?php while&#40;shopp&#40;'category','subcategories'&#41;&#41;: ?&#62; &#60;?php shopp&#40;'subcategory','name'&#41;; ?&#62; (&#60;?php shopp&#40;'subcategory','total'&#41;; ?&#62;) &#60;?php endwhile; ?&#62; Fix: For the products to be countable, the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> Pulling the total number of products from a subcat in Shopp doesn&#8217;t seem to work out the box. For example, this code WON&#8217;T return the total even though the correct tag <a href="http://docs.shopplugin.net/Category_Tags#total">shopp(&#8216;subcategory&#8217;,'total&#8217;)</a> is used:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'subcategories'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'subcategory'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> (<span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'subcategory'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>)
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Fix:</strong> For the products to be countable, the &#8216;<a href="http://docs.shopplugin.net/Category_Tags#has-products">hasproducts</a>&#8216; tag has to be called with the &#8216;load&#8217; option like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'subcategories'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'subcategory'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'hasproducts'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'load=prices,images'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'subcategory'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> (<span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'subcategory'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>)
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Note:</strong> The docs refer to &#8216;category&#8217; tags. Each category tag has an ideantical subcategory tag. For example <?php shopp('category','name'); ?> and <?php shopp('subcategory','name'); ?> both work when used in the correct context.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2012/01/getting-subcategory-totals-working-in-shopp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove prices from Variation drop-downs in Shopp WordPress plugin</title>
		<link>http://myquickfix.co.uk/2011/12/remove-prices-from-variation-drop-downs-in-shopp-wordpress-plugin/</link>
		<comments>http://myquickfix.co.uk/2011/12/remove-prices-from-variation-drop-downs-in-shopp-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 18:56:03 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Shopp Plugin]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=194</guid>
		<description><![CDATA[Problem: In Shopp (1.1.9) the default variations drop-down list shows prices. This isn&#8217;t always desired. This is the default usage: &#60;ul class=&#34;variations&#34;&#62; &#60;?php shopp&#40;'product', 'variations', 'mode=multiple&#38;label=true&#38;defaults=Select an option&#38;before_menu=&#60;li&#62;&#38;after_menu=&#60;/li&#62;'&#41;; ?&#62; &#60;/ul&#62; And this outputs a list that shows options as &#8220;Option Label (price)&#8221;. Fix: The code above can be replaced with this code to manually create [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> In Shopp (1.1.9) the default variations drop-down list shows prices. This isn&#8217;t always desired. This is the default usage:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;ul class=&quot;variations&quot;&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'variations'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mode=multiple&amp;label=true&amp;defaults=Select an option&amp;before_menu=&lt;li&gt;&amp;after_menu=&lt;/li&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;</pre></div></div>

<p>And this outputs a list that shows options as &#8220;Option Label (price)&#8221;.</p>
<p><strong>Fix:</strong> The code above can be replaced with this code to manually create the same thing, giving complete control over output:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;ul class=&quot;variations&quot;&gt;
    &lt;li&gt;
    &lt;label for=&quot;options-1&quot;&gt;Quantity&lt;/label&gt;
    &lt;select name=&quot;products[<span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>][options][]&quot; class=&quot;category-catalog product<span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> options&quot; id=&quot;options-1&quot;&gt;
    &lt;option value=&quot;&quot;&gt;Select an option&lt;/option&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'variations'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;option value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'product'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'variation'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'label'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/select&gt;
    &lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

<p>The $i;$i++ was a bit of a work-around as I couldn&#8217;t get it to work with variation ID, so if you know a better way, please tell us below!</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2011/12/remove-prices-from-variation-drop-downs-in-shopp-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Capture last viewed category in product view in Shopp Plugin for WordPress</title>
		<link>http://myquickfix.co.uk/2011/11/capture-last-viewed-category-in-product-view-in-shopp-plugin-for-wordpress/</link>
		<comments>http://myquickfix.co.uk/2011/11/capture-last-viewed-category-in-product-view-in-shopp-plugin-for-wordpress/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 20:38:51 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Shopp Plugin]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=190</guid>
		<description><![CDATA[Problem: I&#8217;m using the Shopp 1.1.9 ecommerce plugin for WordPress, and my client wanted to display specific background images while showing certain products. Shopp is very complete, but one thing that is missing in the current version &#8216;out of the box&#8217; is the ability to pull the &#8216;last viewed&#8217; category name when viewing a product. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> I&#8217;m using the <a href="https://shopplugin.net/" title="Shopp Plugin homepage" target="_blank">Shopp 1.1.9</a> ecommerce plugin for WordPress, and my client wanted to display specific background images while showing certain products. Shopp is very complete, but one thing that is missing in the current version &#8216;out of the box&#8217; is the ability to pull the &#8216;last viewed&#8217; category name when viewing a product. Obviously a product can belong to more than one cat, so it can&#8217;t know which one to display&#8230;</p>
<p><strong>Fix:</strong> There is however a breadcrumb template tag that stores the category name that a user us currently viewing, so that if they then click on a product, the hierarchical parent category can be displayed in the breadcrumb.</p>
<p>This functionality can be used in a new custom tag. Jon Davis the lead developer of Shopp helped me a lot today as I was barking up the wrong tree going about it the wrong way.</p>
<p>Add this to your theme&#8217;s functions.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shopp_tag_catalog_lastcat'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'get_last_cat'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> get_last_cat <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">,</span><span style="color: #000088;">$options</span><span style="color: #339933;">,</span><span style="color: #000088;">$Object</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$Storefront</span> <span style="color: #339933;">=</span> ShoppStorefront<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">===</span> <span style="color: #000088;">$Storefront</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$category</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$Storefront</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">breadcrumb</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$category</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then anywhere in your Shopp templates you can do this to return the category part of the current breadcrumb e.g &#8220;Smalls&#8221; in Home > Smalls > Purple Pants :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//echo it out straight away..</span>
shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'lastcat'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// return it for use..</span>
<span style="color: #000088;">$lastcat</span> <span style="color: #339933;">=</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'lastcat'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'return=true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Hope that helps someone, props go to JD for getting it working!</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2011/11/capture-last-viewed-category-in-product-view-in-shopp-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add &#8216;Related Products&#8217; to the Product Template in the Shopp WordPress Plugin</title>
		<link>http://myquickfix.co.uk/2011/10/add-related-products-to-the-product-template-in-the-shopp-wordpress-plugin/</link>
		<comments>http://myquickfix.co.uk/2011/10/add-related-products-to-the-product-template-in-the-shopp-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 20:44:48 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Shopp Plugin]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=157</guid>
		<description><![CDATA[Problem: Today I needed to add some code to a Shopp (ver 1.1.9) product.php template so that related products (that have same &#8216;Tag&#8217;) would show up at the bottom. The &#8216;Related Products&#8216; template tag was not behaving as I expected it to.. i.e. it was stopping the product page rendering anything at all. Fix: After chatting to some [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> Today I needed to add some code to a <a href="http://shopplugin.net/" target="_blank">Shopp</a> (ver 1.1.9) product.php template so that related products (that have same &#8216;Tag&#8217;) would show up at the bottom. The &#8216;<a href="http://docs.shopplugin.net/Catalog_Tags#related-products" target="_blank">Related Products</a>&#8216; template tag was not behaving as I expected it to.. i.e. it was stopping the product page rendering anything at all.</p>
<p><strong>Fix:</strong> After chatting to some of the support Mods on <a href="irc://irc.freenode.net:6667/shopp-mods" target="_blank">IRC</a> (thanks <a href="http://twitter.com/TheWebBaker" target="_blank">@TheWebBaker</a> and <a href="http://twitter.com/umargl0bal" target="_blank">@umargl0bal</a>, it seemed I might need to reset the category query (<a title="The catalog - category template tag docs" href="http://docs.shopplugin.net/Catalog_Tags#category" target="_blank">category</a> docs- see &#8216;reset&#8217; option) after calling &#8216;<a href="http://docs.shopplugin.net/Catalog_Tags#related-products" target="_blank">Related Products</a>&#8216;, but this didn&#8217;t work. I turns out (sort of obviously in hindsight) that the product query needed to be reset instead (<a title="The catalog - product template tag docs" href="http://docs.shopplugin.net/Catalog_Tags#product" target="_blank">product</a> docs &#8211; see &#8216;reset&#8217; option). Here&#8217;s some working code inside product.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'related-products'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'product'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'reset=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>That code can be placed anywhere in the <a title="Docs for Shopp product template file" href="http://docs.shopplugin.net/Product.php_template_file" target="_blank">product template</a> but it makes sense to put it at the beginning or end of the product listing.</p>
<p><strong>Tips:</strong></p>
<ul>
<li>If you want to show random products you can use the &#8216;order=random&#8217; option in the &#8216;related-products&#8217; tab (see below for an example).</li>
<li>If you want to limit the number of related products shown, use the &#8216;show=#&#8217; option also (see below for example).</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> shopp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'related-products'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'show=3&amp;order=random'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<ul>
<li>The related items will be rendered using the category.php template. If you want to create a custom template JUST for related items (you really do) then copy category.php as category-related.php and customise that. This new template file will be called to render the related products.</li>
</ul>
<div>Any Questions? Try me, or <a href="irc://irc.freenode.net:6667/shopp-mods" target="_blank">IRC</a> or the <a href="http://shopplugin.net/support/" target="_blank">Shopp Support</a> site <img src='http://myquickfix.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2011/10/add-related-products-to-the-product-template-in-the-shopp-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress replaces double and triple hyphens (&#8211; or &#8212;)</title>
		<link>http://myquickfix.co.uk/2011/09/wordpress-replaces-double-and-tripple-hyphens/</link>
		<comments>http://myquickfix.co.uk/2011/09/wordpress-replaces-double-and-tripple-hyphens/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 00:48:07 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=71</guid>
		<description><![CDATA[Problem: The other day I was trying to type two hypens (&#8211;) in a post, and when I saved/published the post, WordPress reformatted the hypens to display as an &#8216;en dash&#8216; (–). More Info: After some searching about, and some helpful info provided in the WordPress Codex, I found out about a WP function called &#8216;wptexturize&#8217; which is applied each [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> The other day I was trying to type two hypens (&#8211;) in a post, and when I saved/published the post, WordPress reformatted the hypens to display as an &#8216;<a href="http://web.archive.org/web/20090227112339/http://en.wikipedia.org/wiki/Dash#En_dash">en dash</a>&#8216; (–).</p>
<p><strong>More Info:</strong> After some searching about, and some helpful info provided in the <a href="http://web.archive.org/web/20090227112339/http://codex.wordpress.org/">WordPress Codex</a>, I found out about a WP function called <a href="http://web.archive.org/web/20090227112339/http://codex.wordpress.org/Function_Reference/wptexturize">&#8216;wptexturize&#8217;</a> which is applied each time a post is rendered. The function &#8211; which can be found in &#8216;wp-includes/formatting.php&#8217; &#8211; replaces quite a few things, like &#8482; to ™ etc.</p>
<p><strong>Fix:</strong> You could stop this happening a number of ways i.e. editing the function to stop it doing the replace altogether, or install a plugin that does it (maybe <a href="http://web.archive.org/web/20090227112339/http://wordpress.org/extend/plugins/wp-unformatted/">this one</a>, haven&#8217;t tried it!). I decided to use WordPress&#8217;s <a href="http://web.archive.org/web/20090227112339/http://codex.wordpress.org/Function_Reference/remove_filter">remove_filter</a> function to stop the reformatting taking place.</p>
<p>To do this, open the &#8216;functions.php&#8217; file within your theme. If one does not exist, create it.</p>
<p>Add the following code to the bottom of the file, taking care not to end up with too many or too few &lt;?php tags:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
remove_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wptexturize'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
remove_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wptexturize'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Then save the file (or &#8216;update&#8217; if you&#8217;re doing this via the theme editor in WP admin) and view your post. That should do it! (proof is here, you can only see those double and triple hyphens in this blog post title because I&#8217;ve just added the code above to this sites functions.php also!)</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2011/09/wordpress-replaces-double-and-tripple-hyphens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add ‘Drafts’ sorting to Shopp Products list</title>
		<link>http://myquickfix.co.uk/2011/09/add-%e2%80%98drafts%e2%80%99-sorting-to-shopp-products-list/</link>
		<comments>http://myquickfix.co.uk/2011/09/add-%e2%80%98drafts%e2%80%99-sorting-to-shopp-products-list/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 23:41:23 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Shopp Plugin]]></category>

		<guid isPermaLink="false">http://myquickfix.co.uk/?p=53</guid>
		<description><![CDATA[Problem: There is no ‘drafts’ view filter in the Shopp (&#62;1.1.9) Product Manager, i.e you can&#8217;t quickly list all the products that have &#8216;draft&#8217; status in one go. Fix: I made this mod to answer a question in the Shopp Helpdesk forum, it’s not very tested, but seems to work perfectly! Open ‘wp-content/plugins/shopp/core/flow/Warehouse.php’ and replace [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> There is no ‘drafts’ view filter in the <a title="Link to Shopp ecommerce plugin for WordPress" href="http://shopplugin.net" target="_blank">Shopp</a> (&gt;1.1.9) Product Manager, i.e you can&#8217;t quickly list all the products that have &#8216;draft&#8217; status in one go.</p>
<p><strong>Fix:</strong> I made this mod to answer a question in the Shopp Helpdesk forum, it’s not very tested, but seems to work perfectly!</p>
<p>Open ‘wp-content/plugins/shopp/core/flow/Warehouse.php’ and replace this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>198
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$subfilters</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'f'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'featured'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'p'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'published'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'s'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'onsale'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'i'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'inventory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>With this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>198
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$subfilters</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'f'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'featured'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'p'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'published'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'d'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'draft'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'s'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'onsale'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'i'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'inventory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Then in the same file replace this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>199
200
201
202
203
204
205
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$subs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
<span style="color: #0000ff;">'all'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'All'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'published'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Published'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pd.status='publish'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'p'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'onsale'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'On Sale'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pt.sale='on'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'featured'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Featured'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pd.featured='on'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'f'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'inventory'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Inventory'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pt.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pt.inventory='on' AND pt.type!='N/A'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'grouping'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'pt.id'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'i'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>With this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>199
200
201
202
203
204
205
206
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$subs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
<span style="color: #0000ff;">'all'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'All'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'published'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Published'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pd.status='publish'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'p'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'draft'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Draft'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pd.status='draft'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'onsale'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'On Sale'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pt.sale='on'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'featured'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Featured'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pd.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pd.featured='on'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'f'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'inventory'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Inventory'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Shopp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'total'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'columns'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;count(distinct pt.id) AS total&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'where'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;pt.inventory='on' AND pt.type!='N/A'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'grouping'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'pt.id'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'request'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'i'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Hopefully this will be included in a future version of Shopp.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/2011/09/add-%e2%80%98drafts%e2%80%99-sorting-to-shopp-products-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

