Integrate WordPress Blog into Magento Ecommerce Shopping Cart using Lazzymonks WordPress Integration 2.61 Extension
Successfully installed Oct 21, 2008
Application versions: Magento 1.1.6 & WordPress 2.6.2
Hosted on 1&1 Internet

This extension adds the ability to integrate WordPress blog into Magento.
It has adjustable page layout from with in the WordPress admin menu.
Wordpress menu can be set to show in the left column, right column, both or neither.
A link in the Magento footer can be enabled or disabled.
And the page title can also be set.
When everything is setup, separate WordPress login and Magento login is still required to operate each application.

1. Install working version of Magento Ecommerce first

2. Upload WordPress directory into a Magento sub-directory called “wordpress” (magento/wordpress)

3. Add Magento’s DB info to WordPress’s wp-config.php file (this is the same MySQL database that all the Magento files are already in – you’ll be mixing the WordPress files in with the Magento files in the pre-existing Magento database)

4. Acquire the Lazzymonks WordPress Integration 2.61 Extension “key” from Magento Connect. The “key” is currently called: magento-community/Mage_Blog

5. In Magento’s admin, go to the Magento Connect Manager (System > Magento Connect > Magento Connect Manager), login in again, click on the Settings tab and change the Preferred State to “beta”

6. Click on the Extensions tab and paste “magento-community/Mage_Blog” (without the quotes) into the “Paste extension key to install:” box and click Install. (The new WordPress integration extension should show up at the bottom of the page)

7. Click on the Settings tab again and change the Preferred State back to “stable”

8. Go back to Lazzymonks WordPress Integration 2.61 Extension page and follow the instructions starting about half-way down the page (or see #9 below, which is taken from Lazzymonks page)

9. Two of the following files and the theme folder can be found in the Magento base directory, in a folder called “wordpress_module_files” (this folder was installed in Magento’s base directory during the WP Integration extension installation in the Magento Connect Manager). Copies of these files, with “some” of the changes already applied, are included in the extension files (which are in the “wordpress_module_files” folder). These files, however, should be used with caution – double-check all of these files in the “wordpress_module_files” folder against what Lazzymonk recommends on his Magento extension Web page (http://www.magentocommerce.com/extension/296/lazzymonks-wordpress-integration)

9.1. Find index.php in the root of your Magento installation and find the following line of code:

require_once $mageFilename;

And add the following after it:

define(‘WP_USE_THEMES’, true);
require(‘./wordpress/wp-blog-header.php’);

(You will need to be sure that the second line points to the location of your WordPress installation, as it is, it assumes WordPress is installed in the Magento directory.)

9.2. In wordpress/wp-settings.php find the following lines of code and remove the & symbol

Around line 399 (line 472 in WP v2.6.2):

$wp_the_query =& new WP_Query();

Around line 414 (line 487 in WP v2.6.2):

$wp_rewrite =& new WP_Rewrite();

Around line 421 (line 494 in WP v2.6.2):

$wp =& new WP();

Around line 456 (line 530 in WP v2.6.2):

$wp_locale =& new WP_Locale();

9.3 Also in wordpress/wp-settings.php remove or comment out the following lines, around line 386 (line 459 in WP v2.6.2):

// Escape with wpdb.
$_GET = add_magic_quotes($_GET );
$_POST = add_magic_quotes($_POST );
$_COOKIE = add_magic_quotes($_COOKIE);
$_SERVER = add_magic_quotes($_SERVER);

9.4. In wordpress/wp-includes/l10n.php at line 116

Change:

function __($text, $domain = ‘default’) {
return translate($text, $domain);
}

To:

if (!function_exists(‘__’)) {
function __($text, $domain = ‘default’) {
return translate($text, $domain);
}
}

9.5. Now, on to the WordPress part: Copy the “magento” theme in the wordpress_module_files/wordpress-theme folder into the wordpress/wp-content/themes folder.

9.6. Log into the admin panel of WordPress and click the “settings” link. Then, change the “Blog address (URL)” to: http://yoursite.com/magento/blog (or, change it to fit your site), but leave the “blog” directory part in the URL. Save settings. Then, click the permalinks tab and ensure that permalinks are set to default. Finally, click on the “design” link and select the WordPress Magento theme installed in step 9.5.

9.7. Now go to http://yoursite.com/magento/blog to access the blog. Mine is actually located at http://www.aqwearium.com/blog, without the extra magento directory in the URL

10. Configuring the WP Integration in Magento’s back-end admin: System > Configuration > Blog (under the General tab in the left-hand menu)