<?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>damonparker.org &#187; Ecommerce</title>
	<atom:link href="http://damonparker.org/blog/category/technical/ecommerce/feed/" rel="self" type="application/rss+xml" />
	<link>http://damonparker.org</link>
	<description>code / ecommerce / life</description>
	<lastBuildDate>Thu, 24 Feb 2011 21:29:16 +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>Zencart Hack &#8211; Logout Customer Automatically After X Failed Payment Attempts</title>
		<link>http://damonparker.org/blog/2007/06/22/zencart-hack-logout-customer-automatically-after-x-failed-payment-attempts/</link>
		<comments>http://damonparker.org/blog/2007/06/22/zencart-hack-logout-customer-automatically-after-x-failed-payment-attempts/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 19:17:37 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/06/22/zencart-hack-logout-customer-automatically-after-x-failed-payment-attempts/</guid>
		<description><![CDATA[Credit card slamming is the practice of trying hundreds or thousands of card numbers and security code combinations to find the few in the batch that will actually work. I have discussed credit card slamming here and over at the ZenCart forums several times in the past. The code snippet below can be used in [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Credit card slamming is the practice of trying hundreds or thousands of card numbers and security code combinations to find the few in the batch that will actually work.    I have discussed <a href="http://damonparker.org/blog/2007/03/15/combating-card-fraud/">credit card slamming</a> here and over at the <a href="http://www.zen-cart.com/forum/showthread.php?t=52483&#038;page=2#17" rel="external">ZenCart forums</a> several times in the past. </p>
<p>The code snippet below can be used in <em>modules/checkout_process.php</em> to automatically log a user out after a set number (6 in the below snippet) of payment attempts.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// damonp add auto logoff after 6 attempts</span><br />
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span> <a href="http://www.php.net/isset"><span style="color: #000066;">isset</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'payment_attempt'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> &nbsp; <span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'payment_attempt'</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #cc66cc;">0</span>;<br />
<span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'payment_attempt'</span><span style="color: #66cc66;">&#93;</span>++;<br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'payment_attempt'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span>&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">// change 6 to change how many attempts to allow before logout</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// log attempt or email report &nbsp;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// the following information is useful</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &quot;Host:\t\t&quot;.$_SESSION['customers_host_address'].</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &quot;\nCustomer:\t&quot;.$_SESSION['customer_id'].</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &quot;\nTotal:\t\t&quot;.$_SESSION['cart']-&gt;total,</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// destroy session to log customer out</span><br />
&nbsp; &nbsp; zen_session_destroy<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// redirect to timeout page or create new page to redirect to</span><br />
&nbsp; &nbsp; zen_redirect<span style="color: #66cc66;">&#40;</span>zen_href_link<span style="color: #66cc66;">&#40;</span>FILENAME_TIME_OUT, <span style="color: #ff0000;">''</span>, <span style="color: #ff0000;">'SSL'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div></div>
<p>Place in between this code near the top of the file:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">// if the customer is not logged on, redirect them to the time out page</span><br />
&nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'customer_id'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; zen_redirect<span style="color: #66cc66;">&#40;</span>zen_href_link<span style="color: #66cc66;">&#40;</span>FILENAME_TIME_OUT<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
INSERT AUTO LOGOUT FUNCTIONALITY HERE <br />
<br />
<span style="color: #808080; font-style: italic;">// load selected payment module</span><br />
&nbsp; <span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span>DIR_WS_CLASSES . <span style="color: #ff0000;">'payment.php'</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; <span style="color: #0000ff;">$payment_modules</span> = <span style="color: #000000; font-weight: bold;">new</span> payment<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'payment'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #808080; font-style: italic;">// load the selected shipping module</span><br />
&nbsp; <span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span>DIR_WS_CLASSES . <span style="color: #ff0000;">'shipping.php'</span><span style="color: #66cc66;">&#41;</span>;</div></div>
<p>I found six attempts to work well on the sites I implemented on.  You do not want to adversely impact normal users but you do want to make it harder on abusers so that they just go away.  </p>
<h4>BE WARNED</h4>
<p>Improper use of this code could prevent anyone from checking out.  The two things that will save you when trying this out are:</p>
<ol>
<li>MAKE A BACKUP</li>
<li>FULLY TEST BEFORE CALLING IT COMPLETE</li>
</ol>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=320" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=320&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/06/22/zencart-hack-logout-customer-automatically-after-x-failed-payment-attempts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zencart Inventory Report Update v0.9.2</title>
		<link>http://damonparker.org/blog/2007/03/18/zencart-inventory-report-update-v092/</link>
		<comments>http://damonparker.org/blog/2007/03/18/zencart-inventory-report-update-v092/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 15:35:05 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Sites]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/03/18/zencart-inventory-report-update-v092/</guid>
		<description><![CDATA[Feedback from users prompted me to add an extra column to the report display&#8230; the master category. The master_category_id is listed in the products table and is generally the category the product was originally created in (unless changed later). The report won&#8217;t show every category a product is listed in if the product has been [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Feedback from users prompted me to add an extra column to the report display&#8230; the master category.  The master_category_id is listed in the products table and is generally the category the product was originally created in (unless changed later).  The report won&#8217;t show every category a product is listed in if the product has been linked to multiple categories.</p>
<p><a href="http://damonparker.org/files/zen_inventory_report.tar.gz">Download ZenCart Inventory Report</a> </p>
<p><em>Thanks to <a href="http://www.first-class-hosting.com/" rel="external">Ron</a> for the <a href="http://damonparker.org/blog/donationware/">donation</a> to help out with these feature additions.</em></p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=328" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=328&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/03/18/zencart-inventory-report-update-v092/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Combating Card Fraud (or at least slow it down)</title>
		<link>http://damonparker.org/blog/2007/03/15/combating-card-fraud/</link>
		<comments>http://damonparker.org/blog/2007/03/15/combating-card-fraud/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 17:35:45 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/03/15/combating-card-fraud/</guid>
		<description><![CDATA[I have a major client whose Authorize.net gateway account gets hit sometimes hundreds of times a day with charge attempts. Most are posted by an automated script from IPs coming out of Indonesia or Eastern Europe in an attempt to find a valid credit card number and security code. Fortunately, it hasn&#8217;t cost the client [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I have a major client whose Authorize.net gateway account gets hit sometimes hundreds of times a day with charge attempts.  Most are posted by an automated script from IPs coming out of Indonesia or Eastern Europe in an attempt to find a valid credit card number and security code.  Fortunately, it hasn&#8217;t cost the client any money directly yet.  Out of the thousands of attempts in the last few months only a couple of charges actually captured funds from the stolen card information.  All of these were promptly cancelled after review.  </p>
<p>In discussions with this client, we came up with the following options.  They are listed in order of ease to implement and least impact on legitimate customers.</p>
<ol>
<li>Require only a billing address and plainly state all orders are only shipped to billing address</li>
<li>Require card billing address and shipping address to be in same country or deny the order before going to authorize</li>
<li>Require all international orders to be Paypal so they can&#8217;t automate the whole process (or maybe allow orders from countries with low fraud percentage to use a credit card directly and all others Paypal)</li>
<li>Automatically log user out after X failed attempts</li>
<li>Automatically block the IP address after X failed attempts for a time period between a few hours to a day or two</li>
<li>Match customer&#8217;s IP address to billing / shipping country before going to authorize</li>
</ol>
<p>My thinking is the better methods would include ways of slowing down the requests so that automated script kiddie tools would constantly fail while legitimate users that are just having problems would not be completely prevented from checking out.  I also think a more robust system would utilize several layers of protection (same as a multi-layered approach to server security is better in the long run than putting all of your eggs in the single proverbial basket).</p>
<p>Over the course of the next few weeks I will implement some of these options and dream up more if necessary.  Stay tuned for updates.  </p>
<p>Should your site be experiencing similar issues, <a href="http://damonparker.org/contact.php">contact me </a> to discuss options.</p>
<h4>Note</h4>
<p><a href="http://maxmind.com" rel="external">Maxmind</a> supplies a free <a href="http://www.maxmind.com/app/csv" rel="external">IP to country database</a> in CSV format along with their commercial IP database products.</p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=319" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=319&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/03/15/combating-card-fraud/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ZenCart Inventory Report &#8211; Updated</title>
		<link>http://damonparker.org/blog/2007/03/10/zencart-inventory-report-updated/</link>
		<comments>http://damonparker.org/blog/2007/03/10/zencart-inventory-report-updated/#comments</comments>
		<pubDate>Sat, 10 Mar 2007 14:34:26 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sites]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/03/10/zencart-inventory-report-updated/</guid>
		<description><![CDATA[Thanks to Ron for posting a bug back on the Zencart forums about my Zencart Inventory Report Fixed&#8230; download&#8230; enjoy.]]></description>
			<content:encoded><![CDATA[<p></p><p>Thanks to <a href="http://www.zen-cart.com/forum/showpost.php?p=339974&#038;postcount=2" rel="external">Ron</a> for posting a bug back on the <a href="http://zencart.com/forum/">Zencart forums</a> about my <a href="http://damonparker.org/blog/2006/11/29/zencart-inventory-report/">Zencart Inventory Report</a></p>
<p>Fixed&#8230; <a href="http://damonparker.org/files/zen_inventory_report.tar.gz">download&#8230;</a> enjoy.</p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=323" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=323&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/03/10/zencart-inventory-report-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZenCart Manufacturers System Errors</title>
		<link>http://damonparker.org/blog/2007/01/12/zencart-manufacturers-system-errors/</link>
		<comments>http://damonparker.org/blog/2007/01/12/zencart-manufacturers-system-errors/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 17:46:54 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Broken]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/01/12/zencart-manufacturers-system-errors/</guid>
		<description><![CDATA[In ZenCart versions immediately prior to 1.3.6 using many of the public side manufacturers functions may produce this error: Warning: constant&#40;&#41;: Couldn't find constant in &#160;.../includes/init_includes/init_add_crumbs.php on line 45 The error is caused by a missing database column that was added in the official 1.3.6 release. If upgrade is not immediately possible the following SQL [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In ZenCart versions immediately prior to 1.3.6 using many of the public side manufacturers functions may produce this error:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Warning: <a href="http://www.php.net/constant"><span style="color: #000066;">constant</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: Couldn<span style="color: #ff0000;">'t find constant in &nbsp;.../includes/init_includes/init_add_crumbs.php on line 45</span></div></div>
<p>The error is caused by a missing database column that was added in the official 1.3.6 release.  If upgrade is not immediately possible the following SQL snippet will correct the problem in most cases:</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> get_terms_to_filter <span style="color: #993333; font-weight: bold;">ADD</span> get_term_table varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">64</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span>;<br />
<br />
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> get_terms_to_filter <span style="color: #993333; font-weight: bold;">ADD</span> get_term_name_field varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">64</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span>;<br />
<br />
<span style="color: #993333; font-weight: bold;">UPDATE</span> get_terms_to_filter <span style="color: #993333; font-weight: bold;">SET</span> get_term_table <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'TABLE_MANUFACTURERS'</span>, get_term_name_field <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'manufacturers_name'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> get_term_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'manufacturers_id'</span>;<br />
<br />
<span style="color: #993333; font-weight: bold;">UPDATE</span> get_terms_to_filter <span style="color: #993333; font-weight: bold;">SET</span> get_term_table <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'TABLE_MUSIC_GENRE'</span>, get_term_name_field <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'music_genre_name'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> get_term_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'music_genre_id'</span>;<br />
<br />
<span style="color: #993333; font-weight: bold;">UPDATE</span> get_terms_to_filter <span style="color: #993333; font-weight: bold;">SET</span> get_term_table <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'TABLE_RECORD_COMPANY'</span>, get_term_name_field <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'record_company_name'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> get_term_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'record_company_id'</span>;</div></div>
<p>If you are using other product types, some additional UPDATE statements will be required for your new product types.</p>
<p>I found this solution after some searching on the ZenCart <a href="http://www.zen-cart.com/forum/showthread.php?t=50738" rel="external">forums</a>.</p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=293" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=293&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/01/12/zencart-manufacturers-system-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interesting Ecommerce Comparison</title>
		<link>http://damonparker.org/blog/2007/01/09/interesting-ecommerce-comparison/</link>
		<comments>http://damonparker.org/blog/2007/01/09/interesting-ecommerce-comparison/#comments</comments>
		<pubDate>Tue, 09 Jan 2007 17:28:04 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Random Thoughts]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2007/01/09/interesting-ecommerce-comparison/</guid>
		<description><![CDATA[The &#8220;killingest&#8221; assumptions businesses make revolve around how their customers buy. Suppose you and 99 other people go into an electronics store and purchase the exact same item. That&#8217;s 100 sales. But you can probably guess those 100 sales didn&#8217;t unfold in the exact same way. No properly-trained sales person would ever use the exact [...]]]></description>
			<content:encoded><![CDATA[<p></p><blockquote><p>The &#8220;killingest&#8221; assumptions businesses make revolve around how their customers buy. Suppose you and 99 other people go into an electronics store and purchase the exact same item. That&#8217;s 100 sales. But you can probably guess those 100 sales didn&#8217;t unfold in the exact same way. No properly-trained sales person would ever use the exact same language or structure the sale the exact same way for every single customer. And yet, ecommerce sites routinely assume one product page is going to meet the needs of all customers interested in that product. Talk about your huge assumptions!</p></blockquote>
<p>Source: <a href="http://www.grokdotcom.com/Volumes/volume01-01-07.htm" rel="external">GrokDotCom</a></p>
<p>How flexible are your sales processes?</p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=294" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=294&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2007/01/09/interesting-ecommerce-comparison/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZenCart Inventory Report</title>
		<link>http://damonparker.org/blog/2006/11/29/zencart-inventory-report/</link>
		<comments>http://damonparker.org/blog/2006/11/29/zencart-inventory-report/#comments</comments>
		<pubDate>Wed, 29 Nov 2006 17:36:23 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2006/11/29/zencart-inventory-report/</guid>
		<description><![CDATA[Here&#8217;s a simple admin report for ZenCart that will generate an inventory report with per product totals and a report total. The report may be paginated or generated over the whole catalog. The report was created by modifying the ZenCart default Products Viewed report. It was created from the ZenCart v1.2x source but has been [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Here&#8217;s a simple admin report for <a href="http://zencart.com" rel="external">ZenCart</a> that will generate an inventory report with per product totals and a report total.  The report may be paginated or generated over the whole catalog.</p>
<p>The report was created by modifying the ZenCart default Products Viewed report.  It was created from the ZenCart v1.2x source but has been installed on v1.3x versions.  This is the first release, so any problems please comment below.</p>
<p>In future updates, I would like to allow for CSV export as well as reporting by category.</p>
<p>To install, simply unzip and upload to your main ZenCart install directory.</p>
<p><a href="http://damonparker.org/files/zen_inventory_report.tar.gz"><br />
<h4>ZenCart Inventory Report</h4>
<p></a></p>
<p><a href="http://damonparker.org/releases.php?file=zen_inventory_report">View all releaseas</a></p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=282" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=282&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2006/11/29/zencart-inventory-report/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MySQL Database Performance &#8211; ZenCart Sales Report</title>
		<link>http://damonparker.org/blog/2006/10/23/mysql-database-performance-zencart-sales-report/</link>
		<comments>http://damonparker.org/blog/2006/10/23/mysql-database-performance-zencart-sales-report/#comments</comments>
		<pubDate>Mon, 23 Oct 2006 19:13:36 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2006/10/23/mysql-database-performance-zencart-sales-report/</guid>
		<description><![CDATA[One of my client&#8217;s ZenCart installs was loading the server down so much to generate sales reports with the Sales Report v1 contribution that the public side was noticeably less responsive for the couple of minutes it took to build the report. The site has been running for over three years and contains 9k orders, [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>One of my client&#8217;s ZenCart installs was loading the server down so much to generate sales reports with the <a href="http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;cPath=40_41&#038;products_id=83" rel="external">Sales Report v1</a> contribution that the public side was noticeably less responsive for the couple of minutes it took to build the report.  The site has been running for over three years and contains 9k orders, so there is a lot of data to weed through even for a weekly report.  A quick look at the <a href="http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html" rel="external">slow query log</a> listed the following query as the culprit:</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> count<span style="color: #66cc66;">&#40;</span> op.products_id <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix<br />
<span style="color: #993333; font-weight: bold;">FROM</span> orders_products_attributes opa, orders o, orders_products op<br />
<span style="color: #993333; font-weight: bold;">WHERE</span> o.orders_id <span style="color: #66cc66;">=</span> opa.orders_id<br />
<span style="color: #993333; font-weight: bold;">AND</span> op.orders_products_id <span style="color: #66cc66;">=</span> opa.orders_products_id<br />
<span style="color: #993333; font-weight: bold;">AND</span> o.date_purchased <span style="color: #66cc66;">&gt;=</span> <span style="color: #ff0000;">'2006-10-18T00:00:00'</span><br />
<span style="color: #993333; font-weight: bold;">AND</span> o.date_purchased <span style="color: #66cc66;">&lt;</span> <span style="color: #ff0000;">'2006-10-19T00:00:00'</span><br />
<span style="color: #993333; font-weight: bold;">AND</span> op.products_id <span style="color: #66cc66;">=</span><span style="color: #cc66cc;">179</span><br />
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> products_options_values<br />
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> orders_products_id;</div></div>
<p>Running this query through <a href="http://dev.mysql.com/doc/refman/5.0/en/explain.html" rel="external">EXPLAIN</a> <a href="http://damonparker.org/html/explain_sales_report.html#one">shows 20978 rows examined</a>.  In this case, thats 20978 rows per day included in the sales report.</p>
<p>The main problem with this query is the ORDER BY clause which cannot utilize an exisiting index.  Adding the following index:</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">'orders_products_attributes'</span> <span style="color: #993333; font-weight: bold;">ADD</span> <span style="color: #993333; font-weight: bold;">INDEX</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'orders_products_id'</span> <span style="color: #66cc66;">&#41;</span></div></div>
<p>limits the rows examined for each query to 68 (<a href="http://damonparker.org/html/explain_sales_report.html#two">results</a>).  </p>
<p>This simple change allows the sales report to load in seconds as opposed to minutes with no noticeable lag on the public side.</p>
<p>The create table SQL for the current version of ZenCart (v1.3.5) contains the following index in orders_products_attributes:</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<br />
<span style="color: #993333; font-weight: bold;">KEY</span> idx_orders_id_prod_id_zen <span style="color: #66cc66;">&#40;</span>orders_id,orders_products_id<span style="color: #66cc66;">&#41;</span><br />
...</div></div>
<p>This index is used in the query in question.  In my tests it was only slightly slower than the single column index above.  EXPLAIN showed about 270 rows examined with the two column index on my dataset while  the single column index only examined 68 rows.</p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=275" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=275&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2006/10/23/mysql-database-performance-zencart-sales-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZenCart Products ID Search</title>
		<link>http://damonparker.org/blog/2006/10/20/zencart-products-id-search/</link>
		<comments>http://damonparker.org/blog/2006/10/20/zencart-products-id-search/#comments</comments>
		<pubDate>Fri, 20 Oct 2006 16:23:10 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2006/10/20/zencart-products-id-search/</guid>
		<description><![CDATA[The ZenCart admin does not allow searching for products by the products_id field. This is the field assigned internally to each product as it is entered by ZenCart itself. Using the Paypal Session Viewer (updated v2 here) to debug recent Paypal issues for a client, only shows the products_id ordered without any additional product information. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The <a href="http://www.zencart.com" rel="external">ZenCart</a> admin does not allow searching for products by the products_id field.  This is the field assigned internally to each product as it is entered by ZenCart itself.</p>
<p>Using the <a href="http://www.zen-cart.com/index.php?main_page=product_contrib_info&#038;cPath=40_41&#038;products_id=84" rel="external">Paypal Session Viewer</a> (updated v2 <a href="http://www.zen-cart.com/forum/showthread.php?t=32302" rel="external">here</a>) to debug recent Paypal issues for a client, only shows the products_id ordered without any additional product information.  To make it easy to find the product in the ZenCart admin from only the products_id make the following hack in <em>admin/includes/modules/category_product_listing.php</em> around line #191:</p>
<p>Before:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #000066;">isset</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$products_query_raw</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;select p.products_type, p.products_id, pd.products_name, p.products_quantity,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_image, p.products_price, p.products_date_added,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_last_modified, p.products_date_available,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_status, p2c.categories_id,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_model,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.product_is_free, p.product_is_call, p.products_quantity_mixed,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_quantity_order_max, p.products_sort_order<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &quot;</span> . TABLE_PRODUCTS . <span style="color: #ff0000;">&quot; p, &quot;</span> . TABLE_PRODUCTS_DESCRIPTION . <span style="color: #ff0000;">&quot; pd, &quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;. TABLE_PRODUCTS_TO_CATEGORIES . <span style="color: #ff0000;">&quot; p2c<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where p.products_id = pd.products_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and pd.language_id = '&quot;</span> . <span style="color: #66cc66;">&#40;</span>int<span style="color: #66cc66;">&#41;</span><span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'languages_id'</span><span style="color: #66cc66;">&#93;</span> . <span style="color: #ff0000;">&quot;'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and p.products_id = p2c.products_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pd.products_name like '%&quot;</span> . zen_db_input<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;%'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or pd.products_description like '%&quot;</span> . zen_db_input<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;%'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or p.products_model like '%&quot;</span> . zen_db_input<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;%')&quot;</span> .<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$order_by</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div></div>
<p>After:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #000066;">isset</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$products_query_raw</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;select p.products_type, p.products_id, pd.products_name, p.products_quantity,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_image, p.products_price, p.products_date_added,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_last_modified, p.products_date_available,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_status, p2c.categories_id,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_model,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.product_is_free, p.product_is_call, p.products_quantity_mixed,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p.products_quantity_order_max, p.products_sort_order<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &quot;</span> . TABLE_PRODUCTS . <span style="color: #ff0000;">&quot; p, &quot;</span> . TABLE_PRODUCTS_DESCRIPTION . <span style="color: #ff0000;">&quot; pd, &quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;. TABLE_PRODUCTS_TO_CATEGORIES . <span style="color: #ff0000;">&quot; p2c<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where p.products_id = pd.products_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and pd.language_id = '&quot;</span> . <span style="color: #66cc66;">&#40;</span>int<span style="color: #66cc66;">&#41;</span><span style="color: #0000ff;">$_SESSION</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'languages_id'</span><span style="color: #66cc66;">&#93;</span> . <span style="color: #ff0000;">&quot;'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and p.products_id = p2c.products_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pd.products_name like '%&quot;</span> . zen_db_input<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;%'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or pd.products_description like '%&quot;</span> . zen_db_input<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;%'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or p.products_id = '&quot;</span> . zen_db_input<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or p.products_model like '%&quot;</span> . zen_db_input<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'search'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">&quot;%')&quot;</span> .<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$order_by</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div></div>
<p>You can see the:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">or p.products_id = <span style="color: #ff0000;">'&quot; . zen_db_input($_GET['</span>search<span style="color: #ff0000;">']) . &quot;'</span></div></div>
<p>added near the bottom of the snippet.</p>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=274" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=274&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2006/10/20/zencart-products-id-search/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ZenCart Godaddy and cURL</title>
		<link>http://damonparker.org/blog/2006/10/05/zencart-godaddy-and-curl/</link>
		<comments>http://damonparker.org/blog/2006/10/05/zencart-godaddy-and-curl/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 14:17:39 +0000</pubDate>
		<dc:creator>damonp</dc:creator>
				<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://damonparker.org/blog/2006/10/05/zencart-godaddy-and-curl/</guid>
		<description><![CDATA[I recently migrated a customer&#8217;s ZenCart site to a hosting account with Godaddy.com. The project went smoothly except for the Authorize.net gateway. Trying to process orders, the site timed out on the final order process page. Godaddy&#8217;s support site, some googling and debugging led to this working code to be added to the cURL routine [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently migrated a customer&#8217;s ZenCart site to a hosting account with <a href="http://www.godaddy.com" rel="external">Godaddy.com</a>.  The project went smoothly except for the <a href="http://www.authorize.net" rel="external">Authorize.net</a> gateway.  Trying to process orders, the site timed out on the final order process page.  </p>
<p>Godaddy&#8217;s support site, some googling and debugging led to this working code to be added to the <a href="http://curl.haxx.se" rel="external">cURL</a> routine in authorizenet_aim.php.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">curl_setopt <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ch</span>, CURLOPT_PROXYTYPE, CURLPROXY_HTTP<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #808080; font-style: italic;">// The line below was posted on Godaddy's support site, </span><br />
<span style="color: #808080; font-style: italic;">// but did not work for me</span><br />
<span style="color: #808080; font-style: italic;">//curl_setopt ($ch, CURLOPT_PROXY,&quot;http://64.202.165.130:3128&quot;);</span><br />
<span style="color: #808080; font-style: italic;">// This line worked for me instead</span><br />
curl_setopt <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ch</span>, CURLOPT_PROXY,<span style="color: #ff0000;">&quot;64.202.165.130:3128&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
curl_setopt <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ch</span>, CURLOPT_SSL_VERIFYPEER, <span style="color: #000000; font-weight: bold;">FALSE</span><span style="color: #66cc66;">&#41;</span>;<br />
curl_setopt <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ch</span>, CURLOPT_TIMEOUT, <span style="color: #cc66cc;">45</span><span style="color: #66cc66;">&#41;</span>;</div></div>
<p>Links:</p>
<ul>
<li><a href="http://www.zen-cart.com/forum/showthread.php?t=39438" rel="external">http://www.zen-cart.com/forum/showthread.php?t=39438</a>
</li>
<li><a href="http://help.godaddy.com/article.php?article_id=288&#038;topic_id=&#038;&#038;" rel="external">http://help.godaddy.com/article.php?article_id=288&#038;topic_id=&#038;&#038;</a></li>
</ul>
 <img src="http://damonparker.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=273" width="1" height="1" style="display: none;" /><img src="http://damonparker.org/?ak_action=api_record_view&id=273&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://damonparker.org/blog/2006/10/05/zencart-godaddy-and-curl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using xcache
Database Caching 49/91 queries in 0.016 seconds using xcache
Content Delivery Network via cdn.damonparker.org/q9i5a4w8/cds/dp

Served from: damonparker.org @ 2012-02-04 14:29:26 -->
