<?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>ReloadedPC Ashland, Ohio &#187; related products</title>
	<atom:link href="http://www.reloadedpc.com/tag/related-products/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reloadedpc.com</link>
	<description>Small Business Website Development</description>
	<lastBuildDate>Tue, 24 Jan 2012 18:36:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Zencart Related Products</title>
		<link>http://www.reloadedpc.com/zen-cart/zencart-related-products/</link>
		<comments>http://www.reloadedpc.com/zen-cart/zencart-related-products/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 17:00:09 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zen-Cart]]></category>
		<category><![CDATA[related products]]></category>
		<category><![CDATA[zencart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=155</guid>
		<description><![CDATA[Zen-cart is an excellent open source ecommerce shopping cart system. One of the features I like about Zen-cart is that once you understand the templating structure, writing plugins becomes pretty easy. One of the features I enjoyed using with osCommerce, was a plugin for creating a related products box below a displayed. The plugin was [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_18" class="wp-caption alignright" style="width: 156px"><a href="http://www.zen-cart.com"><img class="size-full wp-image-18 " title="zen-cart-logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/zen-cart-logo.png" alt="Zencart Related Products zen cart logo " width="146" height="40" /></a><p class="wp-caption-text">Zen-Cart</p></div><a href="http://www.zen-cart.com">Zen-cart</a> is an excellent open source ecommerce shopping cart system. One of the features I like about Zen-cart is that once you understand the templating structure, writing plugins becomes pretty easy.</p>
<p>One of the features I enjoyed using with osCommerce, was a plugin for creating a related products box below a displayed. The plugin was easily implemented, and used an extra field add to the database. That was a great asset, that I felt missed using. Zen-cart offers something very similar in its port of XSell (Cross Sell). This feature would work fine if you are adding a few products at time, and do not have many related products. However, in my case, I have about 4,000 items in my catalog. The products are mostly lighting fixtures, which for must companies have coordinating fixtures for each room. This would be a bit cumbersome to create all of the related items. This is why I decided to write a quick plugin to get this simple functionality back.<span id="more-155"></span>The code works by simply selecting products that have the same products_family value from the products table. You will first need to add this field to your database.</p>
<p>The default products table is &#8220;zen_products&#8221;, and in your favorite MySQL editor add:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">ALTER TABLE zen_products ADD COLUMN products_family VARCHAR<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next, you will need to add values to your new field family_products. The easiest to do this is to use custom fields in <a href="http://www.reloadedpc.com/zen-cart/zen-cart-easy-populate/">Easy Populate</a>. I added the code to Easy Poplulate for zen-cart to be able to add your own custom fields to the import/export file.</p>
<p>Now that you&#8217;ve got the fields added to the database, it&#8217;s time to upload some files. <a href="https://bitbucket.org/pickupman/zencart-related-products/get/tip.zip">Download Zencart Related Plugins</a>. Read the included readme file, and upload to your zen cart folder.</p>
<p>Open the file /includes/templates/CUSTOM/templates/tpl_product_info_display.php and find the block around line 463:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!--bof also purchased products module --&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$template</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_template_dir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tpl_modules_also_purchased_products.php'</span><span style="color: #339933;">,</span> DIR_WS_TEMPLATE<span style="color: #339933;">,</span> <span style="color: #000088;">$current_page_base</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'templates'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'tpl_modules_also_purchased_products.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!--eof also purchased products module --&gt;</pre></div></div>

<p>Above that copy this into your file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!--bof also related products module--&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$template</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_template_dir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tpl_modules_related_products.php'</span><span style="color: #339933;">,</span> DIR_WS_TEMPLATE<span style="color: #339933;">,</span> <span style="color: #000088;">$current_page_base</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'templates'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'tpl_modules_related_products.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!--eof also related products module--&gt;</pre></div></div>

<p>You should now see products being displayed under the products description.	You will want to add some CSS styles to the box to your liking. Default styles should be:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#relatedProducts</span>	<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.centerBoxContentsRelatedProduct</span>	<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/zen-cart/zencart-related-products/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 9/18 queries in 0.010 seconds using disk: basic
Object Caching 340/381 objects using disk: basic

Served from: www.reloadedpc.com @ 2012-02-05 04:32:33 -->
