<?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>Data-Diggers.com &#187; Zen Cart</title>
	<atom:link href="http://www.data-diggers.com/index.php/tag/zen-cart/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.data-diggers.com</link>
	<description>Zen Cart Optimization, Performance and A/B Split Testing Modules for Zen Cart</description>
	<lastBuildDate>Mon, 24 May 2010 18:56:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Randomized Tests version 1.3</title>
		<link>http://www.data-diggers.com/index.php/2009/11/randomized-tests-version-1-3/</link>
		<comments>http://www.data-diggers.com/index.php/2009/11/randomized-tests-version-1-3/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 10:05:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[A/B Split Tests]]></category>
		<category><![CDATA[Utils]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=77</guid>
		<description><![CDATA[
			
				
			
		
Randomized tests version 1.3 is here (download). This release brings quite few new features that should be very helpful. I added 95% trust intervals for each statistic. There&#8217;s also probability that given experiment will beat control group. You can now also decide when impression occurs. Read below for more.
Installation
Refer to INSTALL.txt in .zip file.
If You [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F11%2Frandomized-tests-version-1-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F11%2Frandomized-tests-version-1-3%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">Randomized tests version 1.3 is here (<a href="http://www.data-diggers.com/contribs/rt/downloads/rt.zip">download</a>). This release brings quite few new features that should be very helpful. I added 95% trust intervals for each statistic. There&#8217;s also probability that given experiment will beat control group. You can now also decide when impression occurs. Read below for more.</p>
<h2 style="text-align: justify;">Installation</h2>
<p style="text-align: justify;">Refer to <em>INSTALL.txt</em> in .zip file.</p>
<p style="text-align: center;"><strong><span style="text-decoration: underline;">If You already have RT installed refer to<em> INSTALL.txt</em> file for UPGRADE instructions.</span></strong></p>
<h2 style="text-align: justify;">Trust intervals</h2>
<p style="text-align: justify;">Randomized Tests provides few estimates:</p>
<ul style="text-align: justify;">
<li>order conversion rate</li>
<li>visitor to customer conversion rate</li>
<li>total items bought</li>
<li>total order value</li>
</ul>
<p style="text-align: justify;">You have to remember that RT presents only estimated values &#8211; for example after tracking ten orders RT might calculate that order conversion rate is 0.9%, but You&#8217;re almost sure (because You know that from earlier experiments) that Your conversion rate is 1.1%. Unfortunately RT can&#8217;t do much better since it hasn&#8217;t collected enough data yet. In new version RT will however present also 95% chance intervals for each estimated value. So now instead of conversion rate 0.9% You&#8217;ll see 0.9% +/- 0.2% which means that there&#8217;s 95% chance that true conversion rate is between 1.1% and 0.7%.</p>
<h2 style="text-align: justify;">Chance to beat Control Group</h2>
<p style="text-align: justify;">Previous versions of RT leaved to You decision if changes You made were actually useful. In version 1.3 RT will give You probability that those changes outpeform original version of Your Zen Cart store. RT displays now &#8216;Chance to Beat Original&#8217; value. This value should be around 95% or 5% before You decide that new version perform better/worse then original version of Your store.</p>
<h2 style="text-align: justify;">Custom impression detection functions</h2>
<p style="text-align: justify;">This new feature lets You decide if and when to include particular visitor in experiment. You might want for example test performance of Your new customer registration form and include in experiment only those visitors who actually visited customer registration form. Thanks to that You&#8217;ll get more accurate results very quickly.</p>
<p style="text-align: justify;">There will be separate post about this new feature &#8211; so stay tuned <img src='http://www.data-diggers.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2 style="text-align: justify;">Download</h2>
<p style="text-align: justify;">You can download latests release of RT here:</p>
<p style="text-align: center;"><a href="http://www.data-diggers.com/contribs/rt/downloads/rt.zip">www.data-diggers.com/contribs/rt/downloads/rt.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/11/randomized-tests-version-1-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New feature in upcoming version of Randomized Tests</title>
		<link>http://www.data-diggers.com/index.php/2009/10/new-feature-in-upcoming-version-of-randomized-tests/</link>
		<comments>http://www.data-diggers.com/index.php/2009/10/new-feature-in-upcoming-version-of-randomized-tests/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 20:14:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[A/B Split Tests]]></category>
		<category><![CDATA[Utils]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=75</guid>
		<description><![CDATA[
			
				
			
		
Yeah, I&#8217;m not dead. I don&#8217;t have much time but I still work on my modules. I spent most time on Randomized Tests module &#8211; sorry to all people counting on new Query Cache version  . In upcoming release of Randomized Tests You&#8217;ll be able to:

decide whether or not impression occurred (and when it [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F10%2Fnew-feature-in-upcoming-version-of-randomized-tests%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F10%2Fnew-feature-in-upcoming-version-of-randomized-tests%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">Yeah, I&#8217;m not dead. I don&#8217;t have much time but I still work on my modules. I spent most time on Randomized Tests module &#8211; sorry to all people counting on new Query Cache version <img src='http://www.data-diggers.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . In upcoming release of Randomized Tests You&#8217;ll be able to:</p>
<ul style="text-align: justify;">
<li>decide whether or not impression occurred (and when it happened). For example, You want to count in experiment only visitors that viewed &#8216;login&#8217; page. Now You can <img src='http://www.data-diggers.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>get more accurate results. Experiment stats view in Admin area will give You probability that given test group will beat control group. All stats will be also presented with 95% probability range. For example visitor/customer conversion ratio will be presented as: 1% +/- 0.02% which mean that conversion ratio is in [0.98%, 1.02%] with 95% probability.</li>
<li>maybe more&#8230; for example support for Your own statistics (like &#8217;search form usage stats&#8217;, &#8216;contact us page stats&#8217; etc).</li>
</ul>
<p style="text-align: justify;">Would You like to see more features in next version? Let me know through comments / mail.</p>
<p style="text-align: justify;">Sorry, multivariate testing will probably not be included in upcoming version. I&#8217;ll add support for it most probably in next next version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/10/new-feature-in-upcoming-version-of-randomized-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Randomized Tests V1.2 for Zen Cart Released</title>
		<link>http://www.data-diggers.com/index.php/2009/07/randomized-tests-v1-2-for-zen-cart-released/</link>
		<comments>http://www.data-diggers.com/index.php/2009/07/randomized-tests-v1-2-for-zen-cart-released/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 12:08:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[A/B Split Tests]]></category>
		<category><![CDATA[Utils]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=73</guid>
		<description><![CDATA[
			
				
			
		
New version of Randomized Tests for Zen Cart is available. New version introduces few bug fixes and one very important feature &#8211; orders filters and customer filter. Order/Customer filters can be used to dynamically remove (not permanently) from statistics certain customers/orders and recalculate statistics without them. Why is it important?
Let&#8217;s assume that You have store [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Frandomized-tests-v1-2-for-zen-cart-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Frandomized-tests-v1-2-for-zen-cart-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">New version of <strong>Randomized Tests for Zen Cart</strong> is available. New version introduces few bug fixes and one very important feature &#8211; orders filters and customer filter. Order/Customer filters can be used to dynamically remove (not permanently) from statistics certain customers/orders and recalculate statistics without them. Why is it important?</p>
<p style="text-align: justify;">Let&#8217;s assume that You have store with many customers. You use <strong>Randomized Tests</strong> to check how new layout affects sales. Unfortunately after You run Your experiment for few days You notice that one group is biased because it includes one or two top buyers. Those two buyers are different from regular customer &#8211; they buy a lot of items, place orders every few days and probably aren&#8217;t affected by new layout &#8211; they already know Your store and don&#8217;t care about it as long as they can place orders.</p>
<p style="text-align: justify;">Group containing these customers is biased since it includes data outliers. You probably would like to remove them from statistics. New version of <strong>Randomized Tests</strong> can do that using filter functions. Currently there are two types of filter functions:</p>
<ul style="text-align: justify;">
<li><strong>order filter functions</strong> &#8211; executed for each order in group &#8211; allows removal certain orders from statistics.</li>
<li><strong>customer filter functions</strong> &#8211; executed for each customer in group. Orders from rejected customers will not included in statistics.</li>
</ul>
<p style="text-align: justify;">Randomized Tests V1.2 contain two sample filter functions:</p>
<ul style="text-align: justify;">
<li><em><strong>ddigers_2std_customer_total_rt_cff()</strong></em> &#8211; removes top buyers (formally &#8211; customers with total spent in 2+ standard deviation from average) from statistics.</li>
<li><em><strong>ddigers_2std_order_total_rt_off()</strong></em> &#8211; removes super big orders from statistics.</li>
</ul>
<p style="text-align: justify;">To check how they&#8217;re implemented view <strong><em>admin/includes/functions/extra_functions/randomized_tests.php</em></strong></p>
<p style="text-align: justify;">You can implement Your own functions by following below pattern.</p>
<h2 style="text-align: justify;"><strong>Custom Customer Filter Functions</strong></h2>
<p style="text-align: justify;">Randomized Tests will recognize any function with name ending with &#8220;_rt_cff&#8221; as customer filter function and allow You to use it. For example following function will be recognized as filter:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">function</span> customer_filter_rt_cff<span class="br0">&#40;</span><span class="re0">$customer_id</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$cid</span> <span class="sy0">==</span> 12345<span class="br0">&#41;</span> <span class="kw1">return</span><span class="br0">&#40;</span><span class="kw4">FALSE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span> <span class="kw1">return</span><span class="br0">&#40;</span><span class="kw4">TRUE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
<p style="text-align: justify;">Randomized Tests passes to customer filter functions single attribute &#8211; id of customer in database. If function returns <em><strong>TRUE </strong></em>customer is accepted in calculation of statistics, and is rejected otherwise.</p>
<h2 style="text-align: justify;"><strong>Order Filter Functions</strong></h2>
<p style="text-align: justify;">Order filter functions are similar to customer filter functions &#8211; any function with name ending with &#8220;_rt_off&#8221; will be recognized as order filter function. Example filter function:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">function</span> order_filter_rt_off<span class="br0">&#40;</span><span class="re0">$eid</span><span class="sy0">,</span> <span class="re0">$gid</span><span class="sy0">,</span> <span class="re0">$cid</span><span class="sy0">,</span> <span class="re0">$oid</span><span class="sy0">,</span> <span class="re0">$itemsBought</span><span class="sy0">,</span> <span class="re0">$ordersTotal</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$orderTotal</span> <span class="sy0">&gt;</span> 1000<span class="sy0">.</span>0<span class="br0">&#41;</span> <span class="kw1">return</span><span class="br0">&#40;</span><span class="kw4">FALSE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span> <span class="kw1">return</span><span class="br0">&#40;</span><span class="kw4">TRUE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
<p style="text-align: justify;">Randomized Tests passes few more parameters to order filter functions:</p>
<ul style="text-align: justify;">
<li><strong>$eid</strong> &#8211; experiment row id in database</li>
<li><strong>$gid</strong> &#8211; group row id in database</li>
<li><strong>$cid</strong> &#8211; customer id in database</li>
<li><strong>$oid</strong> &#8211; order id in database</li>
<li><strong>$itemsBought</strong> &#8211; number of items in order</li>
<li><strong>$totalValue</strong> &#8211; total value of order</li>
</ul>
<p style="text-align: justify;">As with customer filter functions order filter functions should return <em><strong>TRUE </strong></em>to accept order in statistics and <em><strong>FALSE </strong></em>to reject it.</p>
<h2 style="text-align: justify;">Making Filter Functions Visible to Randomized Tests Module</h2>
<p style="text-align: justify;">Let&#8217;s assume that You&#8217;ve placed Your custom filter functions in <em><strong>admin/includes/functions/extra_functions/my_custom_filters.php</strong></em> file. The best way to make them visible to RandomizedTests is to include the file through autoloaders interface. Create <em>config.filters.php</em> file in <em><strong>admin/includes/auto_loaders/</strong></em> and paste there:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="re0">$autoLoadConfig</span><span class="br0">&#91;</span>180<span class="br0">&#93;</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">&#8216;autoType&#8217;</span><span class="sy0">=&amp;</span>gt<span class="sy0">;</span><span class="st_h">&#8216;require&#8217;</span><span class="sy0">,</span><br />
<span class="st_h">&#8216;loadFile&#8217;</span><span class="sy0">=&amp;</span>gt<span class="sy0">;</span> DIR_FS_CATALOG <span class="sy0">.</span> DIR_WS_FUNCTIONS <span class="sy0">.</span> <span class="st_h">&#8216;extra_functions/my_custom_filters.php&#8217;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
</div>
<p style="text-align: justify;">That&#8217;s it &#8211; Randomized Tests module will now be able to use Your filters.</p>
<h2 style="text-align: justify;">Screenshot</h2>
<p style="text-align: justify;">Here&#8217;s screenshot of experiment with applied filters:</p>
<p style="text-align: center;"><a rel="lightbox" href="http://www.data-diggers.com/contribs/rt/images/experiment_stats_demo.jpg"> <img src="http://www.data-diggers.com/contribs/rt/images/experiment_stats_demo.jpg" alt="" width="500" height="109" /> </a></p>
<h2 style="text-align: justify;">Download</h2>
<p style="text-align: justify;">You can download current version of Randomized Tests <a href="http://www.data-diggers.com/contribs/rt/downloads/rt.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/07/randomized-tests-v1-2-for-zen-cart-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Randomized Tests v1.0 Released</title>
		<link>http://www.data-diggers.com/index.php/2009/07/randomized-tests-v1-0-released/</link>
		<comments>http://www.data-diggers.com/index.php/2009/07/randomized-tests-v1-0-released/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 13:38:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[A/B Split Tests]]></category>
		<category><![CDATA[Utils]]></category>
		<category><![CDATA[UTI]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=71</guid>
		<description><![CDATA[
			
				
			
		
This module allows You to perform experiments on Your website. You can test for example how Your new &#8216;Add to Cart&#8217; button performs compared to old one.
I don&#8217;t have much time to write long post, so I&#8217;ll cut it to most important things. You can download the module here. This module requires UTI to work [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Frandomized-tests-v1-0-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Frandomized-tests-v1-0-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">This module allows You to perform experiments on Your website. You can test for example how Your new &#8216;Add to Cart&#8217; button performs compared to old one.</p>
<p style="text-align: justify;">I don&#8217;t have much time to write long post, so I&#8217;ll cut it to most important things. You can <a href="http://www.data-diggers.com/contribs/rt/downloads/rt.zip">download the module here</a>. This module requires UTI to work properly (<a href="http://www.data-diggers.com/content/user-tracking-interface-v10-released">download it here</a> ). Installation instructions are in .zip file. Here&#8217;s how You can use it.</p>
<p style="text-align: justify;">To create experiment follow these steps:</p>
<ol style="text-align: justify;">
<li>Go to Admin-&gt;Tools-&gt;[RT] Groupsets.</li>
<li>Create groupset (it&#8217;s set of groups). Call it &#8216;Basic Test Groupset&#8217;.</li>
<li>Click on Basic Test Groupset &#8211; You will be forwarded to page where You can edit it.</li>
<li>Each groupset must have EXACTLY one control group. I usually call it &#8216;Control Group&#8217;. Create two groups (you can create as many groups in groupset as You want, but for simplicity We use 2 now):</li>
<li>Control Group &#8211; with id &#8216;cg&#8217; (as ControlGroup). Check &#8216;control group&#8217; checkbox</li>
<li>Test Group &#8211; with id &#8216;tg&#8217;. DO NOT check &#8216;control group&#8217; checkbox.</li>
<li>Go to Admin-&gt;Tools-&gt;[RT] Experiments.</li>
<li>Create Experiment &#8216;Exp #1&#8242; using groupset &#8216;Basic Test Groupset&#8217;.</li>
</ol>
<p style="text-align: justify;">Click on Exp #1 &#8211; You will be forwarded to its stats:</p>
<ul style="text-align: justify;">
<li><strong>Impressions </strong>- in this version of Randomized Tests its simply number of visitors in each group</li>
<li><strong>Customers Registered</strong> &#8211; (visitor to customer conversion rate) / (change in regard to control group) / (total count of newly registered customers in this group)</li>
<li><strong>Orders Placed</strong> &#8211; (visitor to order conversion rate) / as above / (total number of orders visitors in this group placed)</li>
<li><strong>Items Bought</strong> &#8211; (avg. size of order) / as above / (total number of items bought)</li>
<li><strong>Orders Value</strong> &#8211; (avg. order value) / as above / (total orders value)</li>
</ul>
<p style="text-align: justify;">Ok, You&#8217;ve created experiment, now You have to create two versions of Your page. Let&#8217;s assume that You want to change &#8216;Add to Cart&#8217; button on product_info page. Edit <em><strong>includes/templates/your_template/templates/tpl_product_info_display.php</strong></em>.Find code responsible for displaying &#8216;Add to Cart&#8217; button &#8211; in my case it&#8217;s:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw1">echo</span> <span class="re0">$display_button</span><span class="sy0">;</span></div>
</div>
</div>
<p style="text-align: justify;">Change it to:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$exp</span><span class="sy0">-&gt;</span><span class="me1">groupID</span> <span class="sy0">==</span> <span class="st_h">&#8216;tg&#8217;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// visitor has been assigned to Test Group</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">echo</span> <span class="re0">$display_my_new_button</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// user is in Control Group &#8211; We don&#8217;t change anything</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">echo</span> <span class="re0">$display_button</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
<p style="text-align: justify;"><em><strong>$exp</strong></em> is global variable (it&#8217;s instance of <strong>ExperimentManager</strong> defined in <em>includes/classes/randomized_tests.php</em>) and holds basic information about experiment and group to which has been assigned current visitor<br />
<em><strong>$exp-&gt;groupID</strong></em> is &#8216;<strong>id</strong>&#8216; of group that You assigned in step 4. You can use it to detect in which group is current visitor and perform custom action.</p>
<p style="text-align: justify;">You&#8217;re done. Wait until experiment becomes statistically significant ( &gt;2000 visitors in each group, many orders ) and check results.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/07/randomized-tests-v1-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User Tracking Interface v1.0 Released</title>
		<link>http://www.data-diggers.com/index.php/2009/07/user-tracking-interface-v1-0-released/</link>
		<comments>http://www.data-diggers.com/index.php/2009/07/user-tracking-interface-v1-0-released/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 21:07:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[UTI]]></category>
		<category><![CDATA[Utils]]></category>
		<category><![CDATA[User Tracking Interface]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=68</guid>
		<description><![CDATA[
			
				
			
		
UTI is tiny module that tracks visitors to Zen Cart site even if they aren&#8217;t logged in or even never created any account. It allows developers to keep in UTI memory small amounts of information about each visitor. For example, UTI can be used to store list of recently viewed products by any particular user. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Fuser-tracking-interface-v1-0-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Fuser-tracking-interface-v1-0-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;"><strong>UTI </strong>is tiny module that tracks visitors to Zen Cart site even if they aren&#8217;t logged in or even never created any account. It allows developers to keep in UTI memory small amounts of information about each visitor. For example, <strong>UTI </strong>can be used to store list of recently viewed products by any particular user. <strong>UTI </strong>will remember this information and when the visitor will come back to Zen Cart store week later <strong>UTI </strong>will recognize him and present list of previously viewed products.</p>
<p style="text-align: justify;"><strong>UTI </strong>takes care of:</p>
<ul style="text-align: justify;">
<li>recognizing visitors &#8211; even if they never created any account</li>
<li>storing and retrieving information about them in database</li>
</ul>
<p style="text-align: justify;"><strong>UTI </strong>does not store any personal information in visitors browser.</p>
<h2 style="text-align: justify;">How to use UTI</h2>
<p style="text-align: justify;"><strong>UTI</strong> is very simple class. It creates global <em><strong>$uti </strong></em>object that contains all information about current visitor. From developer point of view <strong>UTI </strong>class has four methods:</p>
<ul style="text-align: justify;">
<li><em>$uti-&gt;set($name, $value) </em>- stores in database <em>$value</em> as value for attribute <em>$name</em></li>
<li><em>$uti-&gt;get($name)</em> &#8211; retrieves from database value for attribute<em> $name</em>. If there&#8217;s no such attribute<em> </em>method returns <em>FALSE</em>.</li>
<li><em>$uti-&gt;has($name)</em> &#8211; checks if current <strong>$uti</strong> object has attribute <em>$name</em> set</li>
<li><em>$uti-&gt;delete($name)</em> &#8211; deletes attribute.</li>
</ul>
<p style="text-align: justify;"><em><strong>$uti</strong></em> is automatically instantiated through <em>auto_loaders/ </em>mechanism. Developer can use it in any function/class since it&#8217;s global variable.</p>
<p style="text-align: justify;">To show how easy it is to use <strong>UTI </strong>and what it can be used for I&#8217;ve created simple contributions that:</p>
<ul style="text-align: justify;">
<li>records and displays in sidebox list of products visitor viewed recently.</li>
<li>records and displays in sidebox list of searches visitor performed recently.</li>
<li>records when visitor changes currency and saves it as his/hers default. When visitor comes back to Zen Cart contribution automatically switches currency to most recent one.</li>
</ul>
<p style="text-align: justify;">Example contributions are included in UTI package. You can download it here: <a href="http://www.data-diggers.com/contribs/uti/downloads/uti-current.zip">current version of UTI</a>.</p>
<p style="text-align: justify;">In next blog post I&#8217;ll describe how I&#8217;ve created one of those contributions using <strong>UTI</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/07/user-tracking-interface-v1-0-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Need Testers For User Tracking Interface Module</title>
		<link>http://www.data-diggers.com/index.php/2009/07/need-testers-for-user-tracking-interface-module/</link>
		<comments>http://www.data-diggers.com/index.php/2009/07/need-testers-for-user-tracking-interface-module/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 13:13:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[UTI]]></category>
		<category><![CDATA[Utils]]></category>
		<category><![CDATA[User Tracking Interface]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=65</guid>
		<description><![CDATA[
			
				
			
		
I&#8217;ve created User Tracking Interface (UTI) module for Zen Cart v1.3.8 which recognizes visitors (even if they are not logged in or don&#8217;t have account) and stores simple bits of information about them in database. You can use UTI to store such information as favorite currency of each visitor, recently viewed products by particular visitor [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Fneed-testers-for-user-tracking-interface-module%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F07%2Fneed-testers-for-user-tracking-interface-module%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">I&#8217;ve created<strong> User Tracking Interface</strong> (<strong>UTI</strong>) module for Zen Cart v1.3.8 which recognizes visitors (even if they are not logged in or don&#8217;t have account) and stores simple bits of information about them in database. You can use <strong>UTI </strong>to store such information as favorite currency of each visitor, recently viewed products by particular visitor or recently searched products. The best thing is that even if the visitor will leave Your site and will come back later <strong>UTI </strong>will recognize him/her and will set site to his/hers preferences.</p>
<p style="text-align: justify;">You can test it Yourself on demo store here:</p>
<p style="text-align: justify;"><a href="http://www.data-diggers.com/contribs/uti/demo-stores/with-uti/">www.data-diggers.com/contribs/uti/demo-stores/with-uti/</a></p>
<h2 style="text-align: justify;">How to test it</h2>
<ol style="text-align: justify;">
<li>View some products (4-6). The module will remember which items You viewed and will present them in sidebox.</li>
<li>Search for some stuff like &#8220;mouse&#8221;, &#8220;unreal&#8221;, &#8220;mary&#8221;. The module will remember what You searched for and will present links to previous searches in sidebox.</li>
<li>Change currency. The module will remember Your last currency and when You&#8217;ll be back next day/week/month the site will display with Your currency set.</li>
<li>Close down Your browser and switch to different one. Visit above site again. The system will recognize You and adjust site to Your preferences.</li>
</ol>
<h2 style="text-align: justify;">What UTI is really for</h2>
<p style="text-align: justify;">Recently viewed products, recent search terms and user default currency are nice features, but they are just examples of use of <strong>UTI</strong>. <strong>UTI </strong>is simple class which developers can use to make user aware contributions. <strong>UTI </strong>takes care of recognizing users and storing/retrieving information about them in/from database. <strong>UTI </strong>attaches itself to Zen Cart on each request and creates $uti variable which developers can use to store simple information about visitors in database.</p>
<h2 style="text-align: justify;">How to use UTI</h2>
<p style="text-align: justify;"><strong>UTI </strong>has very simple interface. Developer should use only two methods:</p>
<ul style="text-align: justify;">
<li><em>$uti-&gt;get($attribute) </em>- retrieves visitors value for $attribute from database</li>
<li><em>$uti-&gt;set($attribute, $value)</em> &#8211; store visitors value for $attribute in database</li>
</ul>
<p style="text-align: justify;">Developer does not have to worry about creating $uti object. $uti object will automatically recognize user and will retrieve all information about him from database.</p>
<h2 style="text-align: justify;">What UTI can be used for</h2>
<p style="text-align: justify;"><strong>UTI </strong>is tool which can be used to create very simple contributions, for example:</p>
<ul style="text-align: justify;">
<li>remembering language of given visitor. On his next visit site can be automatically switched to preferred language.</li>
<li>presenting recommendations to visitor based on his previous purchases (even if visitor isn&#8217;t logged in).</li>
<li>many more.</li>
</ul>
<h2 style="text-align: justify;">What I need from You</h2>
<p style="text-align: justify;">Please test above site and report any bugs. You can also install current version of <strong>UTI </strong>on Your site and report any bugs. You can download current version of <strong>UTI </strong>here:</p>
<p style="text-align: justify;"><a href="http://www.data-diggers.com/contribs/uti/downloads/uti-current.zip">www.data-diggers.com/contribs/uti/downloads/uti-current.zip</a></p>
<p style="text-align: justify;">Installation instructions are in uti-current.zip</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/07/need-testers-for-user-tracking-interface-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed up admin/orders.php page</title>
		<link>http://www.data-diggers.com/index.php/2009/06/speed-up-adminorders-php-page/</link>
		<comments>http://www.data-diggers.com/index.php/2009/06/speed-up-adminorders-php-page/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 05:38:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=62</guid>
		<description><![CDATA[
			
				
			
		
There&#8217;s suboptimal query in admin/orders.php page which retrieves information about last orders. Unfortunately query is constructed in such way that MySQL scans whole orders, orders_products and orders_total table. As always it&#8217;s not a problem until orders table gets big ( for example 50 000 entries ). If You happen to have at least 10 000 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fspeed-up-adminorders-php-page%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fspeed-up-adminorders-php-page%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">There&#8217;s suboptimal query in admin/orders.php page which retrieves information about last orders. Unfortunately query is constructed in such way that MySQL scans whole orders, orders_products and orders_total table. As always it&#8217;s not a problem until orders table gets big ( for example 50 000 entries ). If You happen to have at least 10 000 orders ( I wish You that <img src='http://www.data-diggers.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ), You probably get impatient each time You request admin/orders.php page.</p>
<p style="text-align: justify;">Good news is that there is quick fix. Just add index on (orders_id, class) on orders_total table to speed up the query. Here&#8217;s MySQL statement which does that for You:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">ALTER</span> <span class="kw1">TABLE</span> orders_total <span class="kw1">ADD</span> <span class="kw1">INDEX</span> idx_oid_class<span class="br0">&#40;</span>orders_id<span class="sy0">,</span> class<span class="br0">&#41;</span></div>
</div>
</div>
<p style="text-align: justify;">The query is still suboptimal, but at least its quite fast until orders table gets really big (500 000 orders? It&#8217;ll depend on Your server).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/06/speed-up-adminorders-php-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance issues with Store Credit Module in admin area</title>
		<link>http://www.data-diggers.com/index.php/2009/06/performance-issues-with-store-credit-module-in-admin-area/</link>
		<comments>http://www.data-diggers.com/index.php/2009/06/performance-issues-with-store-credit-module-in-admin-area/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:34:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[store credit]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=55</guid>
		<description><![CDATA[
			
				
			
		
Store Credit is great module, unfortunately it&#8217;s preety inefecient in some places. For example, on every page request of admin/store_credit.php whole customers table is read, and for each customer additional SELECT and UPDATE query is executed to calculate and update pending points, even if the customer does not have any pending points!
It&#8217;s not a big deal [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fperformance-issues-with-store-credit-module-in-admin-area%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fperformance-issues-with-store-credit-module-in-admin-area%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;"><strong>Store Credit</strong> is great module, unfortunately it&#8217;s preety inefecient in some places. For example, on every page request of<em> admin/store_credit.php</em> whole customers table is read, and for each customer additional SELECT and UPDATE query is executed to calculate and update pending points, even if the customer does not have any pending points!</p>
<p style="text-align: justify;">It&#8217;s not a big deal when You have up to 1000 customers, but when there are more then 100 000 customers page loads in 30 seconds (store_credit.php executes over 2 x customer count,  or in this example over 200 000 queries on each request).</p>
<p style="text-align: justify;">To address that, change following code in admin/store_credit.php:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">function</span> store_pending_rewards<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">global</span> <span class="re0">$db</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$customers</span> <span class="sy0">=</span> <span class="re0">$db</span><span class="sy0">-&gt;</span><span class="me1">Execute</span><span class="br0">&#40;</span><span class="st0">&quot;SELECT customers_id FROM &quot;</span> <span class="sy0">.</span> TABLE_CUSTOMERS <span class="sy0">.</span> <span class="st0">&quot; ORDER BY customers_id ASC&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$customers</span><span class="sy0">-&gt;</span><span class="me1">EOF</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$customers_id</span> <span class="sy0">=</span> <span class="re0">$customers</span><span class="sy0">-&gt;</span><span class="me1">fields</span><span class="br0">&#91;</span><span class="st_h">&#8216;customers_id&#8217;</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$pending_rewards</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">get_pending_rewards</span><span class="br0">&#40;</span><span class="re0">$customers_id</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$db</span><span class="sy0">-&gt;</span><span class="me1">Execute</span><span class="br0">&#40;</span><span class="st0">&quot;UPDATE &quot;</span> <span class="sy0">.</span> TABLE_STORE_CREDIT <span class="sy0">.</span> <span class="st0">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET pending = &quot;</span> <span class="sy0">.</span> <span class="re0">$pending_rewards</span> <span class="sy0">.</span> <span class="st0">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE customers_id = &quot;</span> <span class="sy0">.</span> <span class="re0">$customers_id</span> <span class="sy0">.</span> <span class="st0">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LIMIT 1&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$customers</span><span class="sy0">-&gt;</span><span class="me1">MoveNext</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
<p style="text-align: justify;">to:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">function</span> store_pending_rewards<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">global</span> <span class="re0">$db</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$customers</span> <span class="sy0">=</span> <span class="re0">$db</span><span class="sy0">-&gt;</span><span class="me1">Execute</span><span class="br0">&#40;</span><span class="st0">&quot;SELECT DISTINCT customers_id FROM &quot;</span> <span class="sy0">.</span> TABLE_SC_REWARD_POINT_LOGS <span class="sy0">.</span> <span class="st0">&quot; ORDER BY customers_id ASC&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$customers</span><span class="sy0">-&gt;</span><span class="me1">EOF</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$customers_id</span> <span class="sy0">=</span> <span class="re0">$customers</span><span class="sy0">-&gt;</span><span class="me1">fields</span><span class="br0">&#91;</span><span class="st_h">&#8216;customers_id&#8217;</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$pending_rewards</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">get_pending_rewards</span><span class="br0">&#40;</span><span class="re0">$customers_id</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$pending_rewards</span> <span class="sy0">==</span> 0<span class="sy0">.</span>0<span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$customers</span><span class="sy0">-&gt;</span><span class="me1">MoveNext</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="kw1">continue</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$db</span><span class="sy0">-&gt;</span><span class="me1">Execute</span><span class="br0">&#40;</span><span class="st0">&quot;UPDATE &quot;</span> <span class="sy0">.</span> TABLE_STORE_CREDIT <span class="sy0">.</span> <span class="st0">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET pending = &quot;</span> <span class="sy0">.</span> <span class="re0">$pending_rewards</span> <span class="sy0">.</span> <span class="st0">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE customers_id = &quot;</span> <span class="sy0">.</span> <span class="re0">$customers_id</span> <span class="sy0">.</span> <span class="st0">&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LIMIT 1&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$customers</span><span class="sy0">-&gt;</span><span class="me1">MoveNext</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
</div>
<p style="text-align: justify;">Thanks to that, only customers who actually have some pending points will be processed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/06/performance-issues-with-store-credit-module-in-admin-area/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Query Log v1.5.1 released</title>
		<link>http://www.data-diggers.com/index.php/2009/06/query-log-v1-5-1-released/</link>
		<comments>http://www.data-diggers.com/index.php/2009/06/query-log-v1-5-1-released/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 10:14:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Query Log]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=51</guid>
		<description><![CDATA[
			
				
			
		
Version v1.5.1 of Query Log is available. You can download it from: www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip .
What&#8217;s new in this version:

You can now close &#8216;calculator&#8217; layer (it&#8217;s the tool that highlights queries that match given regular expression)
You can now disable query logging completely. In previous versions Query Log kept all queries in memory, no matter if You wanted to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fquery-log-v1-5-1-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fquery-log-v1-5-1-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">Version v1.5.1 of<strong> Query Log </strong>is available. You can download it from: <a href="http://www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip">www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip</a> .</p>
<h2 style="text-align: justify;">What&#8217;s new in this version:</h2>
<ul style="text-align: justify;">
<li>You can now close &#8216;calculator&#8217; layer (it&#8217;s the tool that highlights queries that match given regular expression)</li>
<li>You can now disable query logging completely. In previous versions Query Log kept all queries in memory, no matter if You wanted to log them (display them) or not.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/06/query-log-v1-5-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed up &#8216;Order history&#8217; query by 50%-75%</title>
		<link>http://www.data-diggers.com/index.php/2009/06/speed-up-order-history-query-by-50-75/</link>
		<comments>http://www.data-diggers.com/index.php/2009/06/speed-up-order-history-query-by-50-75/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 14:46:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Zen Cart]]></category>

		<guid isPermaLink="false">http://www.data-diggers.eu/?p=49</guid>
		<description><![CDATA[
			
				
			
		
I noticed that following query takes long time to execute:


SELECT DISTINCT op.products_id
FROM orders o, orders_products op, products p
WHERE o.customers_id = &#8216;2345&#8242;
AND o.orders_id = op.orders_id
AND op.products_id = p.products_id
AND p.products_status = &#8216;1&#8242;
GROUP BY products_id
ORDER BY o.date_purchased DESC
LIMIT 6


I noticed that there&#8217;s no index on orders table on customers_id field. Without it MySQL has to scan whole table [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fspeed-up-order-history-query-by-50-75%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.data-diggers.com%2Findex.php%2F2009%2F06%2Fspeed-up-order-history-query-by-50-75%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: justify;">I noticed that following query takes long time to execute:</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">SELECT</span> <span class="kw1">DISTINCT</span> op<span class="sy0">.</span>products_id<br />
<span class="kw1">FROM</span> orders o<span class="sy0">,</span> orders_products op<span class="sy0">,</span> products p<br />
<span class="kw1">WHERE</span> o<span class="sy0">.</span>customers_id <span class="sy0">=</span> <span class="st0">&#8216;2345&#8242;</span><br />
<span class="kw1">AND</span> o<span class="sy0">.</span>orders_id <span class="sy0">=</span> op<span class="sy0">.</span>orders_id<br />
<span class="kw1">AND</span> op<span class="sy0">.</span>products_id <span class="sy0">=</span> p<span class="sy0">.</span>products_id<br />
<span class="kw1">AND</span> p<span class="sy0">.</span>products_status <span class="sy0">=</span> <span class="st0">&#8216;1&#8242;</span><br />
<span class="kw1">GROUP</span> <span class="kw1">BY</span> products_id<br />
<span class="kw1">ORDER</span> <span class="kw1">BY</span> o<span class="sy0">.</span>date_purchased <span class="kw1">DESC</span><br />
<span class="kw1">LIMIT</span> <span class="nu0">6</span></div>
</div>
</div>
<p style="text-align: justify;">I noticed that there&#8217;s no index on <strong>orders </strong>table on <strong><em>customers_id</em></strong> field. Without it MySQL has to scan whole table to find orders by <strong><em>customers_id</em></strong><em> </em>(in this case &#8216;2345&#8242;). If <strong>orders </strong>table is small there&#8217;s no problem, but when it has 10 000 or more entries it can noticably slow down Zen Cart. So, let&#8217;s add index on that table</p>
<div style="text-align: justify;">
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">ALTER</span> <span class="kw1">TABLE</span> <span class="st0">`orders`</span> <span class="kw1">ADD</span> <span class="kw1">INDEX</span> <span class="st0">`idx_cid_datepurchased`</span><span class="br0">&#40;</span><span class="st0">`customers_id`</span><span class="sy0">,</span> <span class="st0">`date_purchased`</span><span class="br0">&#41;</span>;</div>
</div>
</div>
<p style="text-align: justify;">I included <strong><em>date_purchased</em></strong> in index, because some pages in admin area will use it for searching all orders of given customer.</p>
<p style="text-align: justify;">In my case it decreased query time from 0.3 sec to 0.08 sec. It&#8217;s still too much, but it&#8217;s better then nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.data-diggers.com/index.php/2009/06/speed-up-order-history-query-by-50-75/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
