<?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>MyCubeCart.com &#187; CubeCart 4 Fixes</title>
	<atom:link href="http://mycubecart.com/tutorials/cubecart-4-fixes/feed/" rel="self" type="application/rss+xml" />
	<link>http://mycubecart.com</link>
	<description>CubeCart Skins, Mods and Developer Ramblings.</description>
	<lastBuildDate>Fri, 05 Dec 2008 03:27:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CubeCart Pagination and SE Friendly URLs</title>
		<link>http://mycubecart.com/2008/12/04/cubecart-pagination-and-se-friendly-urls/</link>
		<comments>http://mycubecart.com/2008/12/04/cubecart-pagination-and-se-friendly-urls/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 05:48:43 +0000</pubDate>
		<dc:creator>Ron Edgecomb II</dc:creator>
				<category><![CDATA[CubeCart 3 and CubeCart 4 Tutorials]]></category>
		<category><![CDATA[CubeCart 4 Fixes]]></category>

		<guid isPermaLink="false">http://mycubecart.com/?p=47</guid>
		<description><![CDATA[In working with CubeCart 4.3 this evening, I&#8217;ve discovered a small bug which affects pagination links generated by CubeCart. If you have your store configured to use search engine friendly URLs, the pagination links will not reflect the desired search engine structure. The standard query based URL is displayed instead.
This bug is explained in detail [...]]]></description>
			<content:encoded><![CDATA[<p>In working with CubeCart 4.3 this evening, I&#8217;ve discovered a small bug which affects pagination links generated by CubeCart. If you have your store configured to use search engine friendly URLs, the pagination links will not reflect the desired search engine structure. The standard query based URL is displayed instead.</p>
<p>This bug is explained in detail below, you are welcome to skip ahead to <a href="/2008/12/04/cubecart-pagination-and-se-friendly-urls/#bug-fix">the fix</a>.<br />
<span id="more-47"></span></p>
<h2>What is pagination?</h2>
<p>For the web, pagination refers to the process of taking your content and splitting it up into separate pages. Pagination is typically reserved for large pieces of content.</p>
<p>For example, if you have a 1000 word article, you may wish to split it up over 4 pages limiting each page to 250 words. In the case of CubeCart, pagination is used to split up the content within the category view of products, search results and product reviews.</p>
<p>Here is an example of how the pagination in CubeCart may be displayed:</p>
<p style="text-align: center;"><img class="size-full wp-image-46 aligncenter" title="CubeCart Pagination Example" src="http://mycubecart.com/wp/wp-content/uploads/2008/12/cubecart-pagination-example.png" alt="CubeCart Pagination Example" width="250" height="25" /></p>
<h2>What does the pagination bug do?</h2>
<p>The pagination bug I&#8217;ve discovered will only affected CubeCart 4 stores which have search engine friendly URLs enabled. All pagination links generated by CubeCart will contain URLs which are not &#8220;clean&#8221;.</p>
<p>Fore example, with search engine friendly URLs enabled, you would anticipate pagination links to look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://mycubecart.com/shop/category-description/cat_1.html?page=1</pre></div></div>

<p>What you get looks more like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://mycubecart.com/shop/index.php?_a=viewCat&amp;amp;catId=1&amp;amp;page=1</pre></div></div>

<p>As you can see from the example, the search engine friendly urls are much cleaner and easier for the user to understand.</p>
<p>The good news is this bug does not prevent your store from being used.</p>
<h2 id="bug-fix">The Pagination Bug Fix</h2>
<p>This bug was discovered in version 4.3.0 but appears to be present on all versions of CubeCart from 4.0.x &#8211; 4.3.0.</p>
<p>The bug fix outlined below references line numbers from CubeCart version 4.3.0. Though the line number may differ from older versions, it appears the fix is identical.</p>
<p>This bug requires the alteration of the following CubeCart 4 files:</p>
<ol>
<li>cubecart root/includes/functions.inc.php</li>
</ol>
<h2>Part 1 &#8211; All Version CubeCart 4.0.x &#8211; 4.3.0</h2>
<p>1. Open functions.inc.php</p>
<p>2. Find:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>386
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$lang</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>3. Replace with:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>386
387
388
389
390
391
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// BEGIN: MyCubeCart.com</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$lang</span><span style="color: #339933;">,</span> <span style="color: #000088;">$config</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/* Replaced
    global $lang;
*/</span>
<span style="color: #666666; font-style: italic;">// END: MyCubeCart.com</span></pre></td></tr></table></div>

<p>4. Find:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>410
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$currentPage</span> <span style="color: #339933;">=</span> sanitizeVar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>5. Replace with:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>410
411
412
413
414
415
416
417
418
419
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// BEGIN: MyCubeCart.com Mod</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sef'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$currentPage</span> <span style="color: #339933;">=</span> sanitizeVar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$currentPage</span> <span style="color: #339933;">=</span> sanitizeVar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/* Replaced
    $currentPage = sanitizeVar($_SERVER['PHP_SELF']);
*/</span>
<span style="color: #666666; font-style: italic;">// END: MyCubeCart.com Mod</span></pre></td></tr></table></div>

<p>6. Save file and upload.</p>
<h3>Bug Fix Complete!</h3>
<p>After saving your updated functions.inc.php file and uploading to your sever, all pagination results will be formated to the desired search engine friendly parameters.</p>
]]></content:encoded>
			<wfw:commentRss>http://mycubecart.com/2008/12/04/cubecart-pagination-and-se-friendly-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
