Title: Mage Enabler
Author: Richard Feraro
Published: <strong>Май 12, 2010</strong>
Last modified: Сентябр 19, 2012

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/mage-enabler.svg)

# Mage Enabler

 By [Richard Feraro](https://profiles.wordpress.org/richardferaro/)

[Download](https://downloads.wordpress.org/plugin/mage-enabler.1.2.2.zip)

 * [Details](https://tg.wordpress.org/plugins/mage-enabler/#description)
 * [Reviews](https://tg.wordpress.org/plugins/mage-enabler/#reviews)
 *  [Installation](https://tg.wordpress.org/plugins/mage-enabler/#installation)
 * [Development](https://tg.wordpress.org/plugins/mage-enabler/#developers)

 [Support](https://wordpress.org/support/plugin/mage-enabler/)

## Description

This plugin links your Magento installation and WordPress by instantiating the Magento’s
Mage object. It is done by using PHP `require_once` of the file `Mage.php` supplied
by Magento. By doing this, the administrator will be able to pull and push information
to/from the Magento. This requires a working Magento setup prior to installation
of this plugin. At the moment, Mage object can be used to non-admin pages such as
themes.

#### Is this plugin for you?

If you know how to program using PHP with basic knowledge of object oriented programming
and familiar with Magento, then yes, this plugin is for you. The plugin, once activated,
gives you a raw access to the Mage object which you can use to access Magento methods
within WordPress and do stuff like [single login](http://mysillypointofview.richardferaro.com/2010/04/08/how-to-use-magentos-session-within-wordpress/),
[pull templates from Magento](http://mysillypointofview.richardferaro.com/2010/07/03/how-to-add-magento-blocks-css-and-javascript-to-an-external-site/),
display categories, [products](http://mysillypointofview.richardferaro.com/2010/06/04/add-a-product-with-custom-options-into-magento-cart-from-external-site/)
and checkout from your blog and many [more](http://docs.magentocommerce.com/). It’s
basically extending the ecommerce function of Magento to your WordPress blog.

#### This plugin is not for you if:

 * You want to display your WordPress blog within your Magento shop (Go to Magento
   Connect instead)
 * You don’t know how to program using PHP
 * You have no idea what Magento is

Please do take some time to rate the plugin as well as fill in the information needed
in the compatibility section. It would be great if you can share your site (only
if you’re allowed to do so) which uses this plugin but it is optional though.

## Screenshots

 * [[
 * Folder structure in installing the plugin
 * [[
 * Mage Enabler running in WordPress version 2.9.2
 * [[
 * Mage Enabler running in WordPress version 3.0-beta1
 * [[
 * Mage Enabler running in WordPress version 3.0-beta2
 * [[
 * Mage Enabler running in WordPress version 3.0 ‘Thelonious’

## Installation

 1.  Fix the function collision problem between Magento and WordPress by doing the 
     following:
 2.  Copy the file `functions.php` from your Magento core folder which can be found
     in:
 3.      ```
             /magento/app/code/core/Mage/Core/functions.php 
         ```
     
 4.  and paste it in the directory below (create the directory if necessary) and open
     the file for editing.
 5.      ```
             /magento/app/code/local/Mage/Core/functions.php
         ```
     
 6.  Locate the `function __()` or go to line 93. The function is similar to the one
     below:
 7.      ```
             function __() 
             { 
                 return Mage::app()->getTranslator()->translate(func_get_args()); 
             }
         ```
     
 8.  replace it with this:
 9.      ```
             if (!function_exists('__')) {
                 function __()
                 {
                 return Mage::app()->getTranslator()->translate(func_get_args());
                 }
             }
         ```
     
 10. Save the file and close it.
 11. Upload `mage-enabler` folder to the `/wp-content/plugins/` directory or use the`
     Add New -> Upload` option in the Administration panel.
 12. If you use FTP to upload the plugin, activate the plugin through the ‘Plugins’
     menu in WordPress. If you use the `Add New -> Upload` option, just click the Activate
     link provided after the plugin’s installation. A menu will be added under `Settings`
     tab labeled as `Mage Enabler`.
 13. Go to the Mage Enabler admin page in WordPress and supply the absolute URL of 
     the file `Mage.php` from Magento
 14. Click Save button. One of the messages below will shows upon saving the settings:
 15.  * Invalid URL – This means your file `Mage.php` can’t be found using the URL 
        you entered.
      * File is accessible! – You have supplied a valid URL.
      * Mage object not found! – Check your cookie settings. Your browser should be
        configured to accept cookies.

## FAQ

  How to use this plugin?

Check my blog for an example [here](http://mysillypointofview.richardferaro.com/2010/05/11/mage-enabler/)

  What Magento methods can I use?

Check the [Magento documentation](http://docs.magentocommerce.com/)

  My website appears blank after I turn on the plugin

It means there’s an error in your code. Set your PHP error_reporting to E_ALL and
refresh the page so you can see what’s causing the error.

  I already set my PHP error reporting to display all errors in .htaccess but still
my page remains blank

Try placing the `error_reporting(E_ALL)` without quotes at the top of the actual
file you’re working on then reload the page.

  I get ‘Cannot send session cookie – headers already sent by…’ error

Try placing your `Mage::getSingleton(...)` call at the top of your PHP file to prevent
this error from taking place.

  I’m getting the ‘The plugin does not have a valid header’ error

Check the [screenshots](https://wordpress.org/extend/plugins/mage-enabler/screenshots/)
area on how to setup the folder structure properly

  I’m getting a ‘Decoding failed: Syntax error’ or ‘An error occurred while saving
the attribute set’

You might wanna take a look at what [John LeBlanc](https://wordpress.org/support/profile/johnleblanc)
did [here](https://wordpress.org/support/topic/plugin-mage-enabler-workaround-for-inability-to-edit-magento-products-and-attribute-sets?replies=3).

Thanks John 🙂

  My question isn’t answered here

Please post it to the [WordPress support forum](https://wordpress.org/tags/mage-enabler/)
and tag your post with «mage-enabler».

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Mage Enabler” is open source software. The following people have contributed to
this plugin.

Contributors

 *   [ Richard Feraro ](https://profiles.wordpress.org/richardferaro/)

[Translate “Mage Enabler” into your language.](https://translate.wordpress.org/projects/wp-plugins/mage-enabler)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/mage-enabler/), check
out the [SVN repository](https://plugins.svn.wordpress.org/mage-enabler/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/mage-enabler/) by
[RSS](https://plugins.trac.wordpress.org/log/mage-enabler/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.2.2

 * Fixed: Fatal error or blank screen (for those with error_reporting turned off)
   when determining the plugin url in `view.php` file.

#### 1.2.1

 * Fixed: Sample and Related Posts not appearing due to `simplexml_load_file()` 
   not allowed by default server configuration.

#### 1.2

 * Changed: Moved the Mage Enabler tab to `Settings -> Mage Enabler`
 * Fixed: Fatal error when no ‘default’ store code is configured [see comment #659](http://mysillypointofview.richardferaro.com/2010/05/11/mage-enabler/#comment-659)
 * Updated: Page layout and added reference for examples and related posts
 * Added: Auto-detect store configuration

#### 1.1.1

 * Fixed fatal error during xmlrpc calls [see comment #417](http://mysillypointofview.richardferaro.com/2010/05/11/mage-enabler/#comment-417).
   Thanks [mik](http://lexiamatic.wordpress.com) for the feedback.

#### 1.1

 * Fixed fatal error when URL value provided is a directory
 * Added WordPress 3.0 screenshot-5.png sample output

#### 1.0

 * Initial commit for Mage Enabler plugin

## Meta

 *  Version **1.2.2**
 *  Last updated ** 14 сол ago**
 *  Active installations **10+**
 *  WordPress version ** 2.9.2 or higher **
 *  Tested up to **3.4.2**
 *  Language
 * [English (US)](https://wordpress.org/plugins/mage-enabler/)
 * Tags
 * [ecommerce](https://tg.wordpress.org/plugins/tags/ecommerce/)[magento](https://tg.wordpress.org/plugins/tags/magento/)
   [session](https://tg.wordpress.org/plugins/tags/session/)
 *  [Advanced View](https://tg.wordpress.org/plugins/mage-enabler/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/mage-enabler/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/mage-enabler/reviews/)

## Contributors

 *   [ Richard Feraro ](https://profiles.wordpress.org/richardferaro/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/mage-enabler/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4YNMXBEXWQWA)