<?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>Axertion.com &#187; Magento</title>
	<atom:link href="http://www.axertion.com/categories/tutorials/magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.axertion.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 24 Mar 2016 21:49:25 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.1</generator>
	<item>
		<title>Updating tax classes for products in specific categories in Magento (For Tax Free Weekends)</title>
		<link>http://www.axertion.com/tutorials/2013/08/updating-tax-classes-for-products-in-specific-categories-in-magento-for-tax-free-weekends/</link>
		<comments>http://www.axertion.com/tutorials/2013/08/updating-tax-classes-for-products-in-specific-categories-in-magento-for-tax-free-weekends/#comments</comments>
		<pubDate>Fri, 09 Aug 2013 16:38:43 +0000</pubDate>
		<dc:creator><![CDATA[Axel]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.axertion.com/?p=571</guid>
		<description><![CDATA[With tax free season coming around, majority of my Magento clients requested that products set to specific categories [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>With tax free season coming around, majority of my Magento clients requested that products set to specific categories be made tax free.</p>
<p>Magento sets the tax_class_id attribute on the product level, which would require me doing a batch update of the products, however I can&#8217;t set a filter to specific categories which puts me back to square one.</p>
<p>Below is a simple SQL query that will update all products to a <strong>Tax Class</strong> of <strong>None</strong>, based on a set of category ids I define.</p>
<p><strong>WARNING: Always do a complete database backup before running SQL queries against your database</strong></p>
<p><pre><code>
UPDATE catalog_product_entity_int cpei
SET cpei.value = 0
WHERE cpei.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = &#039;tax_class_id&#039;)
AND cpei.value = 2
AND cpei.entity_id IN (
&nbsp;&nbsp;&nbsp;&nbsp;SELECT product_id AS entity_id FROM catalog_category_product
&nbsp;&nbsp;&nbsp;&nbsp;WHERE category_id IN (1,2,3,4,5,6,7,8,9)
&nbsp;&nbsp;)
</code></pre></p>
<p>Be sure to replace this section <pre>WHERE category_id IN (1,2,3,4,5,6,7,8,9)</pre> to include the comma separate list of category_id values you wish to apply this to.</p>
<p>You can also change the <strong>tax_class_id</strong> you set these products to by modifying this line: <pre>SET cpei.value = 0</pre>. Change the <code>0</code> to the value of the tax_class_id you wish to set it to.</p>
<p>After applying the SQL query, be sure to update the <strong>Product Flat Data</strong> under <strong>System > Index Management</strong>, then refresh all of your Magento caches under <strong>System > Cache Management</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.axertion.com/tutorials/2013/08/updating-tax-classes-for-products-in-specific-categories-in-magento-for-tax-free-weekends/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wildcard redirect all www to non-www urls for Magento instances running on cPanel Litespeed Server</title>
		<link>http://www.axertion.com/tutorials/2013/05/wildcard-redirect-all-www-to-non-www-urls-for-magento-instances-running-on-cpanel-litespeed-server/</link>
		<comments>http://www.axertion.com/tutorials/2013/05/wildcard-redirect-all-www-to-non-www-urls-for-magento-instances-running-on-cpanel-litespeed-server/#comments</comments>
		<pubDate>Wed, 08 May 2013 17:47:56 +0000</pubDate>
		<dc:creator><![CDATA[Axel]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.axertion.com/?p=556</guid>
		<description><![CDATA[Today I faced an issue with the standard cPanel redirects not working with Magento running on litespeed. When [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Today I faced an issue with the standard cPanel redirects not working with Magento running on litespeed.</p>
<p>When you create a redirect from within cPanel, a Mod Rewrite rule is written to the .htaccess file located in the document root of the domain the rule is for.</p>
<p>If you open the .htaccess file, you should see this at the very bottom (after creating the redirect in cPanel):<br />
<pre><code>
RewriteCond %{HTTP_HOST} ^www\.domain\.com$
RewriteRule ^(.*)$ &quot;http\:\/\/domain\.com\/$1&quot; [R=301,L]
</code></pre></p>
<p>There are two issues related to litespeed.</p>
<p>1. The Rewrite rule must be <strong>placed at the top of your .htaccess file</strong> (some rules set by Magento conflict with litespeed&#8217;s rule interpreter)<br />
2. The Rewrite rule must be formatted correctly (remove the escaping backslashes from the RewriteRule).</p>
<p>Your update rule should look like this:</p>
<p><pre><code>RewriteCond %{HTTP_HOST} ^www\.domain\.com$
RewriteRule ^(.*)$ &quot;http://domain.com/$1&quot; [R=301,L]</code></pre></p>
<p>After making these changes and saving your .htaccess file, your Magento www URLs should now redirect to their respective non-www URL counterparts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.axertion.com/tutorials/2013/05/wildcard-redirect-all-www-to-non-www-urls-for-magento-instances-running-on-cpanel-litespeed-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Category sort order takes a long time in Magento.</title>
		<link>http://www.axertion.com/tutorials/2013/03/changing-category-sort-order-takes-a-long-time-in-magento/</link>
		<comments>http://www.axertion.com/tutorials/2013/03/changing-category-sort-order-takes-a-long-time-in-magento/#comments</comments>
		<pubDate>Tue, 26 Mar 2013 16:48:26 +0000</pubDate>
		<dc:creator><![CDATA[Axel]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.axertion.com/?p=546</guid>
		<description><![CDATA[If you&#8217;re running a large Magento store, you may encounter an the dreaded &#8220;Please Wait&#8221; popup that hangs [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re running a large Magento store, you may encounter an the dreaded &#8220;Please Wait&#8221; popup that hangs for a long period of time when attempting to move a category.</p>
<p>I looked into it, and discovered that Magneto was calling a reindexing process, which usually takes a bit of time to complete.  You obviously don&#8217;t want to wait an eternity to move a single category, so you can simply do the following as a temporary way of disabling the reindexing when you move a category.</p>
<p><em>Disclaimer:</em> This has been tested only on <strong>Magento 1.6.2</strong></p>
<p>1. Open <strong>app/code/core/Mage/Catalog/Model/Category.php</strong><br />
2. Look for the following, around <strong>line 248</strong>:<br />
<pre><pre>
Mage::getSingleton(&#039;index/indexer&#039;)-&gt;processEntityAction(
&nbsp;&nbsp;$this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE
);
Mage::app()-&gt;cleanCache(array(self::CACHE_TAG));
</pre></pre><br />
3. Simply comment out this code like this:<br />
<pre><pre>
/*Mage::getSingleton(&#039;index/indexer&#039;)-&gt;processEntityAction(
&nbsp;&nbsp;$this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE
);
Mage::app()-&gt;cleanCache(array(self::CACHE_TAG));
*/
</pre></pre><br />
4. Save the file, and start moving your categories around instantly.</p>
<p>You can alternatively do this permanently by overriding the Category.php file by copying the file to <code>app/code/local/Mage/Catalog/Model/Category.php</code> and commenting out the code above.</p>
<p>Once you are done the sort order, you can apply the changes to the frontend by reindexing the <strong>catalog_flat_data</strong> Index, and clearing your <strong>Blocks HTML output</strong> caches.</p>
<p>Magento is a great platform, but sometimes I wonder why the developers make some of their decisions (like adding a resource intensive reindexing to a simple action like moving a category).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.axertion.com/tutorials/2013/03/changing-category-sort-order-takes-a-long-time-in-magento/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Magento &#8211; Fixing &#8220;Code already exists&#8221; Error when saving Tax Rules</title>
		<link>http://www.axertion.com/tutorials/2013/01/magento-fixing-code-already-exists-error-when-saving-tax-rules/</link>
		<comments>http://www.axertion.com/tutorials/2013/01/magento-fixing-code-already-exists-error-when-saving-tax-rules/#comments</comments>
		<pubDate>Thu, 31 Jan 2013 00:35:29 +0000</pubDate>
		<dc:creator><![CDATA[Axel]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.axertion.com/?p=521</guid>
		<description><![CDATA[Today I encountered a &#8220;Code already exists.&#8221; error in Magento when trying to save a massive amount of [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Today I encountered a &#8220;Code already exists.&#8221; error in Magento when trying to save a massive amount of Tax Rates to a Tax Rule.<br />
<span id="more-521"></span><br />
After some debugging, I noticed that I could only save up to a certain amount of Tax Classes to a rule, before receiving the following error message: <code>Code already exists.</code></p>
<p><a href="http://www.axertion.com/wp-content/uploads/2013/01/magento_code-already-exists-error-featured-image.jpg"><img src="http://www.axertion.com/wp-content/uploads/2013/01/magento_code-already-exists-error-featured-image.jpg" alt="magento_code-already-exists-error-featured-image" width="590" height="215" class="alignnone size-full wp-image-527" /></a></p>
<p>Magento&#8217;s error message wasn&#8217;t very helpful, so I dove into the Models &#038; Controllers and found the cause was due to the <code>$_POST</code> data not being submitted in full; leaving off important data required for Magento to save the rule to the database.</p>
<p>To fix this, I had to modify the <code>max_input_vars</code> for PHP, which by default limits the variables passed through <code>$_POST</code> to <code>1000</code>.  Since I was saving close to 2500 tax rates to the rule, only half of those were being passed, and the tax rule id data at the end of the Magento object was being cut off.</p>
<p><strong>The Fix:</strong><br />
1. Open your <code>php.ini</code> file (the location may vary for you)<br />
2. Update (or add if it doesn&#8217;t exist) the following line:<br />
<pre><pre>
max_input_vars 10000
</pre></pre><br />
3. Save your php.ini file<br />
4. Try saving your Tax Rule in Magento.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.axertion.com/tutorials/2013/01/magento-fixing-code-already-exists-error-when-saving-tax-rules/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Analytics doesn&#8217;t track Magento&#8217;s E-Commerce Data</title>
		<link>http://www.axertion.com/tutorials/2012/12/google-analytics-doesnt-track-magentos-e-commerce-data/</link>
		<comments>http://www.axertion.com/tutorials/2012/12/google-analytics-doesnt-track-magentos-e-commerce-data/#comments</comments>
		<pubDate>Thu, 13 Dec 2012 22:21:45 +0000</pubDate>
		<dc:creator><![CDATA[Axel]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.axertion.com/?p=492</guid>
		<description><![CDATA[I encountered an issue where Google Analytics wasn&#8217;t receiving the ecommerce data it normally receives when a user [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I encountered an issue where Google Analytics wasn&#8217;t receiving the ecommerce data it normally receives when a user places an order.</p>
<p>The issue is related to a small oversight by Magento developers, in the core GoogleAnalytics extension included with Magento.</p>
<p>If you have any quotes in your Magento&#8217;s store name, the Tracking Code will fail.  This is due to the quotes not being escaped in the javascript for the Analytics code.</p>
<p>To fix this issue, do the following&#8230;</p>
<ol>
<li>Copy <strong>app/code/core/GoogleAnalytics/Block/Ga.php</strong><br /> to <strong>app/code/local/Mage/GoogleAnalytics/Block/Ga.php</strong></li>
<li>Open <strong>app/code/local/Mage/GoogleAnalytics/Block/Ga.php</strong></li>
<li>On <strong>Line 122</strong>, Find: <code>Mage::app()-&gt;getStore()-&gt;getFrontendName()</code></li>
<li>Replace With: <code>$this-&gt;jsQuoteEscape(Mage::app()-&gt;getStore()-&gt;getFrontendName())</code></li>
<li>Save the file and test.</li>
</ol>
<p>This basically escapes any quotes that may be included in your Magento store name.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.axertion.com/tutorials/2012/12/google-analytics-doesnt-track-magentos-e-commerce-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable Magento logging to the database</title>
		<link>http://www.axertion.com/tutorials/2012/12/how-to-disable-magento-logging-to-the-database/</link>
		<comments>http://www.axertion.com/tutorials/2012/12/how-to-disable-magento-logging-to-the-database/#comments</comments>
		<pubDate>Tue, 04 Dec 2012 17:53:28 +0000</pubDate>
		<dc:creator><![CDATA[Axel]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.axertion.com/?p=480</guid>
		<description><![CDATA[Magento does some excessive logging to track customers. This in return causes your Magento database to expand exponentially [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Magento does some excessive logging to track customers. This in return causes your Magento database to expand exponentially in size, and inevitably decreases your sites overall performance.</p>
<p>I found that disabling logging from the Magento admin does not stop Magento from writing to the log tables in the database. To tell Magento to completely stop, do the following.</p>
<p>1. Open your <strong>app/etc/local.xml</strong> file<br />
2. Paste in the following, right before the <code>&lt;/config&gt;</code> closing tag:<br />
<pre><pre>
&lt;frontend&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;events&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;controller_action_predispatch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;observers&gt;&lt;log&gt;&lt;type&gt;disabled&lt;/type&gt;&lt;/log&gt;&lt;/observers&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/controller_action_predispatch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;controller_action_postdispatch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;observers&gt;&lt;log&gt;&lt;type&gt;disabled&lt;/type&gt;&lt;/log&gt;&lt;/observers&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/controller_action_postdispatch&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;customer_login&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;observers&gt;&lt;log&gt;&lt;type&gt;disabled&lt;/type&gt;&lt;/log&gt;&lt;/observers&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/customer_login&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;customer_logout&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;observers&gt;&lt;log&gt;&lt;type&gt;disabled&lt;/type&gt;&lt;/log&gt;&lt;/observers&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/customer_logout&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;sales_quote_save_after&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;observers&gt;&lt;log&gt;&lt;type&gt;disabled&lt;/type&gt;&lt;/log&gt;&lt;/observers&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/sales_quote_save_after&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;checkout_quote_destroy&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;observers&gt;&lt;log&gt;&lt;type&gt;disabled&lt;/type&gt;&lt;/log&gt;&lt;/observers&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/checkout_quote_destroy&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/events&gt;
&lt;/frontend&gt;
</pre></pre></p>
<p>3. Save your local.xml file</p>
<p>4. Now to go <strong>System > Configuration > Advanced</strong> and set <strong>Mage_Log</strong> to <strong>Disable</strong></p>
<p>5. Finally, flush your Magento caches under <strong>System > Cache Management</strong></p>
<p>Magento should no longer write logs to these tables.</p>
<p>To clean out your existing log tables, just run the following SQL command against your Magento database.</p>
<p><strong>WARNING:</strong> Once you truncate these tables, the log information will be permanently lost.  If you have no need for this log data, then by all means get rid of it!<br />
<pre><pre>
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_event;
</pre></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.axertion.com/tutorials/2012/12/how-to-disable-magento-logging-to-the-database/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to add a date/time input field to your Magento extension</title>
		<link>http://www.axertion.com/tutorials/2012/04/how-to-add-a-datetime-input-field-to-your-magento-extension/</link>
		<comments>http://www.axertion.com/tutorials/2012/04/how-to-add-a-datetime-input-field-to-your-magento-extension/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 16:25:33 +0000</pubDate>
		<dc:creator><![CDATA[Axel]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.axertion.com/?p=462</guid>
		<description><![CDATA[In your extension&#8217;s Form.php: For Example: app/code/local/CompanyName/ModuleName/Block/Adminhtml/ModuleName/Edit/Tab/Form.php Add the following code: $dateFormatIso = Mage::app()-&#62;getLocale()-&#62;getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); $fieldset-&#62;addField(&#039;start_date&#039;, &#039;date&#039;, array( &#160;&#160;&#039;name&#039;&#160;&#160; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In your extension&#8217;s Form.php:</p>
<p>For Example: <strong>app/code/local/CompanyName/ModuleName/Block/Adminhtml/ModuleName/Edit/Tab/Form.php</strong></p>
<p>Add the following code:</p>
<p><pre><pre>
$dateFormatIso = Mage::app()-&gt;getLocale()-&gt;getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$fieldset-&gt;addField(&#039;start_date&#039;, &#039;date&#039;, array(
&nbsp;&nbsp;&#039;name&#039;&nbsp;&nbsp; =&gt; &#039;start_date&#039;,
&nbsp;&nbsp;&#039;label&#039;&nbsp;&nbsp;=&gt; Mage::helper(&#039;events&#039;)-&gt;__(&#039;Start Date&#039;),
&nbsp;&nbsp;&#039;title&#039;&nbsp;&nbsp;=&gt; Mage::helper(&#039;events&#039;)-&gt;__(&#039;Start Date&#039;),
&nbsp;&nbsp;&#039;image&#039;&nbsp;&nbsp;=&gt; $this-&gt;getSkinUrl(&#039;images/grid-cal.gif&#039;),
&nbsp;&nbsp;&#039;input_format&#039; =&gt; $dateFormatIso,
&nbsp;&nbsp;&#039;format&#039;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; $dateFormatIso,
&nbsp;&nbsp;&#039;time&#039; =&gt; true
));
</pre></pre></p>
<p>The key things to make it work are the &#8220;input_format&#8221;, &#8220;format&#8221;, and &#8220;time&#8221; parameters in the addField array.  Setting the &#8220;time&#8221; variable to &#8220;true&#8221; makes the time input fields appear in the date selector pop-up.<br />
<a href="http://www.axertion.com/wp-content/uploads/2012/04/magento_datetime-example.png"><img src="http://www.axertion.com/wp-content/uploads/2012/04/magento_datetime-example.png" alt="" title="magento_datetime-example" width="363" height="261" class="alignnone size-full wp-image-467" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.axertion.com/tutorials/2012/04/how-to-add-a-datetime-input-field-to-your-magento-extension/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
