<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Magento-4U</title>
	<atom:link href="http://magento4u.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://magento4u.wordpress.com</link>
	<description>Lets share magento e-commerce experience ...</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:34:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='magento4u.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/d716d19118dafc411f55a3e0115211dd?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Magento-4U</title>
		<link>http://magento4u.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://magento4u.wordpress.com/osd.xml" title="Magento-4U" />
	<atom:link rel='hub' href='http://magento4u.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Add extra field(s) in registration page</title>
		<link>http://magento4u.wordpress.com/2011/03/28/add-extra-fields-in-registration-page/</link>
		<comments>http://magento4u.wordpress.com/2011/03/28/add-extra-fields-in-registration-page/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 06:49:30 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[add extra field]]></category>
		<category><![CDATA[add new attribute]]></category>
		<category><![CDATA[registration page]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=199</guid>
		<description><![CDATA[Add extra field(s) in registration page or any other similar page. <a href="http://magento4u.wordpress.com/2011/03/28/add-extra-fields-in-registration-page/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=199&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Dear Tow…, this post is basically for new guys. Few guys asked me how to add extra field(s) in registration process. So, here I will try to give few technical tricks.</p>
<p>1. Add new fields in config xml (app\code\core\Mage\Customer\etc\config.xml). If you create new module then you can add this xml block in module config xml file. Create new module is the best practice and recommended <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;fieldsets&gt;
   &lt;customer_account&gt;
     &lt;prefix&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/prefix&gt;
     &lt;firstname&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/firstname&gt;
     &lt;middlename&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/middlename&gt;
     &lt;lastname&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/lastname&gt;
     &lt;suffix&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/suffix&gt;
     &lt;email&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/email&gt;
     &lt;password&gt;&lt;create&gt;1&lt;/create&gt;&lt;/password&gt;
     &lt;confirmation&gt;&lt;create&gt;1&lt;/create&gt;&lt;/confirmation&gt;
     &lt;dob&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/dob&gt;
     &lt;taxvat&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/taxvat&gt;
     &lt;gender&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/gender&gt;

     /* newly added field(s)*/
     &lt;accounttype&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/accounttype&gt;
     &lt;companyname&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/companyname&gt;
  &lt;/customer_account&gt;
&lt;/fieldsets&gt;
</pre></p>
<p>2. Add these extra field(s) in your respective theme registration.phtml (app\design\frontend\&#8230;\&#8230;\template\customer\form\registration.phtml). Keep the field name same as you mentioned in config.xml</p>
<p>3. To save extra data in database with customer registration process you have to add these extra field(s) as entity attribute in eav_attribute table.  Here is sql script.</p>
<p><pre class="brush: php;">
insert into `magento`.`eav_attribute` (`entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, frontend_label`, `frontend_class`, `source_model`, `is_required`, `is_user_defined`, `default_value`, `is_unique`, `note`)
values(1, 'accounttype', '', '', 'varchar', '', '', 'select', 'Account Type', '', '', 0, 0, '', 0,''),
        (1, 'companyname', '', '', 'varchar', '', '', 'text', 'Company Name', '', '', 0, 0, '', 0,'');
</pre></p>
<p>That’s all. Try and let me know if you face any complexity.</p>
<p>Like this you can add extra field(s) in any magento pages as well.</p>
<br /> Tagged: <a href='http://magento4u.wordpress.com/tag/add-extra-field/'>add extra field</a>, <a href='http://magento4u.wordpress.com/tag/add-new-attribute/'>add new attribute</a>, <a href='http://magento4u.wordpress.com/tag/registration-page/'>registration page</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=199&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2011/03/28/add-extra-fields-in-registration-page/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<georss:point>23.745764 90.385317</georss:point>
		<geo:lat>23.745764</geo:lat>
		<geo:long>90.385317</geo:long>
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Add option(s) to quote item object at order processing step</title>
		<link>http://magento4u.wordpress.com/2011/03/28/add-options-t-quote-item-object/</link>
		<comments>http://magento4u.wordpress.com/2011/03/28/add-options-t-quote-item-object/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 20:14:45 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Magento order]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[add option]]></category>
		<category><![CDATA[Order quote item]]></category>
		<category><![CDATA[quote item object]]></category>
		<category><![CDATA[quoteItem]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=192</guid>
		<description><![CDATA[Add option(s) to quote item object at order processing step. <a href="http://magento4u.wordpress.com/2011/03/28/add-options-t-quote-item-object/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=192&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi guys, how are you? Hope all of you are doing well. I have been backed after long time and have decided to share few of my recent experiences.</p>
<p>For a recent project I had to create a custom order processing module in magento. I got help from a post of magento forum ( http://www.magentocommerce.com/boards/viewthread/28426/). That was nice and very helpful for me. And it saved my time as well. So my heartiest thanks to all of the guys who have been contributed in that forum post.</p>
<p>But I faced problem to add option(s) with order item. I found a solution to add option(s) to quote object. But using this you can order only single item at a time. Below is the code snap.</p>
<p><pre class="brush: php;">
$option = array('options'=&gt;array(
              &quot;option_id1&quot; =&gt; 'option_value1',
              &quot;option_id2&quot; =&gt; 'option_value2'
             ));

$request = new Varien_Object();
 $request-&gt;setData($option);
$quoteObj-&gt;addProduct($productObj,$request);
</pre></p>
<p>To order multiple items at a time you have to add option(s) with quote item object. Here is the code snap for your help.</p>
<p><pre class="brush: php;">
$quoteObj=Mage::getModel('sales/quote')-&gt;assignCustomer($customerObj);
$productModel=Mage::getModel('catalog/product');

foreach($products as $product) {
	$productObj = $productModel-&gt;load($productId);
	$quoteItem = Mage::getModel('sales/quote_item')-&gt;setProduct($productObj);

	$quoteItem-&gt;addOption(new Varien_Object(
                   	array(
                      		'product' =&gt; $quoteItem-&gt;getProduct(),
                       		'code' =&gt; 'option_ids',
                       		'value' =&gt; $option_id  // 45,46,55
               	         )
               	));

	$quoteItem-&gt;addOption(new Varien_Object(
                    	array(
                       		'product' =&gt; $quoteItem-&gt;getProduct(),
                       		'code' =&gt; 'option_'.$option_id,   //45
                       		'value' =&gt; $option_value          // ‘White’
             	         )
   		));

        $quoteItem-&gt;addOption(new Varien_Object(
                    	array(
                       		'product' =&gt; $quoteItem-&gt;getProduct(),
                       		'code' =&gt; 'option_'.$option_id,   //46
                       		'value' =&gt; $option_value         // ‘Large’
               	        )
   		));

	$quoteItem-&gt;setQuote($quoteObj);
	$quoteItem-&gt;setQty($Quantity);
	$quoteObj-&gt;addItem($quoteItem);
}
$quoteObj-&gt;collectTotals();
$quoteObj-&gt;save();
</pre></p>
<p>This code snap has been worked so far. For more details and any kind of helps contact with me.</p>
<br /> Tagged: <a href='http://magento4u.wordpress.com/tag/add-option/'>add option</a>, <a href='http://magento4u.wordpress.com/tag/order-quote-item/'>Order quote item</a>, <a href='http://magento4u.wordpress.com/tag/quote-item-object/'>quote item object</a>, <a href='http://magento4u.wordpress.com/tag/quoteitem/'>quoteItem</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=192&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2011/03/28/add-options-t-quote-item-object/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>23.745764 90.385317</georss:point>
		<geo:lat>23.745764</geo:lat>
		<geo:long>90.385317</geo:long>
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Product Tier Price add/update in Magento</title>
		<link>http://magento4u.wordpress.com/2009/08/03/product-tier-price-addupdate-in-magento/</link>
		<comments>http://magento4u.wordpress.com/2009/08/03/product-tier-price-addupdate-in-magento/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 20:06:02 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Magento Products]]></category>
		<category><![CDATA[add tier price]]></category>
		<category><![CDATA[Customer group price]]></category>
		<category><![CDATA[Group Price]]></category>
		<category><![CDATA[Magento Product]]></category>
		<category><![CDATA[Magento tier price]]></category>
		<category><![CDATA[Magento tier price update]]></category>
		<category><![CDATA[Product price]]></category>
		<category><![CDATA[product tier price]]></category>
		<category><![CDATA[Tier price]]></category>
		<category><![CDATA[Tier price api]]></category>
		<category><![CDATA[update tier price]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=176</guid>
		<description><![CDATA[Tier Price add/update in magento <a href="http://magento4u.wordpress.com/2009/08/03/product-tier-price-addupdate-in-magento/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=176&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Magento has strong features to set Tier price. If you are interested to set multiple prices of a product for combination of customer group and product quantities, you can set by Magento Tier price option.</p>
<p>We can handle tier price in many ways. Here I am describing basic logic to add/update tier price in modular way. At first define all tier prices as an array. Ofcourse mind one thing about quantity. Quantity format must be four decimal precision. Like 100.0000. For this you can use below formatting.</p>
<p>$qty = number_format($qty, 4, &#8216;.&#8217;, &#8221;);</p>
<p><pre class="brush: php;">
//Define tier price as an array
$tierPrices[] = array(
		     'website_id'  =&gt; 0,
		     'cust_group'  =&gt; $customer_group_id,
		     'price_qty'   =&gt; $qty,
		     'price'       =&gt; $price 
		   );

Ex.
$tierPrices[0] = array(
		     'website_id'  =&gt; 0,
		     'cust_group'  =&gt; 1,
		     'price_qty'   =&gt; 100.0000,
		     'price'       =&gt; 12.0000 
		   );

$tierPrices[1] = array(
		     'website_id'  =&gt; 0,
		     'cust_group'  =&gt; 2,
		     'price_qty'   =&gt; 100.0000,
		     'price'       =&gt; 10.0000 
		   );


//get productid for corresponding SKU.
$productid = Mage::getModel('catalog/product')
                  -&gt;getIdBySku($sku);

// Initiate product model 
$product = Mage::getModel('catalog/product');

// Load specific product whose tier price want to update
$product -&gt;load($productid);

// take existing tier prices of that product
$existingTierPrice = $product-&gt;tier_price;
		
// Marge existing and new tier prices to update
$tierPrices=array_merge($existingTierPrice,$newTierPrices);
		
// Assign all tier prices to product's tier_price object
$product-&gt;tier_price = $tierPrices;

// Save you product with all tier prices
$product-&gt;save(); 

</pre></p>
<p>Also Magento has web service API support to handle tier price. If you are expert in web service work then you can do the same thing using Magento API. To handle tier price with api call do something like below.</p>
<p><pre class="brush: php;">
$proxy = new SoapClient('http://127.0.0.1/magento/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
 
// Get tier prices
$tierPrices = $proxy-&gt;call($sessionId, 'product_tier_price.info', 'Sku');
 
// Add new
$tierPrices[] = array(
    'website'           =&gt; 'all',
    'customer_group_id' =&gt; 'all',
    'qty'               =&gt; 68,
    'price'             =&gt; 18.20
);
 
// Update tier prices
$proxy-&gt;call($sessionId, 'product_tier_price.update', array('Sku', $tierPrices));
</pre></p>
<br /> Tagged: add tier price, Customer group price, Group Price, Magento Product, Magento tier price, Magento tier price update, Product price, product tier price, Tier price, Tier price api, update tier price <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=176&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/08/03/product-tier-price-addupdate-in-magento/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Magento API / web service work</title>
		<link>http://magento4u.wordpress.com/2009/07/28/magento-api-web-service-work/</link>
		<comments>http://magento4u.wordpress.com/2009/07/28/magento-api-web-service-work/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 18:35:58 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Magento Api]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[API role setting]]></category>
		<category><![CDATA[customer api]]></category>
		<category><![CDATA[Magento api key]]></category>
		<category><![CDATA[Magento api setting]]></category>
		<category><![CDATA[Magento web service]]></category>
		<category><![CDATA[soap adapter]]></category>
		<category><![CDATA[v2_soap adapter]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=156</guid>
		<description><![CDATA[All about magento api, web service work, soap, wsdl, v2_soap, api role, api key, api user setting etc <a href="http://magento4u.wordpress.com/2009/07/28/magento-api-web-service-work/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=156&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Magento has strong web service features. I can say Magento’s web service is one step ahead than others e-commerce. Magneto has soap, v2_soap(soap 2) and xmlrpc adapter facilities. Using magento web services you can synchronize customer, categories, products, orders etc data with existing stores. Here I am going to describe magento’s web service deals step by step.</p>
<p><strong>Setup API:</strong> At first create api user and api key from Magento&#8217;s admin. Follow below steps.<br />
1.	Create api user from admin-&gt;system-&gt;web services-&gt; Users-&gt;Add New User-&gt;User Info. See picture.</p>
<div id="attachment_163" class="wp-caption aligncenter" style="width: 476px"><a href="http://magento4u.files.wordpress.com/2009/07/apiuser1.png"><img class="size-full wp-image-163" title="Api user create with api key" src="http://magento4u.files.wordpress.com/2009/07/apiuser1.png?w=500" alt="Api user create with api key"   /></a><p class="wp-caption-text">Api user create with api key</p></div>
<p>2.	Create role to set permission on api method under admin-&gt;system-&gt;web services-&gt; Roles-&gt;Add New Role.<br />
3.	Define “Role Resources” for created role. See picture.</p>
<div id="attachment_167" class="wp-caption aligncenter" style="width: 489px"><a href="http://magento4u.files.wordpress.com/2009/07/api_role_permission3.png"><img class="size-full wp-image-167" title="Set api permission on role" src="http://magento4u.files.wordpress.com/2009/07/api_role_permission3.png?w=500" alt="Set api permission on role"   /></a><p class="wp-caption-text">Set api permission on role</p></div>
<p>4.	Set “User Role” from admin-&gt;system-&gt;web services-&gt; Users-&gt;choose user-&gt;User Role.</p>
<p><strong>Call API:</strong><br />
API user and key is created. Now we can call api methods in two ways.<br />
1.	Soap call<br />
2.	V2_Soap call</p>
<p>Here I am going to discuss both ways.</p>
<p><strong>Soap call: </strong><br />
Magento wiki and help center have described this method. So who are beginner in web service work they can call magento api using this soap method. You get all api documentations in Magento site. Here is an example.</p>
<p><pre class="brush: php;">

//create soap object
$proxy = new SoapClient('http://127.0.0.1/magento/api/soap/?wsdl');

// create authorized session id using api user name and api key
// $sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$sessionId = $proxy-&gt;login('m4u_admin', '12345678');

 // Get customer info for customer id = 1
$customerinfo = $proxy-&gt;call($sessionId, 'customer.info', 1);

print_r($customerinfo);

</pre></p>
<p><strong><br />
V2_Soap call:</strong><br />
V2_soap call is for advance user. Who are expert in web service work they can easily use this method to call any magento api method from remote place. Whose magento knowledge is zero they also can use this soap method to work with magento web service. But about this method you will not get any api documentation in Magento wiki. But I think it will easy for you.</p>
<p>Here I am going to describe a-z about v2_soap method as any beginner also can use this soap calling method.</p>
<p><pre class="brush: php;">

//create soap object
$proxy = new SoapClient('http://127.0.0.1/magento/api/v2_soap/?wsdl');

// create authorized session id using api user name and api key
// $sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$sessionId = $proxy-&gt;login('m4u_admin', '12345678');

 // Get customer info for customer id = 1
$customerinfo = $proxy-&gt;customerCustomerInfo($sessionId,1);

print_r($customerinfo);
</pre></p>
<p><strong>Which method you need to call?</strong></p>
<p>At first decide which method you need to call of api.  Suppose you want to retrieve customer info from Magento store. So you should call customer related api method to get customer info.  But you donot know which method exactly you need. To view all available methods in your magento api please run http://127.0.0.1/magento/api/v2_soap/?wsdl. Now pick appropriate api method from wsdl operation list. Suppose I pick “customerCustomerInfo” method to get customer info.</p>
<p><pre class="brush: xml;">
&lt;operation name=&quot;customerCustomerInfo&quot;&gt;
   &lt;documentation&gt;Retrieve customer data&lt;/documentation&gt; 
   &lt;input message=&quot;typens:customerCustomerInfoRequest&quot;/&gt;
   &lt;output message=&quot;typens:customerCustomerInfoResponse&quot;/&gt;
&lt;/operation&gt;
</pre></p>
<p><strong>What is request parameter? </strong></p>
<p>From wsdl you get a clear concept about api request/input parameter. For “customerCustomerInfo” operation input message is “customerCustomerInfoRequest”. So you will get all input/request parameter info (name and type) to call customerCustomerInfo method in message “customerCustomerInfoRequest”. customerCustomerInfo has three request parameter such sessionid(string), customerid(int) and atribuates(Array).</p>
<p><pre class="brush: xml;">
&lt;message name=&quot;customerCustomerInfoRequest&quot;&gt; 
    &lt;part name=&quot;sessionId&quot; type=&quot;xsd:string&quot;/&gt;
    &lt;part name=&quot;customerId&quot; type=&quot;xsd:int&quot;/&gt;
    &lt;part name=&quot;attributes&quot; type=&quot;typens:ArrayOfString&quot;/&gt;
&lt;/message&gt;   
</pre></p>
<p>So we can request customerCustomerInfo method as below.</p>
<p>// Get customer info for customer id = 1 and attribute is optional<br />
$attribute = array(‘firstname’, ‘lastname’, ‘email’, ‘store_id’);<br />
$customerinfo = $proxy-&gt;call($sessionId, &#8216;customer.info&#8217;, 1, $attribute);</p>
<p>see picture for details-<br />
<div id="attachment_172" class="wp-caption aligncenter" style="width: 509px"><a href="http://magento4u.files.wordpress.com/2009/07/api_v2_soap_wsdl.png"><img src="http://magento4u.files.wordpress.com/2009/07/api_v2_soap_wsdl.png?w=500" alt="API v2_soap wsdl request and response message." title="api_v2_soap_wsdl"   class="size-full wp-image-172" /></a><p class="wp-caption-text">API v2_soap wsdl request and response message.</p></div></p>
<p><strong>What is return/response data?</strong></p>
<p>From wsdl you also get idea about api response/return/output. For “customerCustomerInfo” operation output message is “customerCustomerInfoResponse”. So you will get output/result info (name and type) of customerCustomerInfo method in message “customerCustomerInfoResponse”. customerCustomerInfo will return customerCustomerEntity object as data. Please see what the format of customerCustomerEntity object in wsdl. </p>
<p><pre class="brush: xml;">
&lt;message name=&quot;customerCustomerInfoResponse&quot;&gt;
    &lt;part name=&quot;customerInfo&quot; type=&quot;typens:customerCustomerEntity&quot;/&gt;
&lt;/message&gt;
</pre></p>
<p>That’s it!! </p>
<br /> Tagged: API role setting, customer api, Magento Api, Magento api key, Magento api setting, Magento web service, soap adapter, v2_soap adapter, wsdl <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=156&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/07/28/magento-api-web-service-work/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>

		<media:content url="http://magento4u.files.wordpress.com/2009/07/apiuser1.png" medium="image">
			<media:title type="html">Api user create with api key</media:title>
		</media:content>

		<media:content url="http://magento4u.files.wordpress.com/2009/07/api_role_permission3.png" medium="image">
			<media:title type="html">Set api permission on role</media:title>
		</media:content>

		<media:content url="http://magento4u.files.wordpress.com/2009/07/api_v2_soap_wsdl.png" medium="image">
			<media:title type="html">api_v2_soap_wsdl</media:title>
		</media:content>
	</item>
		<item>
		<title>Update Magento product / inventory from external source.</title>
		<link>http://magento4u.wordpress.com/2009/07/26/magento-product-inventory-update-from-external-source/</link>
		<comments>http://magento4u.wordpress.com/2009/07/26/magento-product-inventory-update-from-external-source/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 04:37:42 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Magento Products]]></category>
		<category><![CDATA[Magento inventory update]]></category>
		<category><![CDATA[Magento product update]]></category>
		<category><![CDATA[override catalog product model]]></category>
		<category><![CDATA[Product]]></category>
		<category><![CDATA[product origdata]]></category>
		<category><![CDATA[product price update]]></category>
		<category><![CDATA[Product quantity update]]></category>
		<category><![CDATA[Product update]]></category>
		<category><![CDATA[product update outside of admin]]></category>
		<category><![CDATA[stock update]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=144</guid>
		<description><![CDATA[Magento product / inventory update from outside of admin by creating new module and overriding catalog product model class.  <a href="http://magento4u.wordpress.com/2009/07/26/magento-product-inventory-update-from-external-source/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=144&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Magento is newly coming great e-commerce. So if you wish you can move your existing store in Magento or if you interested then you can create another new store in Magento. In this case you may want to synchronize your existing inventory with new magento store. Here I am going to explain how we can update magento product/inventory from outside of Magento admin. We can use corn job to process inventory synchronization in automatic way. Magento also have corn job feature.</p>
<p>In two ways we can update magento’s inventory.<br />
1.	By creating new module or<br />
2.	Using product API/web service.</p>
<p>Here I will discuss update through module system.</p>
<p><strong>Update inventory creating new module:</strong></p>
<p>At first create new module in local pool to handle inventory update work. And create all of your necessary files. Then follow below steps to update your inventory.</p>
<p><strong>Load product:</strong> load product using product id. If you have product sku then retrieve product id for corresponding sku.</p>
<p><pre class="brush: php;">
// retrieve product id using sku
 $product_id = Mage::getModel('catalog/product')
                    -&gt;getIdBySku($sku);

// call product model and create product object
$product    = Mage::getModel('catalog/product');
// Load product using product id
 $product -&gt;load($product_id);
</pre></p>
<p><strong>Set updated inventory data:</strong> set all of your updated data in product object.</p>
<p><pre class="brush: php;">
// get product's general info such price, status, description
$productInfoData = $product-&gt;getData();

// update general info using new data
$productInfoData['price'] = 11;
$productInfoData['description'] = 'Testing product update';
$productInfoData['status'] = 1;

// then set product's general info to update
$product-&gt;setData($productInfoData);

// get product's stock data such quantity, in_stock etc
$stockData = $product-&gt;getStockData();

// update stock data using new data
$stockData['qty'] = 356;
$stockData['is_in_stock'] = 1;

// then set product's stock data to update
$product-&gt;setStockData($stockData);

// call save() method to save your product with updated data
$product-&gt;save();
</pre></p>
<p>Basically our product update process is completed but in this situation updated product will not be save. Magento want origData to save product object. Without admin session magento cannot create origData for product. This is a magento security issue.  So if you want to update magento product outside of admin or without creating admin session then you need to override Mage_Catalog_Model_Product class. </p>
<p>Configure new module and create app/local/M4U/catalog/etc/c onfig.xml file and write below code.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt; 
    &lt;global&gt;
	&lt;modules&gt;
           &lt;m4u_catalog&gt;
               &lt;version&gt;0.1.0&lt;/version&gt;
           &lt;/m4u_catalog&gt;
        &lt;/modules&gt;
	&lt;models&gt;
	  &lt;catalog&gt;
            &lt;rewrite&gt;
              &lt;product&gt;M4U_Catalog_Model_Product&lt;/product&gt;
            &lt;/rewrite&gt;
          &lt;/catalog&gt;
       &lt;/models&gt; 
   &lt;/global&gt;	
&lt;/config&gt;
</pre></p>
<p>Override Mage_Catalog_Model_Product class and write setOrigData method as below.</p>
<p><pre class="brush: php;">
class M4U_Catalog_Model_Product extends Mage_Catalog_Model_Product
{
    /**
     * Set original loaded data if needed
     * @param string $key
     * @param mixed $data
     * @return Varien_Object
     */
    public function setOrigData($key=null, $data=null)
    {
       return Mage_Catalog_Model_Abstract::setOrigData($key, $data);
    }
}
</pre></p>
<p>If you expert in Magento module system or in override system only then you can follow this process to update magento inventory otherwise you should proceed with api. For alternative solution, you can see “update product through api / web service” post.</p>
<p>Have any query or question? Feel free to post.</p>
<br /> Tagged: Magento inventory update, Magento product update, override catalog product model, Product, product origdata, product price update, Product quantity update, Product update, product update outside of admin, stock update <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=144&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/07/26/magento-product-inventory-update-from-external-source/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Magento CMS controller override / cms page controller override in magento</title>
		<link>http://magento4u.wordpress.com/2009/07/04/magento-cms-controller-override-noroute-method-modify/</link>
		<comments>http://magento4u.wordpress.com/2009/07/04/magento-cms-controller-override-noroute-method-modify/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 05:56:39 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Class Override]]></category>
		<category><![CDATA[Controller Override]]></category>
		<category><![CDATA[cms controller override]]></category>
		<category><![CDATA[cms index controller override]]></category>
		<category><![CDATA[cms noroute redirection]]></category>
		<category><![CDATA[Magento cms page controller override]]></category>
		<category><![CDATA[magento cms system]]></category>
		<category><![CDATA[Magento marge with expression engine cms]]></category>
		<category><![CDATA[norouteAction method modify]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=117</guid>
		<description><![CDATA[Magento cms module have some nice functionality. Here details about how to override magento cms controller or any method ?  <a href="http://magento4u.wordpress.com/2009/07/04/magento-cms-controller-override-noroute-method-modify/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=117&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Whoops !! what Magento&#8217;s bad ? Ofcourse documentation. Bullshit documentation !!. Magento have features but without documentation !!!!</p>
<p>Magento cms module has some nice functionality. Using Magento’s 404 event handlers of cms module you can integrate 3rd Party CMS Content such Expression Engine, Drupal, wordpress, joomla etc within Magento.<br />
Magento is robust and have some great nice features but still their documentation is very poor. In Magento forum and wiki they just demonstrate “how to override a controller?” as a general theory. But how to override exceptional cms and api controller is not clear. Even Magento did not mention anything about exceptionality of cms and api module. Cms module calls internally. So we cannot override cms module’s controller using as usual magento controller override process.  Here I described how to overrite cms index and page controller.</p>
<p>Target : Override Cms module’s Index (Mage_Cms_IndexController) controller  and Page (Mage_Cms_IndexController) controller.</p>
<p><strong>Hint:</strong> IndexController is responsible for displaying errors (404) &amp; home page and PageController is responsible for displaying pages like &#8216;about-us&#8217;, keep this in mind as you may want to rewrite which controller. </p>
<p>Ok, let’s start&#8212;</p>
<p>Firsty, it’s wise to name your module differently to avoid name collisions. Lets call my module M4U_Mycms for that case.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
    &lt;modules&gt;
        &lt;M4U_Mycms&gt;
            &lt;active&gt;true&lt;/active&gt;
            &lt;codePool&gt;local&lt;/codePool&gt;
        &lt;/M4U_Mycms&gt;
    &lt;/modules&gt;
&lt;/config&gt;
</pre></p>
<p>Now create config xml for new module in app/code/local/M4U/Mycms/etc/config.xml. Here as example I mention xml to override norouteAction method of IndexController. </p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;

    &lt;modules&gt;
        &lt;M4U_Mycms&gt;
            &lt;version&gt;0.1.0&lt;/version&gt;
        &lt;/ M4U_Mycms&gt;
    &lt;/modules&gt;
   
    &lt;frontend&gt;
        &lt;routers&gt;
            &lt;mycms&gt;
                &lt;use&gt;standard&lt;/use&gt;
                &lt;args&gt;
                    &lt;module&gt; M4U_Mycms&lt;/module&gt;
                    &lt;frontName&gt;mycms&lt;/frontName&gt;
                &lt;/args&gt;
            &lt;/mycms&gt;
        &lt;/routers&gt;
&lt;/frontend&gt;	
	
&lt;global&gt;
     &lt;routers&gt;
            &lt;cms&gt;
                &lt;rewrite&gt;
                    &lt;index&gt;
                        &lt;to&gt;M4U_Mycms/index&lt;/to&gt;
                        &lt;override_actions&gt;true&lt;/override_actions&gt;
                        &lt;actions&gt;
                           &lt;noroute&gt;&lt;to&gt; M4U_Mycms/index/noroute&lt;/to&gt;&lt;/noroute&gt;
                        &lt;/actions&gt;
                    &lt;/index&gt;
                &lt;/rewrite&gt;
            &lt;/cms&gt;
        &lt;/routers&gt;

       &lt;/global&gt;
&lt;/config&gt;
</pre></p>
<p><strong>N.B:</strong> Please take care about  tag. It will let you create additional NEW actions that will be rewritten to new controller.</p>
<p>Now create new index controller in app/code/local/M4U/Mycms/controllers/IndexController.php and update noRouteAction method. </p>
<p><pre class="brush: php;">

require_once &quot;Mage/Cms/controllers/IndexController.php&quot;;
class M4U_Mycms_IndexController extends Mage_Cms_IndexController
{
    public function noRouteAction($coreRoute = null)
    {
        //modify this method as you need
        
        exit('Yes, I can successfully override cms/index noRoute method ');
		
        //$this-&gt;getResponse()-&gt;setHeader('HTTP/1.1','404 Not Found');
        //$this-&gt;getResponse()-&gt;setHeader('Status','404 File not found');
       // $pageId = Mage::getStoreConfig('web/default/cms_no_route');
       // if (!Mage::helper('cms/page')-&gt;renderPage($this, $pageId)) {
       //     $this-&gt;_forward('defaultNoRoute');
       // }
    }
}
</pre></p>
<p>Done !! </p>
<p>When any requested class/method is not found in system then Magento throw &#8220;404 Not Found&#8221; error using noRouteAction method. So we can test this method calling any undefined page url like http://127.0.0.1/magento/index.php/undefinedpagename. Here, undefinedpagename is not a defined page in magento.</p>
<p>ok, now run http://127.0.0.1/magento/index.php/undefinedpagename and if you get result<br />
&#8220;Yes, I can successfully override cms/index noRoute method&#8221; in browser then noRouteAction method override is success.</p>
<p>Here i just describe noRouteAction method modification system. Like this way you can modify all of the indexController and pageController method.</p>
<p>You will get source code in right side box widget. Download code and enjoy your work.</p>
<p>if need any help let me know.</p>
<br /> Tagged: Class Override, cms controller override, cms index controller override, cms noroute redirection, Controller Override, Magento cms page controller override, magento cms system, Magento marge with expression engine cms, norouteAction method modify <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=117&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/07/04/magento-cms-controller-override-noroute-method-modify/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Magento email work/create new email template</title>
		<link>http://magento4u.wordpress.com/2009/06/27/magento-email-workcreate-new-email-template/</link>
		<comments>http://magento4u.wordpress.com/2009/06/27/magento-email-workcreate-new-email-template/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 06:35:47 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[control email from admin]]></category>
		<category><![CDATA[create new email in magento]]></category>
		<category><![CDATA[email template]]></category>
		<category><![CDATA[Magento email]]></category>
		<category><![CDATA[magento email customization]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=105</guid>
		<description><![CDATA[Details about magento email work, how to create new email, how to manage email template in magento admin.  <a href="http://magento4u.wordpress.com/2009/06/27/magento-email-workcreate-new-email-template/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=105&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Magento email work/create new email template is coming&#8230;</p>
<br /> Tagged: control email from admin, create new email in magento, email template, Magento email, magento email customization <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=105&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/06/27/magento-email-workcreate-new-email-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Can u imagine !! how much data Magento load to show an order ?</title>
		<link>http://magento4u.wordpress.com/2009/06/12/can-u-imagine-how-much-data-magento-load-to-show-an-order/</link>
		<comments>http://magento4u.wordpress.com/2009/06/12/can-u-imagine-how-much-data-magento-load-to-show-an-order/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 11:35:20 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Magento order]]></category>
		<category><![CDATA[load magento order]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=84</guid>
		<description><![CDATA[I stuck-ed at office today just going to print_r an object !! Today at 11.00AM, i entered in office and check mail. Than started my schedule work. I open a file and just wrote 2 lines code print_r($this-&#62;getOrders()); and hit &#8230; <a href="http://magento4u.wordpress.com/2009/06/12/can-u-imagine-how-much-data-magento-load-to-show-an-order/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=84&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I stuck-ed at office today just going to print_r an object !!</p>
<p>Today at 11.00AM, i entered in office and check mail. Than started my schedule work. I open a file and just wrote 2 lines code</p>
<pre>
print_r($this-&gt;getOrders());
</pre>
<p>and hit the browser url. Oh my god !! browser is loading and loading data. After 10 minutes i see browser is hanged !! Then i closed the browser. Again start browser and run the same url but no luck got the same result. </p>
<p>Now what can i do ? then i update code like this</p>
<pre>
 $orders = Mage::getResourceModel('sales/order_collection')
            //-&gt;addAttributeToSelect('*')
            -&gt;joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
            -&gt;joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
            -&gt;addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getId())
            -&gt;addAttributeToFilter('state', array('in' =&gt; Mage::getSingleton('sales/order_config')-&gt;getVisibleOnFrontStates()))
            -&gt;addAttributeToSort('created_at', 'desc')
        ;

        $this-&gt;setOrders($orders);
        print_r($this-&gt;getOrders());
</pre>
<p>wowwwwww&#8230; now i got the data after 2 minutes !! </p>
<p>Here i see magento loaded around 10 thousands line data just to show a single order of a customer. </p>
<p>Then i again run below modified code</p>
<pre>
 $orders = Mage::getResourceModel('sales/order_collection')
            -&gt;addAttributeToSelect('*')
            //-&gt;joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
            //-&gt;joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
            -&gt;addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getId())
            //-&gt;addAttributeToFilter('state', array('in' =&gt; Mage::getSingleton('sales/order_config')-&gt;getVisibleOnFrontStates()))
            //-&gt;addAttributeToSort('created_at', 'desc')
        ;

        $this-&gt;setOrders($orders);
        print_r($this-&gt;getOrders());
</pre>
<p>Now i got result and copy that data from browser and paste in MS word file. To keep all data MS word take 2499 !! pages and file size is 12.8 MB !! </p>
<p>You believe it or not , i have just discovered the largest array of the world !! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
If any guys know about larger array then you can challenge me. I am ready for your bouncer. </p>
<p><a href='http://magento4u.files.wordpress.com/2009/06/magento_order_show_retrive_data.doc'>Download Doc </a></p>
<br /> Tagged: load magento order, Magento order <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=84&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/06/12/can-u-imagine-how-much-data-magento-load-to-show-an-order/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Create new module &#8220;HelloWorld&#8221; &#8211; in Magento</title>
		<link>http://magento4u.wordpress.com/2009/06/08/create-new-module-helloworld-in-magento/</link>
		<comments>http://magento4u.wordpress.com/2009/06/08/create-new-module-helloworld-in-magento/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 21:29:26 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Magento Module]]></category>
		<category><![CDATA[Block Override]]></category>
		<category><![CDATA[Create module]]></category>
		<category><![CDATA[create new]]></category>
		<category><![CDATA[create new module]]></category>
		<category><![CDATA[create new page in magento]]></category>
		<category><![CDATA[Custom module]]></category>
		<category><![CDATA[Module override]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=66</guid>
		<description><![CDATA[Do you want to create a new page in Magento ? or Do you want to create a new module in Magento ? If yes, Then ok, just spend 10 minutes and follow below steps. Objectives: I will create a &#8230; <a href="http://magento4u.wordpress.com/2009/06/08/create-new-module-helloworld-in-magento/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=66&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Do you want to create a new page in Magento ? or Do you want to create a new module in Magento ? If yes, Then ok, just spend 10 minutes and follow below steps.</p>
<p><strong>Objectives:</strong> I will create a new page in Magento whose output will be &#8220;Hello World ! I am a Magento Guy..&#8221;.</p>
<p><strong>Target:</strong> Create a new module called &#8220;HelloWorld&#8221;</p>
<p><strong>Step 1</strong><strong>: Module Declaration</strong></p>
<p>Create app/etc/modules/M4U_HelloWorld.xml and write below code</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
         &lt;modules&gt;
                &lt;M4U_HelloWorld&gt;
                        &lt;active&gt;true&lt;/active&gt;
                        &lt;codePool&gt;local&lt;/codePool&gt;
                &lt;/M4U_HelloWorld&gt;
         &lt;/modules&gt;
&lt;/config&gt;
</pre></p>
<p><strong>Step 2: Module Configuration</strong></p>
<p>a. Create a controller class app/code/local/M4U/HelloWorld/controllers/IndexController.php</p>
<p><pre class="brush: php;">
class M4U_HelloWorld_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
     $this-&gt;loadLayout(array('default'));
     $this-&gt;renderLayout();
    }
}
</pre></p>
<p>b. Create a Block class app/code/local/M4U/HelloWorld/Block/HelloWorld.php</p>
<p><pre class="brush: php;">
class M4U_HelloWorld_Block_HelloWorld extends Mage_Core_Block_Template
{
  // necessary methods
}
</pre></p>
<p>c. create configuration xml in app/code/local/M4U/HelloWorld/etc/config.xml</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
	&lt;global&gt;
		&lt;modules&gt;
                &lt;m4u_helloworld&gt;
                        &lt;version&gt;0.1.0&lt;/version&gt;
                &lt;/m4u_helloworld&gt;
        &lt;/modules&gt;
	&lt;blocks&gt;
            &lt;helloworld&gt;
                &lt;rewrite&gt;
		 &lt;helloworld&gt;M4U_HelloWorld_Block_HelloWorld&lt;/helloworld&gt;
		&lt;/rewrite&gt;
            &lt;/helloworld&gt;
	 &lt;/blocks&gt;

        &lt;/global&gt;
	   &lt;frontend&gt;
                &lt;routers&gt;
                        &lt;helloworld&gt;
                                &lt;use&gt;standard&lt;/use&gt;
                                &lt;args&gt;
                                      &lt;module&gt;M4U_HelloWorld&lt;/module&gt;
                                      &lt;frontName&gt;helloworld&lt;/frontName&gt;
                                &lt;/args&gt;
                        &lt;/helloworld&gt;
                &lt;/routers&gt;
		&lt;layout&gt;
			&lt;updates&gt;
				&lt;helloworld&gt;
		   		      &lt;file&gt;helloworld.xml&lt;/file&gt;
				&lt;/helloworld&gt;
			&lt;/updates&gt;
       		&lt;/layout&gt;
        &lt;/frontend&gt;
&lt;/config&gt;
</pre></p>
<p><strong>Define Frontend Template :</strong></p>
<p>1. Define page layout in app/design/frontend/<strong>M4U</strong>/default/layout/helloworld.xml</p>
<p><strong>N.B:</strong> Use <strong>default</strong> instead of <strong>M4U</strong> as template location if you use default design packages. Means create file in <strong>app/design/frontend/default/default/layout/helloworld.xml</strong></p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;

	&lt;layout version=&quot;0.1.0&quot;&gt;

		&lt;helloworld_index_index&gt;
			&lt;reference name=&quot;root&quot;&gt;
				&lt;action method=&quot;setTemplate&quot;&gt;&lt;template&gt;page/1column.phtml&lt;/template&gt;&lt;/action&gt;
       	 	&lt;/reference&gt;
			&lt;reference name=&quot;content&quot;&gt;
            	&lt;block type=&quot;helloworld/helloworld&quot; name=&quot;hello&quot; template=&quot;helloworld/helloworld.phtml&quot;/&gt;
        	&lt;/reference&gt;
		&lt;/helloworld_index_index&gt;

	&lt;/layout&gt;
</pre></p>
<p>2. Create template file app/design/frontend/<strong>M4U</strong>/default/template/helloworld/helloworld.phtml and write down</p>
<p><strong>N.B:</strong> Use <strong>default</strong> instead of <strong>M4U</strong> as template location if you use default design packages. Means create file in app/design/frontend/<strong>default</strong>/default/template/helloworld/helloworld.phtml<strong></strong></p>
<p>Hello World ! I am a Magento Guy..</p>
<p>Hey, new module is ready to run and hit browser with url http://127.0.0.1/projectname/index.php/helloworld/</p>
<p>and see result.</p>
<p>That&#8217;s it&#8230;&#8230;..</p>
<p>Is it easy or not ? what you think ?</p>
<p>Coder, Please at first try yourself.</p>
<p>Ohh.., Still are you facing problem ? Lets download full module source code from left panel &#8220;BOX&#8221; section or let me know.</p>
<p>Note: I have upgraded HelloWorld module source code of BOX widget. So it will resolve the problem which was faced by some guys.</p>
<br /> Tagged: Block Override, Create module, create new, create new module, create new page in magento, Custom module, Magento Module, Module override <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=66&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/06/08/create-new-module-helloworld-in-magento/feed/</wfw:commentRss>
		<slash:comments>96</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
		<item>
		<title>Create a new module in magento</title>
		<link>http://magento4u.wordpress.com/2009/06/06/create-new-module-in-magento/</link>
		<comments>http://magento4u.wordpress.com/2009/06/06/create-new-module-in-magento/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 16:06:10 +0000</pubDate>
		<dc:creator>Moinul Al-Mamun</dc:creator>
				<category><![CDATA[Magento Module]]></category>
		<category><![CDATA[Block Override]]></category>
		<category><![CDATA[Controller Override]]></category>
		<category><![CDATA[Create module]]></category>
		<category><![CDATA[Custom module]]></category>
		<category><![CDATA[Helper Override]]></category>
		<category><![CDATA[magento class override]]></category>
		<category><![CDATA[Model Override]]></category>
		<category><![CDATA[Module override]]></category>

		<guid isPermaLink="false">http://magento4u.wordpress.com/?p=33</guid>
		<description><![CDATA[Create a new module in magento.   <a href="http://magento4u.wordpress.com/2009/06/06/create-new-module-in-magento/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=33&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you need to add new functionality or want to edit existing magento class in both case you should create a new module. Suppose, you want to add &#8220;User Credit&#8221; system then you need to create a new UserCredit module in magento. And if you want to edit/update customer functionality  then you should follow magento override rules. To override existing Customer module you should create another new customer  module name M4U_Customer in local pool. In this case you need to use magento rewrite rules. When you go to add or edit something in magento,  each time you can be done as separate module or few methods can be combined in same module if they share functionality or could be used together.</p>
<p>Let’s create a module :</p>
<p><strong>Module Declaration:</strong><br />
Create app/etc/modules/M4U_NewModule.xml and write below code<br />
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
         &lt;modules&gt;
&lt;!-- declare CompanyName_NewModule module --&gt;
           &lt;M4U_NewModule&gt;
&lt;!-- this is an active module --&gt;
                  &lt;active&gt;true&lt;/active&gt;
&lt;!-- this module will be located in app/code/local code pool --&gt;
                  &lt;codePool&gt;local&lt;/codePool&gt;
&lt;!-- specify dependencies for correct module loading order --&gt;
                  &lt;depends&gt;
                             &lt;Mage_ExistingModule /&gt;
                  &lt;/depends&gt;
&lt;!-- declare module's version information for database updates --&gt;
                  &lt;version&gt;0.1.0&lt;/version&gt;
           &lt;/M4U_NewModule&gt;
	&lt;/modules&gt;
&lt;/config&gt;
</pre></p>
<p>Here is example of create new M4U_customer module to override existing Mage_Customer module and M4U_Credit module to create new credit module.<br />
<pre class="brush: xml;">
&lt;config&gt;
    &lt;modules&gt;
        &lt;M4U_Customer&gt;
           &lt;active&gt;true&lt;/active&gt;
           &lt;codePool&gt;local&lt;/codePool&gt;
        &lt;/M4U_Customer&gt;
        &lt;M4U_Credit&gt;
           &lt;active&gt;true&lt;/active&gt;
           &lt;codePool&gt;local&lt;/codePool&gt;
        &lt;/M4U_Credit&gt;
    &lt;/modules&gt;
&lt;/config&gt;
</pre></p>
<p>Our new module will be called NewModule.</p>
<p>Replace all instances of ‘NewModule’ with name of your module and ‘newmodule’ with simplified code, that contains only alphanumeric characters and underscore.</p>
<p>To make this tutorial most concise, it’s implied that mentioned folders will be created when needed.</p>
<p><strong>Module Configuration:</strong></p>
<p>Create Model, Helper, coltrollers, Block, sql and etc folder under <strong> </strong>app/code/local/M4U/NewModule/ and configure app/code/local/M4U/NewModule/etc/config.xml like below:</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
   &lt;config&gt;
       &lt;modules&gt;
           &lt;M4U_NewModule&gt;
                 &lt;version&gt;0.1.0&lt;/version&gt;
           &lt;/M4U_NewModule&gt;
       &lt;/modules&gt;

&lt;!-- define Front end controller and template  --&gt;
       &lt;frontend&gt;
&lt;!-- define Front end controller  --&gt;
           &lt;routers&gt;
               &lt;newmodule&gt;
                   &lt;use&gt;standard&lt;/use&gt;
                   &lt;args&gt;
                          &lt;module&gt;M4U_NewModule&lt;/module&gt;
                          &lt;frontName&gt;newmodule&lt;/frontName&gt;
                   &lt;/args&gt;
               &lt;/newmodule&gt;
           &lt;/routers&gt;
&lt;!-- define Front end template xml --&gt;
           &lt;layout&gt;
               &lt;updates&gt;
                    &lt;newmodule&gt;
                         &lt;file&gt;newmodule.xml&lt;/file&gt;
                    &lt;/newmodule&gt;
                &lt;/updates&gt;
              &lt;/layout&gt;
           &lt;/frontend&gt;   

&lt;!-- define blocks, models, helpers in global area --&gt;
            &lt;global&gt;
               &lt;models&gt;
                  &lt;newmodule&gt;
                         &lt;class&gt;M4U_NewModule_Model&lt;/class&gt;
                  &lt;/newmodule&gt;
               &lt;/models&gt;
               &lt;blocks&gt;
                  &lt;newmodule&gt;
                          &lt;class&gt;M4U_NewModule_Block&lt;/class&gt;
                  &lt;/newmodule&gt;
               &lt;/blocks&gt;
               &lt;helpers&gt;
                  &lt;newmodule&gt;
                          &lt;class&gt;M4U_NewModule_Helper&lt;/class&gt;
                  &lt;/newmodule&gt;
               &lt;/helpers&gt;

&lt;!-- declare resource setup for new module --&gt;
               &lt;resources&gt;
                    &lt;newmodule_setup&gt;
&lt;!-- specify that this resource is a setup resource and used for upgrades --&gt;
                       &lt;setup&gt;
&lt;!-- which module to look for install/upgrade files in --&gt;
                           &lt;module&gt;M4U_NewModule&lt;/module&gt;
                       &lt;/setup&gt;
&lt;!-- specify database connection for this resource --&gt;
                       &lt;connection&gt;
&lt;!-- do not create new connection, use predefined core setup connection --&gt;
                           &lt;use&gt;core_setup&lt;/use&gt;
                       &lt;/connection&gt;
                    &lt;/newmodule_setup&gt;
                    &lt;newmodule_write&gt;
                         &lt;connection&gt;
                              &lt;use&gt;core_write&lt;/use&gt;
                         &lt;/connection&gt;
                    &lt;/newmodule_write&gt;
                    &lt;newmodule_read&gt;
                         &lt;connection&gt;
                               &lt;use&gt;core_read&lt;/use&gt;
                         &lt;/connection&gt;
                    &lt;/newmodule_read&gt;
                &lt;/resources&gt;
           &lt;/global&gt;
      &lt;/config&gt;
</pre></p>
<p><strong>Adapter Class:</strong><br />
To obtain module functionality you can write necessary method in various classes as magento convention.<br />
1. Create necessary model class in app/code/local/M4U/NewModule/Model/<br />
2. Create Block in app/code/local/M4U/NewModule/Block/<br />
3. Create Helper in app/code/local/M4U/NewModule/Helper/<br />
4. Place necessary updated database sql file in app/code/local/M4U/NewModule/sql/</p>
<p><strong>Frontend Template Define:</strong></p>
<p>1. Define page layout in app/design/frontend/M4U/default/layout/NewModule.xml</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
   &lt;layout version=&quot;0.1.0&quot;&gt;
     &lt;newmodule_index_usercredit&gt;
        &lt;reference name=&quot;root&quot;&gt;
            &lt;action method=&quot;setTemplate&quot;&gt;&lt;template&gt;page/1column.phtml&lt;/template&gt;&lt;/action&gt;
        &lt;/reference&gt;
        &lt;update handle=&quot;customer_account&quot;/&gt;
        &lt;reference name=&quot;content&quot;&gt;
            &lt;block type=&quot;newmodule/blockClassName&quot; name=&quot;usercredit&quot; template=&quot;newmodule/usercredit.phtml&quot;/&gt;
        &lt;/reference&gt;
     &lt;/newmodule_index_usercredit&gt;
&lt;/layout&gt;
</pre></p>
<p>2. Create template file app/design/frontend/M4U/default/template/newmodule/usercredit.phtml<br />
<strong> </strong></p>
<p><strong>Troubleshooting</strong></p>
<ul>
<li>Dont put your module in /Mage. It belongs in app/code/community/ or app/code/local/</li>
<li>Make sure your module’s first letter is capitlized. newmodule apparently will not work, it must start with a capital letter Newmodule.</li>
<li>If your module is not showing in configuration&gt;advanced then check your config.xml</li>
<li>Make sure you clear the cache.</li>
</ul>
<p>In this post i described general module customization theory of Magento. For more clarification you can see next post  &#8220;write HelloWord module&#8221; in this blog.</p>
<br /> Tagged: Block Override, Controller Override, Create module, Custom module, Helper Override, magento class override, Magento Module, Model Override, Module override <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/magento4u.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/magento4u.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/magento4u.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/magento4u.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/magento4u.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/magento4u.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/magento4u.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/magento4u.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/magento4u.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/magento4u.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/magento4u.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/magento4u.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/magento4u.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/magento4u.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=magento4u.wordpress.com&amp;blog=7831643&amp;post=33&amp;subd=magento4u&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://magento4u.wordpress.com/2009/06/06/create-new-module-in-magento/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257ac52638292f0c3c02f7d8d2a6a101?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Mamun</media:title>
		</media:content>
	</item>
	</channel>
</rss>
