<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Subesh Pokhrel's Blog - Magento Development Tips</title><link>http://subesh.com.np</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/subesh" /><description>PHP &amp; Magento Tips and Tutorials</description><language>en</language><lastBuildDate>Tue, 20 Mar 2012 11:15:10 PDT</lastBuildDate><generator>http://wordpress.org/?v=3.3.1</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/subesh" /><feedburner:info uri="subesh" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>subesh</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>MagNotes Series : Magento get Store by store code</title><link>http://feedproxy.google.com/~r/subesh/~3/gohiEvWHOj8/</link><category>Magento</category><category>Magento Notes</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Tue, 20 Mar 2012 11:15:10 PDT</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=375</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<blockquote><p><strong>About MagNotes Series</strong><br />
<em>In this blog I have always shared about what I’ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I’ve decided to create a series (MagNotes Series) , for myself as a reference or for whoever think this is helpful.</em></p></blockquote>
<pre class="brush: php; title: ; notranslate">
protected function _getStoreByCode($storeCode)
	{
		$stores = array_keys(Mage::app()-&gt;getStores());
		foreach($stores as $id){
 		  $store = Mage::app()-&gt;getStore($id);
		  if($store-&gt;getCode()==$storeCode) {
		  	return $store;
		  }
		 }
		 return false;
	}
</pre>
]]></content:encoded><description>About MagNotes Series In this blog I have always shared about what I’ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I’ve decided [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/03/magnotes-series-magento-get-store-by-store-code/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://subesh.com.np/2012/03/magnotes-series-magento-get-store-by-store-code/</feedburner:origLink></item><item><title>MagNotes Series : Magento get Locale Options as single Array</title><link>http://feedproxy.google.com/~r/subesh/~3/Jr4FN1dEdKE/</link><category>Magento</category><category>Magento Notes</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Mon, 19 Mar 2012 11:15:28 PDT</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=372</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<blockquote><p><strong>About MagNotes Series</strong><br />
<em>In this blog I have always shared about what I’ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I’ve decided to create a series (MagNotes Series) , for myself as a reference or for whoever think this is helpful.</em></p></blockquote>
<pre class="brush: php; title: ; notranslate">
             // Get all the locale options
                $locale = new Mage_Adminhtml_Model_System_Config_Source_Locale();
		$localSource = $locale-&gt;toOptionArray();

		// Change Options array to one dimentional array
		$localSourceCodes = array();
		foreach ($localSource as $source) {
			$localSourceCodes [$source ['value']] = $source ['label'];
		}
</pre>
]]></content:encoded><description>About MagNotes Series In this blog I have always shared about what I’ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I’ve decided [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/03/magnotes-series-magento-get-locale-options-as-single-array/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://subesh.com.np/2012/03/magnotes-series-magento-get-locale-options-as-single-array/</feedburner:origLink></item><item><title>MagNote Series : Magento Get Default Store</title><link>http://feedproxy.google.com/~r/subesh/~3/VdCTCRAHNsM/</link><category>Magento</category><category>Magento Notes</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Mon, 19 Mar 2012 11:15:25 PDT</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=370</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<blockquote><p><em>In this blog I have always shared about what I’ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I’ve decided to create a series (MagNotes Series) , for myself as a reference or for whoever think this is helpful.</em></p></blockquote>
<pre class="brush: php; title: ; notranslate">
Mage::app()-&gt;getStore(Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID);
</pre>
]]></content:encoded><description>In this blog I have always shared about what I’ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I’ve decided to create a [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/03/magnote-series-magento-get-default-store/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://subesh.com.np/2012/03/magnote-series-magento-get-default-store/</feedburner:origLink></item><item><title>MagNote Series – Magento Log</title><link>http://feedproxy.google.com/~r/subesh/~3/Vmxcnv0By-Q/</link><category>Magento</category><category>Magento Notes</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Sun, 18 Mar 2012 02:23:02 PDT</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=366</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<blockquote><p>In this blog I have always shared about what I&#8217;ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I&#8217;ve decided to create a series (MagNotes Series) , for myself as a reference or for whoever think this is helpful.</p></blockquote>
<p>One of the most useful method of tracking how your code is working is by writing a log of things happening between your lines of codes. Magento by default has provided a very helpful static function for this purpose in final class <strong>Mage</strong>.</p>
<p><strong><em>public static function log($message, $level = null, $file = &#8221;, $forceLog = false)</em></strong></p>
<p><strong>$message</strong><br />
Data you want to log. Can be string, array, object anything.<br />
<strong>$level</strong><br />
Log message level. The detailed list of type of message level can be found on Zend_Log. Here are the list which you can use.</p>
<pre class="brush: php; title: ; notranslate">
    const EMERG   = 0;  // Emergency: system is unusable
    const ALERT   = 1;  // Alert: action must be taken immediately
    const CRIT    = 2;  // Critical: critical conditions
    const ERR     = 3;  // Error: error conditions
    const WARN    = 4;  // Warning: warning conditions
    const NOTICE  = 5;  // Notice: normal but significant condition
    const INFO    = 6;  // Informational: informational messages
    const DEBUG   = 7;  // Debug: debug messages
</pre>
<p>By default the function uses <strong>Zend_Log::DEBUG</strong>.</p>
<p><strong>$file</strong><br />
Log file name relative to var/log, if you do not provide a file name then the default value for logfile name in settings will be used. If you haven&#8217;t changed then it would be <em>system.log</em>.<br />
<strong>$forceLog</strong><br />
This parameter defines if you want to override the log settings of the backend. So if you absolutely want to log your data whatever the condtion then this value should be set to true.</p>
]]></content:encoded><description>In this blog I have always shared about what I&amp;#8217;ve learned on Magento, which I felt is taken me one step closer to understanding Magento and Magento development. But during the course of time, I bump on some elementary things which are absolutely required. So just for those elementary things I&amp;#8217;ve decided to create a [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/03/magnote-series-magento-log/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://subesh.com.np/2012/03/magnote-series-magento-log/</feedburner:origLink></item><item><title>Ajaxify v1.0.0 : Extension to Help in working with Ajax in Magento Released on Magento Connect.</title><link>http://feedproxy.google.com/~r/subesh/~3/Ix0TTO9a6ic/</link><category>Ajax</category><category>Free Extensions</category><category>Magento</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Tue, 14 Feb 2012 00:06:05 PST</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=357</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>[<a href="http://www.magentocommerce.com/magento-connect/ajaxify-8411.html" title="Ajaxify" target="_blank">Get Module From Magento Connect</a>]</p>
<p>I have few blog posts regarding working with Ajax on Magento. <a href="http://subesh.com.np/category/ajax/">http://subesh.com.np/category/ajax/</a>. And I see many people visiting those pages to get the information on working with Ajax in Magento. Sensing the need of developer I came up with an idea of making the whole process into a module in an effort to give back to the Magento community. I&#8217;ve tried to make the module simple for now, which of course can be extended a lot to incorporate all kinds of needs. But for now, if I may say, there are roughly these two things you might want to do (Purely in Magento terms).</p>
<ol>
<li>Request to a controller with params, do some changes in the model, set error/success message and show those message to the user.</li>
<li>Next, perform all the actions as #1 and in addition to that refresh the content of certain HTML elements.</li>
</ol>
<p>This module has been devised just to meet these two actions. In addition, the module is loader ready and has by default a floating message block.<br />
Followings are the ways you can perform those two actions using this module.</p>
<p><strong>Overview</strong><br />
The core functionality implemenation is done in js/ajaxify/ajaxify.js file. If you look into that file, you will find a JS Class. The constructor for the class are:</p>
<ol>
<li>URL of the request controller.</li>
<li>Parameters (JSON object) to be sent as request params to the controller.</li>
</ol>
<p>For request and show message just call <em>request()</em> method, while if you want an HTML element to be updated then call <em>requestUpdate(&#8216;elementID&#8217;)</em>, with element ID in the parameter.</p>
<p><strong>Request to a controller with params, do some changes in the model, set error/success message and show those message to the user.</strong></p>
<p>This is how you initillize the JS Object.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
	var ajxObj =  new SpAjaxify('&lt;?php echo $this-&gt;getUrl('ajaxify/index/test') ?&gt;', {id: '12', value: '23'});
	ajxObj.request(); // Request
&lt;/script&gt;
</pre>
<p>To set the message error/success you have to use ajaxify/session model, because it is from this model the messages are shown.</p>
<pre class="brush: php; title: ; notranslate">
/**
     * Always use this session to set your error or success message
     *
     * @return Sp_Ajaxify_Model_Session
     *
     * PLEASE DO NOT EDIT THIS
     */
    protected function _getSession()
    {
    	return Mage::getSingleton('ajaxify/session');
    }

	// Set Error message .
   	$this-&gt;_getSession()-&gt;addError('Item was not added to the shopping cart.');

    	// Set Success message
    	$this-&gt;_getSession()-&gt;addSuccess('Item was successfully added to the shopping cart.');
</pre>
<p><strong>In addition to the above refresh the content of certain HTML elements.</strong></p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
	var ajxObj =  new SpAjaxify('&lt;?php echo $this-&gt;getUrl('ajaxify/index/test') ?&gt;', {id: '12', value: '23'});

	ajxObj.requestUpdate('sidebar_cart'); // Ajax request with parameter to update the HTML element.
&lt;/script&gt;
</pre>
<p>The source also contains description of the hidden logic to manage templates/layouts required.</p>
]]></content:encoded><description>[Get Module From Magento Connect] I have few blog posts regarding working with Ajax on Magento. http://subesh.com.np/category/ajax/. And I see many people visiting those pages to get the information on working with Ajax in Magento. Sensing the need of developer I came up with an idea of making the whole process into a module in [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/02/ajaxify-v1-0-0-extension-to-help-in-working-with-ajax-in-magento-released-on-magento-connect/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><feedburner:origLink>http://subesh.com.np/2012/02/ajaxify-v1-0-0-extension-to-help-in-working-with-ajax-in-magento-released-on-magento-connect/</feedburner:origLink></item><item><title>External Database Connector FAQ’s</title><link>http://feedproxy.google.com/~r/subesh/~3/tdDhEBlatvk/</link><category>Custom Module</category><category>Free Extensions</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Mon, 06 Feb 2012 16:00:57 PST</pubDate><guid isPermaLink="false">http://www.thethreetree.com/?p=53</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>We have been receiving a lots of comments on how to &#8220;install&#8221; External Database Connector (Formarly, TTT_EDB) in Magento. So we thought why not clear that out some of the questions we received here and lets see if this will help you and all.</p>
<p>First of all we would like to say that this is not a fully functional module (Don&#8217;t Panic..), meaning you will not be able work with tables of external database just by configuring the settings of the module. You will have to code your associated Model/Collection classes based on the <a href="http://subesh.com.np/2012/02/magento-external-database-connector-v1-0-0-released/">Magento External Database Connector Released</a>.</p>
<p>Few things which came and we would want to clear out.</p>
<p><strong>1. I tried to install the module via Magento Connect, but showed some error during installation?</strong></p>
<p>We have packaged this extention using Magento 1.5.x. There are complaints on installing using Magento Downloader v1, please use Magento Downloader v2. We will try to fix this problem for v1 ASAP.</p>
<p><strong>2. Which Config file do I have to use/edit?</strong></p>
<p>In Magento, database connection settings can be found on app/etc/local.xml, but we are NOT talking about that settings. If we say a config file we are talking about <strong>Sp/Edb/etc/config.xml</strong>.</p>
<p><strong>3. How do I configure Edb to use my external database&#8217;s table? </strong></p>
<p>Edit <strong>Sp/Edb/etc/config.xml</strong> and find the [entities]. You will then find a child node there [report]. Change that to your table alias (lets say magician). Also change the value of [table]tbl_magician[/table]. The value for [table] should be the table name of the external database you want to work with. If you want to work with multiple tables of the external database, you will have to add multiple alias and its respective table name.</p>
<p><strong><em>Note #1 that the nodes are shown in [ ], because of the rendering issue.<br />
Note #2 that you can do the same in your own Module&#8217;s config file.</em></strong></p>
<p><strong>4. How to define Model/Resource/Collection?</strong></p>
<p>If you follow the basic step defined <a href="http://subesh.com.np/2012/02/magento-external-database-connector-v1-0-0-released/">http://subesh.com.np/2012/02/magento-external-database-connector-v1-0-0-released/</a>. You should be able to set all those up. For multiple table access you must create multiple Model/Resource and Collection.<br />
<strong><br />
5. How do I test if it&#8217;s working?</strong></p>
<p>Simplest method would be in your cron.php file found on installed Magento&#8217;s root folder. Open the cron.php file and inside the try block call the model you just created write the following. If you have followed the documentation exactly as in the link above, then</p>
<pre class="brush: php; title: ; notranslate">
try {
$model = Mage::getModel('edb/magician');

// This data will depend on your table schema.
$model-&gt;setName('The three Tree')-&gt;save();
$model-&gt;setName('TTT')-&gt;save();
exit;
----
----

}
</pre>
<p>Then run the cron.php from your browser example.com/cron.php. After this see you external database table, a new row should be inserted.</p>
<p>Hope this clarifies something if not everything. Please send us feedbacks, we would be happy to address that.</p>
]]></content:encoded><description>We have been receiving a lots of comments on how to &amp;#8220;install&amp;#8221; External Database Connector (Formarly, TTT_EDB) in Magento. So we thought why not clear that out some of the questions we received here and lets see if this will help you and all. First of all we would like to say that this is [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/02/ttt-edb-faqs/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">5</slash:comments><feedburner:origLink>http://subesh.com.np/2012/02/ttt-edb-faqs/</feedburner:origLink></item><item><title>Magento External Database Connector Released</title><link>http://feedproxy.google.com/~r/subesh/~3/dqWNkDuptUk/</link><category>Free Extensions</category><category>Magento</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Mon, 06 Feb 2012 16:00:13 PST</pubDate><guid isPermaLink="false">http://www.thethreetree.com/?p=7</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<blockquote><p>Formarly Known as The Three Tree External Database Connector</p></blockquote>
<p>Magento External Database Connector module will be helpful for the &#8220;Developers&#8221; who want to connect to the external Database server (other than the database used by Magento). This module will help the developer to set up a connection object (Read &amp; Write) with the configuration configured in Admin Settings and use that connection to do database transactions on external database.</p>
<blockquote><p>All you have to do is set the settings of your external database connection in your Magento Settings and extend your model/collection class with the class of this module and use other codes as you have been using in Magento to select/update/delete records.</p></blockquote>
<blockquote><p>It will be as simple as Mage::getModel(&#8216;mymodule/mymodel&#8217;)-&gt;setData(&#8216;name&#8217;,'The Next Tree&#8217;)-&gt;save()</p></blockquote>
<p>Here is the explanation of how you can use the External Database Connector module&#8217;s classes to define your</p>
<ol>
<li>Model</li>
<li>Resource Model</li>
<li>Collection</li>
</ol>
<p>Lets take a simple example. Say you have a table (of course in an external database) named tbl_magician, which has two just two columns id and name. First thing set up an entity definition in the config.xml file of your module or you can add in this module&#8217;s config as well.</p>
<pre class="brush: xml; title: ; notranslate">
 &lt;entities&gt;
      &lt;!-- Add As many tables config here --&gt;
            &lt;magician&gt; &lt;!-- Table alias --&gt;
                   &lt;table&gt;tbl_magician&lt;/table&gt; &lt;!-- Actual Table Name --&gt;
             &lt;/magician&gt;
      &lt;!-- Add As many tables config here --&gt;
&lt;/entities&gt;
</pre>
<h3>Model Defination</h3>
<p>All of your Model that uses the external source has to be extended by Sp_Edb_Model_Abstract. If you see on this class you can find that the connection has been established based on the settings you do on Magento backend. An example for your model class will be something like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Sp_Edb_Model_Magician extends Sp_Edb_Model_Abstract
{
	 /**
     * Initialize resources
     */
    public function __construct()
    {
		parent::__construct();
		$this-&gt;_init('edb/magician);
     }

}
</pre>
<p><a href="http://www.thethreetree.com/wp-content/uploads/2011/04/settings.png"><img src="http://www.thethreetree.com/wp-content/uploads/2011/04/settings-300x140.png" alt="" title="EDB Settings" width="300" height="140" class="alignleft size-medium wp-image-24" /></a><br />
If you are wondering where to set up your connection settings go to System&#8211;>Configuration&#8211;>SP EDB and add your settings there.<br />
<br/><br/><br/></p>
<h3>Resource Model</h3>
<p>Similary your resource model should extend one another class of the module as shown below.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Sp_Edb_Model_Mysql4_Magician extends Sp_Edb_Model_Mysql4_Abstract
{

	protected function _construct()
    {
        $this-&gt;_init('edb/magician', 'id');
    }

}
</pre>
<h3>Collection</h3>
<p>As you might have already guessed yes..! collection also needs to be extended by one another class of the module as below</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Sp_Edb_Model_Mysql4_Magician_Collection extends Sp_Edb_Model_Mysql4_Collection_Abstract
{
	 /**
     * Local constructor
     *
     */
    protected function _construct()
    {
        $this-&gt;_init('edb/magician');
    }
}
</pre>
<blockquote><p>
All those parent classes used are themselves extended from the classes which Magento uses for Model or Resource or Collection. So there is no any functionality missing and you can use the same old methods for insert/update or select.
</p></blockquote>
<p>After setting up all these classes you can now just freely use these functions without keeping external connection in mind.</p>
<pre class="brush: php; title: ; notranslate">
$model = Mage::getModel('edb/magician');
// To save
$model-&gt;setName('The three Tree')-&gt;save();
$model-&gt;setName('TTT')-&gt;save();

// Get Collection
$collection = $model-&gt;getCollection();
$collection-&gt;getSelect()-&gt;where('main_table.id = ?', 1);
</pre>
<p>If you have any confusion we would be happy to address that.The module is now available on <a target="_blank" href="http://www.magentocommerce.com/magento-connect/sp-edb-4574.html"> Magento Connect</a>.</p>
<p><a href="http://subesh.com.np/2012/02/ttt-edb-faqs/" title="EDB FAQs" target="_blank">FAQ&#8217;s</a></p>
]]></content:encoded><description>Formarly Known as The Three Tree External Database Connector Magento External Database Connector module will be helpful for the &amp;#8220;Developers&amp;#8221; who want to connect to the external Database server (other than the database used by Magento). This module will help the developer to set up a connection object (Read &amp;#38; Write) with the configuration configured [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/02/magento-external-database-connector-v1-0-0-released/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">30</slash:comments><feedburner:origLink>http://subesh.com.np/2012/02/magento-external-database-connector-v1-0-0-released/</feedburner:origLink></item><item><title>MagDoc – Powered by Scribd Released on Magento Connect</title><link>http://feedproxy.google.com/~r/subesh/~3/Q2TnAjL-e9o/</link><category>Custom Module</category><category>Free Extensions</category><category>Magento</category><category>Extensions</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Tue, 31 Jan 2012 20:09:38 PST</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=315</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>MagDoc will give store administrator a feature of managing/displaying document in the Magento storefront powered by richly featured “<strong><em>the world’s largest social reading and publishing platform</em></strong>” &#8211;  <strong>Scribd</strong>. This module provides a unique user experience for reading a document online using the Scribd Reader application embedded in HTML.</p>
<p>Get this extension on <a target="_blank" href="http://www.magentocommerce.com/magento-connect/sp-magdoc-8372.html">Magento Connect</a></p>
<h2>Features</h2>
<ol>
<li>Uses the <strong>free API service</strong> provided by Scribd to upload and manage your document from the Magento administration area.</li>
<li>Upload as much document you want to upload, because there is <strong>no restriction on the storage limit.</strong></li>
<li>Tag your uploaded documents on Scribd.</li>
<li>Set scope <strong>Private</strong> or <strong>Public</strong> for your uploaded document.</li>
<li>Upload and transform any file &#8212; <strong>including PDF, Word and PowerPoint</strong> &#8212; into a web document that’s discoverable through <strong>search engines, shared on social networks and read on billions of mobile devices.</strong></li>
<li>Assign uploaded files to your product which can be shown in the storefront using a multi functional online <strong>Scribd Reader</strong>.</li>
<li>Supports <strong>all the document formats</strong> supported by Scribd. This list of the supported format can be found on <a target="_blank" href="http://www.scribd.com/developers/api?method_name=doc_types" target="_blank"> This Location </a></li>
</ol>
<h2>Installation Guide</h2>
<ol>
<li>Get the extension from<a target="_blank" href="http://www.magentocommerce.com/magento-connect/sp-magdoc-8372.html" target="_blank"> Magento Connect</a>.</li>
<li>Install the extension from Magento Connect Manager.</li>
<li>Voila! Installation completed.</li>
</ol>
<h2>Setting up the Module</h2>
<ol>
<li>Sign up for an account on <a target="_blank" href="http://www.scribd.com"> http://www.scribd.com </a></li>
<li>Get the API Key and Secret Key from Scribd. The procedure for getting your API key and Secret Key is described on <a target="_blank" href="http://support.scribd.com/entries/25453-where-can-i-find-my-api-key">http://support.scribd.com/entries/25453-where-can-i-find-my-api-key</a>.</li>
<li>In Magento backend goto System&#8211;&gt;Configuration&#8211;&gt;MagDoc&#8211;&gt;Settings.</li>
<li>Fill out the API key and Secret Key value you obtain from Scribd and save the settings.</li>
<li>Now the module is set up and ready to be used.</li>
</ol>
<h2>User Guide</h2>
<ol>
<li> Document can be uploaded on Scribd from Magento administration area. In admin area go to <strong>Magdoc&#8211;>Manage Document</strong>. You can add/edit/delete documents from here.</li>
<li>Documents can be assigned to product. Create or Edit any product. A new  option for selecting the document for the product will be visible in the  product edit area. But make sure the attribute “<strong>magdoc_id</strong>” is already  in the attribute set of the product being edited. Select the required  document and save the product.</li>
<li>Visit the product details page on the frontend. The document will be visible using <strong>Scribd Reader</strong>.</li>
</ol>
<h2>Developer Guide</h2>
<p>To display Scribd document in the product details page. This should be placed in appropriate place. Also you can see that the height and width for the Scribd Reader can be configured from layout.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;block type=&quot;magdoc/magdoc&quot; name=&quot;magdoc&quot; template=&quot;magdoc/magdoc.phtml&quot;&gt;
            	&lt;action method=&quot;setDocumentHeight&quot;&gt;&lt;width&gt;600px&lt;/width&gt;&lt;/action&gt;
            	&lt;action method=&quot;setDocumentWidth&quot;&gt;&lt;width&gt;850px&lt;/width&gt;&lt;/action&gt;
 &lt;/block&gt;
</pre>
<p>Here’s a tip for showing the Scribd document on tabs on product details page.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;block type=&quot;catalog/product_view_tabs&quot; name=&quot;product.info.tabs&quot; as=&quot;info_tabs&quot; template=&quot;catalog/product/view/tabs.phtml&quot; &gt;
                    &lt;action method=&quot;addTab&quot; translate=&quot;title&quot; module=&quot;catalog&quot;&gt;
                    	&lt;alias&gt;magdoc&lt;/alias&gt;
                    	&lt;title&gt;Document&lt;/title&gt;
                    	&lt;block&gt;magdoc/magdoc&lt;/block&gt;
                    	&lt;template&gt;magdoc/magdoc.phtml&lt;/template&gt;
                   	&lt;/action&gt;
        &lt;/block&gt;
</pre>
<p>I hope the module will be useful for the store owners. If you have any feedbacks, please report in the comment section below.</p>
<p><br/></p>
<blockquote><p>Disclaimer: <strong>Scribd</strong> is the property of Scribd Inc. This module is NOT the official module of Scribd.</p></blockquote>
]]></content:encoded><description>MagDoc will give store administrator a feature of managing/displaying document in the Magento storefront powered by richly featured “the world’s largest social reading and publishing platform” &amp;#8211; Scribd. This module provides a unique user experience for reading a document online using the Scribd Reader application embedded in HTML. Get this extension on Magento Connect Features [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/02/magdoc-powered-by-scribd-released-on-magento-connect/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://subesh.com.np/2012/02/magdoc-powered-by-scribd-released-on-magento-connect/</feedburner:origLink></item><item><title>Debugging Magento Using Eclipse on Ubuntu</title><link>http://feedproxy.google.com/~r/subesh/~3/93KFujhrP6o/</link><category>Magento</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Fri, 27 Jan 2012 02:25:13 PST</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=321</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I&#8217;ve previously posted <a href="http://subesh.com.np/2010/01/debugging-magento-eclipse-pdt-zend-debugger/" title="http://subesh.com.np/2010/01/debugging-magento-eclipse-pdt-zend-debugger/" target="_blank">http://subesh.com.np/2010/01/debugging-magento-eclipse-pdt-zend-debugger</a> but currently I think it was just a snub. What I currently do now is far more better approach then the previous one. Here is how you can set up a debugging environment in Ubuntu using Eclipse for debugging Magento.</p>
<p>[Note: I am describing here based on Ubuntu.]</p>
<p><strong>Step 1: Download and Install Eclipse</strong><br />
<a href="http://www.eclipse.org/pdt/downloads/" title="Download" target="_blank">Download</a> and Install Eclipse. Choose the relevant package to download. Unzip the package and copy to some location. Lets say /home/user/ Please note that the Eclipse IDE requires that a Java Runtime Environment (JRE) be installed on your machine to run. Java SE 5 or greater is recommended.</p>
<p><strong>Step 2: Setting up PHP Project</strong><br />
Next thing you have to do is to setup the project in Eclipse. Open the Eclipse IDE and it will ask for your Workspace. Browse to your workspace (Where your Magento site is running locally) or by default point it to <strong><em>/var/www</em></strong> and click OK. Now click on <strong>File&#8211;>New &#8211;> New PHP Project</strong>, and add your folder name on Project Name and click Finish. Eclipse will take few time on building your project, so take a coffee break if you want and be back in few minutes to go through the steps below.</p>
<p><strong>Step 3: Installing X-Debugger</strong></p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install php5-xdebug
</pre>
<p><strong>Step 4: Configure X-Debugger</strong><br />
Type this in your command prompt.</p>
<pre class="brush: bash; title: ; notranslate">
sudo gedit /etc/php5/apache2/conf.d/xdebug.ini
</pre>
<p>And add this settings on the .ini file</p>
<pre class="brush: bash; title: ; notranslate">
xdebug.remote_enable=1
</pre>
<p>And restart the apache server.</p>
<pre class="brush: bash; title: ; notranslate">
sudo /etc/init.d/apache2 restart
</pre>
<p><strong>Step 5: Debug Configuration on Eclipse</strong></p>
<p>On menu click <strong>Window&#8211;>Preference</strong>. Find <strong>PHP&#8211;>Debug</strong> Node in the left. When you click Debug you can see screen like this. <strong>Select PHP Debugger &#8211; XDebug</strong>.</p>
<p><img alt="" src="https://lh4.googleusercontent.com/-VPXpprs69Zs/TyJt9pH7SUI/AAAAAAAAAIw/xNflpZ_t3GY/w612-h503-k/php-Debug.png" title="PHP - Eclipse - Debugger Settings" class="aligncenter" width="611" height="502" /></p>
<p>To Set Server click <strong>PHP Servers</strong> and add new server as follows and click Finish.</p>
<p><img alt="" src="https://lh3.googleusercontent.com/-A9yecKpDgNk/TyJwssyq9MI/AAAAAAAAAJU/uwWKVvWvmiM/w306-h222-n-k/Server.png" title="PHP-Eclipse-Magento Server Configuration" class="aligncenter" width="306" height="222" /></p>
<p><strong>Step 6: Configuring debug conf for Magento Projects</strong></p>
<p>On menu click<strong> Run&#8211;> Debug Configurations</strong>. Find <strong>PHP Web Page</strong> and Right click for adding new configuration. Add something similar to like this.</p>
<p><img alt="" src="https://lh6.googleusercontent.com/-e0CrUe0yLyE/TyJ3RqF5VPI/AAAAAAAAAJ0/0btGPXdLfcA/w291-h222-n-k/Debug%2BSettings.png" title="PHP - Eclipse - Magento - Web Page configuration." class="aligncenter" width="291" height="222" /></p>
<p><strong>Step 7: Add Break-Point and start debugging</strong></p>
<p>Now almost all the settings are done. Now you can just add a break-point on your code and start debugging your script by clicking the BUG icon on the top bar.</p>
<p>Few tips though before you start.</p>
<ol>
<li> Set up an external browser to run your debug configuation. Go to <strong>Window&#8211;>Preference</strong> and type in <strong><em>web browse</em>r</strong> in the top left search. And you will get a result. Click on Web Browser to select Use External Web Browser. If that is not clickable first click the restore default button and then the external web browser should be clickable.</li>
<li> You can enable multi-session debug, because you do not want to always click the debug button after each debug end. For that go to preference. Search for debug. Find <strong> PHP &#8211;> Debug &#8211;>Installed Debugger</strong>. Click the <strong>XDebug</strong> and then click configure. You can then Check the <strong>Use Multisession</strong> checkbox and save.</li>
</ol>
]]></content:encoded><description>I&amp;#8217;ve previously posted http://subesh.com.np/2010/01/debugging-magento-eclipse-pdt-zend-debugger but currently I think it was just a snub. What I currently do now is far more better approach then the previous one. Here is how you can set up a debugging environment in Ubuntu using Eclipse for debugging Magento. [Note: I am describing here based on Ubuntu.] Step 1: Download [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2012/01/debugging-magento-using-eclipse-on-ubuntu/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://subesh.com.np/2012/01/debugging-magento-using-eclipse-on-ubuntu/</feedburner:origLink></item><item><title>Happy Dashain Holidays!</title><link>http://feedproxy.google.com/~r/subesh/~3/34KxE50FhoY/</link><category>Uncategorized</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Subesh Pokhrel</dc:creator><pubDate>Fri, 30 Sep 2011 02:19:49 PDT</pubDate><guid isPermaLink="false">http://subesh.com.np/?p=305</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Its time for all of Nepal to mark their &#8220;only&#8221; long term holidays. It&#8217;d Dashain time and don&#8217;t expect me to come up with things during this week long holidays.<br />
Image courtesy: nepalifonts.blogspot.com</p>
<p><a href="http://subesh.com.np/2011/09/happy-dashain-holidays/dashain-cards2011_page_2/" rel="attachment wp-att-306"><img src="http://subesh.com.np/wp-content/uploads/2011/09/dashain-cards2011_Page_2-300x240.jpg" alt="" title="dashain cards2011_Page_2" width="300" height="240" class="aligncenter size-medium wp-image-306" /></a></p>
]]></content:encoded><description>Its time for all of Nepal to mark their &amp;#8220;only&amp;#8221; long term holidays. It&amp;#8217;d Dashain time and don&amp;#8217;t expect me to come up with things during this week long holidays. Image courtesy: nepalifonts.blogspot.com</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://subesh.com.np/2011/09/happy-dashain-holidays/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://subesh.com.np/2011/09/happy-dashain-holidays/</feedburner:origLink></item></channel></rss>

