Magento

eCommerce Software for Online Growth

Magento Forum

From setting up your store to managing your products, pages and promotions to generating detailed reports, the Magento User Guide empowers the user to utilize the platform for all of its vast capacity.
Available in eBook and Print formats – Download Now!!!
   
Page 1 of 2
revised instructions for 2.7.1 and 1.3.2.1
 
mk2dev
Member
 
Total Posts:  35
Joined:  2008-08-07
Chicago, IL
 

We are using the above combo and the instructions need changes to reflect new line numbers and a check on the wordpress inclusion in index.php

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

if (strstr($_SERVER[’REQUEST_URI’], “/wordpress/")) {
define(’WP_USE_THEMES’, true);
require(’./wordpress/wp-blog-header.php’);
}

Note the “/wordpress/”. Make that match where ever the public sees the blog. Putting it in the REQUEST_URI resolves the page 2 issue that people were having when you paginated the products page on magento and you have an active ‘page’ in the wordpress CMS.

you will need to be sure that the second line points to the location of your wordpress installation, as it is, it assumes wordpress in installed in the magento directory.

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

Line 520

$wp_the_query =& new WP_Query();

Line 535

$wp_rewrite =& new WP_Rewrite();

Line 542

$wp =& new WP();

Line 578

$wp_locale =& new WP_Locale();

also in wordpress/wp-settings.php remove or comment out the following lines

Line 507

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

3. In wordpress/wp-includes/l10n.php at line 112

change

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

to

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

4. now to the wordpress part. copy the theme in wordpress_module_files/wordpress-theme into wordpress\wp-content\themes

5. log into the admin panel of wordpress and click settings. then change the “Blog address (URL)” to http://yoursite.com/magento/blog change to fit your site, but leave the blog part. Save settings then Click permalinks. Ensure permalinks are set to default. Finaly goto design and select the magento theme installed in step 4.

6. now go to http://yoursite.com/magento/blog to access the blog.

 Signature 

mk2dev.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1187
Joined:  2007-12-14
Illinois, USA
 

Thanks for this, I was trying to troubleshoot the index.php file but you saved me the time!

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extension: Pickup at Event/Multiple Flatrates

 
Magento Community Magento Community
Magento Community
Magento Community
 
m4e
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2009-03-31
 

Additionally:
You should fix your app/code/community/Mage/Blog/Model/Layouts.php :
‘global/cms/layouts’ => ‘global/page/layouts’

foreach (Mage::getConfig()->getNode('global/page/layouts')->children() as $layoutConfig{

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1187
Joined:  2007-12-14
Illinois, USA
 

Did either of you have problems with your sidebar not appearing after doing this?

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extension: Pickup at Event/Multiple Flatrates

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1187
Joined:  2007-12-14
Illinois, USA
 

The error is showing up on any magento pages:

Fatal error: Call to undefined function is_404() in /app/design/frontend/default/gladrag/template/blog/menu.phtml on line 28

While the sidebar works fine on any blog pages. Any ideas?

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extension: Pickup at Event/Multiple Flatrates

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1187
Joined:  2007-12-14
Illinois, USA
 

It also doesn’t like this code:

<?php include (TEMPLATEPATH '/searchform.php'); ?>

from the menu.phtml file. It worked fine previously.

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extension: Pickup at Event/Multiple Flatrates

 
Magento Community Magento Community
Magento Community
Magento Community
 
symmetrics GmbH
Member
 
Avatar
Total Posts:  41
Joined:  2009-06-15
Hannover, Germany
 

Is there any chance the support for the module is continuing?
Seems a bit outdated.
I also don’t like the fact to modify the Magento core files.

 Signature 

Magento Enterprise Partner symmetrics gmbh, Hannover

Magento Enterprise, Magento SaaS, Magento Hosting

 
Magento Community Magento Community
Magento Community
Magento Community
 
govind123
Jr. Member
 
Total Posts:  4
Joined:  2009-06-14
 

Hi,

I have made all the changes given above. I could see the blog in the magento home page right sidebar. However if I click the blog link it will take to me blank page . I don’t know where I am wrong. Please give me your solution for this issue.

Regards,
Govind

 
Magento Community Magento Community
Magento Community
Magento Community
 
symmetrics GmbH
Member
 
Avatar
Total Posts:  41
Joined:  2009-06-15
Hannover, Germany
 

Please notice that the url in the 1. line in the 1. step has to be similar to the url in the 5. step. (/blog and /blog, not /wrdpress and /blog as described).

If it still doesn’t work please doublecheck all the instructions in the first and third post.
The line numbers may be different!
I used Wordpress 2.8 and nearly every line specification was “wrong”.

 Signature 

Magento Enterprise Partner symmetrics gmbh, Hannover

Magento Enterprise, Magento SaaS, Magento Hosting

 
Magento Community Magento Community
Magento Community
Magento Community
 
govind123
Jr. Member
 
Total Posts:  4
Joined:  2009-06-14
 

Thanks. Now its working fine. I have another doubt. Can we integrate Wordpress admin into magenta admin?  Is it possible to integrate both admin modules.

 
Magento Community Magento Community
Magento Community
Magento Community
 
symmetrics GmbH
Member
 
Avatar
Total Posts:  41
Joined:  2009-06-15
Hannover, Germany
 

"Impossible is nothing” to quote some advertising…
You just have to write a module which adds some functionality to the magento backend. The wordpress database structure is really easy.

INSERT INTO wp_posts
should do the job.

sherrie - 12 June 2009 12:04 PM

The error is showing up on any magento pages:

Fatal error: Call to undefined function is_404() in /app/design/frontend/default/gladrag/template/blog/menu.phtml on line 28

While the sidebar works fine on any blog pages. Any ideas?

Having the same problem right now.
I assume its a problem with the path/skin/template. Using the enterprise edition?

Fatal errorCall to undefined function is_404() in /var/www/shop/app/design/frontend/default/default/template/blog/menu.phtml on line 28

//Edit:
Here’s another thread with the same problem (404):
http://www.magentocommerce.com/boards/viewthread/38528/

 Signature 

Magento Enterprise Partner symmetrics gmbh, Hannover

Magento Enterprise, Magento SaaS, Magento Hosting

 
Magento Community Magento Community
Magento Community
Magento Community
 
govind123
Jr. Member
 
Total Posts:  4
Joined:  2009-06-14
 

Awesome quote..Even I am new to Magento. I have been started since last Monday. I couldn’t find how to create the custom modules in Magento. Do you have any document or tutorial or sample code to do this. It would be helpful to integrate Wordpress admin into Magento admin. Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
spread
Member
 
Total Posts:  32
Joined:  2009-04-27
 

When installing the module in the Magento Connect admin, shouldn’t that installation set up a Wordpress folder in the root folder? I don’t find that folder and neither the files that should be modified according to this discussion. Can anyone make a screencast of this? I would pay for something like that as I’ve heard that the Lazzymonk pluggin is the best blog plugin for Magento. Is there anything else I could use instead of Lazzymonk/Wordpress?

Forever grateful for the one that can help me!

Best regards,
Christoffer

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1187
Joined:  2007-12-14
Illinois, USA
 

You have to install wordpress separately, it doesn’t come with the extension. Go to www.wordpress.org to download the files. Hope that helps!

 Signature 

Creativity is falling in love with the world. – Dewitt Jones
Community Extension: Pickup at Event/Multiple Flatrates

 
Magento Community Magento Community
Magento Community
Magento Community
 
spread
Member
 
Total Posts:  32
Joined:  2009-04-27
 

Thanks! Found it!

Let’s see if I can do it this time. Just a short question. The index.php-file that should at first be modified with adding that code. Is that the Magento index.php file that lies in the Magento root folder or the Wordpress installation folder?

Thank you for allt the help!

Best regards,
Christoffer

 
Magento Community Magento Community
Magento Community
Magento Community
 
spread
Member
 
Total Posts:  32
Joined:  2009-04-27
 

Solved below by correcting the php code as my text editor didn’t copy the right characters from the webbrowser into the code.

I have done everything that is written above but I end up with this error message. Does anyone know what causes this problem? I don’t have the default Magento theme but a custom made one.

---------------------------------------------------------

Cannot send headers; headers already sent in /var/www/index.php, line 58
Trace:
#0 /var/www/lib/Zend/Controller/Response/Abstract.php(114): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /var/www/app/code/core/Mage/Core/Model/App.php(1181): Zend_Controller_Response_Abstract->setHeader(’Content-Type’, ‘text/html; char...’)
#2 /var/www/app/code/core/Mage/Core/Controller/Varien/Front.php(80): Mage_Core_Model_App->getResponse()
#3 /var/www/app/code/core/Mage/Core/Model/Url/Rewrite.php(171): Mage_Core_Controller_Varien_Front->getResponse()
#4 /var/www/app/code/core/Mage/Core/Controller/Varien/Front.php(147): Mage_Core_Model_Url_Rewrite->rewrite()
#5 /var/www/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch()
#6 /var/www/index.php(70): Mage::run()
#7 {main}

---------------------------------------------------------

Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 2
 
© Copyright 2010 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
177522 users|1154 users currently online|277044 forum posts