ECommerce Insights Blog

Stay on top of it all and get ahead with useful articles, how-tos, tips and tricks on e-commerce.

Magento WordPress Integration Plugin Surfaces In Market

Vento - Magento Theme-0

Here is a good news for all WordPress lovers who find it hard to work with Magento. The Magento WordPress Integration plugin for WordPress primarily allows you to initiate an instance of your local Magento installation in your WordPress theme. This allows you to communicate with your Magento store to bring in certain elements that are usually unavailable, such as the mini shopping cart, navigation, logos, static blocks, and more.

Using the Magento WordPress Integration plugin you will be able to add any Magento blocks to your WordPress theme – including ones you have created yourself and static blocks created through the Magento admin area.

The Magento WordPress Integration plugin also allows you to show any number of Magento products in a WordPress post or page, with the ability to add simple products straight to the Magento shopping cart.

Key Features Of Magento WordPress Integration Plugin

  • Bring out any of the default Magento Blocks in your WordPress theme.
  • Bring out any Magento blocks that you have created yourself.
  • Bring out any static blocks that you have made in your Magento admin area.
  • Choose which toplinks to show (if you are using that block).
  • Choose which javascript and css files to load in your WordPress theme.
  • Add additional javascript and css files from you Magento installation.
  • Show Magento products on a WordPress post or page by entering a list of comma separated SKUs into the field provided in the post/page editors.
  • Use the options provide in the plugin settings to style the products that are shown on posts/pages.

Download it here

Installation Instructions

This first step is massively important, and cannot be missed out.

  1. Deactivate a Magento function that conflicts with one in WordPress.
    1. Navigate to ~/your-magento/app/code/core/Mage/Core/functions.php
    2. Duplicate that file and place the new version in ~/your-magento/app/code/local/Mage/Core/functions.php – this file will now be used over the original, and will remain during Magento upgrades.
    3. Open the newly created file and browse to around line 90, where you will find this:
      function __()
      {
      	return Mage::app()->getTranslator()->translate(func_get_args());
      }
      
    4. Replace the above line with:
      if(!function_exists('__')) {
      	function __()
      	{
      		return Mage::app()->getTranslator()->translate(func_get_args());
      	}
      }
      
    5. Upload the file to your server, and you are done!

Now that we have that out the way, let’s move on to the good stuff. You can either download the plugin manually from the WordPress Plugin Directory, or browse to Plugins » Add New in your WordPress admin area, then search for “Magento WordPress Integration”.

  1. Install the plugin as described above.
  2. Activate the plugin. There will be a message reminding you to remove the __() function from Magento. If you have already done so, please ignore the message.
  3. Click Mage/WP in your side bar.
  4. Under the Initial Setuptab, you will need to enter the details of your Magento store.
    1. The first field requires the path to your Magento installation – this needs to be on the same domain as your WordPress installation, and must be entered from the root (i.e. it will start with a forward slash – for example: /shop).
    2. The second field requires the name of Magento theme or package – For example, if you are using the modern theme, just enter modern. If you have installed a new package, then enter package-name/theme-name.
    3. The third field needs to be the store view code of the Magento store that you want to get blocks and data from. If you haven’t specifically renamed or made any new Magento store views, then just leave this as default.
  5. Once you have done the above, you can move on the other tabs. Each of these tabs contains usage instructions and should be pretty workable. If you have any issues just let me know.

Setting the cookie paths in Magento can help to solve any issues regarding customer session data between platforms – Go to your Magento admin area. Navigate to System » Configuration » Web » Session Cookie Management. Set the Cookie Path to / and the Cookie Domain to .yourdomain.com.

>How To Use

Usage instructions can be found in the settings under each tab, there is also a tab entitled Usage, which describes how to bring out the default Magento blocks.

The plugin basically provides little PHP snippets that you can the use in your WordPress theme to bring out the required blocks. For example:


The above will echo the Magento welcome message.

For more information visit plugin’s author site.

I would love to hear your thoughts on this plugin, please leave me a comment and let me know. Subscribe our RSS to receive latest Magento news and updates.