<?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>IIS.Magento &#187; beginner guide</title>
	<atom:link href="http://www.iismagento.com/category/beginner-guide/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iismagento.com</link>
	<description>Making Magento play on IIS</description>
	<lastBuildDate>Tue, 16 Feb 2010 21:56:36 +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>Using magento configuration data</title>
		<link>http://www.iismagento.com/2009/06/using-magento-configuration-data/</link>
		<comments>http://www.iismagento.com/2009/06/using-magento-configuration-data/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 11:18:13 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[beginner guide]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.iismagento.com/?p=64</guid>
		<description><![CDATA[The previous post looked at how to add configuration variables to Magento. This Post will show how to set and use the variables.
The naming convention for variables is the path through the xml, section/group/form. So the url variable from the previous post is shipping/mydispatch/url.
The function to retireve the value of the variable is
Mage::getStoreConfig(&#8217;shipping/mydispatch/url&#8217;)
for a specific [...]]]></description>
			<content:encoded><![CDATA[<p>The previous post looked at how to <a href="http://www.iismagento.com/2009/06/adding-configuration-variables-to-magento/">add configuration variables</a> to Magento. This Post will show how to set and use the variables.</p>
<p>The naming convention for variables is the path through the xml, section/group/form. So the url variable from the previous post is shipping/mydispatch/url.</p>
<p>The function to retireve the value of the variable is</p>
<p style="padding-left: 30px;">Mage::getStoreConfig(&#8217;shipping/mydispatch/url&#8217;)</p>
<p>for a specific store use</p>
<p style="padding-left: 30px;">Mage::getStoreConfig(&#8217;shipping/mydispatch/url&#8217;,x)</p>
<p style="padding-left: 30px;">Where x is id of the store</p>
<p>The default variables can also be set in the config.xml file for your module. For example to set default test values for the mydispatch module one can use the following</p>
<pre class="brush: xml;">
&lt;config&gt;

&lt;default&gt;

&lt;shipping&gt;

&lt;mydispatch&gt;

&lt;url&gt;test.mydispatch.com/testsystem&lt;/url&gt;

&lt;user&gt;Tester1&lt;/user&gt;

&lt;secret&gt;Password1&lt;/secret&gt;

&lt;/mydispatch&gt;

&lt;/shipping&gt;

&lt;/default&gt;

&lt;/config&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.iismagento.com/2009/06/using-magento-configuration-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding configuration variables to Magento</title>
		<link>http://www.iismagento.com/2009/06/adding-configuration-variables-to-magento/</link>
		<comments>http://www.iismagento.com/2009/06/adding-configuration-variables-to-magento/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 10:18:18 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[beginner guide]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.iismagento.com/?p=40</guid>
		<description><![CDATA[Configuration variables in Magento control the setup an operation of your store, through the configuration settings in the admin portal. Creating new configuration variables and sections for your own modules is very straight forward.
Looking at the configuration for an existing configuration section, the Locale options in the General section.

So we can write the location of [...]]]></description>
			<content:encoded><![CDATA[<p>Configuration variables in Magento control the setup an operation of your store, through the configuration settings in the admin portal. Creating new configuration variables and sections for your own modules is very straight forward.</p>
<p>Looking at the configuration for an existing configuration section, the Locale options in the General section.</p>
<p><a href="http://www.iismagento.com/wp-content/uploads/2009/06/configuration_general_local.jpg"><img class="aligncenter size-full wp-image-41" title="configuration_general_locale" src="http://www.iismagento.com/wp-content/uploads/2009/06/configuration_general_local.jpg" alt="configuration_general_locale" width="740" height="497" /></a></p>
<p>So we can write the location of each variable shown as</p>
<p>config/general/locale/timezone<br />
config/general/locale/locale<br />
config/general/ locale/first<br />
config/ general/locale/weekend</p>
<p>I have used only the first word of each name to simplify the path. Conveniently this maps to the xml that is used to build these variables; shown below.</p>
<pre class="brush: xml;">
&lt;config&gt;
&lt;sections&gt;
&lt;general translate=&quot;label&quot; module=&quot;core&quot;&gt;
&lt;label&gt;General&lt;/label&gt;
&lt;tab&gt;general&lt;/tab&gt;
&lt;frontend_type&gt;text&lt;/frontend_type&gt;
&lt;sort_order&gt;10&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;
&lt;groups&gt;
&lt;locale translate=&quot;label&quot;&gt;
&lt;label&gt;Locale options&lt;/label&gt;
&lt;frontend_type&gt;text&lt;/frontend_type&gt;
&lt;sort_order&gt;8&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;
&lt;fields&gt;
&lt;timezone translate=&quot;label&quot;&gt;
&lt;label&gt;Timezone&lt;/label&gt;
&lt;frontend_type&gt;select&lt;/frontend_type&gt;
&lt;source_model&gt;adminhtml/system_config_source_locale_timezone&lt;/source_model&gt;
&lt;sort_order&gt;1&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;0&lt;/show_in_store&gt;
&lt;/timezone&gt;
&lt;code translate=&quot;label&quot;&gt;
&lt;label&gt;Locale&lt;/label&gt;
&lt;frontend_type&gt;select&lt;/frontend_type&gt;
&lt;source_model&gt;adminhtml/system_config_source_locale&lt;/source_model&gt;
&lt;sort_order&gt;5&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;
&lt;/code&gt;
&lt;firstday translate=&quot;label&quot;&gt;
&lt;label&gt;First Day of Week&lt;/label&gt;
&lt;frontend_type&gt;select&lt;/frontend_type&gt;
&lt;source_model&gt;adminhtml/system_config_source_locale_weekdays&lt;/source_model&gt;
&lt;sort_order&gt;10&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;
&lt;/firstday&gt;
&lt;weekend translate=&quot;label&quot;&gt;
&lt;label&gt;Weekend Days&lt;/label&gt;
&lt;frontend_type&gt;multiselect&lt;/frontend_type&gt;
&lt;source_model&gt;adminhtml/system_config_source_locale_weekdays&lt;/source_model&gt;
&lt;sort_order&gt;15&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;
&lt;/weekend&gt;
&lt;/fields&gt;
&lt;/locale&gt;
&lt;/groups&gt;
&lt;/general&gt;
&lt;/sections&gt;
&lt;/config&gt;
</pre>
<p>Looking at the first 4 lines it states that this is configuration data, the section tag shows that the next tag will be at the section level. The general tag is the identifier for the section. Imediately within this are a five tags which configure the section.<br />
Following the section configuration is the groups tag. This indicates that the next blocks are groups. The locale tag is the identifier for the group. as with the section the next 6 tags set the properties for the group.<br />
The fields tag then indicates that the following blocks represent the fields to show. Again the first tag is the idenitifer of the field, followed by tags to configure the field.<br />
The configuration variables at the section and groups levels are</p>
<ul>
<li>label &#8211; The displayed text</li>
<li>tab &#8211; which menu tab the section appears within</li>
<li>frontend_type &#8211; always text for sections and groups</li>
<li>sort_order &#8211; order of display lower number shows higher</li>
<li>show_in_default &#8211; Show in the default view</li>
<li>show_in_website &#8211; Show in the website level view</li>
<li>show_in_store &#8211; Show in the store level view</li>
</ul>
<p>configuration tags for field</p>
<ul>
<li>label</li>
<li>frontend_type &#8211; field type &#8211; text, textarea, select, label, image, multiselect, time, password, allowspecific</li>
<li>source_model &#8211; Model class to call for list data</li>
<li>sort_order</li>
<li>show_in_default</li>
<li>show_in_website</li>
<li>show_in_store</li>
</ul>
<p><strong>Example</strong></p>
<p>The example module acme_mydispatch needs configuration variables to set the url to connect on and the user account details. This logically goes in the shipping section. The xml used is</p>
<pre class="brush: xml;">
&lt;config&gt;
&lt;sections&gt;
&lt;shipping&gt;
&lt;groups&gt;

&lt;mydispatch translate=&quot;label&quot;&gt;

&lt;label&gt;My Dispatch Connection data&lt;/label&gt;
&lt;frontend_type&gt;text&lt;/frontend_type&gt;
&lt;sort_order&gt;50&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;0&lt;/show_in_website&gt;
&lt;show_in_store&gt;0&lt;/show_in_store&gt;

&lt;fields&gt;

&lt;url translate=&quot;label&quot;&gt;

&lt;label&gt;url&lt;/label&gt;
&lt;frontend_type&gt;text&lt;/frontend_type&gt;
&lt;sort_order&gt;10&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;

&lt;/url&gt;

&lt;user translate=&quot;label&quot;&gt;

&lt;label&gt;User ID&lt;/label&gt;
&lt;frontend_type&gt;text&lt;/frontend_type&gt;
&lt;sort_order&gt;20&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;

&lt;/user&gt;

&lt;secret translate=&quot;label&quot;&gt;

&lt;label&gt;Secret Key&lt;/label&gt;
&lt;frontend_type&gt;password&lt;/frontend_type&gt;
&lt;sort_order&gt;30&lt;/sort_order&gt;
&lt;show_in_default&gt;1&lt;/show_in_default&gt;
&lt;show_in_website&gt;1&lt;/show_in_website&gt;
&lt;show_in_store&gt;1&lt;/show_in_store&gt;

&lt;/secret&gt;

&lt;/fields&gt;

&lt;/mydispatch&gt;
&lt;/groups&gt;
&lt;/shipping&gt;
&lt;/sections&gt;
&lt;/config&gt;
</pre>
<p>This creates the configuration settings shown below.</p>
<p><a href="http://www.iismagento.com/wp-content/uploads/2009/06/shipping_settings.jpg"><img class="aligncenter size-full wp-image-61" title="shipping_settings" src="http://www.iismagento.com/wp-content/uploads/2009/06/shipping_settings.jpg" alt="shipping_settings" width="740" height="382" /></a><br />
In the next post I&#8217;ll look at how to use the new variables we have just created.</p>
<p>Note &#8211; creating a new section requires a module to be defined, in version 1.2 this assumes the module is a mage_ module. this make screating custom tabs trciky and a topic for a future post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iismagento.com/2009/06/adding-configuration-variables-to-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento Modules</title>
		<link>http://www.iismagento.com/2009/06/magento-modules/</link>
		<comments>http://www.iismagento.com/2009/06/magento-modules/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 15:48:26 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[beginner guide]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://www.iismagento.com/?p=23</guid>
		<description><![CDATA[Magento is built using the MVC  model, this provides for clear sepperation of the logic and display. Each part of Magento is constructed as a module which adhears to this convention. When developing new modules you must also adhear to the convention.
Initially the structure can be a little hard to understand, however once over the [...]]]></description>
			<content:encoded><![CDATA[<p>Magento is built using the MVC  model, this provides for clear sepperation of the logic and display. Each part of Magento is constructed as a module which adhears to this convention. When developing new modules you must also adhear to the convention.</p>
<p>Initially the structure can be a little hard to understand, however once over the learning hurdle it becomes very easy to add new features or override exisiting features.</p>
<p>At it&#8217;s simplest a module is two files, one to tell the system the module exists and one to detail the features of the module.</p>
<p>A module must follow a simple naming convention, of developer_moduleTitle. The developer will be your name or buisness name, the module title is the descriptive name for the module. For example a business called Acme creating a module to integrate with their dispatch system called mydispatch might create a module acme_mydispatch.</p>
<p>The module name is also the folder path to store all the files for the module. It is important that folder paths follow the naming conventions as paths are determined from class or module names and visa versa.</p>
<p>All modules exist in one of three folders, these are code\core, code\community, code\local</p>
<ul>
<li>core &#8211; used for all magento built in modules. Never edit this folder.</li>
<li>community &#8211; used for modules downloaded from the magento community.</li>
<li>local &#8211; used for your own developed code. Always place your overrides and modules in this folder.</li>
</ul>
<p><a href="http://www.iismagento.com/wp-content/uploads/2009/06/mydispatch_folders.gif"><img class="alignright size-full wp-image-30" title="mydispatch_folders" src="http://www.iismagento.com/wp-content/uploads/2009/06/mydispatch_folders.gif" alt="mydispatch_folders" width="218" height="195" /></a>Magento is written such that folders have a hierachy of local-&gt;community-&gt;core.  Within the local folders the module is structured as developer/module. The folder structure for the example module is shown on the right.</p>
<p><strong>config.xml</strong></p>
<p>config.xml must exist in the etc folder. The file contains xml which tells Magento how to apply the module. This includes</p>
<ul>
<li>version number</li>
<li>available models</li>
<li>url rewrite rules</li>
<li>url definitions</li>
<li>helpers</li>
</ul>
<p>The version is used by magento to determine if it should run SQL scripts to update the database for the current version. This means that upgrading the module is a case of dropping in the new files and updating the version number.</p>
<p>Models, url rewrites, url definitions and helpers will be explained more in future posts. Below is an example of the minimum possible  XML</p>
<pre class="brush: xml;">
&lt;config&gt;
&lt;modules&gt;
&lt;acme_mydispatch&gt;
&lt;version&gt;0.1.0&lt;/version&gt;
&lt;/acme_mydispatch&gt;
&lt;/modules&gt;
&lt;/config&gt;
</pre>
<p>&lt;strong&gt;acme_mydispatch.xml&lt;/strong&gt;</p>
<p>Magento needs to know that your module exists. This is done by creating an xml file in app/etc/modules called developer_module.xml. The xml tells magento the activation state and the code pool. In most cases activation state will be true as you want to use the module. The code pool is the code the module should use by default. generally this will be local.</p>
<p>Below is an example of the XML.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
&lt;modules&gt;
&lt;acme_mydispatch&gt;
&lt;active&gt;true&lt;/active&gt;
&lt;codePool&gt;local&lt;/codePool&gt;
&lt;/acme_mydispatch&gt;
&lt;/modules&gt;
&lt;/config&gt;
</pre>
<p><strong>Check the module is loaded</strong></p>
<p>To check the module has loaded, open the Magento admin interface and browse to System/Configuration/Advanced. Expand the Disable modules output section, this lists all loaded modules. Your module should be listed and the active state match that set in your config file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iismagento.com/2009/06/magento-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
