<?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>Jontas &#187; Magento</title>
	<atom:link href="http://www.f15ijp.com/tag/magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.f15ijp.com</link>
	<description>My digital notepad (notes etc)</description>
	<lastBuildDate>Wed, 28 Dec 2011 18:24:47 +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>Magento change store via url</title>
		<link>http://www.f15ijp.com/2010/12/16/magento-change-store-via-url/</link>
		<comments>http://www.f15ijp.com/2010/12/16/magento-change-store-via-url/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 16:21:08 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[multi store]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=761</guid>
		<description><![CDATA[In a multi store environment there is sometimes a need to change the store when the user clicks a link. A &#8220;simple&#8221; way to do this is to pass the store along in the url (just add a &#8220;?___store=&#8221; either id or the store name, so for instance. $stores = $category-&#62;getStoreIds&#40;&#41;; echo '&#60;p&#62;&#60;a href=&#34;'. Mage::getUrl&#40;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>In a multi store environment there is sometimes a need to change the store when the user clicks a link.<br />
A &#8220;simple&#8221; way to do this is to pass the store along in the url (just add a &#8220;?___store=&#8221; either id or the store name, so for instance.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$stores</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStoreIds</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'?___store='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">end</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$stores</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/12/16/magento-change-store-via-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Get the skin url</title>
		<link>http://www.f15ijp.com/2010/11/27/magento-get-the-skin-url/</link>
		<comments>http://www.f15ijp.com/2010/11/27/magento-get-the-skin-url/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 15:59:47 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=747</guid>
		<description><![CDATA[When editing Magento tempates or CMS pages you will have a need to access images and other content inside the skin/&#8212;/images folder. Instead of making hard coded links in the CMS or templates a better way is to get this from Magento (one of the many reasons for doing this is that it will still [...]]]></description>
			<content:encoded><![CDATA[<p>When editing Magento tempates or CMS pages you will have a need to access images and other content inside the skin/&#8212;/images folder. Instead of making hard coded links in the CMS or templates a better way is to get this from Magento (one of the many reasons for doing this is that it will still work if something in the directory structure is changed &#8211; like say you dev server is dev.something/shopverige but the live store is directly on a domain like say <a href="http://www.shopsverige.se">http://www.shopsverige.se</a></p>
<p>Here is how to do it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!-- this is inside of .phtml files --&gt;
&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSkinUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'images/coolimage.png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;arrow&quot;/&gt;
&nbsp;
&lt;!-- use this is in cms block --&gt;
&lt;img src=&quot;{{skin url='images/coolerimage.png'}}&quot; alt=&quot;&quot; /&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/11/27/magento-get-the-skin-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Selling clothing (or anyother product with options) while having Magento keep track of stock</title>
		<link>http://www.f15ijp.com/2010/10/26/magento-selling-clothing-or-anoy-other-product-with-options-while-having-magento-keep-track-of-stock/</link>
		<comments>http://www.f15ijp.com/2010/10/26/magento-selling-clothing-or-anoy-other-product-with-options-while-having-magento-keep-track-of-stock/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 11:31:08 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento admin]]></category>
		<category><![CDATA[product]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=717</guid>
		<description><![CDATA[Creating confugurable products is more work than adding custom attributes but it might be better in some cases (keeping track of stock, having one set of attributes to select from etc). In short the steps needed are Create the attributes that will be configurable by the user &#8211; for our example they will be Size [...]]]></description>
			<content:encoded><![CDATA[<p>Creating confugurable products is more work than <a href="http://www.f15ijp.com/2010/10/25/magento-selling-clothing-or-anoy-other-product-with-options-without-having-magento-keep-track-of-stock/">adding custom attributes</a> but it might be better in some cases (keeping track of stock, having one set of attributes to select from etc).</p>
<p>In short the steps needed are</p>
<ol>
<li>Create the attributes that will be configurable by the user &#8211; for our example they will be Size and Color</li>
<li>Create the attribute set that will be assigned to the variant products &#8211; for our example, we’ll call it “T-shirt”</li>
<li>Create the individual variant products</li>
<li>Create the configurable product, and add the “T-shirt” attribute set</li>
<li>Add the individual variants to this configurable product</li>
</ol>
<p><b>Create the attributes that will be configurable by the user &#8211; for our example they will be Size and Color</b><br />
In the adminpanel this is under Catalog->Attributes->Manage Attributes<br />
Scope needs to be set to Global and Input type to drop down. Once this is done then Use To Create Configurable Product is shown and this should be set to yes. Setting required to yes is a good idea as well.<br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-01-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-01-attribute_admin-300x224.png" alt="" title="shirt-01-attribute_admin" width="300" height="224" class="alignnone size-medium wp-image-724" /></a><br />
Under label / options create a label (for instance size) and give the different options it can take.<br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-02-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-02-attribute_admin-300x154.png" alt="" title="shirt-02-attribute_admin" width="300" height="154" class="alignnone size-medium wp-image-721" /></a><br />
Repeat for all attributes you want to create (for instance size and color)</p>
<p><b>Create the attribute set that will be assigned to the variant products &#8211; for our example, we’ll call it &#8220;T-shirt&#8221;</b><br />
Now we’re ready to create an attribute set called “T-shirt” to start using for this product.  Go to “Catalog -> Attributes -> Manage Attribute Sets” and press “Add New Set”.<br />
Give the new set a name and then drag and drop the attributes to the group where you want them to be when creating a product.<br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-03-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-03-attribute_admin-300x200.png" alt="" title="shirt-03-attribute_admin" width="300" height="200" class="alignnone size-medium wp-image-723" /></a></p>
<p><b>Create the individual variant products</b><br />
Create a product and make sure that you use the attribute set you have created. Add the attributes where you placed them.<br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-04-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-04-attribute_admin-300x83.png" alt="" title="shirt-04-attribute_admin" width="300" height="83" class="alignnone size-medium wp-image-727" /></a><br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-05-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-05-attribute_admin-300x37.png" alt="" title="shirt-05-attribute_admin" width="300" height="37" class="alignnone size-medium wp-image-728" /></a><br />
Repeat for all the products you have</p>
<p><b>Create the configurable product, and add the “T-shirt” attribute set</b><br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-06-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-06-attribute_admin-300x79.png" alt="" title="shirt-06-attribute_admin" width="300" height="79" class="alignnone size-medium wp-image-730" /></a><br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-07-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-07-attribute_admin-300x178.png" alt="" title="shirt-07-attribute_admin" width="300" height="178" class="alignnone size-medium wp-image-731" /></a></p>
<p><b>Add the individual variants to this configurable product</b><br />
This can be done when the configurable product is created or later on using edit product.<br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-08-attribute_admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-08-attribute_admin-300x152.png" alt="" title="shirt-08-attribute_admin" width="300" height="152" class="alignnone size-medium wp-image-733" /></a></p>
<p><b>And then it should look something like this in the shop</b><br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-09-store.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/shirt-09-store-259x300.png" alt="" title="shirt-09-store" width="259" height="300" class="alignnone size-medium wp-image-735" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/10/26/magento-selling-clothing-or-anoy-other-product-with-options-while-having-magento-keep-track-of-stock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Selling clothing (or another product with options) without having Magento keep track of stock</title>
		<link>http://www.f15ijp.com/2010/10/25/magento-selling-clothing-or-anoy-other-product-with-options-without-having-magento-keep-track-of-stock/</link>
		<comments>http://www.f15ijp.com/2010/10/25/magento-selling-clothing-or-anoy-other-product-with-options-without-having-magento-keep-track-of-stock/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 12:41:41 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento admin]]></category>
		<category><![CDATA[product]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=697</guid>
		<description><![CDATA[Some products have a number of options that are important for the customer to select. Here I show how to make a product with options (color and size) where Magento only sees one product &#8211; so it won&#8217;t it will not be possible to see how many large in red you have from Magento. When [...]]]></description>
			<content:encoded><![CDATA[<p>Some products have a number of options that are important for the customer to select.<br />
Here I show how to make a product with options (color and size) where Magento only sees one product &#8211; so it won&#8217;t it will not be possible to see how many large in red you have from Magento.</p>
<p>When you create a product in the admin panel there is a label Custom Options.<br/><br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/clothing-admin.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/10/clothing-admin-300x252.png" alt="" title="clothing-admin" width="300" height="252" class="alignnone size-medium wp-image-704" /></a><br />
<br/><br />
Use &#8220;Add new option&#8221; to make the option (color, size or whatnot)<br />
Then for each of the options use add new row to add the deferent values that the option can have.<br />
The column labeled price is for adding a extra cost for a option (if for instance the red shirt should be more expensive).</p>
<p>Then this will look something like this in the store<br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/10/clothing-store.png"><img class="alignnone size-medium wp-image-707" title="clothing-store" src="http://www.f15ijp.com/wp-content/uploads/2010/10/clothing-store-245x300.png" alt="" width="245" height="300" /></a></p>
<p>Then only down sides I have seen with this is that I have to add the options one time for each of the products (but that is also nice since not all products have the same values) and that Magento will treat this as one single product so I can&#8217;t let Magento manage the stock for this/these products.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/10/25/magento-selling-clothing-or-anoy-other-product-with-options-without-having-magento-keep-track-of-stock/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento redirect</title>
		<link>http://www.f15ijp.com/2010/10/25/magento-redirect/</link>
		<comments>http://www.f15ijp.com/2010/10/25/magento-redirect/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 10:24:45 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=692</guid>
		<description><![CDATA[Sometimes there is a need to do a redirect from inside a Magento page where you might not know if headers are sent or not &#8211; Or maybe you wish to make a new redirect function where you don&#8217;t have to worry about writing different code if the headers are sent or not. This is [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes there is a need to do a redirect from inside a Magento page where you might not know if headers are sent or not &#8211; Or maybe you wish to make a new redirect function where you don&#8217;t have to worry about writing different code if the headers are sent or not.</p>
<p>This is a way to do a redirect where a javascript redirect is used if headers have been sent (and thus it is no longer possible to use a header redirect)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">headers_sent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	Mage<span style="color: #339933;">::</span><span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setRedirect</span><span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getBaseUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'portal/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$baseUrl</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getBaseUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'portal/'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">'&lt;script type=&quot;text/javascript&quot;&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;window.location.href = '<span style="color: #006699; font-weight: bold;">{$baseUrl}</span>';&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">'&lt;/script&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And the function <a href="http://php.net/manual/en/function.headers-sent.php">headers_sent()</a> is a php function so that can of course be used outside of Magento in any php scrip where a header location is nice but not always possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/10/25/magento-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Problem uploading images</title>
		<link>http://www.f15ijp.com/2010/10/11/magento-problem-uploading-images/</link>
		<comments>http://www.f15ijp.com/2010/10/11/magento-problem-uploading-images/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 09:16:26 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento admin]]></category>
		<category><![CDATA[product]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=680</guid>
		<description><![CDATA[When I was truing to upload images to products in the Magento admin panel I got the following error: SSL Error: Invalid or self-signed certificate while uploading image from backend The way I solved this issue was by setting the timezone on the computer that I was uploading from to the same timezone as the [...]]]></description>
			<content:encoded><![CDATA[<p>When I was truing to upload images to products in the Magento admin panel I got the following error:<br />
<span style="color: #ff0000;">SSL Error: Invalid or self-signed certificate while uploading image from backend</span></p>
<p>The way I solved this issue was by setting the timezone on the computer that I was uploading from to the same timezone as the settings in Magento.</p>
<p>Other suggestions to try out if that don&#8217;t work:</p>
<ul>
<li>If you are using certificate: Verify that it is valid, you have correct domains etc</li>
<li>Set use secure url in admin to false</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/10/11/magento-problem-uploading-images/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento: Redirecting from inside a view</title>
		<link>http://www.f15ijp.com/2010/09/30/magento-redirecting-from-inside-a-view/</link>
		<comments>http://www.f15ijp.com/2010/09/30/magento-redirecting-from-inside-a-view/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 14:06:46 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=665</guid>
		<description><![CDATA[To redirect before headers are started to be sent (for instance from inside a controller) the following works: Mage::app&#40;&#41;-&#62;getFrontController&#40;&#41;-&#62;getResponse&#40;&#41;-&#62;setRedirect&#40;Mage::getUrl&#40;'portal'&#41;&#41;; This will redirect to the page called portal. However if you try to do this from a view then you will get an error message about headers already having been sent. If you need to do [...]]]></description>
			<content:encoded><![CDATA[<p>To redirect before headers are started to be sent (for instance from inside a controller) the following works:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Mage<span style="color: #339933;">::</span><span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrontController</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setRedirect</span><span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'portal'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will redirect to the page called portal.</p>
<p>However if you try to do this from a view then you will get an error message about headers already having been sent.<br />
If you need to do a redirect form inside a view then using javascript is one way to do this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Due to SOMEREASON you are being redirected &lt;a herf=&quot;'</span> <span style="color: #339933;">.</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'portal'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;Please click here if nothing happens&lt;/a&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;script type=&quot;text/javascript&quot;&gt;
		&lt;!--
		window.location = &quot;'</span> <span style="color: #339933;">.</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'portal'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;
		//--&gt;
		&lt;/script&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>However a tip is to reconsider if you really need to do the redirect from the view, doing it from the controller is a lot easier and quicker.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/09/30/magento-redirecting-from-inside-a-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Loading a store by store_id</title>
		<link>http://www.f15ijp.com/2010/09/30/magento-loading-a-store-by-store_id/</link>
		<comments>http://www.f15ijp.com/2010/09/30/magento-loading-a-store-by-store_id/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 12:18:08 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[store]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=654</guid>
		<description><![CDATA[Sometimes there is a need to load a store from the store id, this is not hard to do once you find the right function. Mage::getModel&#40;'core/store'&#41;-&#62;load&#40;$storeId&#41;; //a store object A store object might look like this. Each of the data has a get and a set fucntion (so getIsActive() returns if the store is active [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes there is a need to load a store from the store id, this is not hard to do once you find the right function.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'core/store'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$storeId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//a store object</span></pre></div></div>

<p>A store object might look like this. Each of the data has a get and a set fucntion (so getIsActive() returns if the store is active or not)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
&nbsp;
Mage_Core_Model_Store Object
<span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#91;</span>_cacheTag<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
    <span style="color: #009900;">&#91;</span>_eventPrefix<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> store
    <span style="color: #009900;">&#91;</span>_eventObject<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> store
    <span style="color: #009900;">&#91;</span>_priceFilter<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_website<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_group<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_configCache<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_configCacheBaseNodes<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span>
        <span style="color: #009900;">&#40;</span>
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> catalog<span style="color: #339933;">/</span>price<span style="color: #339933;">/</span>scope
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>secure<span style="color: #339933;">/</span>base_url
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>secure<span style="color: #339933;">/</span>use_in_adminhtml
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>secure<span style="color: #339933;">/</span>use_in_frontend
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>url<span style="color: #339933;">/</span>use_store
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>unsecure<span style="color: #339933;">/</span>base_url
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>seo<span style="color: #339933;">/</span>use_rewrites
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>unsecure<span style="color: #339933;">/</span>base_link_url
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> web<span style="color: #339933;">/</span>secure<span style="color: #339933;">/</span>base_link_url
            <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> general<span style="color: #339933;">/</span>locale<span style="color: #339933;">/</span>code
        <span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #009900;">&#91;</span>_dirCache<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #009900;">&#91;</span>_urlCache<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #009900;">&#91;</span>_baseUrlCache<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #009900;">&#91;</span>_session<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_isAdminSecure<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_isFrontSecure<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_isReadOnly<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">private</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_resourceName<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> core<span style="color: #339933;">/</span>store
    <span style="color: #009900;">&#91;</span>_resource<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_resourceCollectionName<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> core<span style="color: #339933;">/</span>store_collection
    <span style="color: #009900;">&#91;</span>_dataSaveAllowed<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
    <span style="color: #009900;">&#91;</span>_data<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span>
        <span style="color: #009900;">&#40;</span>
            <span style="color: #009900;">&#91;</span>store_id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">64</span>
            <span style="color: #009900;">&#91;</span>code<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> mystore
            <span style="color: #009900;">&#91;</span>website_id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
            <span style="color: #009900;">&#91;</span>group_id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">25</span>
            <span style="color: #009900;">&#91;</span>name<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> mystore
            <span style="color: #009900;">&#91;</span>sort_order<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span>
            <span style="color: #009900;">&#91;</span>is_active<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
        <span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #009900;">&#91;</span>_origData<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span>
        <span style="color: #009900;">&#40;</span>
            <span style="color: #009900;">&#91;</span>store_id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">64</span>
            <span style="color: #009900;">&#91;</span>code<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> mystore
            <span style="color: #009900;">&#91;</span>website_id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
            <span style="color: #009900;">&#91;</span>group_id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">25</span>
            <span style="color: #009900;">&#91;</span>name<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> mystore
            <span style="color: #009900;">&#91;</span>sort_order<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span>
            <span style="color: #009900;">&#91;</span>is_active<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span>
        <span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #009900;">&#91;</span>_idFieldName<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #009900;">&#91;</span>_isDeleted<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">protected</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>An an example code to find if the store with id 5 is active or not</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'core/store'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$storeId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIsActive</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #666666; font-style: italic;">//do something if we are active</span>
<span style="color: #b1b100;">else</span>
    <span style="color: #666666; font-style: italic;">//do something else if the store is not active</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/09/30/magento-loading-a-store-by-store_id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating sitemap(s) in magento</title>
		<link>http://www.f15ijp.com/2010/09/23/creating-sitemaps-in-magento/</link>
		<comments>http://www.f15ijp.com/2010/09/23/creating-sitemaps-in-magento/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 08:46:44 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[magento admin]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[sitemap]]></category>
		<category><![CDATA[sitemap.xml]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=640</guid>
		<description><![CDATA[A sitemap is a xml file that is used by (for instance) search engines to get a better overview of your site. It gives details about what pages exists and how ranks the pages towards themselves. Despite the name the sitemap is not Google specific, it can be used for any search engine, or any [...]]]></description>
			<content:encoded><![CDATA[<p>A sitemap is a xml file that is used by (for instance) search engines to get a better overview of your site. It gives details about what pages exists and how ranks the pages towards themselves.<br />
Despite the name the sitemap is not Google specific, it can be used for any search engine, or any other reason that you need a sitemap.</p>
<h3>Create a folder for the site map and make it writable</h3>
<p>First figure out where to place the sitemap(s) and make that location writable by the webserver.<br />
In a Linux environment this is done from the console this is done like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> sitemap
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> admin:www-data sitemap
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</span> sitemap
<span style="color: #c20cb9; font-weight: bold;">touch</span> sitemap<span style="color: #000000; font-weight: bold;">/</span>index.php</pre></div></div>

<p>The touch index.php will create a empty index file (that keeps the folder from being listed.</p>
<h3>Define a sitemap</h3>
<p>In the admin panel go to &#8220;Catalog->Goolge Sitemap->Add sitemap&#8221;<br />
<a href="http://www.f15ijp.com/wp-content/uploads/2010/09/sitemap.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/09/sitemap.png" alt="" title="magento_sitemap" width="828" height="146" class="alignleft size-full wp-image-647" /></a><br />
Fill out this form with values that makes sense to you.<br />
<em>Note:</em> If you have sveral stores one website, then all product that are visible on that website is added to the sitemap.</p>
<h3>Make the site map update automatically</h3>
<p>In the admin pangel go to &#8220;System->Configuration->Google sitemap&#8221;<br />
<div id="attachment_648" class="wp-caption alignleft" style="width: 435px"><a href="http://www.f15ijp.com/wp-content/uploads/2010/09/magento_config_sitemap.png"><img src="http://www.f15ijp.com/wp-content/uploads/2010/09/magento_config_sitemap.png" alt="" title="magento_config_sitemap" width="425" height="675" class="size-full wp-image-648" /></a><p class="wp-caption-text">As always, change to values that makes sense to you</p></div></p>
<p>Another (older) way of doing this is described by the guys at <a href="http://inchoo.net/ecommerce/magento/manual-creation-of-google-sitemap-in-magento/">inchoo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/09/23/creating-sitemaps-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Admin login redrecting to old url after a url change (even though the database was updated)</title>
		<link>http://www.f15ijp.com/2010/03/25/magento-admin-login-redrecting-to-old-url-after-a-url-change-even-though-the-database-was-updated/</link>
		<comments>http://www.f15ijp.com/2010/03/25/magento-admin-login-redrecting-to-old-url-after-a-url-change-even-though-the-database-was-updated/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 15:35:24 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://f15ijp.com/?p=431</guid>
		<description><![CDATA[If you have the problem that you have moved a magento database (and perhaps files to) from one server to another, you have update web/unsecure/base_url &#038; web/secure/base_url in the database to point at the new address, but the admin panel login is still redirecting to the old address, then the solution is fairly simple. Make [...]]]></description>
			<content:encoded><![CDATA[<p>If you have the problem that you have moved a magento database (and perhaps files to) from one server to another, you have update<br />
web/unsecure/base_url &#038; web/secure/base_url in the database to point at the new address, but the admin panel login is still redirecting to the old address, then the solution is fairly simple.</p>
<p>Make the var folder writable to the web server and clear out the var/session and var/cache folders.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/03/25/magento-admin-login-redrecting-to-old-url-after-a-url-change-even-though-the-database-was-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

