<?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>Chicago Web Design &#187; leoj3n</title>
	<atom:link href="http://blueprintds.com/author/joelk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blueprintds.com</link>
	<description>Design and Marketing implemented the right way.</description>
	<lastBuildDate>Mon, 12 Jul 2010 16:00:03 +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>Tutorial: How to add forms to Store-Locator plugin in WordPress</title>
		<link>http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/</link>
		<comments>http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 00:36:43 +0000</pubDate>
		<dc:creator>leoj3n</dc:creator>
				<category><![CDATA[Web Design Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[modification]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[store-locator]]></category>

		<guid isPermaLink="false">http://blueprintds.com/?p=1532</guid>
		<description><![CDATA[Yesterday I had to add some custom forms to a WordPress plugin called Google Maps Store Locator for WordPress (version 1.2.28) and found it&#8217;s not as straight-forward as one might expect. After about forty-five minutes of digging through all of the plugin&#8217;s files, I located four that were of use to me:

/store-locator/view-locations.php
/store-locator/add-locations.php
/store-locator/generate-xml.php
/store-locator/js/store-locator.js

By making additions to [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I had to add some custom forms to a WordPress plugin called <a title="Google Maps Store Locator for WordPress" href="http://wordpress.org/extend/plugins/store-locator/">Google Maps Store Locator for WordPress</a> (version 1.2.28) and found it&#8217;s not as straight-forward as one might expect. After about forty-five minutes of digging through all of the plugin&#8217;s files, I located four that were of use to me:</p>
<ul>
<li>/store-locator/<strong>view-locations.php</strong><strong></strong></li>
<li>/store-locator/<strong>add-locations.php</strong></li>
<li>/store-locator/<strong>generate-xml.php</strong></li>
<li>/store-locator/js/<strong>store-locator.js</strong></li>
</ul>
<p>By making additions to these four files as well as the store-locator database, you can add custom form fields to the plugin that actually store data and, of course, display this data to the user!</p>
<h4><strong>Step 1</strong>: Add custom fields (or &#8220;columns&#8221;) to the <strong>wp_store_locator</strong> table</h4>
<p style="padding-left: 30px;">We need to add columns to the table named <strong>wp_store_locator</strong> in our WordPress database so that our custom info can be stored somewhere. We are going to add our columns after the last column in the table (which should be named <strong>sl_neat_title</strong>).</p>
<p style="padding-left: 30px;">So, using <a title="phpMyAdmin" href="http://www.phpmyadmin.net/">phpMyAdmin</a> or any other database administration tool, add your custom columns. For this tutorial, I&#8217;m going to add <strong>sl_creditcard</strong> and <strong>sl_giftcard</strong> to keep track of which stores allow the use of credit cards or gift cards. Notice that I included the <strong>sl_</strong> prefix. This is necessary because the plugin expects every column in the table to have this prefix.</p>
<p style="padding-left: 30px;">Note: From now on when you see &#8220;<span style="color: #ff0000;"><em><strong>creditcard</strong></em></span>&#8221; or &#8220;<span style="color: #ff0000;"><em><strong>giftcard</strong></em></span>&#8221; OR  &#8220;<span style="color: #ff0000;"><em><strong>sl_creditcard</strong></em></span>&#8221; or &#8220;<span style="color: #ff0000;"><em><strong>sl_giftcard</strong></em></span>&#8221; OR &#8220;<span style="color: #ff0000;"><em><strong>Credit Card</strong></em></span>&#8221; or &#8220;<span style="color: #ff0000;"><em><strong>Gift Card</strong></em></span>&#8221; this is where you can insert the names of <strong><em>your</em></strong> custom fields.</p>
<div id="attachment_1566" class="wp-caption alignnone" style="width: 569px"><img class="size-full wp-image-1566" title="before_add" src="http://blueprintds.com/wp-content/uploads/2009/06/before_add.png" alt="Before adding the custom fields" width="559" height="428" /><p class="wp-caption-text">Above: Database table wp_store_locator before adding custom fields</p></div>
<div id="attachment_1568" class="wp-caption alignnone" style="width: 569px"><img class="size-full wp-image-1568" title="after_add" src="http://blueprintds.com/wp-content/uploads/2009/06/after_add.png" alt="Above: Database table wp_store_locator after adding the fields sl_creditcard and sl_giftcard" width="559" height="475" /><p class="wp-caption-text">Above: Database table wp_store_locator after adding custom fields</p></div>
<h4><strong>Step 2</strong>: Modify <strong>view-locations.php</strong>, and <strong>add-locations.php</strong></h4>
<p style="padding-left: 30px;">We need to modify these two files so the custom forms and info show up in the admin panel when the admin tries to add, edit, remove, or view locations.</p>
<p style="padding-left: 30px;">In <strong>add-locations.php</strong> we must append our custom form field HTML. Opening the file initially and looking at lines 98 to 100 you will see:</p>
<p>&#8220;.__(&#8220;Hours&#8221;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;sl_hours&#8217;&gt;&lt;br&gt;&lt;br&gt;<br />
&#8220;.__(&#8220;Phone&#8221;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;sl_phone&#8217;&gt;&lt;br&gt;&lt;br&gt;<br />
&#8220;.__(&#8220;Image (shown on map with location)&#8221;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;sl_image&#8217;&gt;&lt;br&gt;&lt;br&gt;</p>
<p style="padding-left: 30px;">To add form fields for the fields we added to the database (<strong>sl_creditcard</strong> and <strong>sl_giftcard</strong>), simply do the following:</p>
<p>&#8220;.__(&#8220;Hours&#8221;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;sl_hours&#8217;&gt;&lt;br&gt;&lt;br&gt;<br />
&#8220;.__(&#8220;Phone&#8221;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;sl_phone&#8217;&gt;&lt;br&gt;&lt;br&gt;<br />
<span style="color: red;">&#8220;.__(&#8220;<em><strong>Credit Card</strong></em>&#8220;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;<em><strong>sl_creditcard</strong></em>&#8216;&gt;&lt;br&gt;&lt;br&gt;</span><br />
<span style="color: red;">&#8220;.__(&#8220;<em><strong>Gift Card</strong></em>&#8220;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;<em><strong>sl_giftcard</strong></em>&#8216;&gt;&lt;br&gt;&lt;br&gt;</span><br />
&#8220;.__(&#8220;Image (shown on map with location)&#8221;, $text_domain).&#8221;&lt;br&gt;&lt;input name=&#8217;sl_image&#8217;&gt;&lt;br&gt;&lt;br&gt;</p>
<p style="padding-left: 30px;">Next, in <strong>view-locations.php</strong>, we will have to make three additions. First, on lines 153 to 155 find:</p>
<pre style="overflow-x: scroll;">&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=sl_hours&amp;d=$d'&gt;".__("Hours", $text_domain)."&lt;/th&gt;
&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=sl_phone&amp;d=$d'&gt;".__("Phone", $text_domain)."&lt;/a&gt;&lt;/th&gt;
&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=sl_image&amp;d=$d'&gt;".__("Image", $text_domain)."&lt;/a&gt;&lt;/th&gt;";</pre>
<p style="padding-left: 30px;">And do the following:</p>
<pre style="overflow-x: scroll;">&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=sl_hours&amp;d=$d'&gt;".__("Hours", $text_domain)."&lt;/th&gt;
&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=sl_phone&amp;d=$d'&gt;".__("Phone", $text_domain)."&lt;/a&gt;&lt;/th&gt;
<span style="color: red;">&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=<em><strong>sl_creditcard</strong></em>&amp;d=$d'&gt;".__("<em><strong>Credit Card</strong></em>", $text_domain)."&lt;/a&gt;&lt;/th&gt;
&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=<em><strong>sl_giftcard</strong></em>&amp;d=$d'&gt;".__("<strong><em>Gift Card</em></strong>", $text_domain)."&lt;/a&gt;&lt;/th&gt;</span>
&lt;th&gt;&lt;a href='".ereg_replace("&amp;o=$_GET[o]&amp;d=$_GET[d]", "", $_SERVER[REQUEST_URI])."&amp;o=sl_image&amp;d=$d'&gt;".__("Image", $text_domain)."&lt;/a&gt;&lt;/th&gt;";</pre>
<p style="padding-left: 30px;">Then on lines 189 to 191 find:</p>
<p>&lt;td&gt;&lt;input name=&#8217;hours-$value[sl_id]&#8216; value=&#8217;$value[sl_hours]&#8216;&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input name=&#8217;phone-$value[sl_id]&#8216; value=&#8217;$value[sl_phone]&#8216;&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input name=&#8217;image-$value[sl_id]&#8216; value=&#8217;$value[sl_image]&#8216;&gt;&lt;/td&gt;&#8221;;</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>&lt;td&gt;&lt;input name=&#8217;hours-$value[sl_id]&#8216; value=&#8217;$value[sl_hours]&#8216;&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input name=&#8217;phone-$value[sl_id]&#8216; value=&#8217;$value[sl_phone]&#8216;&gt;&lt;/td&gt;<br />
<span style="color: red;">&lt;td&gt;&lt;input name=&#8217;<em><strong>creditcard</strong></em>-$value[sl_id]&#8216; value=&#8217;$value[<em><strong>sl_creditcard</strong></em>]&#8216;&gt;&lt;/td&gt;</span><br />
<span style="color: red;">&lt;td&gt;&lt;input name=&#8217;<em><strong>giftcard</strong></em>-$value[sl_id]&#8216; value=&#8217;$value[<em><strong>sl_giftcard</strong></em>]&#8216;&gt;&lt;/td&gt;</span><br />
&lt;td&gt;&lt;input name=&#8217;image-$value[sl_id]&#8216; value=&#8217;$value[sl_image]&#8216;&gt;&lt;/td&gt;&#8221;;</p>
<p style="padding-left: 30px;">Then on lines 217 to 219 find:</p>
<p>&lt;td&gt;$value[sl_hours]&lt;/td&gt;<br />
&lt;td&gt;$value[sl_phone]&lt;/td&gt;<br />
&lt;td&gt;$value[sl_image]&lt;/td&gt;&#8221;;</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>&lt;td&gt;$value[sl_hours]&lt;/td&gt;<br />
&lt;td&gt;$value[sl_phone]&lt;/td&gt;<br />
<span style="color: red;">&lt;td&gt;$value[<em><strong>sl_creditcard</strong></em>]&lt;/td&gt;</span><br />
<span style="color: red;">&lt;td&gt;$value[<em><strong>sl_giftcard</strong></em>]&lt;/td&gt;</span><br />
&lt;td&gt;$value[sl_image]&lt;/td&gt;&#8221;;</p>
<p style="padding-left: 30px;">Whew! Feel free to upload the files you just worked on. You can view the fruits of your labor by going to your WordPress Dashboard and clicking &#8220;Manage Locations&#8221; or &#8220;Add Locations&#8221; under the &#8220;Store Locator&#8221; menu. Your custom fields should show up like this:</p>
<div id="attachment_1576" class="wp-caption alignnone" style="width: 565px"><img class="size-full wp-image-1576" title="add_loc_afteradd" src="http://blueprintds.com/wp-content/uploads/2009/06/add_loc_afteradd.png" alt="Result of adding code to add-locations.php" width="555" height="324" /><p class="wp-caption-text">Above: Result of adding code to add-locations.php</p></div>
<hr />
<div id="attachment_1575" class="wp-caption alignnone" style="width: 565px"><img class="size-full wp-image-1575" title="view_loc_added" src="http://blueprintds.com/wp-content/uploads/2009/06/view_loc_added.png" alt="Result of adding code to view-locations.php" width="555" height="324" /><p class="wp-caption-text">Above: Result of adding code to view-locations.php</p></div>
<h4><strong>Step 3</strong>: Modify <strong>generate-xml.php</strong> and <strong>store-locator.js</strong></h4>
<p style="padding-left: 30px;">We need to modify these two files so our custom info shows up on the front end when the user interacts with the actual &#8220;store locator.&#8221;</p>
<p style="padding-left: 30px;">Modifying <strong>generate-xml.php</strong> is a bit more tricky than duplicating HTML (like we did previously) because we must add our custom fields (<strong>sl_creditcard</strong> and <strong>sl_giftcard</strong>) to a SQL query. But follow along closely and everything should turn out well!</p>
<p style="padding-left: 30px;">Open <strong>generate-xml.php</strong> and on line 43 find:</p>
<p>$query = sprintf(&#8220;SELECT sl_address, sl_store, sl_city, sl_state, sl_zip, sl_latitude, sl_longitude, sl_description, sl_url, sl_hours, sl_phone, sl_image,( $multiplier * acos( cos( radians(&#8216;%s&#8217;) ) * cos( radians( sl_latitude ) ) * cos( radians( sl_longitude ) &#8211; radians(&#8216;%s&#8217;) ) + sin( radians(&#8216;%s&#8217;) ) * sin( radians( sl_latitude ) ) ) ) AS sl_distance FROM &#8220;.$wpdb-&gt;prefix.&#8221;store_locator HAVING sl_distance &lt; &#8216;%s&#8217; ORDER BY sl_distance&#8221;,</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>$query = sprintf(&#8220;SELECT sl_address, sl_store, sl_city, sl_state, sl_zip, sl_latitude, sl_longitude, sl_description, sl_url, sl_hours, sl_phone, sl_image, <strong><em><span style="color: red;">sl_creditcard</span></em></strong>, <strong><em><span style="color: red;">sl_giftcard</span></em></strong>,( $multiplier * acos( cos( radians(&#8216;%s&#8217;) ) * cos( radians( sl_latitude ) ) * cos( radians( sl_longitude ) &#8211; radians(&#8216;%s&#8217;) ) + sin( radians(&#8216;%s&#8217;) ) * sin( radians( sl_latitude ) ) ) ) AS sl_distance FROM &#8220;.$wpdb-&gt;prefix.&#8221;store_locator HAVING sl_distance &lt; &#8216;%s&#8217; ORDER BY sl_distance&#8221;,</p>
<p style="padding-left: 30px;">Then, on line 69 to 72 find:</p>
<p>echo &#8216;hours=&#8221;&#8216; . parseToXML($row['sl_hours']) . &#8216;&#8221; &#8216;;<br />
echo &#8216;phone=&#8221;&#8216; . $row['sl_phone'] . &#8216;&#8221; &#8216;;<br />
echo &#8216;image=&#8221;&#8216; . $row['sl_image'] . &#8216;&#8221; &#8216;;<br />
echo &#8220;/&gt;\n&#8221;;</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>echo &#8216;hours=&#8221;&#8216; . parseToXML($row['sl_hours']) . &#8216;&#8221; &#8216;;<br />
echo &#8216;phone=&#8221;&#8216; . $row['sl_phone'] . &#8216;&#8221; &#8216;;<br />
echo &#8216;image=&#8221;&#8216; . $row['sl_image'] . &#8216;&#8221; &#8216;;<br />
<span style="color: red;">echo &#8216;<em><strong>creditcard</strong></em>=&#8221;&#8216; . $row['<em><strong>sl_creditcard</strong></em>'] . &#8216;&#8221; &#8216;;<br />
echo &#8216;<em><strong>giftcard</strong></em>=&#8221;&#8216; . $row['<em><strong>sl_giftcard</strong></em>'] . &#8216;&#8221; &#8216;;</span><br />
echo &#8220;/&gt;\n&#8221;;</p>
<p style="padding-left: 30px;">Okay, we&#8217;re almost there! All that&#8217;s left is <strong>store-locator.js</strong>&#8230;</p>
<p style="padding-left: 30px;">Open <strong>store-locator.js</strong> and on lines 61 to 63 find:</p>
<p>var hours = markers[i].getAttribute(&#8216;hours&#8217;);<br />
var phone = markers[i].getAttribute(&#8216;phone&#8217;);<br />
var image = markers[i].getAttribute(&#8216;image&#8217;);</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>var hours = markers[i].getAttribute(&#8216;hours&#8217;);<br />
var phone = markers[i].getAttribute(&#8216;phone&#8217;);<br />
<span style="color: red;">var <em><strong>creditcard</strong></em> = markers[i].getAttribute(&#8216;<em><strong>creditcard</strong></em>&#8216;);<br />
var <em><strong>giftcard</strong></em> = markers[i].getAttribute(&#8216;<em><strong>giftcard</strong></em>&#8216;);</span><br />
var image = markers[i].getAttribute(&#8216;image&#8217;);</p>
<p style="padding-left: 30px;">Then, on line 66 find:</p>
<p>var marker = createMarker(point, name, address, &#8220;&#8221;, description, url, hours, phone, image);</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>var marker = createMarker(point, name, address, &#8220;&#8221;, description, url, hours, phone, <span style="color: #ff0000;"><em><strong>creditcard</strong></em></span>, <span style="color: #ff0000;"><em><strong>giftcard</strong></em></span>, image);</p>
<p style="padding-left: 30px;">Then, on lines 139 to 141 find:</p>
<p>var hours = markers[i].getAttribute(&#8216;hours&#8217;);<br />
var phone = markers[i].getAttribute(&#8216;phone&#8217;);<br />
var image = markers[i].getAttribute(&#8216;image&#8217;);</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>var hours = markers[i].getAttribute(&#8216;hours&#8217;);<br />
var phone = markers[i].getAttribute(&#8216;phone&#8217;);<br />
<span style="color: #ff0000;">var <em><strong>creditcard</strong></em> = markers[i].getAttribute(&#8216;<em><strong>creditcard</strong></em>&#8216;);<br />
var <em><strong>giftcard</strong></em> = markers[i].getAttribute(&#8216;<em><strong>giftcard</strong></em>&#8216;);</span><br />
var image = markers[i].getAttribute(&#8216;image&#8217;);</p>
<p style="padding-left: 30px;">Then, on lines 143 find:</p>
<p>var marker = createMarker(point, name, address, homeAddress, description, url, hours, phone, image);</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>var marker = createMarker(point, name, address, homeAddress, description, url, hours, phone, <span style="color: #ff0000;"><em><strong>creditcard</strong></em></span>, <span style="color: #ff0000;"><em><strong>giftcard</strong></em></span>, image);</p>
<p style="padding-left: 30px;">Then, on lines 145 find:</p>
<p>var sidebarEntry = createSidebarEntry(marker, name, address, distance, homeAddress, url);</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>var sidebarEntry = createSidebarEntry(marker, name, address, distance, homeAddress, url, <span style="color: #ff0000;"><em><strong>creditcard</strong></em></span>, <span style="color: #ff0000;"><em><strong>giftcard</strong></em></span>);</p>
<p style="padding-left: 30px;">Then, on lines 154 find:</p>
<p>function createMarker(point, name, address, homeAddress, description, url, hours, phone, image) {</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>function createMarker(point, name, address, homeAddress, description, url, hours, phone, <span style="color: #ff0000;"><em><strong>creditcard</strong></em></span>, <span style="color: #ff0000;"><em><strong>giftcard</strong></em></span>, image) {</p>
<p style="padding-left: 30px;">Then, on lines 163 to 164 find:</p>
<p>if (hours!=&#8221;") {more_html+=&#8221;&lt;br/&gt;&lt;b&gt;Hours:&lt;/b&gt; &#8220;+hours;} else {hours=&#8221;"}<br />
if (phone!=&#8221;") {more_html+=&#8221;&lt;br/&gt;&lt;b&gt;Phone:&lt;/b&gt; &#8220;+phone;} else {phone=&#8221;"}</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>if (hours!=&#8221;") {more_html+=&#8221;&lt;br/&gt;&lt;b&gt;Hours:&lt;/b&gt; &#8220;+hours;} else {hours=&#8221;"}<br />
if (phone!=&#8221;") {more_html+=&#8221;&lt;br/&gt;&lt;b&gt;Phone:&lt;/b&gt; &#8220;+phone;} else {phone=&#8221;"}<br />
<span style="color: #ff0000;">if (<em><strong>creditcard</strong></em>!=&#8221;") {more_html+=&#8221;&lt;br/&gt;&lt;b&gt;<em><strong>Credit Card</strong></em>:&lt;/b&gt; &#8220;+<em><strong>creditcard</strong></em>;} else {<em><strong>creditcard</strong></em>=&#8221;"}<br />
if (<em><strong>giftcard</strong></em>!=&#8221;") {more_html+=&#8221;&lt;br/&gt;&lt;b&gt;<em><strong>Gift Card</strong></em>:&lt;/b&gt; &#8220;+<em><strong>giftcard</strong></em>;} else {<em><strong>giftcard</strong></em>=&#8221;"}</span></p>
<p style="padding-left: 30px;">Then, on line 188 find:</p>
<p>function createSidebarEntry(marker, name, address, distance, homeAddress, url) {</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>function createSidebarEntry(marker, name, address, distance, homeAddress, url, <span style="color: #ff0000;"><em><strong>creditcard</strong></em></span>, <span style="color: #ff0000;"><em><strong>giftcard</strong></em></span>) {</p>
<p style="padding-left: 30px;">Then, on line 197 find:</p>
<p>var html = &#8216;&lt;center&gt;&lt;table width=&#8221;96%&#8221; cellpadding=&#8221;4px&#8221; cellspacing=&#8221;0&#8243; class=&#8221;searchResultsTable&#8221;&gt;&lt;tr&gt;&lt;td width=&#8221;30%&#8221; style=&#8221;padding-right:4px&#8221; valign=&#8221;top&#8221;&gt;&lt;b&gt;&#8217; + name + &#8216;&lt;/b&gt;&lt;br&gt;&#8217; + distance.toFixed(1) + &#8216; &#8216; + sl_distance_unit + &#8216;&lt;/td&gt;&lt;td width=&#8221;40%&#8221; valign=&#8221;top&#8221;&gt;&#8217; + street + &#8216;&lt;br/&gt;&#8217; + city + state_zip +&#8217; &lt;/td&gt;&lt;td width=&#8221;30%&#8221; valign=&#8221;top&#8221; style=&#8221;text-align:right&#8221;&gt;&#8217; + link + &#8216;&lt;a href=&#8221;http://&#8217; + sl_google_map_domain + &#8216;/maps?saddr=&#8217; + homeAddress + &#8216;&amp;daddr=&#8217; + address + &#8216;&#8221; target=&#8221;_blank&#8221; class=&#8221;storelocatorlink&#8221;&gt;Directions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;&#8217;;</p>
<p style="padding-left: 30px;">And do the following:</p>
<p>var html = &#8216;&lt;center&gt;&lt;table width=&#8221;96%&#8221; cellpadding=&#8221;4px&#8221; cellspacing=&#8221;0&#8243; class=&#8221;searchResultsTable&#8221;&gt;&lt;tr&gt;&lt;td width=&#8221;30%&#8221; style=&#8221;padding-right:4px&#8221; valign=&#8221;top&#8221;&gt;&lt;b&gt;&#8217; + name + &#8216;&lt;/b&gt;&lt;br&gt;&#8217; + distance.toFixed(1) + &#8216; &#8216; + sl_distance_unit + &#8216;<span style="color: #ff0000;">&lt;br&gt;<em><strong>Credit Card</strong></em>: &#8216; + <em><strong>creditcard</strong></em> + &#8216;&lt;br&gt;<em><strong>Gift Card</strong></em>: &#8216; + <em><strong>giftcard</strong></em> + &#8216;</span>&lt;/td&gt;&lt;td width=&#8221;40%&#8221; valign=&#8221;top&#8221;&gt;&#8217; + street + &#8216;&lt;br/&gt;&#8217; + city + state_zip +&#8217; &lt;/td&gt;&lt;td width=&#8221;30%&#8221; valign=&#8221;top&#8221; style=&#8221;text-align:right&#8221;&gt;&#8217; + link + &#8216;&lt;a href=&#8221;http://&#8217; + sl_google_map_domain + &#8216;/maps?saddr=&#8217; + homeAddress + &#8216;&amp;daddr=&#8217; + address + &#8216;&#8221; target=&#8221;_blank&#8221; class=&#8221;storelocatorlink&#8221;&gt;Directions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;&#8217;;</p>
<p style="padding-left: 30px;">Congratulations, if you&#8217;ve followed the steps correctly your custom fields should be showing up on the front end like this:</p>
<div id="attachment_1581" class="wp-caption alignnone" style="width: 475px"><img class="size-full wp-image-1581" title="final_map" src="http://blueprintds.com/wp-content/uploads/2009/06/final_map.png" alt="Above: Our custom fields on the front end!" width="465" height="527" /><p class="wp-caption-text">Above: Our custom fields on the front end!</p></div>
<div style="text-align: center">This tutorial was written by <a title="Joel Kuczmarski's Profile Site" href="http://www.joelak.com">Joel Kuczmarski</a>, a web designer in Chicago working for Blue Print Design Studio. Send any personal comments or questions to joelk [at] blueprintds [dot] com</div>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress+-+http://b2l.me/wrz3+(via+@blueprintds)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;t=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-mail">
			<a href="mailto:?subject=%22Tutorial%3A%20How%20to%20add%20forms%20to%20Store-Locator%20plugin%20in%20WordPress%22&amp;body=I%20thought%20this%20article%20might%20interest%20you.%0A%0A%22Yesterday%20I%20had%20to%20add%20some%20custom%20forms%20to%20a%20WordPress%20plugin%20called%20Google%20Maps%20Store%20Locator%20for%20WordPress%20%28version%201.2.28%29%20and%20found%20it%27s%20not%20as%20straight-forward%20as%20one%20might%20expect.%20After%20about%20forty-five%20minutes%20of%20digging%20through%20all%20of%20the%20plugin%27s%20files%2C%20I%20located%20four%20that%20were%20of%20use%20to%20m%22%0A%0AYou%20can%20read%20the%20full%20article%20here%3A%20http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/" rel="nofollow" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;submitHeadline=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress&amp;submitSummary=Yesterday%20I%20had%20to%20add%20some%20custom%20forms%20to%20a%20WordPress%20plugin%20called%20Google%20Maps%20Store%20Locator%20for%20WordPress%20%28version%201.2.28%29%20and%20found%20it%27s%20not%20as%20straight-forward%20as%20one%20might%20expect.%20After%20about%20forty-five%20minutes%20of%20digging%20through%20all%20of%20the%20plugin%27s%20files%2C%20I%20located%20four%20that%20were%20of%20use%20to%20m&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;t=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Post this to MySpace">Post this to MySpace</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress&amp;summary=Yesterday%20I%20had%20to%20add%20some%20custom%20forms%20to%20a%20WordPress%20plugin%20called%20Google%20Maps%20Store%20Locator%20for%20WordPress%20%28version%201.2.28%29%20and%20found%20it%27s%20not%20as%20straight-forward%20as%20one%20might%20expect.%20After%20about%20forty-five%20minutes%20of%20digging%20through%20all%20of%20the%20plugin%27s%20files%2C%20I%20located%20four%20that%20were%20of%20use%20to%20m&amp;source=Chicago Web Design" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-google">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/&amp;title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress" rel="nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Tutorial%3A+How+to+add+forms+to+Store-Locator+plugin+in+WordPress&amp;link=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-sphinn">
			<a href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/" rel="nofollow" title="Sphinn this on Sphinn">Sphinn this on Sphinn</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblueprintds.com%2F2009%2F06%2F13%2Ftutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px;margin-top:5px;"></iframe>]]></content:encoded>
			<wfw:commentRss>http://blueprintds.com/2009/06/13/tutorial-how-to-add-forms-to-store-locator-plugin-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
