<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3096948998424560639</id><updated>2012-01-20T14:20:21.011+02:00</updated><category term='block'/><category term='list'/><category term='discount rules'/><category term='import'/><category term='customer'/><category term='method'/><category term='tier price'/><category term='export'/><category term='currency'/><category term='product'/><category term='in stock'/><category term='breadcrumbs'/><category term='delete'/><category term='address'/><category term='footer links'/><category term='description'/><category term='multi-language'/><category term='class'/><category term='image'/><category term='email templates'/><category term='review'/><category term='total'/><category term='code review'/><category term='IPv6'/><category term='abstract'/><category term='extensions'/><category term='navigation'/><category term='login'/><category term='attribute'/><category term='accessories'/><category term='override'/><category term='3 columns'/><category term='reset'/><category term='order'/><category term='website'/><category term='config'/><category term='cart'/><category term='category'/><category term='template hints'/><category term='invoice'/><category term='store view'/><category term='form validation'/><category term='upload'/><category term='log'/><category term='session'/><category term='design'/><category term='fun'/><category term='password'/><category term='related'/><category term='remove'/><category term='save object'/><title type='text'>It's not a bug. It's a feature.</title><subtitle type='html'>This is not a blog about me. I'm not going to write here what I ate this morning, or how am I doing. I will write here small and medium solutions to small, medium and big Magento issues as I encounter them. Feel free to make any remarks, suggestions and comments. If I don't like them I will ignore them :)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>47</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-7555944223630024803</id><published>2011-12-05T15:16:00.002+02:00</published><updated>2011-12-05T15:19:19.391+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='category'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><title type='text'>Add category names in product view page</title><content type='html'>Here is an other short but useful for some people thing you can do in Magento.&lt;br /&gt;Here is how you can add the category tree path in the product view page.&lt;br /&gt;&lt;br /&gt;Edit file app/design/frontend/{interface}/{theme}/template/catalog/product/view.phtml&lt;br /&gt;&lt;br /&gt;And in the section that you want the categories to appear add this code:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php $categoryIds = $_product-&amp;gt;getCategoryIds();?&amp;gt;&lt;br /&gt; &amp;lt;?php foreach ($categoryIds as $categoryId) :?&amp;gt;&lt;br /&gt;  &amp;lt;?php $tmpId = $categoryId;?&amp;gt;&lt;br /&gt;  &amp;lt;?php $categories = array();?&amp;gt;&lt;br /&gt;  &amp;lt;?php while($tmpId != Mage::app()-&amp;gt;getStore()-&amp;gt;getRootCategoryId()) : ?&amp;gt;&lt;br /&gt;   &amp;lt;?php $category = Mage::getModel('catalog/category')-&amp;gt;setStoreId(Mage::app()-&amp;gt;getStore()-&amp;gt;getId())-&amp;gt;load($tmpId);?&amp;gt;&lt;br /&gt;   &amp;lt;?php $categories[] = $category;?&amp;gt;&lt;br /&gt;   &amp;lt;?php $tmpId = $category-&amp;gt;getParentId();?&amp;gt;&lt;br /&gt;  &amp;lt;?php endwhile;?&amp;gt;&lt;br /&gt;  &amp;lt;?php for ($i = count($categories) - 1; $i&amp;gt;=0;$i--) :?&amp;gt;&lt;br /&gt;   &amp;lt;a href="&amp;lt;?php echo $categories[$i]-&amp;gt;getUrl() ?&amp;gt;"&amp;gt;&amp;lt;?php echo $categories[$i]-&amp;gt;getName() ?&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;   &amp;lt;?php if ($i &amp;gt;0 ):?&amp;gt;&lt;br /&gt;    -&amp;amp;gt;&amp;lt;!-- this is the tree separator. change to whatever you like--&amp;gt;&lt;br /&gt;   &amp;lt;?php endif;?&amp;gt;&lt;br /&gt;  &amp;lt;?php endfor;?&amp;gt;&lt;br /&gt;  &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;?php //break;//uncomment this if you want only one category tree to appear.?&amp;gt;&lt;br /&gt; &amp;lt;?php endforeach;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I hope this helps someone.&lt;br /&gt;Keep in mind that this will make your page load a little slower, but I don't think it's something you should worry about.&lt;br /&gt;Any comments are welcomed.&lt;br /&gt;&lt;br /&gt;Marius.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-7555944223630024803?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/7555944223630024803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/12/add-category-names-in-product-view-page.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/7555944223630024803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/7555944223630024803'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/12/add-category-names-in-product-view-page.html' title='Add category names in product view page'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1355116427634905601</id><published>2011-10-06T09:34:00.000+03:00</published><updated>2011-10-06T09:34:46.451+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer'/><category scheme='http://www.blogger.com/atom/ns#' term='extensions'/><category scheme='http://www.blogger.com/atom/ns#' term='breadcrumbs'/><title type='text'>New Customer Account Breadcrumbs Extension</title><content type='html'>I've just developed &amp; released under the name AnaisSoftware (the company I work for) a new FREE Magento Extension.&lt;br /&gt;It is called 'Customer Account Breadcrumbs' (Anais_Breadcrumbs). It's not a big technical achievement but I saw some people on the forum requesting this.&lt;br /&gt;All it does is it adds breadcrumbs to the customer account pages.&lt;br /&gt;You can select from the back-end to enable the breadcrumbs for all the available account pages or select from a list the pages you want to have breadcrumbs.&lt;br /&gt;&lt;br /&gt;It works Magento 1.4.2.0, 1.5.0.1, 1.5.1.0 and 1.6.0.0.&lt;br /&gt;I have a hunch it works for previous versions also, I just didn't test them.&lt;br /&gt;It has also been tested on Magneto Enterprise 1.9.1.1 but it doesn't work for enterprise specific pages (Gift registry, Reward points, ...).&lt;br /&gt;The extension can be found here &lt;a href="http://www.magentocommerce.com/magento-connect/AnaisSoftware/extension/8220/anais_breadcrumbs"&gt;http://www.magentocommerce.com/magento-connect/AnaisSoftware/extension/8220/anais_breadcrumbs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Waiting for your feedback.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Marius.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1355116427634905601?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1355116427634905601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/10/new-customer-account-breadcrumbs.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1355116427634905601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1355116427634905601'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/10/new-customer-account-breadcrumbs.html' title='New Customer Account Breadcrumbs Extension'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1327751675373665170</id><published>2011-09-30T16:26:00.003+03:00</published><updated>2011-10-07T15:46:56.683+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='upload'/><title type='text'>Upload issue for Magento 1.6.0.0</title><content type='html'>I've seen lately the magento forum flooded with this issue.&lt;br /&gt;When trying to upload an image for the product the section with the image name gets a red border and an error message appears.&lt;br /&gt;When trying to upload something for the downloadable products...well..&lt;br /&gt;same s**t different a**h**e (pardon my French).&lt;br /&gt;&lt;br /&gt;Here is what I did to fix it:&lt;br /&gt;The problem seems to be caused by the prototype v1.7. &lt;br /&gt;It works great with prototype 1.6 &lt;br /&gt;Get the 1.6 version from here &lt;a href="http://prototypejs.org/assets/2009/8/31/prototype.js"&gt;http://prototypejs.org/assets/2009/8/31/prototype.js&lt;/a&gt; &lt;br /&gt;Create this file: js/prototype/prototype1.6.js and put the contents from the link above in it. &lt;br /&gt;Now edit app/design/adminhtml/default/default/layout/main.xml and add this line &lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;action method="addJs"&amp;gt;&amp;lt;script&amp;gt;prototype/prototype1.6.js&amp;lt;/script&amp;gt;&amp;lt;/action&amp;gt;&lt;br /&gt;&lt;/pre&gt;right below &lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;action method="addJs"&amp;gt;&amp;lt;script&amp;gt;prototype/prototype.js&amp;lt;/script&amp;gt;&amp;lt;/action&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I don’t think it’s a problem if you edit this core file. I can assume that the guys at Magento will fix the issue with the uploader untill the next version (at least I hope it’s the same issue as reported here: &lt;a href="http://www.magentocommerce.com/bug-tracking/issue?issue=12265"&gt;http://www.magentocommerce.com/bug-tracking/issue?issue=12265&lt;/a&gt; - and they claim it’s fixed)&lt;br /&gt;&lt;br /&gt;I hope this helps someone&lt;br /&gt;Cheers,&lt;br /&gt;Marius.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1327751675373665170?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1327751675373665170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/09/upload-issue-for-magento-1600.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1327751675373665170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1327751675373665170'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/09/upload-issue-for-magento-1600.html' title='Upload issue for Magento 1.6.0.0'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-5394094617707037113</id><published>2011-09-09T09:15:00.002+03:00</published><updated>2011-09-09T09:16:44.316+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='override'/><category scheme='http://www.blogger.com/atom/ns#' term='abstract'/><title type='text'>Why can't you override some classes in Magento?</title><content type='html'>I saw a lot of pleaople having this issue on the magento forum.&lt;br /&gt;Some classes cannot pe overridden the clasical way.&lt;br /&gt;First of all, this is the classical way: &lt;a href="http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/"&gt;http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/&lt;/a&gt;&lt;br /&gt;It's a old post but is still very useful and it saved me a lot of time in the past.&lt;br /&gt;&lt;br /&gt;But there are some classes that cannot be overridden this way.&lt;br /&gt;Here are some examples: Mage_Core_Block_Template, Mage_Core_Model_Abstract, Varien_Object, Mage_Core_Block_Abstract, Mage_Customer_Model_Address_Abstract and the list can go on.&lt;br /&gt;&lt;br /&gt;Basically these are the classes that are not instantiated in the application. They are used just to create other classes with common behavior.&lt;br /&gt;&lt;br /&gt;But if you need to override these classes here are your 2 options. (I only know 2. If you know others please share.)&lt;br /&gt;&lt;br /&gt;1. Quick and dirty. Using this there is a small change that on an upgrade you will lose some functionality or even crash. but don't dismiss it yet. Using the second method it's even worse.&lt;br /&gt;The basics of this method is that Magento uses an autoloader to load classes. The autoloader first searches in the 'app/code/local' folder then in 'app/code/community' and in the end 'app/code/core'.&lt;br /&gt;What you have to do is to copy the class you want to override in the app/code/local folder.&lt;br /&gt;Let's take as an example Mage_Core_Model_Abstract. You need to copy the file app/code/core/Mage/Core/Model/Abstract.php to app/code/local/Mage/Core/Model/Abstract.php.&lt;br /&gt;You can make the changes in this file.&lt;br /&gt;Now when all the other classes that extend this are declared &lt;br /&gt;&lt;pre class="brush:php"&gt;class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract&lt;br /&gt;{ ...}&lt;br /&gt;&lt;/pre&gt;they will extend your own class because when searching for Mage_Core_Model_Abstract magento will find it in your app/code/local folder and will stop looking for the one in app/code/core.&lt;br /&gt;&lt;br /&gt;2. Long and 'clean?' - You can still lose functionality on the upgrade, it's more time consuming&lt;br /&gt;and a bigger source of errors.&lt;br /&gt;You can create your own class. Let's call it 'Mycomp_Core_Model_Abstract' that extends Mage_Core_Model_Abstract and put your custom code in this.&lt;br /&gt;In order for this to affect all the other models that extend Mage_Core_Model_Abstract you need to override each class that extend Mage_Core_Model_Abstract and make them extend the class you just created. Using the same example as above..&lt;br /&gt;&lt;pre class="brush:php"&gt;class Mycomp_Customer_Model_Customer extends Mycomp_Core_Model_Abstract&lt;br /&gt;{ ...}&lt;br /&gt;&lt;/pre&gt;But now you need to copy all the functionality from Mage_Customer_Model_Customer to Mycomp_Customer_Model_Customer because, unfortunately, PHP does not support multiple inheritance (yet?)&lt;br /&gt;And for Mage_Core_Model_Abstract there are around 70 classes that extend it. You have to do this 70 times.&lt;br /&gt;&lt;br /&gt;Pick your own method. I strongly recommend the first one.&lt;br /&gt;I hope this helps someone.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Marius.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-5394094617707037113?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/5394094617707037113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/09/why-cant-you-override-some-classes-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5394094617707037113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5394094617707037113'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/09/why-cant-you-override-some-classes-in.html' title='Why can&apos;t you override some classes in Magento?'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1090647615821922391</id><published>2011-09-08T08:49:00.000+03:00</published><updated>2011-09-08T08:49:39.569+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='accessories'/><category scheme='http://www.blogger.com/atom/ns#' term='extensions'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><title type='text'>New Accessories Extension</title><content type='html'>Because you asked for it, well at least 6 of you asked for it, the 'Product accessories' extension is out. More will follow.&lt;br /&gt;You can find it here: &lt;a href="http://www.magentocommerce.com/magento-connect/AnaisSoftware/extension/7880/anais_accessories"&gt;http://www.magentocommerce.com/magento-connect/AnaisSoftware/extension/7880/anais_accessories&lt;/a&gt;&lt;br /&gt;The extension is developed by myself under the name of AnaisSoftware (the company I work for).&lt;br /&gt;&lt;br /&gt;I hope it's what you wanted. If not, well, I'm waiting for suggestions to improve it.&lt;br /&gt;&lt;br /&gt;Please contact the e-mail address associated to the extension for the install/uninstall guide. I don't think you need it, it's plug and play, but just in case, or for the PHPDoc.&lt;br /&gt;&lt;br /&gt;You can also contact me directly.&lt;br /&gt;&lt;br /&gt;I'm waiting for reviews&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Marius.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1090647615821922391?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1090647615821922391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/09/new-accessories-extension.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1090647615821922391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1090647615821922391'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/09/new-accessories-extension.html' title='New Accessories Extension'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-629325597283929567</id><published>2011-06-07T09:56:00.002+03:00</published><updated>2011-07-07T11:13:49.033+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='category'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='list'/><title type='text'>Add category names to the product list</title><content type='html'>In order to add category names to the product list (grid)&lt;br /&gt;you have 2 options. For both of them you have to edit app/design/frontend/{interface}/{theme}/template/catalog/product/list.phtml&lt;br /&gt;1. Add the category (categories) link(s) for all the products in any list (search results included). Keep in mind that any product can be in one or more categories (or none).&lt;br /&gt;At the top of the file add this:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php $_category = Mage::regsitry('current_category');?&amp;gt;&lt;br /&gt;&amp;lt;?php if ($_category) : ?&amp;gt;&lt;br /&gt;&amp;lt;a href="&amp;lt;?php echo $_category-&amp;gt;getUrl();?&amp;gt;"&amp;gt;&amp;lt;?php echo $_category-&amp;gt;getName();?&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;?php endif;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;2. &lt;br /&gt;At the top of the file add this:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php $_categories = array();?&amp;gt;&lt;br /&gt;&lt;/pre&gt;This will work as some kind of cache.&lt;br /&gt;Now below the $_product item (inside the foreach) add this&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php foreach ($_product-&amp;gt;getCategoryIds() as $categoryId) : ?&amp;gt;&lt;br /&gt; &amp;lt;?php if (isset($_categories[$categoryId])) : ?&amp;gt;&lt;br /&gt;  &amp;lt;?php $_category = $_categories[$categoryId];?&amp;gt;&lt;br /&gt; &amp;lt;?php else:?&amp;gt;&lt;br /&gt;  &amp;lt;?php $_category = Mage::getModel('catalog/category')-&amp;gt;setStoreId(Mage::app()-&amp;gt;getStore()-&amp;gt;getId())-&amp;gt;load($categoryId);?&amp;gt;&lt;br /&gt;  &amp;lt;?php $_categories[$categoryId] = $_category;?&amp;gt;&lt;br /&gt; &amp;lt;?php endif;?&amp;gt;&lt;br /&gt; &amp;lt;a href="&amp;lt;?php echo $_category-&amp;gt;getUrl()?&amp;gt;"&amp;gt;&amp;lt;?php echo $_category-&amp;gt;getName();?&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt; &amp;lt;?php //if you want only the first category link add a break here; ?&amp;gt;&lt;br /&gt;&amp;lt;?php endforeach;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;This second method covers all the cases but it's a little bit slower than the first one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-629325597283929567?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/629325597283929567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/06/add-category-names-to-product-list.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/629325597283929567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/629325597283929567'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/06/add-category-names-to-product-list.html' title='Add category names to the product list'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2590143504712503772</id><published>2011-06-02T10:56:00.004+03:00</published><updated>2011-10-20T13:04:14.282+03:00</updated><title type='text'>How to change 'My account' menu link in the customer name for logged in users</title><content type='html'>Hello.&lt;br /&gt;Here is how you can change the 'My account' menu link into the customer name (John Doe) for logged in users.&lt;br /&gt;I'm going to use the same system that the checkout module uses to add the cart and the checkout link.&lt;br /&gt;First of all create a new module that will extend the Mage_Customer module. We will call it Custom_Customer.&lt;br /&gt;In app/code/local folder create a folder named 'Custom'.&lt;br /&gt;[UPDATE]&lt;br /&gt;Inside the Custom folder create a folder 'Customer'.&lt;br /&gt;/* Thanks for the comment 'Anonymous' - see first comment*/&lt;br /&gt;[/UPTATE]&lt;br /&gt;In this folder create a subfolder called 'Block' (because we need a new block).&lt;br /&gt;Inside 'Block' folder create a php file named 'Links.php' with this content&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php &lt;br /&gt;class Custom_Customer_Block_Links extends Mage_Core_Block_Template&lt;br /&gt;{&lt;br /&gt;/**&lt;br /&gt;ads my account link to some block&lt;br /&gt;*/&lt;br /&gt;    public function addAccountLink()&lt;br /&gt;    {&lt;br /&gt;        $parentBlock = $this-&amp;gt;getParentBlock();//this block will have a parent&lt;br /&gt;        if ($parentBlock &amp;&amp; Mage::helper('core')-&amp;gt;isModuleOutputEnabled('Mage_Customer')) {//check if the customer module is not disabled&lt;br /&gt;            $customerSession = Mage::getSingleton('customer/session');//the customer session&lt;br /&gt;&lt;br /&gt;            if( $customerSession-&amp;gt;isLoggedIn() ) {//if the customer is logged in get the name&lt;br /&gt;                $text = $customerSession-&amp;gt;getCustomer()-&amp;gt;getName();&lt;br /&gt;            } else {//if the customer is not logged in print 'My account'&lt;br /&gt;                $text = Mage::helper('customer')-&amp;gt;__('My Account');&lt;br /&gt;            }&lt;br /&gt;//add the block to the set of links.&lt;br /&gt;            $parentBlock-&amp;gt;addLink($text, Mage::helper('customer')-&amp;gt;getAccountUrl(), $text, false, array(), 10, null, '');&lt;br /&gt;        }&lt;br /&gt;        return $this;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now create the config.xml file for the module.&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;In folder 'Custom' create a subfolder 'etc' and inside it the config.xml with this content.&lt;/strike&gt;&lt;br /&gt;[UPDATE]&lt;br /&gt;inside the Customer folder create a subfolder 'etc' and inside it the config.xml with this content.&lt;br /&gt;/* Thanks for the comment 'Anonymous' - see first comment*/&lt;br /&gt;[/UPTATE]&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;config&amp;gt;&lt;br /&gt;    &amp;lt;modules&amp;gt;&lt;br /&gt;        &amp;lt;!-- the  version of the module--&amp;gt;&lt;br /&gt;        &amp;lt;Custom_Customer&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;0.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/Custom_Customer&amp;gt;&lt;br /&gt;    &amp;lt;/modules&amp;gt;&lt;br /&gt;    &amp;lt;!-- Hack to tell magento that our block overrides a core block (that does not exits) --&amp;gt;&lt;br /&gt;    &amp;lt;global&amp;gt;&lt;br /&gt;     &amp;lt;blocks&amp;gt;&lt;br /&gt;      &amp;lt;customer&amp;gt;&lt;br /&gt;       &amp;lt;rewrite&amp;gt;&lt;br /&gt;        &amp;lt;links&amp;gt;Custom_Customer_Block_Links&amp;lt;/links&amp;gt;&lt;br /&gt;       &amp;lt;/rewrite&amp;gt;&lt;br /&gt;      &amp;lt;/customer&amp;gt;&lt;br /&gt;     &amp;lt;/blocks&amp;gt;&lt;br /&gt;    &amp;lt;/global&amp;gt;&lt;br /&gt;&amp;lt;/config&amp;gt;&lt;br /&gt;&lt;/pre&gt;Now we have to use out block in the design.&lt;br /&gt;in app/design/frontend/{interface}/{theme}/layout/customer.xml replace this:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;default&amp;gt;&lt;br /&gt;        &amp;lt;!-- Mage_Customer --&amp;gt;&lt;br /&gt;        &amp;lt;reference name="top.links"&amp;gt;&lt;br /&gt;            &amp;lt;action method="addLink" translate="label title" module="customer"&amp;gt;&amp;lt;label&amp;gt;My Account&amp;lt;/label&amp;gt;&amp;lt;url helper="customer/getAccountUrl"/&amp;gt;&amp;lt;title&amp;gt;My Account&amp;lt;/title&amp;gt;&amp;lt;prepare/&amp;gt;&amp;lt;urlParams/&amp;gt;&amp;lt;position&amp;gt;10&amp;lt;/position&amp;gt;&amp;lt;/action&amp;gt;&lt;br /&gt;            &lt;br /&gt;        &amp;lt;/reference&amp;gt;&lt;br /&gt;    &amp;lt;/default&amp;gt;&lt;br /&gt;&lt;/pre&gt;with this&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;default&amp;gt;&lt;br /&gt;        &amp;lt;!-- Mage_Customer --&amp;gt;&lt;br /&gt;        &amp;lt;reference name="top.links"&amp;gt;&lt;br /&gt;            &amp;lt;!-- THe block we've just created and the method to add the link --&amp;gt;&lt;br /&gt;            &amp;lt;block type="customer/links" name="customer_links"&amp;gt;&lt;br /&gt;             &amp;lt;action method="addAccountLink" /&amp;gt;&lt;br /&gt;            &amp;lt;/block&amp;gt;&lt;br /&gt;        &amp;lt;/reference&amp;gt;&lt;br /&gt;    &amp;lt;/default&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now all we have to do is to tell Magento that we have a new module.&lt;br /&gt;in app/etc/modules create a new file called Custom_Customer.xml (the name is not important) with this content:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;config&amp;gt;&lt;br /&gt;    &amp;lt;modules&amp;gt;&lt;br /&gt;        &amp;lt;Custom_Customer&amp;gt;&lt;br /&gt;            &amp;lt;active&amp;gt;true&amp;lt;/active&amp;gt;&lt;br /&gt;            &amp;lt;codePool&amp;gt;local&amp;lt;/codePool&amp;gt;&lt;br /&gt;            &amp;lt;depends&amp;gt;&amp;lt;Mage_Customer /&amp;gt;&amp;lt;/depends&amp;gt;&lt;br /&gt;        &amp;lt;/Custom_Customer&amp;gt;&lt;br /&gt;    &amp;lt;/modules&amp;gt;&lt;br /&gt;&amp;lt;/config&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Clear the contents of 'var/cache' and enjoy.&lt;br /&gt;&lt;br /&gt;Tested on Magento CE 1.5.1.0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2590143504712503772?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2590143504712503772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/06/how-to-change-my-account-menu-link-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2590143504712503772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2590143504712503772'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/06/how-to-change-my-account-menu-link-in.html' title='How to change &apos;My account&apos; menu link in the customer name for logged in users'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-8557718538859988007</id><published>2011-05-31T14:29:00.000+03:00</published><updated>2011-05-31T14:29:46.689+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer'/><category scheme='http://www.blogger.com/atom/ns#' term='log'/><title type='text'>Disabling customer logging</title><content type='html'>All the tables that start with 'log_' become pretty big after some uptime.&lt;br /&gt;If you don't need these here is a solution to disable them.&lt;br /&gt;Create your own Magento extension. Let's call it 'Custom_Log'.&lt;br /&gt;For this you need to create in app/code/local the folder 'Custom' and inside it the folder 'Log'.&lt;br /&gt;Each module needs a config file.&lt;br /&gt;Create inside the 'Log' folder a folder named 'etc' and inside it a file called config.xml with this content:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;config&amp;gt;&lt;br /&gt;    &amp;lt;modules&amp;gt;&lt;br /&gt;         &amp;lt;Custom_Log&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;0.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/Custom_Log&amp;gt;&lt;br /&gt;    &amp;lt;/modules&amp;gt;&lt;br /&gt;    &amp;lt;frontend&amp;gt;&lt;br /&gt; &amp;lt;!-- [+] Disable logging --&amp;gt;&lt;br /&gt;   &amp;lt;events&amp;gt;&lt;br /&gt;            &amp;lt;controller_action_predispatch&amp;gt;&lt;br /&gt;                &amp;lt;observers&amp;gt;&lt;br /&gt;                    &amp;lt;log&amp;gt;&lt;br /&gt;                        &amp;lt;type&amp;gt;disabled&amp;lt;/type&amp;gt;&lt;br /&gt;                    &amp;lt;/log&amp;gt;&lt;br /&gt;                &amp;lt;/observers&amp;gt;&lt;br /&gt;            &amp;lt;/controller_action_predispatch&amp;gt;&lt;br /&gt;            &amp;lt;controller_action_postdispatch&amp;gt;&lt;br /&gt;                &amp;lt;observers&amp;gt;&lt;br /&gt;                    &amp;lt;log&amp;gt;&lt;br /&gt;                        &amp;lt;type&amp;gt;disabled&amp;lt;/type&amp;gt;&lt;br /&gt;                    &amp;lt;/log&amp;gt;&lt;br /&gt;                &amp;lt;/observers&amp;gt;&lt;br /&gt;            &amp;lt;/controller_action_postdispatch&amp;gt;&lt;br /&gt;            &amp;lt;customer_login&amp;gt;&lt;br /&gt;                &amp;lt;observers&amp;gt;&lt;br /&gt;                    &amp;lt;log&amp;gt;&lt;br /&gt;                        &amp;lt;type&amp;gt;disabled&amp;lt;/type&amp;gt;&lt;br /&gt;                    &amp;lt;/log&amp;gt;&lt;br /&gt;                &amp;lt;/observers&amp;gt;&lt;br /&gt;            &amp;lt;/customer_login&amp;gt;&lt;br /&gt;            &amp;lt;customer_logout&amp;gt;&lt;br /&gt;                &amp;lt;observers&amp;gt;&lt;br /&gt;                    &amp;lt;log&amp;gt;&lt;br /&gt;                        &amp;lt;type&amp;gt;disabled&amp;lt;/type&amp;gt;&lt;br /&gt;                    &amp;lt;/log&amp;gt;&lt;br /&gt;                &amp;lt;/observers&amp;gt;&lt;br /&gt;            &amp;lt;/customer_logout&amp;gt;&lt;br /&gt;            &amp;lt;sales_quote_save_after&amp;gt;&lt;br /&gt;                &amp;lt;observers&amp;gt;&lt;br /&gt;                    &amp;lt;log&amp;gt;&lt;br /&gt;                        &amp;lt;type&amp;gt;disabled&amp;lt;/type&amp;gt;&lt;br /&gt;                    &amp;lt;/log&amp;gt;&lt;br /&gt;                &amp;lt;/observers&amp;gt;&lt;br /&gt;            &amp;lt;/sales_quote_save_after&amp;gt;&lt;br /&gt;            &amp;lt;checkout_quote_destroy&amp;gt;&lt;br /&gt;                &amp;lt;observers&amp;gt;&lt;br /&gt;                    &amp;lt;log&amp;gt;&lt;br /&gt;                        &amp;lt;type&amp;gt;disabled&amp;lt;/type&amp;gt;&lt;br /&gt;                    &amp;lt;/log&amp;gt;&lt;br /&gt;                &amp;lt;/observers&amp;gt;&lt;br /&gt;            &amp;lt;/checkout_quote_destroy&amp;gt;&lt;br /&gt;        &amp;lt;/events&amp;gt;&lt;br /&gt;   &amp;lt;!-- [-] Disable logging --&amp;gt;&lt;br /&gt;    &amp;lt;/frontend&amp;gt;&lt;br /&gt;&amp;lt;/config&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;now you need to tell Magento to use your module.&lt;br /&gt;In app/etc/modules create the file 'Custom_Log.xml' with this content:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;config&amp;gt;&lt;br /&gt;    &amp;lt;modules&amp;gt;&lt;br /&gt;        &amp;lt;Custom_Log&amp;gt;&lt;br /&gt;            &amp;lt;active&amp;gt;true&amp;lt;/active&amp;gt;&lt;br /&gt;            &amp;lt;codePool&amp;gt;local&amp;lt;/codePool&amp;gt;&lt;br /&gt;        &amp;lt;/Custom_Log&amp;gt;&lt;br /&gt;    &amp;lt;/modules&amp;gt;&lt;br /&gt;&amp;lt;/config&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;now just clear the cache (contents of folder var/cache) and you are done.&lt;br /&gt;The downside of doing this is that you won't get any details of the customers visits. But you can live with that. There's Google Analytics for this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-8557718538859988007?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/8557718538859988007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/05/disabling-customer-logging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8557718538859988007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8557718538859988007'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/05/disabling-customer-logging.html' title='Disabling customer logging'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1685605049314076849</id><published>2011-05-31T13:18:00.000+03:00</published><updated>2011-05-31T13:18:31.498+03:00</updated><title type='text'>New design</title><content type='html'>Based on the visitor suggestions (if they were needed) I decided to change the design of this 'so called blog' to a 'less ugly one'.&lt;br /&gt;I hope this is more readable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1685605049314076849?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1685605049314076849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/05/new-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1685605049314076849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1685605049314076849'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/05/new-design.html' title='New design'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-4269557122450609649</id><published>2011-05-31T11:46:00.000+03:00</published><updated>2011-05-31T11:46:49.913+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='extensions'/><title type='text'>Magento extensions you would like to see or to improuve</title><content type='html'>Hello everyone.&lt;br /&gt;I decided to make a list and a poll (I hope it's still active when you read this) of extensions that people would like to see or to have perfected.&lt;br /&gt;&lt;br /&gt;Here is the the short list I came up with.&lt;br /&gt;Save a product as pdf&lt;br /&gt;Tree like sitemap&lt;br /&gt;Live chat&lt;br /&gt;Yahoo weather widget&lt;br /&gt;Multilanguage FAQ (with categories)&lt;br /&gt;Product accessories&lt;br /&gt;Price based on dimensions (WxHxD)&lt;br /&gt;Multi-language e-mail templates&lt;br /&gt;&lt;br /&gt;If you have any other ideas please put them here and maybe you will get that extension.&lt;br /&gt;&lt;br /&gt;Please do not suggest online payment extensions.&lt;br /&gt;&lt;br /&gt;Marius.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-4269557122450609649?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/4269557122450609649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/05/magento-extensions-you-would-like-to.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4269557122450609649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4269557122450609649'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/05/magento-extensions-you-would-like-to.html' title='Magento extensions you would like to see or to improuve'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-3189571284669982779</id><published>2011-04-12T16:49:00.002+03:00</published><updated>2011-05-31T12:04:40.632+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='form validation'/><title type='text'>Adding 'on the fly' form validation</title><content type='html'>Here is how you can add 'on the fly' validation for forms in Magento. I mean to validate the forms not only on submit but after editing a field.&lt;br /&gt;Put the following line in a js file included in all the pages or in the &amp;lt;head&amp;gt; tag&lt;br /&gt;&lt;pre class="brush:html"&gt;Validation.defaultOptions.immediate = true; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you also want the classes of the validation to be added not only for the input but fur it's parent also add the following line in the same place as the one above.&lt;br /&gt;&lt;pre class="brush:html"&gt;Validation.defaultOptions.addClassNameToContainer = true;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Hope it helps&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-3189571284669982779?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/3189571284669982779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2011/04/adding-on-fly-form-validation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/3189571284669982779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/3189571284669982779'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2011/04/adding-on-fly-form-validation.html' title='Adding &apos;on the fly&apos; form validation'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-5702311087827220324</id><published>2010-11-24T10:18:00.003+02:00</published><updated>2011-05-31T12:07:02.089+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tier price'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><title type='text'>How to add tier prices in the product list</title><content type='html'>Inside the app/design/frontend/{interface}/{theme}/template/catalog/product/list.phtml add this inside the foreach loops for grid and/or list&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php $this-&amp;gt;setProduct(Mage::getModel('catalog/product')-&amp;gt;setStoreId(Mage::app()-&amp;gt;getStore()-&amp;gt;getId())-&amp;gt;load($_product-&amp;gt;getId()))?&amp;gt;&lt;br /&gt;&amp;lt;?php echo $this-&amp;gt;getTierPriceHtml() ?&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It does not look nice for grid but it can be fixed by css.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-5702311087827220324?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/5702311087827220324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/11/how-to-add-tier-prices-in-product-list.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5702311087827220324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5702311087827220324'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/11/how-to-add-tier-prices-in-product-list.html' title='How to add tier prices in the product list'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-3885726085029326748</id><published>2010-08-03T09:03:00.003+03:00</published><updated>2011-05-31T12:08:10.173+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='delete'/><category scheme='http://www.blogger.com/atom/ns#' term='order'/><title type='text'>How to delete orders from Magento</title><content type='html'>This is a response for &lt;a href="http://www.magentocommerce.com/boards/viewthread/197549/"&gt;http://www.magentocommerce.com/boards/viewthread/197549/&lt;/a&gt;&lt;br /&gt;Problem: How to delete (test) orders from Magento.&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;br /&gt;Here is a free but 'quick and dirty' way to do it.&lt;br /&gt;Create a file on the same level as index.php. Let's call it orders.php&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php&lt;br /&gt;$mageFilename = 'app/Mage.php';&lt;br /&gt;require_once $mageFilename;&lt;br /&gt;Varien_Profiler::enable();&lt;br /&gt;Mage::setIsDeveloperMode(true);&lt;br /&gt;ini_set('display_errors', 1);&lt;br /&gt;umask(0);&lt;br /&gt;Mage::app('default');&lt;br /&gt;Mage::register('isSecureArea', 1);&lt;br /&gt;//until here you gained access to the Magento models. The rest is custom code&lt;br /&gt;&lt;br /&gt;$orderId = 156;//put here the id of the order you want to delete. THE ONE FROM THE DATABASE NOT THE INCREMENT_ID&lt;br /&gt;&lt;br /&gt;$order = Mage::getModel('sales/order')-&amp;gt;load($orderId);&lt;br /&gt;$invoices = $order-&amp;gt;getInvoiceCollection();&lt;br /&gt;foreach ($invoices as $invoice){&lt;br /&gt;$invoice-&amp;gt;delete();&lt;br /&gt;}&lt;br /&gt;$creditnotes = $order-&amp;gt;getCreditmemosCollection();&lt;br /&gt;foreach ($creditnotes as $creditnote){&lt;br /&gt;$creditnote-&amp;gt;delete();&lt;br /&gt;}&lt;br /&gt;$shipments = $order-&amp;gt;getShipmentsCollection();&lt;br /&gt;foreach ($shipments as $shipment){&lt;br /&gt;$shipment-&amp;gt;delete();&lt;br /&gt;}&lt;br /&gt;$order-&amp;gt;delete();&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;Save and call it in your browser (http://my-magento.root/orders.php)&lt;br /&gt;This will delete an order with the id you specify.&lt;br /&gt;If you want to delete more of them just create a for (foreach) loop that will execute this code for each order you want to delete.&lt;br /&gt;&lt;br /&gt;For example, if all your test orders are consecutive up to a number you can do this:&lt;br /&gt;&lt;pre class="brush:php"&gt;//let's say that the orders with ids less than 200 are test orders&lt;br /&gt;$collection = Mage::getModel('sales/order')-&amp;gt;getCollection()-&amp;gt;addAttributeToFilter(array(array('attribute'=&amp;gt;'entity_id', 'lt'=&amp;gt;200)));&lt;br /&gt;foreach ($collection as $o){&lt;br /&gt;$orderId = $o-&amp;gt;getId();&lt;br /&gt;//here goes the code above starting below $orderId = 156.&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I've used it in several occasions and it worked, but please back-up before using it. I will not be responsible if something goes wrong :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-3885726085029326748?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/3885726085029326748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/08/how-to-delete-orders-from-magento.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/3885726085029326748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/3885726085029326748'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/08/how-to-delete-orders-from-magento.html' title='How to delete orders from Magento'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-4128497027699038860</id><published>2010-06-09T10:02:00.001+03:00</published><updated>2011-05-31T12:09:21.033+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='related'/><category scheme='http://www.blogger.com/atom/ns#' term='import'/><title type='text'>Adding related products, up-sells and cross-sells programmaticly</title><content type='html'>Problem:&lt;br /&gt;Adding related products, up-sells and cross-sells programmaticly.&lt;br /&gt;&lt;a href="http://www.magentocommerce.com/boards/viewthread/195440/"&gt;http://www.magentocommerce.com/boards/viewthread/195440/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;br /&gt;In order to set related, up-sells and crosssells you need to do the following&lt;br /&gt;Let's assume that the current product is $_product (that you got by doing Mage::getModel('catalog/product')-&amp;gt;load(SOME ID))&lt;br /&gt;&lt;pre class="brush:php"&gt;//for related&lt;br /&gt;$_product-&amp;gt;setRelatedLinkData($param);&lt;br /&gt;//for up-sells&lt;br /&gt;$_product-&amp;gt;setUpSellLinkData($param);&lt;br /&gt;//for crosssells&lt;br /&gt;$_product-&amp;gt;setCrossSellLinkData($param);&lt;br /&gt;&lt;/pre&gt;$param is an array with the following structure&lt;br /&gt;&lt;pre class="brush:php"&gt;$param = array(&lt;br /&gt;$associatedProductId=&amp;gt;array(&lt;br /&gt;'position'=&amp;gt;$associatedProductPosition&lt;br /&gt;)&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is an example. Let's say you want to add products with ids 101 and 102 as related products to $_product on positions 3 and 5.&lt;br /&gt;You should do something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;$param = array(&lt;br /&gt;101=&amp;gt;array(&lt;br /&gt;'position'=&amp;gt;3&lt;br /&gt;),&lt;br /&gt;102=&amp;gt;array(&lt;br /&gt;'position'=&amp;gt;5&lt;br /&gt;)&lt;br /&gt;);&lt;br /&gt;$_product-&amp;gt;setRelatedLinkData($param);&lt;br /&gt;//here ... some other product operations and in the end&lt;br /&gt;$_product-&amp;gt;save();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It works the same for up-sells and crosssels.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-4128497027699038860?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/4128497027699038860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/06/adding-related-products-up-sells-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4128497027699038860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4128497027699038860'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/06/adding-related-products-up-sells-and.html' title='Adding related products, up-sells and cross-sells programmaticly'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2127424071952900700</id><published>2010-05-20T16:42:00.000+03:00</published><updated>2010-05-20T16:42:41.670+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='method'/><title type='text'>how to find methods in Magento</title><content type='html'>Problem: &lt;a href="http://www.magentocommerce.com/boards/viewthread/193422/"&gt;http://www.magentocommerce.com/boards/viewthread/193422/&lt;/a&gt;&lt;br /&gt;Here is how I've learned.&lt;br /&gt;Let's say you have in a phtml file this line of code.&lt;br /&gt;&lt;div class="code"&gt;$object-&amp;gt;method();&lt;br /&gt;&lt;/div&gt;($object can be anything including $this).&lt;br /&gt;And you don't know what type is $object.&lt;br /&gt;put this line above the method call.&lt;br /&gt;&lt;div class="code"&gt;echo get_class($object);&lt;br /&gt;&lt;/div&gt;Clear the cache (contents of var/cache) and reload the page. You should see the name of the class. For example Mage_Catalog_Model_Category. now all you have to do is to find the class.&lt;br /&gt;Because Magento is based on Zend Framework it uses the the same convention for class naming. &lt;br /&gt;So class Abc_Def_Ghi will be in the file Abc/Def/Ghi.php (for the example above the file is Mage/Catalog/Model/Category.php)&lt;br /&gt;All the classes are placed in app/code/core or app/code/local/ or app/code/community or lib/ and after that follow the path like explained above.&lt;br /&gt;&lt;br /&gt;If you don't find a method in that specific class look in one of the parents. Check the class that the current class extends.&lt;br /&gt;&lt;br /&gt;You will not find all the methods in Magento. For example some of the methods that start with get, set, has, uns is possible that the methods are missing. &lt;br /&gt;For this take a look in Varien_Object class (that is the base class for most of the objects) lib/Varien/Object.php file (remember the convention above?) and look in the 'magic' method __call().&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2127424071952900700?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2127424071952900700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/05/how-to-find-methods-in-magento.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2127424071952900700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2127424071952900700'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/05/how-to-find-methods-in-magento.html' title='how to find methods in Magento'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-4529698591993141978</id><published>2010-05-17T15:34:00.001+03:00</published><updated>2011-05-31T12:10:02.358+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='import'/><title type='text'>Import products update</title><content type='html'>This is an update for &lt;a href="http://marius-strajeru.blogspot.com/2009/11/import-simple-products-for-barrmy.html"&gt;http://marius-strajeru.blogspot.com/2009/11/import-simple-products-for-barrmy.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Starting version 1.4 you can only perform product updates 'programmatic' only if Magento thinks you are in the admin panel.&lt;br /&gt;&lt;br /&gt;If you try to do this from a non-admin page make sure you put this&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::app()-&gt;setCurrentStore(Mage::getModel('core/store')-&amp;gt;load(Mage_Core_Model_App::ADMIN_STORE_ID));&lt;br /&gt;&lt;/pre&gt;before you call &lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;save();&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-4529698591993141978?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/4529698591993141978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/05/import-products-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4529698591993141978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4529698591993141978'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/05/import-products-update.html' title='Import products update'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-5434887468574330793</id><published>2010-05-06T10:27:00.004+03:00</published><updated>2011-05-31T12:12:06.761+03:00</updated><title type='text'>How to add product skus (or payment method) to the orders grid</title><content type='html'>I've tried in different ways to add articles skus (or payment method) to the orders grid in admin. I've tried 'left joining' different tables, performing different actions after applying _prepareCollection() method. All of them worked in some way, but the website started working slow when it reached 10000-12000 orders. And when I say slow I mean over 2 minutes to render the orders grid in admin. This was because of the slow queries which also resulted in slow loading of the frontend pages.&lt;br /&gt;I found an easier solution, it's somehow redundant but it works and it's pretty fast.&lt;br /&gt;I added a new varchar attribute for the order object.&lt;br /&gt;&lt;strong&gt;EDIT: This only works in versions &amp;lt; 1.4&lt;/strong&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;INSERT INTO `eav_attribute` (`attribute_id`, `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&lt;br /&gt;(NULL, 11, 'product_skus', NULL, NULL, 'varchar', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, '');&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Clear the cache (contents of the folder var/cache)&lt;br /&gt;Override the Mage_Sales_Model_Order class and in the _beforeSave() method add this:&lt;br /&gt;&lt;pre class="brush:php"&gt;if (!$this-&gt;getProductSkus()) {&lt;br /&gt;$skus = array();&lt;br /&gt;foreach ($this-&gt;getAllItems() as $item) {&lt;br /&gt;$skus[] = $item-&gt;getSku();&lt;br /&gt;}&lt;br /&gt;$this-&gt;setProductSkus(implode(",", $skus));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;This will add a string with all the skus separated by comma to the order model.&lt;br /&gt;Now all you have to do is to show the string in the orders grid.&lt;br /&gt;Override the Mage_Adminhtml_Block_Sales_Order_Grid block and in the _prepareColumns() method add a new column like this:&lt;br /&gt;&lt;pre class="brush:php"&gt;$this-&gt;addColumn('product_skus', array(&lt;br /&gt;'header' =&gt; Mage::helper('sales')-&gt;__('Products'),&lt;br /&gt;'index' =&gt; 'product_skus',&lt;br /&gt;));&lt;br /&gt;&lt;/pre&gt;Added it where ever you want.&lt;br /&gt;If you don't know how to overwrite a model or a class this is a good tutorial:&lt;br /&gt;&lt;a href="http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/"&gt;http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The only problem is that these changes will take effect only for the orders you make from now on.&lt;br /&gt;&lt;br /&gt;You can add the skus for every order like this.&lt;br /&gt;Create a new php file, let's call it orders.php and place it in the root of the application (same level as index.php) with this code:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php&lt;br /&gt;$mageFilename = 'app/Mage.php';&lt;br /&gt;&lt;br /&gt;require_once $mageFilename;&lt;br /&gt;&lt;br /&gt;Varien_Profiler::enable();&lt;br /&gt;&lt;br /&gt;Mage::setIsDeveloperMode(true);&lt;br /&gt;&lt;br /&gt;ini_set('display_errors', 1);&lt;br /&gt;&lt;br /&gt;umask(0);&lt;br /&gt;Mage::app('default');&lt;br /&gt;Mage::register('isSecureArea', 1);&lt;br /&gt;&lt;br /&gt;$orders = Mage::getModel('sales/order')-&gt;getCollection()-&gt;addAttributeToSelect("*");&lt;br /&gt;foreach ($orders as $order){&lt;br /&gt;$order-&gt;save();&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and call it in the browser (http://yourwebsite.com/orders.php)&lt;br /&gt;&lt;br /&gt;If you have many orders it will take some time to run but eventually ... you get my point.&lt;br /&gt;&lt;br /&gt;If you want to do this with the payment method the system is the same. Add a new attribute:&lt;br /&gt;&lt;pre class="brush:php"&gt;INSERT INTO `eav_attribute` (`attribute_id`, `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&lt;br /&gt;(NULL, 11, 'order_payment_method', NULL, NULL, 'varchar', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, '');&lt;br /&gt;&lt;/pre&gt;Clear the cache.&lt;br /&gt;In the _beforeSave() method add this:&lt;br /&gt;&lt;pre class="brush:php"&gt;if (!$this-&gt;getOrderPaymentMethod()) {&lt;br /&gt;$this-&gt;setOrderPaymentMethod($this-&gt;getPayment()-&gt;getMethodInstance()-&gt;getTitle()); //if you want the payment method's name (Check / money order)&lt;br /&gt;//$this-&gt;setOrderPaymentMethod($this-&gt;getPayment()-&gt;getMethod());//if you want the payment method's code (checkmo)&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the Mage_Adminhtml_Block_Sales_Order_Grid block _prepareColumns() method add this:&lt;br /&gt;&lt;pre class="brush:php"&gt;$this-&gt;addColumn('order_payment_method', array(&lt;br /&gt;'header' =&gt; Mage::helper('sales')-&gt;__('Payment'),&lt;br /&gt;'index' =&gt; 'order_payment_method',&lt;br /&gt;));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Same as for the product skus, this will now work for previous orders, but you can run the same script as above to update all the old orders.&lt;br /&gt;&lt;br /&gt;That's it. Let me know how it turns out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-5434887468574330793?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/5434887468574330793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/05/how-to-add-product-skus-or-payment.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5434887468574330793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5434887468574330793'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/05/how-to-add-product-skus-or-payment.html' title='How to add product skus (or payment method) to the orders grid'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-6527206523476472458</id><published>2010-04-30T14:58:00.001+03:00</published><updated>2011-05-31T12:12:56.709+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='order'/><category scheme='http://www.blogger.com/atom/ns#' term='email templates'/><title type='text'>Add new variable to order update e-mail</title><content type='html'>possible solution:&lt;br /&gt;&lt;br /&gt;You need to override the Order model (app/code/core/Mage/Sales/Model/Order.php) and for the sendOrderUpdateEmail() method&lt;br /&gt;you need to change this section&lt;br /&gt;&lt;pre class="brush:php"&gt;$mailTemplate-&amp;gt;setDesignConfig(array('area'=&amp;gt;'frontend', 'store' =&amp;gt; $this-&amp;gt;getStoreId()))&lt;br /&gt;-&amp;gt;sendTransactional(&lt;br /&gt;$template,&lt;br /&gt;Mage::getStoreConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $this-&amp;gt;getStoreId()),&lt;br /&gt;$recipient['email'],&lt;br /&gt;$recipient['name'],&lt;br /&gt;array(&lt;br /&gt;'order'     =&amp;gt; $this,&lt;br /&gt;'billing'   =&amp;gt; $this-&amp;gt;getBillingAddress(),&lt;br /&gt;'comment'   =&amp;gt; $comment&lt;br /&gt;)&lt;br /&gt;);&lt;br /&gt;&lt;/pre&gt;to this:&lt;br /&gt;&lt;pre class="brush:php"&gt;$mailTemplate-&amp;gt;setDesignConfig(array('area'=&amp;gt;'frontend', 'store' =&amp;gt; $this-&amp;gt;getStoreId()))&lt;br /&gt;-&amp;gt;sendTransactional(&lt;br /&gt;$template,&lt;br /&gt;Mage::getStoreConfig(self::XML_PATH_UPDATE_EMAIL_IDENTITY, $this-&amp;gt;getStoreId()),&lt;br /&gt;$recipient['email'],&lt;br /&gt;$recipient['name'],&lt;br /&gt;array(&lt;br /&gt;'order'     =&amp;gt; $this,&lt;br /&gt;'billing'   =&amp;gt; $this-&amp;gt;getBillingAddress(),&lt;br /&gt;'comment'   =&amp;gt; $comment,&lt;br /&gt;'your_var_name'=&amp;gt;'SOMETHNG'&lt;br /&gt;)&lt;br /&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the e-mail template you can show the new var like this&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;{{var your_var_name}}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-6527206523476472458?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/6527206523476472458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/add-new-variable-to-order-update-e-mail.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6527206523476472458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6527206523476472458'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/add-new-variable-to-order-update-e-mail.html' title='Add new variable to order update e-mail'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-6409606363064545370</id><published>2010-04-29T11:54:00.003+03:00</published><updated>2011-05-31T12:15:46.126+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='block'/><category scheme='http://www.blogger.com/atom/ns#' term='3 columns'/><title type='text'>How to add a block above the 3 columns in 3 columns layout</title><content type='html'>Problem: Adding on home page a block above the 3 columns&lt;br /&gt;&lt;a href="http://www.magentocommerce.com/boards/viewthread/180617/"&gt;http://www.magentocommerce.com/boards/viewthread/180617/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;Here is how i did it.&lt;br /&gt;Edit app/design/frontend/{interface}/{theme}/layout/page.xml&lt;br /&gt;In the &amp;lt;default&amp;gt; tag add this&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;block type="core/text_list" name="top" as="top" translate="label"&amp;gt;&lt;br /&gt;&amp;lt;label&amp;gt;Top Row&amp;lt;/label&amp;gt;&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;/pre&gt;Now go to admin panel: Cms-&amp;gt;Pages and edit the homepage.&lt;br /&gt;I've created a new phtml file in which I placed the content I want on top&lt;br /&gt;Let's say it's app/design/frontend/{interface}/{theme}/template/callouts/top_callout.phtml&lt;br /&gt;In the design tab for 'Layout Update XML' I put this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;reference name="top"&amp;gt;&lt;br /&gt;&amp;lt;block type="core/template" name="top.callout" template="callouts/top_callout.phtml" /&amp;gt;&lt;br /&gt;&amp;lt;/reference&amp;gt;&lt;br /&gt;&lt;/pre&gt;You can put every block you want here. I just used this as an example. Just put it inside &lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;reference name="top"&amp;gt;&lt;br /&gt;....&lt;br /&gt;&amp;lt;/reference&amp;gt;&lt;br /&gt;&lt;/pre&gt;Now edit  app/design/frontend/{interface}/{theme}/template/page/3columns.phtml&lt;br /&gt;and add this line &lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php echo $this-&amp;gt;getChildHtml('top') ?&amp;gt;&lt;br /&gt;&lt;/pre&gt;right under &lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php echo $this-&amp;gt;getChildHtml('header') ?&amp;gt;&lt;br /&gt;&lt;/pre&gt;Save all files you edited and clear the contents of 'var/cache/'&lt;br /&gt;&lt;br /&gt;I attached an image to see how it looks like.&lt;br /&gt;&lt;img src="http://www.magentocommerce.com/?ACT=25&amp;fid=15&amp;aid=14077_SPSxrlZn3hPg0y9Ki2Jq&amp;board_id=1" alt="" width="300" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.magentocommerce.com/?ACT=25&amp;fid=15&amp;aid=14077_SPSxrlZn3hPg0y9Ki2Jq&amp;board_id=1" target="blank"&gt;View full size image&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-6409606363064545370?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/6409606363064545370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/how-to-add-block-above-3-columns-in-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6409606363064545370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6409606363064545370'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/how-to-add-block-above-3-columns-in-3.html' title='How to add a block above the 3 columns in 3 columns layout'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-6537753530942901844</id><published>2010-04-22T16:11:00.002+03:00</published><updated>2011-05-31T12:17:24.359+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='invoice'/><title type='text'>How to change invoice status in Admin panel</title><content type='html'>Problem: When creating Invoice directly from Order in admin the invoice automatically gets marked as Paid. how can it be created with the status 'Pending' and marked as paid later. &lt;a href="http://www.magentocommerce.com/boards/viewthread/54391/"&gt;http://www.magentocommerce.com/boards/viewthread/54391/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;In order to create a 'pending' invoice, the payment method you use for the order must allow you to.&lt;br /&gt;For that you need to add in the payment method's model this member:&lt;br /&gt;&lt;pre class="brush:php"&gt;protected $_canCapture = true;&lt;br /&gt;&lt;/pre&gt;You can add it right under&lt;br /&gt;&lt;pre class="brush:php"&gt;protected $_code  = 'PAYMENT CODE HERE';&lt;br /&gt;&lt;/pre&gt;For example if you want to do this for Check/money order you need to add the line above in app/code/core/Mage/Payment/Model/Method/Checkmo.php&lt;br /&gt;&lt;br /&gt;After this when you create an invoice you will have an option near the save button to set the invoice status. (see picture attached). To create a pending invoice select 'Not capture'.&lt;br /&gt;If you want to mark it later as paid edit the invoice and between the buttons on to one called 'Capture' (see picture). Well you get the idea....&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.magentocommerce.com/?ACT=25&amp;fid=10&amp;aid=13923_8LdWBmrvMfGNn4f4inGm&amp;board_id=1" alt="pic1" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.magentocommerce.com/?ACT=25&amp;fid=10&amp;aid=13924_LCjgIngcNDLQxQVTyaLQ&amp;board_id=1" alt="pic1" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-6537753530942901844?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/6537753530942901844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/how-to-change-invoice-status-in-admin.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6537753530942901844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6537753530942901844'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/how-to-change-invoice-status-in-admin.html' title='How to change invoice status in Admin panel'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1132682438854563786</id><published>2010-04-13T08:39:00.002+03:00</published><updated>2010-04-13T08:39:37.153+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='multi-language'/><title type='text'>Handle multi-language</title><content type='html'>Possible solution:&lt;br /&gt;This is actually very simple. One store view = one language.&lt;br /&gt;You download the desired language pack. For example French(France).&lt;br /&gt;You should get a file called fr_FR_default_full_package.zip (or any other archive format)&lt;br /&gt;Unzip this file over the root of your Magento application.&lt;br /&gt;After that go to the admin panel. System-&gt;Configuration. Select from the top-left drop-down the store view you want to be in French and under the General tab 'Locale options' set Locale as French(France).&lt;br /&gt;Save and clear the cache and you should have a store view in French. As for the products and categories again is simple. Edit the product you desire, Select from the top-left drop-down the French store view and enter the French values for the text attributes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1132682438854563786?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1132682438854563786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/handle-multi-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1132682438854563786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1132682438854563786'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/handle-multi-language.html' title='Handle multi-language'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2715235666938780074</id><published>2010-04-12T09:05:00.001+03:00</published><updated>2011-05-31T12:18:23.131+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='design'/><category scheme='http://www.blogger.com/atom/ns#' term='footer links'/><title type='text'>Move footer links to the top</title><content type='html'>Problem: How to move footer links to the top of the page&lt;br /&gt;More details here:&lt;a href="http://www.magentocommerce.com/boards/viewthread/178685/"&gt;http://www.magentocommerce.com/boards/viewthread/178685/&lt;/a&gt; or here &lt;a href="http://www.magentocommerce.com/boards/viewthread/177423/"&gt;http://www.magentocommerce.com/boards/viewthread/177423/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;Edit this file:&lt;br /&gt;app/design/frontend/{interface}/{theme}/layout/page.xml&lt;br /&gt;Look for this line:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/&amp;gt;&lt;br /&gt;&lt;/pre&gt;It should be inside of an other &amp;lt;block&amp;gt; tag named footer.&lt;br /&gt;Remove it from there and put it inside the &amp;lt;block&amp;gt; named 'header' (same file).&lt;br /&gt;It should look like this (or close to it):&lt;br /&gt;BEFORE:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;block type="page/html_header" name="header" as="header"&amp;gt;&lt;br /&gt;&amp;lt;block type="page/template_links" name="top.links" as="topLinks"/&amp;gt;&lt;br /&gt;&amp;lt;block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/&amp;gt;&lt;br /&gt;&amp;lt;block type="core/text_list" name="top.menu" as="topMenu"/&amp;gt;&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;/pre&gt;AFTER:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;block type="page/html_header" name="header" as="header"&amp;gt;&lt;br /&gt;&amp;lt;block type="page/template_links" name="top.links" as="topLinks"/&amp;gt;&lt;br /&gt;&amp;lt;block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/&amp;gt;&lt;br /&gt;&amp;lt;block type="core/text_list" name="top.menu" as="topMenu"/&amp;gt;&lt;br /&gt;&amp;lt;block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/&amp;gt;&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then edit app/design/frontend/{interface}/{theme}/template/page/html/header.phtml&lt;br /&gt;Add this line at the end of the file (or where ever it fits your needs&amp;#41;&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php echo $this-&amp;gt;getChildHtml('footer_links') ?&amp;gt;&lt;br /&gt;&lt;/pre&gt;Clear the contents of dir var/cache and it should work. You might need to do some css work so the new added links would look nice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2715235666938780074?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2715235666938780074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/move-footer-links-to-top.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2715235666938780074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2715235666938780074'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/move-footer-links-to-top.html' title='Move footer links to the top'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1934235049692384372</id><published>2010-04-08T09:32:00.003+03:00</published><updated>2011-05-31T12:19:24.850+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer'/><category scheme='http://www.blogger.com/atom/ns#' term='login'/><title type='text'>Adding a sidebar login box</title><content type='html'>Problem:&lt;br /&gt;How to add a login box on sidebar.&lt;br /&gt;More details here &lt;a href="http://www.magentocommerce.com/boards/viewthread/178324/"&gt;http://www.magentocommerce.com/boards/viewthread/178324/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;First create a phtml file. Let's call it mini.login.phtml.&lt;br /&gt;Place it in app\design\frontend\{interface}\{theme}\template\customer\form\mini.login.phtml&lt;br /&gt;Make sure the form has the same action as in login.phtml Also give the inputs the same name as they have in login.phtml.&lt;br /&gt;&lt;br /&gt;Edit app\design\frontend\{interface}\{theme}\layout\customer.xml&lt;br /&gt;under the tag &amp;lt;customer_logged_out&amp;gt; put the following&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;reference name="left"&amp;gt;&lt;br /&gt;&amp;lt;block type="customer/form_login" name="customer_mini_login" before="-" template="customer/form/mini.login.phtml"/&amp;gt;&lt;br /&gt;&amp;lt;/reference&amp;gt;&lt;br /&gt;&lt;/pre&gt;Clear the cache and refresh.&lt;br /&gt;This will put the mini.login at the top of your left column.If you want it lower play with the 'before' attribute. (You can even replace it with after)&lt;br /&gt;See more details here. &lt;a href="http://www.magentocommerce.com/design_guide/articles/intro-to-layouts"&gt;http://www.magentocommerce.com/design_guide/articles/intro-to-layouts&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The side effect of this is that all the pages that contain this block will have the meta-tille 'Customer Login'.  (at least for version 1.4.0.1)&lt;br /&gt;To avoid this you have 2 options.&lt;br /&gt;The 'quick and dirty' one. &lt;br /&gt;Edit app\code\core\Mage\Customer\Block\Form\Login.php and in method _prepareLayout() remove this line:&lt;br /&gt;&lt;pre class="brush:php"&gt;$this-&amp;gt;getLayout()-&amp;gt;getBlock('head')-&amp;gt;setTitle(Mage::helper('customer')-&amp;gt;__('Customer Login'));&lt;br /&gt;&lt;/pre&gt;or remove the method completely (same effect).&lt;br /&gt;This will work but the problem will reappear after an upgrade.&lt;br /&gt;The 'by the book' option.&lt;br /&gt;Overwrite the Mage_Customer_Block_Form_Login block. See tutorial here: &lt;br /&gt;[&lt;a href="http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/"&gt;http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/&lt;/a&gt;&lt;br /&gt;After that in the the class that extends Mage_Customer_Block_Form_Login create the method _prepareLayout() that does nothing. Just returns the current object.&lt;br /&gt;&lt;pre class="brush:php"&gt;protected function _prepareLayout()&lt;br /&gt;{&lt;br /&gt;return $this;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1934235049692384372?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1934235049692384372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/adding-sidebar-login-box.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1934235049692384372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1934235049692384372'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/adding-sidebar-login-box.html' title='Adding a sidebar login box'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-307368046913002318</id><published>2010-04-01T12:44:00.005+03:00</published><updated>2011-07-07T10:09:03.551+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='discount rules'/><category scheme='http://www.blogger.com/atom/ns#' term='import'/><title type='text'>Create bulk discount rules</title><content type='html'>Problem:&lt;br /&gt;Create bulk discount rules with unique coupon codes.&lt;br /&gt;Details found here: &lt;a href="http://www.magentocommerce.com/boards/viewthread/177465/"&gt;http://www.magentocommerce.com/boards/viewthread/177465/&lt;/a&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;This is not an extension, it's just a 'quick and dirty' script that I hope some day (when I have the time) will grow up and become an extension.&lt;br /&gt;&lt;br /&gt;put the code below into a file (let's call it coupons.php) and follow the instructions below:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php&lt;br /&gt;$mageFilename = 'app/Mage.php';&lt;br /&gt;&lt;br /&gt;require_once $mageFilename;&lt;br /&gt;&lt;br /&gt;Varien_Profiler::enable();&lt;br /&gt;&lt;br /&gt;Mage::setIsDeveloperMode(true);&lt;br /&gt;&lt;br /&gt;ini_set('display_errors', 1);&lt;br /&gt;&lt;br /&gt;umask(0);&lt;br /&gt;Mage::app('default');&lt;br /&gt;Mage::register('isSecureArea', 1);&lt;br /&gt;function generateUniqueId($length = null){&lt;br /&gt;$rndId = crypt(uniqid(rand(),1)); &lt;br /&gt;$rndId = strip_tags(stripslashes($rndId)); &lt;br /&gt;$rndId = str_replace(array(".", "$"),"",$rndId); &lt;br /&gt;$rndId = strrev(str_replace("/","",$rndId));&lt;br /&gt;if (!is_null($rndId)){&lt;br /&gt;return strtoupper(substr($rndId, 0, $length));&lt;br /&gt;} &lt;br /&gt;return strtoupper($rndId);&lt;br /&gt;} &lt;br /&gt;function getAllCustomerGroups(){&lt;br /&gt;//get all customer groups&lt;br /&gt;$customerGroups = Mage::getModel('customer/group')-&amp;gt;getCollection();&lt;br /&gt;$groups = array();&lt;br /&gt;foreach ($customerGroups as $group){&lt;br /&gt;$groups[] = $group-&amp;gt;getId();&lt;br /&gt;}&lt;br /&gt;return $groups;&lt;br /&gt;}&lt;br /&gt;function getAllWbsites(){&lt;br /&gt;//get all wabsites&lt;br /&gt;$websites = Mage::getModel('core/website')-&amp;gt;getCollection();&lt;br /&gt;$websiteIds = array();&lt;br /&gt;foreach ($websites as $website){&lt;br /&gt;$websiteIds[] = $website-&amp;gt;getId();&lt;br /&gt;}&lt;br /&gt;return $websiteIds;&lt;br /&gt;}&lt;br /&gt;//read comments for each line&lt;br /&gt;function generateRule(){&lt;br /&gt;$uniqueId = generateUniqueId(10);&lt;br /&gt;$rule = Mage::getModel('salesrule/rule');&lt;br /&gt;$rule-&amp;gt;setName($uniqueId);&lt;br /&gt;$rule-&amp;gt;setDescription('Generated by tzyganu');&lt;br /&gt;$rule-&amp;gt;setFromDate(date('Y-m-d'));//starting today&lt;br /&gt;//$rule-&amp;gt;setToDate('2011-01-01');//if you need an expiration date&lt;br /&gt;$rule-&amp;gt;setCouponCode($uniqueId);&lt;br /&gt;$rule-&amp;gt;setUsesPerCoupon(1);//number of allowed uses for this coupon&lt;br /&gt;$rule-&amp;gt;setUsesPerCustomer(1);//number of allowed uses for this coupon for each customer&lt;br /&gt;$rule-&amp;gt;setCustomerGroupIds(getAllCustomerGroups());//if you want only certain groups replace getAllCustomerGroups() with an array of desired ids &lt;br /&gt;$rule-&amp;gt;setIsActive(1);&lt;br /&gt;$rule-&amp;gt;setStopRulesProcessing(0);//set to 1 if you want all other rules after this to not be processed&lt;br /&gt;$rule-&amp;gt;setIsRss(0);//set to 1 if you want this rule to be public in rss&lt;br /&gt;$rule-&amp;gt;setIsAdvanced(1);//have no idea what it means :)&lt;br /&gt;$rule-&amp;gt;setProductIds('');&lt;br /&gt;$rule-&amp;gt;setSortOrder(0);// order in which the rules will be applied&lt;br /&gt;&lt;br /&gt;$rule-&amp;gt;setSimpleAction('by_percent');&lt;br /&gt;//all available discount types&lt;br /&gt;//by_percent - Percent of product price discount&lt;br /&gt;//by_fixed - Fixed amount discount&lt;br /&gt;//cart_fixed - Fixed amount discount for whole cart&lt;br /&gt;//buy_x_get_y - Buy X get Y free (discount amount is Y)&lt;br /&gt;&lt;br /&gt;$rule-&amp;gt;setDiscountAmount('20');//the discount amount/percent. if SimpleAction is by_percent this value must be &amp;lt;= 100&lt;br /&gt;$rule-&amp;gt;setDiscountQty(0);//Maximum Qty Discount is Applied to&lt;br /&gt;$rule-&amp;gt;setDiscountStep(0);//used for buy_x_get_y; This is X&lt;br /&gt;$rule-&amp;gt;setSimpleFreeShipping(0);//set to 1 for Free shipping&lt;br /&gt;$rule-&amp;gt;setApplyToShipping(1);//set to 0 if you don't want the rule to be applied to shipping&lt;br /&gt;$rule-&amp;gt;setWebsiteIds(getAllWbsites());//if you want only certain websites replace getAllWbsites() with an array of desired ids&lt;br /&gt;&lt;br /&gt;$conditions = array();&lt;br /&gt;$conditions[1] = array(&lt;br /&gt;'type' =&amp;gt; 'salesrule/rule_condition_combine',&lt;br /&gt;'aggregator' =&amp;gt; 'all',&lt;br /&gt;'value' =&amp;gt; 1,&lt;br /&gt;'new_child' =&amp;gt; ''&lt;br /&gt;);&lt;br /&gt;//the conditions above are for 'if all of these conditions are true'&lt;br /&gt;//for if any one of the conditions is true set 'aggregator' to 'any'&lt;br /&gt;//for if all of the conditions are false set 'value' to 0.&lt;br /&gt;//for if any one of the conditions is false set 'aggregator' to 'any' and 'value' to 0&lt;br /&gt;$conditions['1--1'] = Array&lt;br /&gt;(&lt;br /&gt;'type' =&amp;gt; 'salesrule/rule_condition_address',&lt;br /&gt;'attribute' =&amp;gt; 'base_subtotal',&lt;br /&gt;'operator' =&amp;gt; '&amp;gt;=',&lt;br /&gt;'value' =&amp;gt; 200&lt;br /&gt;);&lt;br /&gt;//the constraints above are for 'Subtotal is equal or grater than 200'&lt;br /&gt;//for 'equal or less than' set 'operator' to '&amp;lt;='... You get the idea other operators for numbers: '==', '!=', '&amp;gt;', '&amp;lt;'&lt;br /&gt;//for 'is one of' set operator to '()';&lt;br /&gt;//for 'is not one of' set operator to '!()';&lt;br /&gt;//in this example the constraint is on the subtotal&lt;br /&gt;//for other attributes you can change the value for 'attribute' to: 'total_qty', 'weight', 'payment_method', 'shipping_method', 'postcode', 'region', 'region_id', 'country_id'&lt;br /&gt;&lt;br /&gt;//to add an other constraint on product attributes (not cart attributes like above) uncomment and change the following:&lt;br /&gt;/*&lt;br /&gt;$conditions['1--2'] = array&lt;br /&gt;(&lt;br /&gt;'type' =&amp;gt; 'salesrule/rule_condition_product_found',//-&amp;gt; means 'if all of the following are true' - same rules as above for 'aggregator' and 'value'&lt;br /&gt;//other values for type: 'salesrule/rule_condition_product_subselect' 'salesrule/rule_condition_combine'&lt;br /&gt;'value' =&amp;gt; 1,&lt;br /&gt;'aggregator' =&amp;gt; 'all',&lt;br /&gt;'new_child' =&amp;gt; '', &lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;$conditions['1--2--1'] = array&lt;br /&gt;(&lt;br /&gt;'type' =&amp;gt; 'salesrule/rule_condition_product',&lt;br /&gt;'attribute' =&amp;gt; 'sku',&lt;br /&gt;'operator' =&amp;gt; '==',&lt;br /&gt;'value' =&amp;gt; '12',&lt;br /&gt;);&lt;br /&gt;*/&lt;br /&gt;//$conditions['1--2--1'] means sku equals 12. For other constraints change 'attribute', 'operator'(see list above), 'value'&lt;br /&gt;&lt;br /&gt;$rule-&amp;gt;setData('conditions',$conditions);&lt;br /&gt;$rule-&amp;gt;loadPost($rule-&amp;gt;getData());&lt;br /&gt;$rule-&amp;gt;save();&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;[UPDATE]. This was made for Magento 1.3 and lower. For versions &gt;= 1.4 you have to add a new line&lt;br /&gt;&lt;pre class="brush:php"&gt;$rule-&amp;gt;setCouponType(2);&lt;br /&gt;&lt;/pre&gt;Add it just before&lt;br /&gt;&lt;pre class="brush:php"&gt;$rule-&amp;gt;save();&lt;br /&gt;&lt;/pre&gt;(Thanks Raj for pointing this out).&lt;br /&gt;[/UPDATE]&lt;br /&gt;&lt;br /&gt;[UPDATE 1.1]&lt;br /&gt;For Magento 1.4 and later there are store labels for the discount rules.&lt;br /&gt;To add this construct the following array&lt;br /&gt;&lt;pre class="brush:php"&gt;$labels = array();&lt;br /&gt;$labels[0] = 'Default store label';//default store label&lt;br /&gt;$labels[1] = 'Label for store with id 1';&lt;br /&gt;//....&lt;br /&gt;$labels[n] = 'Label for store with id n';&lt;br /&gt;//add one line for each store view you have. The key is the store view ID&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and before calling $rule-&amp;gt;save(); add this line&lt;br /&gt;&lt;pre class="brush:php"&gt;$rule-&amp;gt;setStoreLabels($labels);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;(Thanks Sigmund for the update)&lt;br /&gt;[/UPDATE 1.1]&lt;br /&gt;&lt;br /&gt;Put the newly created file in the root of your magento installation (same level as index.php)&lt;br /&gt;Walk through the file read all the comments and configure your discount settings (some programming skills are requred)&lt;br /&gt;After everything is done add the following code at the end of the file (before php closing tag)&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;for ($i=1;$i&amp;lt;=200;$i++){//replace 200 with the number of coupons you want&lt;br /&gt;generateRule();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;call the page in you browser (http://your.magento.root/coupons.php) or run it from the command line.&lt;br /&gt;Now check your admin for the new added rules.&lt;br /&gt;PS (this does not work yet for 'Actions' tab).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-307368046913002318?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/307368046913002318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/create-bulk-discount-rules.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/307368046913002318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/307368046913002318'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/04/create-bulk-discount-rules.html' title='Create bulk discount rules'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-7518974223943502555</id><published>2010-03-16T21:55:00.003+02:00</published><updated>2011-05-31T12:21:27.369+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='code review'/><title type='text'>Jut for fun!</title><content type='html'>While working on a theme for Magento 1.4.0.1 I found this in app\design\frontend\base\default\template\checkout\onepage\shipping.phtml between lines 49 and 56 &lt;br /&gt;&lt;pre class="brush:html"&gt;&amp;lt;?php if(false): ?&amp;gt;&lt;br /&gt;&amp;lt;div class="fields"&amp;gt;&lt;br /&gt;&amp;lt;label for="shipping:email" class="required"&amp;gt;&amp;lt;em&amp;gt;*&amp;lt;/em&amp;gt;&amp;lt;?php echo $this-&amp;gt;__('Email Address') ?&amp;gt;&amp;lt;/label&amp;gt;&lt;br /&gt;&amp;lt;div class="input-box"&amp;gt;&lt;br /&gt;&amp;lt;input type="text" name="shipping[email]" id="shipping:email" value="&amp;lt;?php echo $this-&amp;gt;htmlEscape($this-&amp;gt;getAddress()-&amp;gt;getEmail()) ?&amp;gt;" title="&amp;lt;?php echo $this-&amp;gt;__('Email Address') ?&amp;gt;" class="input-text validate-email required-entry" /&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;?php endif ?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Good one Magento Team.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-7518974223943502555?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/7518974223943502555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/03/jut-for-fun.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/7518974223943502555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/7518974223943502555'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/03/jut-for-fun.html' title='Jut for fun!'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-3717478405171530588</id><published>2010-03-01T10:53:00.001+02:00</published><updated>2011-05-31T12:21:54.884+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='attribute'/><title type='text'>Retrieve attributes by groupId</title><content type='html'>Problem: how to retrieve product attributes by group id.&lt;br /&gt;See here: &lt;a href="http://www.magentocommerce.com/boards/viewthread/79694/"&gt;http://www.magentocommerce.com/boards/viewthread/79694/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt?php&lt;br /&gt;require_once 'path/to/app_dir/app/Mage.php';&lt;br /&gt;Mage::app('default');&lt;br /&gt;$product = Mage::getModel('catalog/product');&lt;br /&gt;$product-&amp;gt;setAttributeSetId('THE ATTRIBUTE SET YOU WANT TO USE');&lt;br /&gt;$groupId = 'THE ID OF THE GROUP YOU WANT TO RETRIEVE';&lt;br /&gt;&lt;br /&gt;$collection = $product-&amp;gt;getAttributes($groupId, false);&lt;br /&gt;foreach($collection as $attribute){&lt;br /&gt;//do something with the attribute&lt;br /&gt;}&lt;br /&gt;?&gt; &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-3717478405171530588?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/3717478405171530588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/03/retrieve-attributes-by-groupid.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/3717478405171530588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/3717478405171530588'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/03/retrieve-attributes-by-groupid.html' title='Retrieve attributes by groupId'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1592273652355117405</id><published>2010-02-27T21:52:00.001+02:00</published><updated>2011-05-31T12:23:23.373+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer'/><category scheme='http://www.blogger.com/atom/ns#' term='IPv6'/><title type='text'>IPv6 for online customers</title><content type='html'>Problem : how to make Magento show the ipv6 ip address on online customers.&lt;br /&gt;See full text here &lt;a href="http://www.magentocommerce.com/boards/viewthread/79160/"&gt;http://www.magentocommerce.com/boards/viewthread/79160/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible (untested) solution. If someone tests it please tell me the results also:&lt;br /&gt;&lt;br /&gt;In theory you cannot do this, because in the database the fields for ip address are 'bigint' (see tables that start with log_visitor_)&lt;br /&gt;All the ip addresses stored in this table 'suffer' a modification with ip2long() method. Unfortunately php does not support IPv6 (at least that's what I know. If I'm wrong someone please correct me).&lt;br /&gt;Enough with the problems.&lt;br /&gt;Here is what you can try.&lt;br /&gt;Change the type of the columns for ip addresses from bigint to varchar.&lt;br /&gt;In app/code/core/Mage/Log/Model/Visitor.php look for these lines:&lt;br /&gt;&lt;pre class="brush:php"&gt;$this-&gt;addData(array(&lt;br /&gt;'server_addr'           =&gt; $helper-&gt;getServerAddr(true),&lt;br /&gt;'remote_addr'           =&gt; $helper-&gt;getRemoteAddr(true), &lt;br /&gt;....&lt;br /&gt;&lt;/pre&gt;and remove the 'true' parameters from the functions.&lt;br /&gt;&lt;pre class="brush:php"&gt;$this-&gt;addData(array(&lt;br /&gt;'server_addr'           =&gt; $helper-&gt;getServerAddr(),&lt;br /&gt;'remote_addr'           =&gt; $helper-&gt;getRemoteAddr(), &lt;br /&gt;&lt;/pre&gt;This should save the ip addresses as strings.&lt;br /&gt;&lt;br /&gt;We are half way there. Now all you have to do is make sure that the ip addresses are rendered in the back-end grid you need to change the \app\code\core\Mage\Adminhtml\Block\Customer\Online\Grid\Renderer\Ip.php file.&lt;br /&gt;Change this &lt;br /&gt;&lt;pre class="brush:php"&gt;public function render(Varien_Object $row)&lt;br /&gt;{&lt;br /&gt;return long2ip($row-&gt;getData($this-&gt;getColumn()-&gt;getIndex()));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;to&lt;br /&gt;&lt;pre class="brush:php"&gt;public function render(Varien_Object $row)&lt;br /&gt;{&lt;br /&gt;return $row-&gt;getData($this-&gt;getColumn()-&gt;getIndex());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;or to this, for backwards compatibility (to see the previous saved ip addresses) &lt;br /&gt;&lt;pre class="brush:php"&gt;public function render(Varien_Object $row)&lt;br /&gt;{&lt;br /&gt;$val = $this-&gt;getColumn()-&gt;getIndex();&lt;br /&gt;if (is_int($val)){&lt;br /&gt;return long2ip($val);&lt;br /&gt;}&lt;br /&gt;return $val;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Clear the cache and test it.&lt;br /&gt;I have no way of testing this but it seams to me that this is the way to go.&lt;br /&gt;&lt;br /&gt;(Of course you don't need to modify the core files if you plan to upgrade, you can overwrite them the proper magento way ).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1592273652355117405?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1592273652355117405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/02/ipv6-for-online-customers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1592273652355117405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1592273652355117405'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/02/ipv6-for-online-customers.html' title='IPv6 for online customers'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2390569202154493539</id><published>2010-02-01T16:05:00.001+02:00</published><updated>2011-05-31T12:52:12.057+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='save object'/><title type='text'>Save an object into the database with a specific id. (insert - not update)</title><content type='html'>Problem can be found here: &lt;a href="http://www.magentocommerce.com/boards/viewthread/74588/"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;br /&gt;The presence of an id means update and if the id is null it means is insert.&lt;br /&gt;So when you try to insert and add an id Magento is actually trying to update the entity but the id you specify does not exist.&lt;br /&gt;It's something similar to this:&lt;br /&gt;&lt;pre class="brush:php"&gt;UPDATE some_table SET some_field = some_value WHERE id = some_id; &lt;br /&gt;&lt;/pre&gt;The sql goes through but nothing gets updated.&lt;br /&gt;If you want to modify something (but I don't advice you to do this) you can change the Mage_Core_Model_Mysql4_Abstract and  Mage_Core_Model_Abstract models (the save() method for both of them.)&lt;br /&gt;&lt;br /&gt;If you look inside the save method of Mage_Core_Model_Mysql4_Abstract you will see that there's an 'if' statement&lt;br /&gt;&lt;pre class="brush:php"&gt;if (!is_null($object-&gt;getId())) {...}&lt;br /&gt;&lt;/pre&gt;This means exactly what I explained above.&lt;br /&gt;&lt;br /&gt;Here is an idea on how you can make magento do an insert with a specified id.&lt;br /&gt;Overwrite the Mage_Core_Model_Abstract::save() method to accept and other parameter.&lt;br /&gt;Let's call it $alwaysInsert and set it's default value to false (so you will not interfere with the other objects that use save()).&lt;br /&gt;Then pass the $alwaysInsert parameter to the save method from the resource.&lt;br /&gt;Your new method could look like this:&lt;br /&gt;&lt;pre class="brush:php"&gt;public function save($alwaysInsert = false)&lt;br /&gt;{&lt;br /&gt;$this-&gt;_getResource()-&gt;beginTransaction();&lt;br /&gt;try {&lt;br /&gt;$this-&gt;_beforeSave();&lt;br /&gt;$this-&gt;_getResource()-&gt;save($this, $alwaysInsert);&lt;br /&gt;$this-&gt;_afterSave();&lt;br /&gt;&lt;br /&gt;$this-&gt;_getResource()-&gt;commit();&lt;br /&gt;}&lt;br /&gt;catch (Exception $e){&lt;br /&gt;$this-&gt;_getResource()-&gt;rollBack();&lt;br /&gt;throw $e;&lt;br /&gt;}&lt;br /&gt;return $this;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In Mage_Core_Model_Mysql4_Abstract, change the method save() to accept 2 parameters. &lt;br /&gt;It could look like this:&lt;br /&gt;&lt;pre class="brush:php"&gt;public function save(Mage_Core_Model_Abstract $object, bool $alwaysInsert)&lt;br /&gt;{&lt;br /&gt;if ($object-&gt;isDeleted()) {&lt;br /&gt;return $this-&gt;delete($object);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$this-&gt;_beforeSave($object);&lt;br /&gt;$this-&gt;_checkUnique($object);&lt;br /&gt;&lt;br /&gt;if (!is_null($object-&gt;getId()) &amp;&amp; !$alwaysInsert) {&lt;br /&gt;$condition = $this-&gt;_getWriteAdapter()-&gt;quoteInto($this-&gt;getIdFieldName().'=?', $object-&gt;getId());&lt;br /&gt;$this-&gt;_getWriteAdapter()-&gt;update($this-&gt;getMainTable(), $this-&gt;_prepareDataForSave($object), $condition);&lt;br /&gt;} else {&lt;br /&gt;$this-&gt;_getWriteAdapter()-&gt;insert($this-&gt;getMainTable(), $this-&gt;_prepareDataForSave($object));&lt;br /&gt;$object-&gt;setId($this-&gt;_getWriteAdapter()-&gt;lastInsertId($this-&gt;getMainTable()));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$this-&gt;_afterSave($object);&lt;br /&gt;&lt;br /&gt;return $this;&lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;WARNING:&lt;br /&gt;There are 2 issues (at least that is all I can think about now)&lt;br /&gt;1. I didn't test this. You can test it and tell everyone the results&lt;br /&gt;2. I'm not sure how Magento behaves when extending an abstract class. Normally it shouldn't cause any problems, but make sure the class(es) you are working with extend the new class(es) that you just created (extensions of Mage_Core_Model_Abstract and Mage_Core_Model_Mysql4_Abstract not these classes themselves).&lt;br /&gt;&lt;br /&gt;If instead of overwriting you decide to modify the core this should take care of these issues, but you are not suppose to modify the code.&lt;br /&gt;I hope this works for you. If it doesn't I'm sorry.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2390569202154493539?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2390569202154493539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/02/save-object-into-database-with-specific.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2390569202154493539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2390569202154493539'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/02/save-object-into-database-with-specific.html' title='Save an object into the database with a specific id. (insert - not update)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-1044642971594337134</id><published>2010-01-19T09:04:00.001+02:00</published><updated>2011-05-31T12:53:01.542+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='template hints'/><category scheme='http://www.blogger.com/atom/ns#' term='config'/><title type='text'>Display 'template hints' in 'default config'</title><content type='html'>Problem: Display 'template hints' and 'bloc hints' in 'default config'&lt;br /&gt;Posible solution&lt;br /&gt;If you want this option displayed for 'default config' also, just edit the app\code\core\Mage\Core\etc\system.xml file.&lt;br /&gt;Look for something like this&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;template_hints translate="label"&amp;gt;&lt;br /&gt;&amp;lt;label&amp;lt;Template Path Hints&amp;lt;/label&amp;gt;&lt;br /&gt;&amp;lt;frontend_type&amp;gt;select&amp;lt;/frontend_type&amp;gt;&lt;br /&gt;&amp;lt;source_model&amp;gt;adminhtml/system_config_source_yesno&amp;lt;/source_model&amp;gt;&lt;br /&gt;&amp;lt;sort_order&amp;gt;20&amp;lt;/sort_order&amp;gt;&lt;br /&gt;&amp;lt;show_in_default&amp;gt;0&amp;lt;/show_in_default&amp;gt;&lt;br /&gt;&amp;lt;show_in_website&amp;gt;1&amp;lt;/show_in_website&amp;gt;&lt;br /&gt;&amp;lt;show_in_store&amp;gt;1&amp;lt;/show_in_store&amp;gt;&lt;br /&gt;&amp;lt;/template_hints&amp;gt;&lt;br /&gt;&lt;/pre&gt;replace &lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;show_in_default&amp;gt;0&amp;lt;/show_in_default&amp;gt;&lt;br /&gt;&lt;/pre&gt;with &lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;show_in_default&amp;gt;1&amp;lt;/show_in_default&amp;gt;&lt;br /&gt;&lt;/pre&gt;and clear the cache&lt;br /&gt;Do the same for this section&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;template_hints_blocks translate="label"&amp;gt;&lt;br /&gt;&amp;lt;label&amp;gt;Add Block Names to Hints&amp;lt;/label&amp;gt;&lt;br /&gt;&amp;lt;frontend_type&amp;gt;select&amp;lt;/frontend_type&amp;gt;&lt;br /&gt;&amp;lt;source_model&amp;gt;adminhtml/system_config_source_yesno&amp;lt;/source_model&amp;gt;&lt;br /&gt;&amp;lt;sort_order&amp;gt;21&amp;lt;/sort_order&amp;gt;&lt;br /&gt;&amp;lt;show_in_default&amp;gt;0&amp;lt;/show_in_default&amp;gt;&lt;br /&gt;&amp;lt;show_in_website&amp;gt;1&amp;lt;/show_in_website&amp;gt;&lt;br /&gt;&amp;lt;show_in_store&amp;gt;1&amp;lt;/show_in_store&amp;gt;&lt;br /&gt;&amp;lt;/template_hints_blocks&amp;gt;&lt;br /&gt;&lt;/pre&gt;Be careful. When you enable these 2 from 'default config' you will also see template hints and block hints in the admin section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-1044642971594337134?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/1044642971594337134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/display-template-hints-in-default.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1044642971594337134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/1044642971594337134'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/display-template-hints-in-default.html' title='Display &apos;template hints&apos; in &apos;default config&apos;'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-7329515328305478457</id><published>2010-01-18T16:06:00.004+02:00</published><updated>2011-05-31T12:54:53.984+03:00</updated><title type='text'>Avoid empty meta-title for products (for biostall)</title><content type='html'>Problem: in case the meta-title is not filled in for a product the title should replace it&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;br /&gt;Create a new method in the product model (Mage_Catalog_Model_Product) class called getMetaTitle();&lt;br /&gt;&lt;pre class="brush:php"&gt;function getMetaTitle(){&lt;br /&gt;if (!$this-&amp;gt;getData('meta_title')){&lt;br /&gt;$this-&gt;setMetaTitle($this-&amp;gt;getTitle());&lt;br /&gt;}&lt;br /&gt;return $this-&amp;gt;getData('meta_title');&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-7329515328305478457?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/7329515328305478457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/avoid-empty-meta-title-for-products.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/7329515328305478457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/7329515328305478457'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/avoid-empty-meta-title-for-products.html' title='Avoid empty meta-title for products (for biostall)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-8575428975744706092</id><published>2010-01-18T15:50:00.003+02:00</published><updated>2011-05-31T12:55:32.057+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='product'/><title type='text'>A list of all the products in the website (for travelingwilly)</title><content type='html'>Problem: a list of all the products in the website.&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;br /&gt;The easiest (less code) solution is to create a category called 'All' an put all the products in that category(beside the category that they belong to).&lt;br /&gt;The second method implies some code.&lt;br /&gt;Create the Mage_Catalog_Block_Product_All class and put it in a file located here (app/code/code/Mage/Catalog/Block/Product/All.php)&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php&lt;br /&gt;class Mage_Catalog_Block_Product_All extends Mage_Catalog_Block_Product_List&lt;br /&gt;{&lt;br /&gt;protected function _getProductCollection()&lt;br /&gt;{&lt;br /&gt;if (is_null($this-&amp;gt;_productCollection)) {&lt;br /&gt;$collection = Mage::getResourceModel('catalog/product_collection')&lt;br /&gt;-&amp;gt;addAttributeToSelect('*')&lt;br /&gt;-&amp;gt;addAttributeToFilter('status', 1)&lt;br /&gt;-&amp;gt;addAttributeToFilter(array(array('attribute'=&gt;'visibility', 'eq'=&gt;"4")));&lt;br /&gt;$this-&amp;gt;_productCollection = $collection;&lt;br /&gt;}&lt;br /&gt;return $this-&amp;gt;_productCollection;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After this create a CMS page. and in it's content put the following&lt;br /&gt;&lt;pre class="brush:php"&gt;{{block type="catalog/product_all" template="catalog/product/list.phtml"}}&lt;br /&gt;&lt;/pre&gt;In the "Layout" field (from the 'Custom design' tab) select '2columns-left' (or any other design just don't leave it to 'empty')&lt;br /&gt;Save and that's it.&lt;br /&gt;If the page you just created has the identifier ('all-products') and is enabled you will see a paginated list of all your products here:&lt;br /&gt;http://www.yoursite/all-products (or http://www.yoursite/{YOUR STORE CODE}/all-products if you have store codes in the url)&lt;br /&gt;&lt;br /&gt;I know that this is not 100% clean because you need to add some code in the core. This is no problem, you can add this also in the local folder.&lt;br /&gt;&lt;br /&gt;EDIT: I forgot to close a curly bracket at the end of the class. Thanks To John (see who John is the comments below) I fixed it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-8575428975744706092?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/8575428975744706092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/list-of-all-products-in-website-for.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8575428975744706092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8575428975744706092'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/list-of-all-products-in-website-for.html' title='A list of all the products in the website (for travelingwilly)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-5637914857860614569</id><published>2010-01-18T14:43:00.004+02:00</published><updated>2011-05-31T12:56:25.132+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='block'/><title type='text'>Display CMS Blocks on product description (for Mattse)</title><content type='html'>Problem: add static block to product description&lt;br /&gt;&lt;br /&gt;possible solution&lt;br /&gt;&lt;br /&gt;You can add a new method to the product model.&lt;br /&gt;&lt;pre class="brush:php"&gt;function getDescription(){&lt;br /&gt;$processor = Mage::getModel('core/email_template_filter');&lt;br /&gt;$html = $processor-&gt;filter($this-&gt;getData('description'));&lt;br /&gt;return $html;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In this way you can use the same {{block}} and {{skin}} sections just like the static blocks and pages and e-mail templates.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-5637914857860614569?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/5637914857860614569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/problem-add-static-block-to-product.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5637914857860614569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5637914857860614569'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/problem-add-static-block-to-product.html' title='Display CMS Blocks on product description (for Mattse)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-381267418127441151</id><published>2010-01-13T09:58:00.002+02:00</published><updated>2011-05-31T12:57:14.198+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='total'/><category scheme='http://www.blogger.com/atom/ns#' term='cart'/><title type='text'>how to display number of items in cart and cart total (for elmuchoprez)</title><content type='html'>Problem: how to display number of items in cart and cart total?&lt;br /&gt;Possible solution&lt;br /&gt;&lt;br /&gt;To display items in cart do this:&lt;br /&gt;&lt;pre class="brush:php"&gt;$this-&gt;helper('checkout/cart')-&gt;getSummaryCount();&lt;br /&gt;&lt;/pre&gt;or &lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::helper('checkout/cart')-&gt;getSummaryCount();&lt;br /&gt;&lt;/pre&gt;And for the total:&lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::getSingleton('checkout/session')-&gt;getQuote()-&gt;getSubtotal();&lt;br /&gt;&lt;/pre&gt;This will display only the total amount for the products.&lt;br /&gt;If you want the grand total (including shipping &amp; handling) do this:&lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::getSingleton('checkout/session')-&gt;getQuote()-&gt;getGrandTotal();&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-381267418127441151?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/381267418127441151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/how-to-display-number-of-items-in-cart.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/381267418127441151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/381267418127441151'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/how-to-display-number-of-items-in-cart.html' title='how to display number of items in cart and cart total (for elmuchoprez)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-90247230422931343</id><published>2010-01-05T09:33:00.001+02:00</published><updated>2011-05-31T12:57:45.281+03:00</updated><title type='text'>Show customer group in order e-mail (for redbeetstudio)</title><content type='html'>Problem: Show customer group in order e-mail.&lt;br /&gt;&lt;a href="http://www.magentocommerce.com/boards/viewthread/71736/"&gt;http://www.magentocommerce.com/boards/viewthread/71736/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Possible solution&lt;br /&gt;In order for this to work in the e-mail template:&lt;br /&gt;&lt;pre class="brush:php"&gt;{{var order.getCustomerGroupName()}}&lt;br /&gt;&lt;/pre&gt;you have to create a method in the Order model (overwrite it or edit the core at your own risk).&lt;br /&gt;&lt;pre class="brush:php"&gt;function getCustomerGroupName(){&lt;br /&gt;$group = Mage::getModel('customer/customer_group')-&gt;load($this-&gt;getCustomerGroupId());&lt;br /&gt;if ($group-&gt;getId()){&lt;br /&gt;return $group-&gt;getName();&lt;br /&gt;}&lt;br /&gt;return '';//or any default value if the customer is not in a group or is a guest&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-90247230422931343?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/90247230422931343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/show-customer-group-in-order-e-mail-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/90247230422931343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/90247230422931343'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2010/01/show-customer-group-in-order-e-mail-for.html' title='Show customer group in order e-mail (for redbeetstudio)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-8770457380158552351</id><published>2009-12-29T10:21:00.001+02:00</published><updated>2011-05-31T12:59:24.832+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer'/><category scheme='http://www.blogger.com/atom/ns#' term='session'/><category scheme='http://www.blogger.com/atom/ns#' term='address'/><title type='text'>how to get customer address (for MagentoPycho)</title><content type='html'>Problem:how to get customer address from session? &lt;br /&gt;&lt;br /&gt;Possible solution&lt;br /&gt;Here is how you retrieve the primary billing address object:&lt;br /&gt;&lt;pre class="brush:php"&gt;$customerAddressId = Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getDefaultBilling();&lt;br /&gt;if ($customerAddressId){&lt;br /&gt;$address = Mage::getModel('customer/address')-&gt;load($customerAddressId);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;If you want the address in html format do this:&lt;br /&gt;&lt;pre class="brush:php"&gt;$customerAddressId = Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getDefaultBilling();&lt;br /&gt;if ($customerAddressId){&lt;br /&gt;$address = Mage::getModel('customer/address')-&gt;load($customerAddressId);&lt;br /&gt;$htmlAddress = $address-&gt;format('html')&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;if you want specific parts of the address just print it out and see how that part is called&lt;br /&gt;&lt;pre class="brush:php"&gt;$customerAddressId = Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getDefaultBilling();&lt;br /&gt;if ($customerAddressId){&lt;br /&gt;$address = Mage::getModel('customer/address')-&gt;load($customerAddressId);&lt;br /&gt;echo "&lt;pre&gt;"; print_r($address-&gt;getData());echo "&lt;/pre&gt;";}&lt;/pre&gt;for example if you want the street do this:&lt;br /&gt;&lt;pre class="brush:php"&gt;$street = $address-&gt;getData('street');&lt;br /&gt;&lt;/pre&gt;It works the same for the rest of the of the address attributes (firstname, lastname, phone, ...)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-8770457380158552351?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/8770457380158552351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/how-to-get-customer-address-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8770457380158552351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8770457380158552351'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/how-to-get-customer-address-for.html' title='how to get customer address (for MagentoPycho)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-6857308981008503590</id><published>2009-12-29T09:49:00.002+02:00</published><updated>2011-05-31T13:00:12.500+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='export'/><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>Exporting reviews (for rpeters83)</title><content type='html'>Problem: how to export reviews from Magento.&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is how you can retrieve all the comments.&lt;br /&gt;Create a new php file on the same level as index.php of Magento. let's call it reviews.php&lt;br /&gt;the content of this file should look like this:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php &lt;br /&gt;$mageFilename = 'app/Mage.php';&lt;br /&gt;&lt;br /&gt;require_once $mageFilename;&lt;br /&gt;&lt;br /&gt;Varien_Profiler::enable();&lt;br /&gt;&lt;br /&gt;Mage::setIsDeveloperMode(true);&lt;br /&gt;&lt;br /&gt;ini_set('display_errors', 1);&lt;br /&gt;&lt;br /&gt;umask(0);&lt;br /&gt;Mage::app('default');&lt;br /&gt;Mage::register('isSecureArea', 1);&lt;br /&gt;&lt;br /&gt;header('Content-Type: text/xml; charset=utf-8');&lt;br /&gt;echo "&amp;lt;?xml version =\"1.0\" encoding =\"UTF-8\"?&amp;gt;\n";&lt;br /&gt;echo "&amp;lt;reviews&amp;gt;\n";&lt;br /&gt;$collection = Mage::getModel('review/review')-&amp;gt;getCollection();&lt;br /&gt;foreach ($collection as $item){&lt;br /&gt;$review = Mage::getModel('review/review')-&amp;gt;load($item-&amp;gt;getId());&lt;br /&gt;echo "\t&amp;lt;review&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;id&amp;gt;".$review-&amp;gt;getId()."&amp;lt;/id&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;created_at&amp;gt;".$review-&amp;gt;getCreatedAt()."&amp;lt;/created_at&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;status_id&amp;gt;".$review-&amp;gt;getStatusId()."&amp;lt;/status_id&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;store_id&amp;gt;".$review-&amp;gt;getStoreId()."&amp;lt;/store_id&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;title&amp;gt;".$review-&amp;gt;getTitle()."&amp;lt;/title&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;detail&amp;gt;".$review-&amp;gt;getDetail()."&amp;lt;/detail&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;nickname&amp;gt;".$review-&amp;gt;getNickname()."&amp;lt;/nickname&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;customer_id&amp;gt;".$review-&amp;gt;getCustomerId()."&amp;lt;/customer_id&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;product_id&amp;gt;".$review-&amp;gt;getEntityPkValue()."&amp;lt;/product_id&amp;gt;\n";&lt;br /&gt;echo "\t\t&amp;lt;stores&amp;gt;".implode(",", $review-&amp;gt;getStores())."&amp;lt;/stores&amp;gt;\n";&lt;br /&gt;echo "\t&amp;lt;/review&amp;gt;\n";&lt;br /&gt;}&lt;br /&gt;echo "&amp;lt;/reviews&amp;gt;";&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;Just call the page in your browser (www.yoursite.com/review.php)&lt;br /&gt;This will export all the reviews in xml format. If you want an other format you can manage from this.&lt;br /&gt;The status id is one of these&lt;br /&gt;&lt;pre class="brush:php"&gt;APPROVED       = 1;&lt;br /&gt;PENDING        = 2;&lt;br /&gt;NOT_APPROVED   = 3;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-6857308981008503590?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/6857308981008503590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/exporting-reviews-for-rpeters83.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6857308981008503590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6857308981008503590'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/exporting-reviews-for-rpeters83.html' title='Exporting reviews (for rpeters83)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-4741913551163491124</id><published>2009-12-28T09:38:00.001+02:00</published><updated>2011-05-31T13:00:57.116+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='store view'/><category scheme='http://www.blogger.com/atom/ns#' term='website'/><title type='text'>Switching language and currency when having multiple websitecodes (for sonician)</title><content type='html'>Problem (and maybe better solutions) found here:&lt;br /&gt;&lt;a href="http://www.magentocommerce.com/boards/viewthread/71171/"&gt;http://www.magentocommerce.com/boards/viewthread/71171/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hi again&lt;br /&gt;There is a way of running a store view directly.&lt;br /&gt;When you call something like this:&lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::run('website1', 'website');&lt;br /&gt;&lt;/pre&gt;the default store view from website1 will run.&lt;br /&gt;Let's say in website1 you have a store view called store_view_1. You can run it like this.&lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::run('store_view_1');&lt;br /&gt;&lt;/pre&gt;As for the currency, you can set a default currency for each store view.&lt;br /&gt;For example you can have to identical store views (in English), one with default currency 'EUR' and one 'GBP'.&lt;br /&gt;Let's say the first one is called store_view_eur, and the second one store_view_gbp.&lt;br /&gt;You can run them like this.&lt;br /&gt;&lt;pre class="brush:php"&gt;if (some condition){&lt;br /&gt;Mage::run('store_view_eur');&lt;br /&gt;}&lt;br /&gt;else{&lt;br /&gt;Mage::run('store_view_gbp');&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;As for the IP location, sorry but I don't think I can help you much there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-4741913551163491124?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/4741913551163491124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/switching-language-and-currency-when.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4741913551163491124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/4741913551163491124'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/switching-language-and-currency-when.html' title='Switching language and currency when having multiple websitecodes (for sonician)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-6640912856691051955</id><published>2009-12-24T12:09:00.003+02:00</published><updated>2011-05-31T13:02:14.691+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='store view'/><category scheme='http://www.blogger.com/atom/ns#' term='website'/><category scheme='http://www.blogger.com/atom/ns#' term='currency'/><title type='text'>Websitecode, currency, language (for sonician)</title><content type='html'>Problem: &lt;br /&gt;get through code the current values for website, currency and language.&lt;br /&gt;Hello,&lt;br /&gt;Website:&lt;br /&gt;&lt;pre class="brush:php"&gt;//for name&lt;br /&gt;Mage::app()-&gt;getWebsite()-&gt;getName();&lt;br /&gt;//for code&lt;br /&gt;Mage::app()-&gt;getWebsite()-&gt;getCode();&lt;br /&gt;&lt;/pre&gt;Currency:&lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::app()-&gt;getStore()-&gt;getCurrentCurrencyCode();&lt;br /&gt;&lt;/pre&gt;Language:&lt;br /&gt;This is a little tricky. You can get the ISO code  for the language, because by standards French for France is different from French for Belgium&lt;br /&gt;&lt;pre class="brush:php"&gt;Mage::app()-&gt;getLocale()-&gt;getLocale();//will return something like fr_FR, fr_BE or en_US&lt;br /&gt;&lt;/pre&gt;if you want to go further and see only the language code it's simple&lt;br /&gt;&lt;pre class="brush:php"&gt;$isoCode = Mage::app()-&gt;getLocale()-&gt;getLocale();&lt;br /&gt;$parts = explode("_", $isoCode);&lt;br /&gt;$language = $parts[0];&lt;br /&gt;$country = $parts[1];&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-6640912856691051955?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/6640912856691051955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/websitecode-currency-language-for.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6640912856691051955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6640912856691051955'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/websitecode-currency-language-for.html' title='Websitecode, currency, language (for sonician)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2270115390472874521</id><published>2009-12-24T09:08:00.002+02:00</published><updated>2011-05-31T13:02:54.644+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='currency'/><title type='text'>Currency Rounding (for jjones17)</title><content type='html'>Problem:&lt;br /&gt;Round the currency to the nearest ten ore (ten cents)&lt;br /&gt;&lt;br /&gt;Possible solution:&lt;br /&gt;&lt;br /&gt;Here is what you can try.&lt;br /&gt;In lib/Zend/Currency.php, in the $_options member of the class change precision from 2 to 1.&lt;br /&gt;This will have the desired effect but also side effects.&lt;br /&gt;All the other currencies besides Norwegian Krone they will all be rounded in the same way.&lt;br /&gt;All prices will look like this 123.4 instead of 123.40.&lt;br /&gt;In order to avoid the first problem instead of changing the precision you can do a "quick and dirty" job.&lt;br /&gt;in Mage_Directory_Model_Currency class for method formatTxt() add this right at the beginning.&lt;br /&gt;&lt;pre class="brush:php"&gt;if ($this-&gt;getCode() == 'NOK'){//if you need it for an other //currency just replace the code here&lt;br /&gt;$options['precision'] = 1;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you want to avoid the last problem (123.4 instead of 123.40) in the same method formatTxt() add add a 0 to the return value&lt;br /&gt;&lt;pre class="brush:php"&gt;return Mage::app()-&gt;getLocale()-&gt;currency($this-&gt;getCode())-&gt;toCurrency($price, $options)."0";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you don't mind these 2 side effects than I recommended using the first solution. It's less code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2270115390472874521?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2270115390472874521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/currency-rounding-for-jjones17.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2270115390472874521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2270115390472874521'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/12/currency-rounding-for-jjones17.html' title='Currency Rounding (for jjones17)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-8383437259660023614</id><published>2009-11-25T15:19:00.002+02:00</published><updated>2011-05-31T13:05:34.187+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='import'/><title type='text'>Import Simple Products (for barrmy)</title><content type='html'>You don't need to import the data directly in the into the tables. My suggestion is to use the models provided by magento (that's why it's a MVC).&lt;br /&gt;&lt;br /&gt;Create an product instance like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;$product = Mage::getModel('catalog/product');&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;set the data you need&lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;setName('PRODUCT NAME');&lt;br /&gt;$product-&amp;gt;setDescription('PRODUCT DESCRIPTION');&lt;br /&gt;&lt;/pre&gt;and so on.&lt;br /&gt;To add stock to this:&lt;br /&gt;&lt;pre class="brush:php"&gt;$stock_data=array(&lt;br /&gt;'use_config_manage_stock' =&amp;gt; 1,&lt;br /&gt;'qty' =&amp;gt; 998,&lt;br /&gt;'min_qty' =&amp;gt; 0,&lt;br /&gt;'use_config_min_qty'=&amp;gt;1,&lt;br /&gt;'min_sale_qty' =&amp;gt; 0,&lt;br /&gt;'use_config_min_sale_qty'=&amp;gt;1,&lt;br /&gt;'max_sale_qty' =&amp;gt; 9999,&lt;br /&gt;'use_config_max_sale_qty'=&amp;gt;1,&lt;br /&gt;'is_qty_decimal' =&amp;gt; 0,&lt;br /&gt;'backorders' =&amp;gt; 0,&lt;br /&gt;'notify_stock_qty' =&amp;gt; 0,&lt;br /&gt;'is_in_stock' =&amp;gt; 1&lt;br /&gt;);&lt;br /&gt;$product-&amp;gt;setData('stock_data',$stock_data);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you have more that 1 website you must specify on which website to appear&lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;setWebsiteIds(array(1,2));&lt;br /&gt;&lt;/pre&gt;To add categories:&lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;setCategoryIds(array(7,10));&lt;br /&gt;&lt;/pre&gt;Set status&lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;setStatus(1);//1=Enabled; 2=Disabled;&lt;br /&gt;&lt;/pre&gt;Set visibility&lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;setVisibility(4);//4 = catalog &amp;amp; search.&lt;br /&gt;&lt;/pre&gt;For photos:&lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;addImageToMediaGallery('path/to/photo', array('image', 'small_image', 'thumbnail'), false, false);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;second parameter can be replaced by null for a regular image. You can test the difference :)&lt;br /&gt;&lt;br /&gt;After all the attributes are set just call&lt;br /&gt;&lt;pre class="brush:php"&gt;$product-&amp;gt;save();&lt;br /&gt;&lt;/pre&gt;and Magento will put all the attributes in the right table.&lt;br /&gt;If you want to update a product, do the same but instead of creating an "empty" instance of a product, load one.&lt;br /&gt;&lt;pre class="brush:php"&gt;$product = Mage::getModel('catalog/product')-&amp;gt;load(PRODUCT ID);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will work if you want to modify the default values. If you want to modify the values for a specific store do this.&lt;br /&gt;&lt;pre class="brush:php"&gt;$product = Mage::getModel('catalog/product')-&amp;gt;setStoreId(STORE ID)-&amp;gt;load(PRODUCT ID);&lt;br /&gt;&lt;/pre&gt;These are the basics. If you want a "fine tuned" product creation you just have to play around with the attributes setData() method.&lt;br /&gt;&lt;br /&gt;It's not easy. You need some programming skills, but it can be done.&lt;br /&gt;&lt;br /&gt;You can find an update to this post here:&lt;br /&gt;&lt;a href="http://marius-strajeru.blogspot.com/2010/05/import-products-update.html"&gt;http://marius-strajeru.blogspot.com/2010/05/import-products-update.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-8383437259660023614?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/8383437259660023614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/import-simple-products-for-barrmy.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8383437259660023614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8383437259660023614'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/import-simple-products-for-barrmy.html' title='Import Simple Products (for barrmy)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-8640959121635530848</id><published>2009-11-23T12:56:00.002+02:00</published><updated>2011-05-31T13:07:25.643+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='category'/><category scheme='http://www.blogger.com/atom/ns#' term='remove'/><category scheme='http://www.blogger.com/atom/ns#' term='navigation'/><title type='text'>Remove category from navigation. (Linking to non active category? for HyekiM)</title><content type='html'>This is a response for &lt;a href="http://www.magentocommerce.com/boards/viewthread/67559/"&gt;http://www.magentocommerce.com/boards/viewthread/67559/&lt;/a&gt; &lt;br /&gt;&lt;strong&gt;For versions &gt;= 1.4 this is included in the core (not this, but something similar)&lt;/strong&gt;&lt;br /&gt;Problem: Linking to a non-active category. Turned into "removing a category from navigation".&lt;br /&gt;Why don't you trey an other approach. Set the category as active and remove it from the navigation.&lt;br /&gt;If you are using drawItem method from 'Mage_Catalog_Block_Navigation' class to list your categories you can do this. Replace&lt;br /&gt;&lt;pre class="brush:php"&gt;if (!$category-&amp;gt;getIsActive()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $html;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/pre&gt;with &lt;br /&gt;&lt;pre class="brush:php"&gt;if (!$category-&amp;gt;getIsActive() || $category-&amp;gt;getId() == YOUR CATEGORY ID) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $html;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/pre&gt;This is the quick and dirty way to do it.&lt;br /&gt;The clean way is to add a new 'yes/no' attribute on the category object "Show in Navigation (show_in_navigation)", and you can change the code above to:&lt;br /&gt;&lt;pre class="brush:php"&gt;if (!$category-&amp;gt;getIsActive() || !$category-&amp;gt;getShowInNavigation()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $html;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To add a new attribute to the category do this:&lt;br /&gt;Run this sql script on your database&lt;br /&gt;&lt;pre class="brush:php"&gt;INSERT INTO `eav_attribute` (`attribute_id`, `entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, `frontend_label`, `frontend_class`, `source_model`, `is_global`, `is_visible`, `is_required`, `is_user_defined`, `default_value`, `is_searchable`, `is_filterable`, `is_comparable`, `is_visible_on_front`, `is_unique`, `is_configurable`, `apply_to`, `position`, `note`, `is_visible_in_advanced_search`, `is_used_for_price_rules`) VALUES&lt;br /&gt;(NULL, 3, 'is_anchor', NULL, '', 'int', '', '', 'select', 'Show in Navigation', NULL, 'eav/entity_attribute_source_boolean', 1, 1, 0, 0, '', 0, 0, 0, 0, 0, 1, '', 1, '', 0, 1);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The second value to insert (3) is the entity_type id for the category object. You can check if this is correct in this table:eav_entity_type.&lt;br /&gt;Take the entity_type_id for entity_type_code 'catalog_category'.&lt;br /&gt;&lt;br /&gt;After you run the sql clear the cache (var/cache).&lt;br /&gt;Now you should have the "Show in Navigation" attribute for each category.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-8640959121635530848?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/8640959121635530848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/remove-category-from-navigation-linking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8640959121635530848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/8640959121635530848'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/remove-category-from-navigation-linking.html' title='Remove category from navigation. (Linking to non active category? for HyekiM)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2728842859717196753</id><published>2009-11-23T11:29:00.001+02:00</published><updated>2009-11-23T11:31:50.599+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer'/><category scheme='http://www.blogger.com/atom/ns#' term='store view'/><category scheme='http://www.blogger.com/atom/ns#' term='website'/><title type='text'>Link customer login to store view? (for Pulse Digital Ltd)</title><content type='html'>This is a response for &lt;a href="http://www.magentocommerce.com/boards/viewthread/67624/"&gt;http://www.magentocommerce.com/boards/viewthread/67624/&lt;/a&gt;&lt;br /&gt;Problem: Limit customers to only one store view.&lt;br /&gt;&lt;br /&gt;I don't think you can limit a customer to a single store view, and limit his access only to that store view.&lt;br /&gt;The whole idea of store view is that you have multiple versions (languages or currencies) for the same website.&lt;br /&gt;What you can do is to set up 2 (or more) websites, each one with specific prices and/or products and allow the customer to access only that website.&lt;br /&gt;You can find a tutorial here &lt;a href="http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work"&gt;http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work&lt;/a&gt; and in the videos reffered here.&lt;br /&gt;For example you set up mysite.com and mysite.eu. They can be hosted on the same machine and moderated form the same admin panel.&lt;br /&gt;After that you can choose not to share the customer accounts from System-&amp;gt;configuration-&amp;gt;Customer configuration.&lt;br /&gt;In the "Account Sharing Options" section set "Share Customer Accounts" to "Per Website".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2728842859717196753?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2728842859717196753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/link-customer-login-to-store-view-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2728842859717196753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2728842859717196753'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/link-customer-login-to-store-view-for.html' title='Link customer login to store view? (for Pulse Digital Ltd)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2197974373269984212</id><published>2009-11-23T11:03:00.002+02:00</published><updated>2011-05-31T13:10:37.000+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='category'/><category scheme='http://www.blogger.com/atom/ns#' term='in stock'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><title type='text'>Link to first product in category, dynamically (for marcfalk)</title><content type='html'>This is a response for &lt;a href="http://www.magentocommerce.com/boards/viewthread/67625/"&gt;http://www.magentocommerce.com/boards/viewthread/67625/&lt;/a&gt;&lt;br /&gt;Problem: Create a link to the first(smallest id) in stock product in a category.&lt;br /&gt;This is the code to retrieve the first product in stock with the smallest id:&lt;br /&gt;(Let's assume the category id you want to do it for is $categoryId)&lt;br /&gt;&lt;pre class="brush:php"&gt;$_category = Mage::getModel('catalog/category')-&amp;gt;load($categoryId);&lt;br /&gt;$collection = Mage::getModel('catalog/product')-&amp;gt;getCollection();&lt;br /&gt;$collection-&amp;gt;addCategoryFilter($_category);&lt;br /&gt;$collection-&amp;gt;getSelect()-&amp;gt;joinLeft(&lt;br /&gt;array('_inventory_table'=&amp;gt;$collection-&amp;gt;getResource()-&amp;gt;getTable('cataloginventory/stock_item')),&lt;br /&gt;"_inventory_table.product_id = e.entity_id",&lt;br /&gt;array('is_in_stock', 'manage_stock')&lt;br /&gt;);&lt;br /&gt;$collection-&amp;gt;addExpressionAttributeToSelect('on_top',&lt;br /&gt;'(CASE WHEN (((_inventory_table.use_config_manage_stock = 1) AND (_inventory_table.is_in_stock = 1)) OR  ((_inventory_table.use_config_manage_stock = 0) AND (1 - _inventory_table.manage_stock + _inventory_table.is_in_stock &amp;gt;= 1))) THEN 1 ELSE 0 END)',&lt;br /&gt;array());&lt;br /&gt;$collection-&amp;gt;getSelect()-&amp;gt;order('on_top DESC');&lt;br /&gt;$collection-&amp;gt;getSelect()-&amp;gt;order('entity_id ASC');&lt;br /&gt;$collection-&amp;gt;getSelect()-&amp;gt;limit('1');&lt;br /&gt;if ($collection-&amp;gt;count() &amp;gt; 0){&lt;br /&gt;$_product = Mage::getModel('catalog/product')-&amp;gt;setStoreId(Mage::app()-&amp;gt;getStore()-&amp;gt;getId())-&amp;gt;load($collection-&amp;gt;getFirstItem()-&amp;gt;getId());&lt;br /&gt;}&lt;br /&gt;else{&lt;br /&gt;$_product = Mage::getModel('catalog/product');&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After that in order to print the product url do this:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php if ($_product-&amp;gt;getId()) : ?&amp;gt;&lt;br /&gt;&amp;lt;a href="&amp;lt;?php echo $_product-&amp;gt;getUrl()?&amp;gt;"&amp;gt; First in stock product in category A  (or &amp;lt;?php echo $_product-&amp;gt;getName(); ?&amp;gt;)&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;?php endif;?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In case the category has no products at all the link above will not be displayed.&lt;br /&gt;In case all the products in the category are out of stock the link will point to the product with the smallest id.&lt;br /&gt;if you want in this case not to display the link change the if above into:&lt;br /&gt;&lt;pre class="brush:php"&gt;&amp;lt;?php if ($_product-&amp;gt;getId() &amp;amp;&amp;amp; $_product-&amp;gt;isSalable()) : ?&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2197974373269984212?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2197974373269984212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/link-to-first-product-in-category.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2197974373269984212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2197974373269984212'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/link-to-first-product-in-category.html' title='Link to first product in category, dynamically (for marcfalk)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-5115228053634845219</id><published>2009-11-21T10:13:00.001+02:00</published><updated>2011-05-31T13:11:17.372+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='description'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><category scheme='http://www.blogger.com/atom/ns#' term='list'/><title type='text'>Show description in the product list page (for Vania)</title><content type='html'>This is an answer for&amp;nbsp;&lt;a href="http://www.magentocommerce.com/boards/viewthread/67466/"&gt;http://www.magentocommerce.com/boards/viewthread/67466/&lt;/a&gt;&lt;br /&gt;Problem: Show the product long description on the list page.&lt;br /&gt;Hi Vania. You can use in the list.phtml file this.&lt;br /&gt;&lt;pre class="brush:php"&gt;$_product-&amp;gt;getDescription(); &lt;br /&gt;&lt;/pre&gt;but Magento does not load all the attributes on the product listing page. Go to the admin pannel Catalod-&amp;gt;Attributes-&amp;gt; Manage Attributes and edit the description attribute. Set "Used in product listing" to "Yes". Save and clear the cache.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-5115228053634845219?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/5115228053634845219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/show-description-in-product-list-page.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5115228053634845219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/5115228053634845219'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/show-description-in-product-list-page.html' title='Show description in the product list page (for Vania)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-6137149810835381607</id><published>2009-11-21T09:20:00.009+02:00</published><updated>2011-05-31T13:12:29.165+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='customer'/><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='reset'/><title type='text'>How to reset the passwords for all the customers (for Andrew)</title><content type='html'>This is a response for: &lt;a href="http://www.magentocommerce.com/boards/viewthread/67065/"&gt;http://www.magentocommerce.com/boards/viewthread/67065/&lt;/a&gt;&lt;br /&gt;Hi Andrew You can create a new php file.&lt;br /&gt;Let's call it customer.php and place it on the same level as index.php file af Magento. Put this code in the file.&lt;br /&gt;&lt;pre class="brush:php"&gt;error_reporting(E_ALL | E_STRICT);&lt;br /&gt;$mageFilename = 'app/Mage.php';&lt;br /&gt;if (!file_exists($mageFilename)) {&lt;br /&gt;if (is_dir('downloader')) {&lt;br /&gt;header("Location: downloader");&lt;br /&gt;} else {&lt;br /&gt;echo $mageFilename." was not found";&lt;br /&gt;}&lt;br /&gt;exit;&lt;br /&gt;}&lt;br /&gt;require_once $mageFilename;&lt;br /&gt;Varien_Profiler::enable();&lt;br /&gt;Mage::setIsDeveloperMode(true);&lt;br /&gt;ini_set('display_errors', 1);&lt;br /&gt;umask(0);&lt;br /&gt;Mage::app('default');&lt;br /&gt;$passwordLength = 10;&lt;br /&gt;$customers = Mage::getModel('customer/customer')-&amp;gt;getCollection();&lt;br /&gt;foreach ($customers as $customer){&lt;br /&gt;$customer-&amp;gt;setPassword($customer-&amp;gt;generatePassword($passwordLength))-&amp;gt;save();&lt;br /&gt;$customer-&amp;gt;sendNewAccountEmail();&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;then just call the page in your browser http://mydomain.com/customer.php After you finish delete the customer.php file from your server to avoid running it again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-6137149810835381607?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/6137149810835381607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/how-to-reset-passwords-for-all.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6137149810835381607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6137149810835381607'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/how-to-reset-passwords-for-all.html' title='How to reset the passwords for all the customers (for Andrew)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-2391069659534617560</id><published>2009-11-20T09:26:00.004+02:00</published><updated>2011-05-31T13:12:56.500+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='product'/><title type='text'>Add one image to just one product (For John Egg)</title><content type='html'>Problem: &lt;a href="http://www.magentocommerce.com/boards/viewthread/67233/"&gt;http://www.magentocommerce.com/boards/viewthread/67233/&lt;/a&gt;&lt;br /&gt;Add an image to only a single product in the view page:&lt;br /&gt;Possible solution:&lt;br /&gt;Add a new 'yes/no' attribute for the products, lets call it 'use_alternative_image' &lt;br /&gt;Edit the product you want the image for and set the attribute to "Yes";&lt;br /&gt;In the view.phtml file, you just have to do this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:php"&gt;&lt;br /&gt;&amp;lt;?php if ($_product-&amp;gt;getUseAlternativeImage()) : ?&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;img src="{Your image src}" /&amp;gt;&lt;br /&gt;&amp;lt;?php endif; ?&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This way you can set this image to one ore more products (or none).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-2391069659534617560?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/2391069659534617560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/add-one-image-to-just-one-product-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2391069659534617560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/2391069659534617560'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/add-one-image-to-just-one-product-for.html' title='Add one image to just one product (For John Egg)'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3096948998424560639.post-6032010789561796603</id><published>2009-11-19T15:30:00.000+02:00</published><updated>2009-11-19T15:32:46.026+02:00</updated><title type='text'>Just to be safe</title><content type='html'>Yesterday Nov 19th 2009, my magentocommerce forum account and all 300 posts went down the drain, because of a "human error".&lt;br /&gt;Just to be on the safe side I decided to put all answers here, and just reference them on the forum.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3096948998424560639-6032010789561796603?l=marius-strajeru.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marius-strajeru.blogspot.com/feeds/6032010789561796603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/just-to-be-safe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6032010789561796603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3096948998424560639/posts/default/6032010789561796603'/><link rel='alternate' type='text/html' href='http://marius-strajeru.blogspot.com/2009/11/just-to-be-safe.html' title='Just to be safe'/><author><name>tzyganu</name><uri>http://www.blogger.com/profile/03260476970491519251</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-kJMFkzncmBA/TgRZHCBWCXI/AAAAAAAAAWs/eoOvT72p0vg/s1600/photo.jpg%253Fsz%253D200'/></author><thr:total>0</thr:total></entry></feed>
