Top 3 mistakes by Magento beginners

Featured Image

First of all, let me inform you that this article is for those of you who are just starting with Magento. If you are a Magento expert, you will probably know this.  Consider it just a reminder for those who use Magento for first time. There are three common mistakes that most people do when they try to use Magento for first time, so read this article and you won’t be one of them.:)

  1. First mistake is downloading Magento’s full release and trying to upload it using ftp. Much easier solution is using Magento downloader method and you won’t lose upgrade capability.
  2. More experienced PHP developers will first read Magento Designers Guide before they try to style Magento, but others won’t and that’s the mistake number two. Since Magento has great theme fallback system there is really no need to touch default theme. Although easiest way to make new theme for new Magento is top copy the whole theme to a new folder, don’t do that. Copy only the files you will need: from /design/frontend/default/default/ directory to /design/frontend/default/YOUR_NEW_THEME directory. Do the same thing with /skin/frontend/default/default/ Congratulations, you have your own theme just like that. All that left is to apply new theme (System->Configuration->Design) and you are ready to do with your theme files whatever you want.
  3. Third mistake is modifying Magento core files. What files are core ones? All what is in app/code/core folder. If you have a need to modify some of those ones, you just need to duplicate that file in the same directory path to app/code/local. For example, if you need to modify the file
    app/code/core/Mage/Checkout/Block/Success.php
    copy it to
    app/code/local/Mage/Checkout/Block/Success.php
    and leave the core file intact. This way your Magento will be more bullet-proof to future updates.

I hope this article can help all new Magento developers.

24
Top

Care to rate this post?

Author

Tomas Novoselic

Team Leader, Backend Developer

At Inchoo, Tomas is a Team Leader and Certified Magento Developer who handles Magento modifications at any level. He also works closely with clients on Magento projects of any size and difficulty.

Other posts from this author

Discussion 24 Comments

Add Comment
  1. Nice article and I agree with all of it!

  2. Great list. 4th mistake I would say is to manage features manually instead of using the configuration.

    I inherited a site where all instances for wishlist, reviews, etc were all commented out in PHP files when switching those features on and off is as easy as going to System>Configuration and disabling the features there. System>Configuration>Advanced>Advanced is a great little switchboard

  3. I’ve developed several Magento themes. I completely agree with #1 and #3 however I think that #2 needs some modification:

    The first two themes I developed, I did exactly what step #2 prescribed. What I realized was that when a newer version of Magento came out, I had to manually merge all of the changes from the newest Default theme into my custom theme. I discovered was that it was only necessary to copy the files into my custom theme that I needed to modify. My custom theme directory (/app/design/frontend/default/YOUR_NEW_THEME) ended up with a few dozen files in it, as opposed to the hundreds of files in the default theme.

  4. I would add a 4th:
    leaving install.php on a production server after installation…

  5. Regarding the third mistake: better use model/block rewrites together with inheritance to reduce code redundancy. This saves a lot of time after upgrading to a new version which might contain modifications (bug fixes, etc.) in the classes you have modified.

  6. BelowZero

    I totally agree with Erik Hansen. You don’t have to copy the entire theme. Just copy the files you want to change.

  7. Erik, BelowZero, you are correct. Original article was now slightly modified ;)

  8. rkscott

    Another vote for ‘just whats needed’ on copied theme files (#2). Else you’ll be dif’ing thousands, as opposed to a couple of dozen files, each time you upgrade.

  9. Excellent document! Must be in the wiki page. Really useful. Thanks for sharing.

  10. Regarding #2 I totally agree with you guys!
    @Tomislav: Tnx for modifying original article ^_^

  11. Prashant

    If we simple copy
    app/code/core/Mage/Checkout/Block/Success.php
    to
    app/code/local/Mage/Checkout/Block/Success.php

    and then will modify the file under app/code/local/Mage/Checkout/Block/ then will the modification will apply or not. And what exactly for “app/code/local/” folder is made in magento.

  12. vrrt

    thanks for this article. I’ve one issue with advice nr.2 – “Copy only the files you will need”. If I use “blank” theme as source of the customized one, how can I configure Magento to fallback to “default/blank” instead of “default/default”? Now I’ve to copy all files of blank theme into my own directory though I don’t want to do it this way.

  13. Great article! Simple, short, but invaluable tips. Thank you!

  14. vrrt – I think you can make “blank” your default, so that fallbacks will work as prescribed. I also think that Magento intends to support more fallback levels in the future.

  15. Thanks for this info.

    This is my first go at a Magento site. I am converting a heavily customized oscommerce site to Magento. I chose to use a purchased theme as my base (using that purchased theme for another store front). Copied it from the default/custom_theme to custom_theme/default and went from there. So in my admin I have the package name as the custom folder and the default is default, does this make sense? I am basically modifying 3/4ths of the xml and template pages so I don’t know if the fallback portion applies to me or not yet. Do you think I should still use the fallback default?

    But I did not know about copying core files to the local folder and it picking them up from there. I just did that to add a custom “tab” to my product views page, excellent. I will now be able to go to town on tutorials that involve modifying some core files!

  16. Casey

    When trying to do #3 in version 1.3.x it doesn’t seem to work. What is the easiest way to changes the core code in the new version??

  17. @Casey,
    It still works in current versions (1.3.2.2). Make sure there are no errors in your local file and that the folder structure matches what’s in core/.

  18. mogento sucks

    What is the hyrerichal structure of core files. It seems to me that mogento core is never meant to be customizeable. The db structure is pathetic. Can someone clarify this??

  19. Hello Dear
    I want to show all the products which have Status In Stock, from all categories on magento home page, So can you tell me how to do this.
    Plz comment on any post here
    VaseemAnsari.blogspot.com
    to let me know the answers

    I want these things to implement so can u help me
    1. i have created some demo.phtml files
    now i want to call it in direct url like abc.com/demo
    so is there any method i can call those static phtml files created by me directly in url of website.
    Or you can mail me at Vaseem@ doomshell.com

  20. @vaseem ansari,
    Sorry, but your reply is totally off topic, therefore this is the only way I can help you.

  21. Ahmed Arous

    Hi,
    I’m working on magento 1.4 and im traying to modify some of the core files so i copied them on app/code/local, but i’ve got this error :
    “Cannot redeclare class Mage_Catalog_Block_Layer_Filter_Price in /var/www/html/ …” is there something else to do to make it work ??
    Thanks.

  22. Sanjeev

    Hi All….i am new in magento and i have html website template ,its fully js,css and image based design.

    Now i want to use this html template in magento ,but i don’t know how to use html template ,,,!!!

    is It any way to use direct in magento or i need to create every page in CMS->Page Design method

    Thanks,
    Sanjeev

  23. I “tripped” #1 and #2 and you saved me with #3 haha. Thank you for this post!

  24. Nice blog site there! Also your website opens fast!
    What web host are you using? May I have your online url to your web host?
    If only my web site opened as rapidly as yours.

Add Your Comment

Please wrap all source codes with [code][/code] tags.
Top