Magicento

Magicento is a PHPStorm plugin for Magento developers. Features include:
Goto for factories and template paths, autocomplete for factories, xml files and class names, documentation for xml nodes, evaluation of PHP code inside Magento environment, and much more! check the features and videos below

Download »

Created by Enrique Piattienrique piatti (enriquepiatti)

Download

Free Trial Version

The trial version has a limitation of 15 days.

Features not available on the trial version:

  • Create Model Triad view
  • Add @method to Models view
  • Magic methods autocomplete view
  • Automatic Block class detection for $this inside templates view
  • Create cron method intention view
  • Create observer intention view
  • Create layout and template files intention view
  • Code completion for getTable view
  • Code completion for getStoreConfig view
  • Code completion for block alias view
  • Rewrite conflicts warning view
  • Malformed config.xml warning view
  • Compare with original view
  • Compare templates view
  • Magicento PHP Scripts view
  • Evaluate in Magento view
  • All features from v2.6+ view

Full Version
$25 usd

After completing the payment a new Magicento user will be generated for you automatically and you will get a special download link for your unique version of Magicento (next updates are free, it's an only one time payment).

Magicento license is by User,
it can be used in multiple devices, but always by the same user.
If you are a company needing a bulk license please contact me.

If PayPal is not available in your Country please contact me.
30 Days Money Back Guarantee

30 days money-back guarantee!

I'm pretty sure you will love Magicento. I'm a Magento developer too, I use Magicento everyday and I can guarantee it's a big time saver, also you will enjoy much more developing in Magento with the help of Magicento.
But If you are unsatisfied for any reason, please email me and I will issue a refund.

I'm always trying to improve Magicento, so if you find any problem or you have new ideas/suggestions you are welcome to contact me by email or skype.

Installation

  1. Go to File > Settings
  2. Select Plugins option under "IDE Setting"
  3. Click "Install plugin from disk..." button
  4. Select your magicento.jar file
  5. Save the settings and restart the IDE
Magicento Installation

Features

Note: Magicento adds only one shortcut for all its custom actions: ALT+M (Option+M in mac), this is context aware (you will see different actions depending where the edit cursor is).

The other actions are just extensions of the default PHPStorm actions, so you can use the normal shortcuts:
  • CTRL+SPACE (autocomplete)
  • CTRL+B | CTRL+CLICK (goto)
  • ALT+ENTER (intentios)
  • CTRL+Q (documentation)

NEW FEATURES (v2.8.6)

You can assign multiple Magento folder paths now
This could be useful with custom folder structures like the one below.


Magento src is not on the project root, and it doesn't have the full code from Magento inside


Magicento will try to detect the correct folder to create the new files (controllers, models, etc) but if it can't decide it you will be asked where you want to create them.
In the example above that is what happening when trying to create a new module

NEW FEATURES (v2.8)

Use (anywhere) ALT + M > Create Controller

NOTE: If you choose an existing frontname or routename it will rewrite the original controller from that frontname or routename

Use (anywhere) ALT + M > Go to Controller
Put your Magento URL (or just the relative path: "frontname/controllername/action")

NOTE: it doesn't support URL rewrites yet

Use CTRL + B when cursor is over some handle in any layour XML file

NOTE: if Magicento can find the controller/action for that handle it will be shown as the first item in the list (the other items are references to other places where that handle is used inside the Layout)

Use CTRL + B when cursor is over action method

Use CTRL + SPACE to get al possible handles (using controllers actions combinations)

Use ALT + M > Go to Template from other Package Theme when editing some .phtml file.

You will be able to jump to the same template from other packages themes

Use ALT + M > Copy Relative Path when editing some .phtml file.

This could be specially useful for Windows users, to avoid getting the backslash "\" when copying the file path from PhpStorm

Use CTRL + SPACE. Magicento should detect better the class when using chained methods.

Anyway, the support for this is not complete (see the example below). The problem here is that Magento is using a bad @return PHPDoc.
Magento sometimes is using things like "@return Varien_Object" and it should use "@return $this" instead when the method is returning $this.

TIP: to fix the above problem, try using a non chained version of the same code:

Use CTRL + SPACE when cursor is inside Mage::registry('[HERE]')

Use CTRL + SPACE to get code completion

NOTE: this only works for keys originally registered in Magento, is not dynamic

  • Compare with original File Action now works with original files from "Community" pool
  • Evaluate in Magento is showing the result inside the information panel too (to allow copy and check previous results). And is not showing with a dialog if the result is too long.
  • Added autocomplete for system config paths inside $installer->setConfigData('CTRL+SPACE HERE')
  • Compare templates and layout files dialog now only shows packages and themes containing the file to compare (same relative path)
  • Compare With Original action works with original files not included in the current project (Mage.php not in the current project)
  • Added "go to character position" support for Magicento PHP Scripts. Just append "::POSITION" to the filepath to open (see more details when creating a Magicento Php Script)

NEW FEATURES (v2.7)

You can now execute IDE actions from your Magicento PHP Scripts.
You just need to assing some values to the $GLOBALS['MagicentoActions'] var.
Available Actions:

  • $GLOBALS['MagicentoActions']['alert'] = 'Some text here to show with an alert inside the IDE';
  • $GLOBALS['MagicentoActions']['info'] = 'Text here will be shown with a Notification of type INFO';
  • $GLOBALS['MagicentoActions']['warning'] = 'Text here will be shown with a Notification of type WARNING';
  • $GLOBALS['MagicentoActions']['error'] = 'Text here will be shown with a Notification of type ERROR';
  • $GLOBALS['MagicentoActions']['refresh'] = array($absoluteFilePath,...); // These files will be refreshed (useful if you change the content of some file inside this script)
  • $GLOBALS['MagicentoActions']['open'] = array($absoluteFilePath,...); // These files will be opened (useful if you create some file)

Check this example for more details (you can download and execute it in yout environment)

Use ALT + M > Go to Event Observer anywhere.
type the name of the event (or part of it)
Magicento will show you the observers for that event

Use ALT + ENTER (or your intention shortcut) when the cursor is over some variable in PHP

  • Goto for skin images. Use CTRL+B (CTRL+CLICK) when the cursor is over any skin url (filepath ending with .jpg .gif or .png)
  • Autocomplete and Goto for "helper" method inside Block classes: $this->helper('[CTRL+B] and also [CTRL+SPACE]')->[CTRL+SPACE]
  • Improved validation for Module Creator dialog
  • Magicento menu (ALT+M) now works when there isn't any opened file
  • New Copy Layout File action. ALT+M inside any .xml from the layout to copy it to another package/theme
  • New Compare Layout File action. ALT+M inside any .xml from the layout to compare it with another package/theme
  • Added new config for omitting Magicento notifications. Set a list of regular expressions and the messages matching that (and not marked internally as important) won't be show anymore
  • Added foreach item type inference when looping collections annotated with @var. Ex:
    /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
    foreach($collection as $item){
    $item->[CTRL+SPACE]
    }
    // I'm working on adding more intelligence to the foreach item type inference.

NEW FEATURES (v2.6)

Use CTRL + SPACE inside a foreach with a collection.
Magicento will infere the model type automatically. You don't need to add @var phpdocs.

Use CTRL + SPACE after
->getResource()
->_getResource()
->getCollection()
->getResourceCollection()
should work fine everywhere.

Use CTRL + B (or CTRL+CLICK) when the cursor is over some method in Observer.php

Added data installer, mysql4 prefix is optional, autocomplete for namespaces.

Use CTRL + SPACE inside addAttributeToFilter and addFieldToFilter

Use ALT + ENTER to camelize ->getData('key') or ->setData('key', $value)

New delay setting for PHP features.
It will delay the excution of eval.php, this could be useful for example if you need to upload with some sync script the eval.php to your server

New test button for checking if PHP features are working with the current settings

NEW FEATURES (v2.5)

Use ALT + M > Create Model Triad anywhere (the cursor must be inside the editor (an opened file)
Magicento will open a dialog for creating the Model, Resource and Collection (with the required nodes in config.xml if it doesn't exist)

You can edit the templates used to generate the Model, Resource and Collection class:

Use ALT + M > Add @method PHP Doc when the cursor is inside a Model class

It will read the fields from the table associeted with that Model in your Magento DB

Use ALT + ENTER (normal shortcut for intention actions) when the cursor is over your cron method definition
Magicento will create the method in the corresponding class (and will create the class if it doesn't exist too).

Go to File > Settings > Magicento

NEW FEATURES (v2.4)

New autocomplete for get/set/uns/has methods on models (just use CTRL+SPACE as always, it works when you have the prefix already typed: Mage::getModel('catalog/product')->get[CTRL+SPACE HERE])

The first time you will probably need to read the data keys for your model from your Magento DB:

If the PHP features are not working fine in your Project, you can use the Magicento script called: Get Varien Object Keys

* NOTE: You will probably see that file inside the "Other" folder
Download that script, it will be saved into:
[YOUR PROJECT FOLDER]/.idea/magicento/scripts/magicento/get_varien_object_keys.php
You can use that script as a reference for generating the .xml used by Magicento for all your models.
You will probably need to adapt it a bit (for example execute Mage::app(); first), and upload and execute that script to your Magento server, manually.
If you are generating the XML in that way, save it to:
[YOUR PROJECT FOLDER]/.idea/magicento/varienobjectdata.xml

Use ALT + ENTER (normal shortcut for intention actions) when the cursor is over the filename for the new layout update inside your confg.xml
Magicento will let you choose the package and theme and will create and open that file for you.

Use ALT + ENTER when the cursor is over Use ALT + ENTER (normal shortcut for intention actions) when the cursor is over some: ->getsomething_here and it will be converted to ->getSomethingHere()

*You need to prefix the method with get, set, uns or has to invoke the intention

Estimated saved time in a week using Magicento Expand All

Using PHPStorm 6+ (*) you will get code completion for factories automatically (just use Ctrl+Space like always).
This is useful not only for code completion but also for "go to declaration" feature (just use Ctrl+B / Ctrl+Click / middle click (windows)).

It works for $this->helper() inside templates and $this->_factory->getModel|getHelper|getSingleton|getResourceModel too

* If you are using an old PHPStorm version, you can have code completion using "add @var" action:

with the cursor over your $variable use Alt+M (Option+M)

PHPStorm 6+ required (with older versions you can use Alt+M > add @var $this on any .phtml file).
Make sure you have enabled this option inside Magicento settings.

Note: sometimes is not possible to find the correct Block for the current template (for example when the template is not assigned with the layout.xml but is hardcoded inside the Block class, or when you have wrong package/theme in Magicento Settings)

Just use Ctrl+Space after the "class " keyword

It works for controllers too

Note: this could be a big time saver because your class names won't have typo errors anymore, also is very useful when you need to refactor some module name.

Use Ctrl+Space after the "extends " keyword.

Use Alt+M when the edit cursor is inside the class you want to rewrite and select Rewrite Class or Rewrite Controller.

Then select the target module where the new class will be created.
And lastly you can change the default class name (proposed by Magicento) for the new class.

When you are rewriting a controller the dialog is a bit different:

The prior dialog will generate a class and xml like this:

You can change the templates used for creating the new classes going to File > Settings > File and Code Templates > Jave EE

Note: the only requirement for these actions is to have a valid target module already created, with a config.xml file (config.xml can be empty, Magicento will create the correct nodes)

Use Alt+M anywhere inside any opened file and select Create Module

The options are self explanatory
The "Group" field can be empty and it will use the default one (NAMESPACE_MODULENAME), in the image above the default group is "magicento_test" but it was changed to "mtest"
You can choose if you want to generate the nodes and folders for the blocks, models, helpers (in this case it will create a Data.php file too) and installers.

These are the files generated by the prior dialog:

You can change the templates used for creating the new module going to File > Settings > File and Code Templates > Templates > magicento_*

Use your "Go to" shortcut (by default Ctrl+B / Ctrl+Click) on any string representing a factory to jump to the class for that factory.
This works everywhere:
Mage::getModel('[CTRL+B HERE]')
<block type="[CTRL+B HERE]" ... >
$this->_init('[CTRL+B HERE]')
etc

Use your "Go to" shortcut (by default Ctrl+B / Ctrl+Click) on any relative path to some file.
For example
<block ... template="[CTRL+B HERE]" >
<file>some_layout_file.xml</file>

Layout Features must be enabled in Magicento Settings

Use your "Go to" shortcut (by default Ctrl+B / Ctrl+Click) on any string representing a block name/alias or handle name.
For example
<reference name="[CTRL+B HERE]">
<update handle="[CTRL+B HERE]">
$this->getChildHtml('[CTRL+B HERE]')
$this->getBlock('[CTRL+B HERE]')

Layout Features must be enabled in Magicento Settings

Use Alt+M when the edit cursor is inside a Block class and select the action Goto block definition in layout

Note: sometimes Magicento can't find the <block> nodes where the Block class is used. This happens for example when the block is created from PHP instead of using the layout (adminhtml grids for example).

Layout Features must be enabled in Magicento Settings

Use Alt+M when the edit cursor is inside a Block class and select the action Go to template from block

Note: sometimes Magicento can't find the .phtml file/s where the Block class is used. This happens for example when the template is assigned with PHP instead of using the layout.

Layout Features must be enabled in Magicento Settings

Use Alt+M when editing some template (.phtml) file and select the action Go to Block

Note: sometimes Magicento can't find the Block class reference by $this in the .phtml file. This happens for example when the template is assigned with PHP instead of using the layout.

Layout Features must be enabled in Magicento Settings

Use your "Go to" shortcut (by default Ctrl+B / Ctrl+Click) on the event name inside any Mage::dispatchEvent call.
Mage::dispatchEvent('[CTRL+B HERE]')

Note: at the moment this works only for constant/hardcoded event names

Use Ctrl+Space), for example:
Mage::helper('[CTRL+SPACE HERE]')

This works with $this->_init([CTRL+SPACE HERE]) inside Models and Collections too

Use Ctrl+Space) with ->getTable calls, for example:

This works with $this->_init([CTRL+SPACE HERE]) inside ResourceModels too

Use Ctrl+Space) with Mage::getStoreConfig, for example:

Note: this works part by part, you probably need write a forward slash "/" and use Ctrl+Space again to get the final desired config path

Use Ctrl+Space with:
$this->getChild('Ctrl+Space')
$this->getChildHtml('Ctrl+Space')
$this->getBlock('Ctrl+Space')
$this->getBlockdHtml('Ctrl+Space')

Layout Features must be enabled in Magicento Settings

Use Ctrl+Space inside any config.xml:




Tip: try to use it always, on any level, for nodes and also values.

Use Ctrl+Space inside any system.xml:

Tip: try to use it always, on any level, for nodes and also values.

Use Ctrl+Space inside any adminhtml.xml:

Tip: try to use it always, on any level, for nodes and also values.

Use Ctrl+Space inside any /layout/*.xml file:

Tip: try to use it always, on any level, for nodes, attributes and values.

Layout Features must be enabled in Magicento Settings

Tip: if the autoformat is breaking your original format maybe that is because you have the wrong settings for the code styles.
Please make sure you have this configuration:

Use Ctrl+Q when the cursor is over some node name or attribute name to get some brief documentation.

Note: at the moment not all the nodes and attributes are documented

Magicento will search rewrite conflicts automatically and will show you an alert if some conflict is found

Also you can trigger this check manually using Alt+M > Check rewrite conflicts, from anywhere (inside the editor)

Lastly you can set the classes for the rewrite conflicts you have fixed so Magicento is won't warn you about them anymore:
File > Settings > Magicento > Rewrite conflicts solved
you can disable the auto check for rewrite conflicts from Magicento settings too.

Use Alt+M when editing some .phtml and select the action Copy Template
Then you need to select the target Package and Theme (*), a new file with the same relative path will be created there.

* At the moment this only works for existent themes (so you need to create the folder first if you want to use a new Theme)

Since Magicento 2.2.0 you can also change the final relative path for the new .phtml

Use Alt+M when editing some file located in /code/local/Mage or some .phtml/.xml and select the action Compare with Original

Use ALT + M > Compare Templates when editing any .phtml file, you can select the package and theme to compare with.

Use Alt+M when editing any file and select the action Evaluate in Magento
Write the PHP code to evaluate (it will be executed inside your Magento so you can use Magento code)




By default the code is evaluated inside a "var_dump" call, that's why you don't need to put the semicolon, and you can evaluate just one sentence.
But this can be changed from Magicento Settings
When you are not using the "var_dump" option you can write any PHP code, but if you want to see some output you need to call "echo" (or some output function) by yourself.

You need to enable and configure PHP in your Magicento Settings

Use Alt+M when editing any file and select the action Toggle Template Hints
This action will toggle the template hints for the frontend and also the backend in your current Magento

You need to enable and configure PHP in your Magicento Settings

Use Alt+M when editing any file and select the action Flush Cache
This action is very useful when you are developing with the cache enabled

You need to enable and configure PHP in your Magicento Settings

Use Alt+M when editing any installer script (.php files inside /sql and /data folders) and select the action Remove this installer from core_resource table
This is useful when you want to run again some installer script
The core_resource table will be reseted to the prior script version so when you run Magento again the script will be executed automatically

You need to enable and configure PHP in your Magicento Settings

Use Alt+M when the edit cursor is over some config path inside any Mage::getStoreConfig call and select the action Get Store Config
You can do the same evaluating the code with Alt+M > Evaluate in Magento
To obtain the specific value for some store, you need to set the current store from Magicento Settings (or use Alt+M > Set Store)

You need to enable and configure PHP in your Magicento Settings

Select the text inside any .phtml file, use Alt+M and select the action Translate TExt


TIP: put the cursor in some part of the text to translate and use Ctrl+W to select the whole string quickly

Use Alt+M when the edit cursor is over some translated string and select the action Add Translation
Then type the translated text and select the translation .csv type (if you choose translate.csv and the file doesn't exist in the selected theme, it will be created)

Magicento includes the Magento dictionary from here: https://github.com/tim-bezhashvyly/phpstorm-magento-dictionary

Magicento will check automatically for malformed config.xml (for example when you have an end of line after some class name/prefix, etc)

You can add your own features writing them in pure PHP!
Magicento will execute your script passing your custom params and some information about the file you are editing.
Example:


Open MagicentoScripts toolwindow


Create a new script


Write your PHP code
Inside $GLOBALS['Magicento'] you will have the data from your params and also some data from the current file your are editing in PhpStorm


Alt+M > Execute PHP scripts anywhere when editing some file


Choose the script to execute


Because we added a param called "echo" Magicento is asking us for the value we want for it in our script


Magicento will show the output of the script (if any) inside the toolwindow


You can share your scripts with other Magicento users (or using it as a shared database for your team or for your different projects)


Refresh your tree (right click) to see the scripts uploaded to Magicento.com by you and other users
Download will save that script in your local project so you can use it (or edit if need it)

* This feature is in alpha state and there are a lot of things to do in this area if the community find it useful.

If your project code does not contain the Magento core files you can use Magicento anyway.
Just set the Mage.php to some local Magento installation.
Magicento will create all modules and new files under the current project, and will merge the code from your current project and the code from your local Magento

You can use ${MAGENTO_MODULE_VERSION}, ${MAGENTO_MODULE_NAMESPACE}, and ${MAGENTO_MODULE} in your File Templates
File > Settings > File and Code Templates

Use ALT + ENTER (normal shortcut for intention actions) when the cursor is over any relative path to some .phtml file
Magicento will let you choose the package and theme and will create and open that file for you.
This is useful when you are setting some template in your layout XML but that template doesn't exist yet

Use ALT + ENTER (normal shortcut for intention actions) when the cursor is over your method name in your config.xml
Magicento will create the method in the corresponding observer class (and will create the observer class if it doesn't exist too).

Use ALT + ENTER (normal shortcut for intention actions) when the cursor is over the event name in any call to Mage::dispatchEvent
Magicento will create the nodes in your config.xml for that event and also the observer class (if doesn't exist yet) and method

Using Magicento you not only will save at least 1 hour every week (probably much more if you are using all the features), but also your code will be less prone to errors and you will enjoy develping with Magento because you can focus on your specific requirements and let Magicento do the ugly part of your work.

Videos

You can see Magicento in action in these videos (note there are some missing features like Magicento PHP Scripts more videos comming soon):

Configuration

Go to File > Settings > Magicento

Changelog

2.8.0

2.7.0

2.6.5

2.6.0

2.5.0

2.4.0

2.3.0

2.2.0

2.0.1

2.0.0

1.7.1

1.6.2

1.6.2

1.6.0

1.4.2

1.4.1

1.4.0

1.3.0

1.2.0

1.0.1

1.0

0.9.8

0.9.7

Video with all the features: www.magicento.com

0.9

0.8.2

0.8

FAQ

  • How to use Magicento?

    Magicento will work automatically on your Magento projects (if not please check the configuration going to File > Settings > Magicento).
    You have only one shortcut: Alt+M (Option+M on mac). This shortcut is context aware, that is, you will see different options depending where the cursor is (a var definition, a .phtml file, a Block class, an intaller script, an xml etc).
    The rest of the features from Magicento are accesible using the original shortcuts from PHPStorm (Ctrl+Space for autocomplete, Ctrl+B | Middle Click | Ctrl+Click for "Go to..", Ctrl+Q for documentation).
    Please read the Features (really important to take advantage of Magicento)

  • How can I know when a new version is released?

    Magicento will show an alert when a new version is available.
    Moreover you will see a new option "Update Magicento" inside Magicento menu (Alt+M or Option+M in Mac) Also you can follow @magicentoplugin on twitter, I will inform about updates there too.

  • How to inform about issues/problems?

    Please use the issues tab on github: https://github.com/enriquepiatti/Magicento/issues. If you don't have a github account send an email to "issues at magicento.com" describing the issue, with the full trace of the exception if it's available.

  • How to suggest new features/ideas?

    You can request, comment and vote new features clicking the "suggestions" box in the middle left of this screen

  • How to disable Magicento?

    You can uninstall it from the plugin section on the settings panel of the IDE. Or if you want to disable it just for the current project goto "magicento" section inside the settings of the project and disable it from there.
    If for some reason you can't do that (maybe the IDE hangs up or you can't start it), then you can disable it by adding this line to /.idea/magicento.xml:
    <option name="enabled" value="false" />
    As a last option, you can also search for "magicento.jar" in your hdd and remove it, in Windows for example it is normally located at: [USER_FOLDER]\.WebIde60\config\plugins\magicento.jar and in Mac at: ~/Library/Application/Support/WebIde60/magicento.jar

  • PHPStorm is broken/frozen, how to solve it?

    Try first uninstalling Magicento: How to disable Magicento?
    If that doesn't work try removing PHPStorm logs too (in windows for PHPStorm 6+: [USER_FOLDER]\.WebIde60\system\log\)
    If that doesn't work either try removing indexes, or remove the /.idea folder from your project (the IDE should start correctly if you don't start it with an opened project, and then you can remove or disable Magicento from there).
    And don't hesitate to contact me by email: contacto@enriquepiatti.com or skype: enriquepiatti.
    Also please remember to submit the issue (How to inform about issues/problems?), and I will try to fix it ASAP

  • Error java.lang.NoClassDefFoundError: org/intellij/plugins/xpathView/support/XPathSupport

    Make sure "IntelliLang" and "XPathView + XSLT Support" plugins are installed and enabled. Also check you don't have any other plugin causing some conflict.

  • Fail to load plugin descriptor from file magicento.jar

    If you are getting that error when trying to install Magicento, then probably your magicento.jar is corrupted, please contact me in that case.

  • Why PHPStorm?

    Because I've tested a lot of IDEs and even when it's not perfect, I think it's the best option in the market

  • What versions of PHPStorm are compatible with Magicento?

    Magicento was successfully tested on PHPStorm 6 and 7 using Windows, MacOs and Linux.
    It could work on PhpStorm 5 and earlier, but not with all the features, it's highly recommended to use PhpStorm 6 at least.