Call-back icon  Enterprise Sales: +1.310.775.2674 (N. America)   +44 20.3286.4137 (UK)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Page 1 of 2
Error after configuring Wordpress Integration
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

After installing the extension via Magento Connect, I followed the configuration steps for changing the files.
I enabled the Magento theme in Wordpress admin.
I enabled the blog and the settings in the Magento admin, Configuration.

As my last step, I copied over the updated index.php file to my Magento directory. When I try to load the main site, http://heritagefineart.com/shop, I receive the following error:

Cannot send headersheaders already sent in /home/heritcom/public_html/shop/wordpress/wp-config.phpline 15
Trace
:
#0 /home/heritcom/public_html/shop/lib/Zend/Controller/Response/Abstract.php(114): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Model/App.php(983): Zend_Controller_Response_Abstract->setHeader('Content-Type', 'text/html; char...')
#2 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Controller/Varien/Front.php(72): Mage_Core_Model_App->getResponse()
#3 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Model/Url/Rewrite.php(137): Mage_Core_Controller_Varien_Front->getResponse()
#4 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Controller/Varien/Front.php(139): Mage_Core_Model_Url_Rewrite->rewrite()
#5 /home/heritcom/public_html/shop/app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/heritcom/public_html/shop/index.php(44): Mage::run()
#7 {main}

Magento is installed in /shop
Wordpress is installed in /shop/wordpress

Here is the snippet from my Magento index.php file:

require_once $mageFilename;
/* --- BEGIN EDIT FOR MAGE-BLOG EXTENSION */
define('WP_USE_THEMES'true);
require(
'wordpress/wp-blog-header.php');
/* --- END EDIT FOR MAGE-BLOG EXTENSION */

My site is live, so I am using the old index.php file at the moment.... any help or ideas of what is happening would be greatly appreciated!
Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
wasa1977
Jr. Member
 
Total Posts:  4
Joined:  2008-06-07
 

Hi,

I also try hard to see it working and suceeded with some tricks! Despite those problems of integration, I have to tell this is a great job from LazzyMonks! Many thanks!

For my part, I follow the configuration steps also. And as many of us, I get a blank screen on the home page of my demo site.

Here are the steps to see it working (on a demo site), hope this could help:

Here is my magento configuration:
- For me the magento root dir is: http://www.example.com/magento
- My wordpress directory is in my magento directory (ie.: http://www.example.com/magento/wordpress)
- All configuration steps were done as LazzyMonks wrote. (i.e I did all steps before finding the solution so this is the starting point from my explanation wink)

So:

1. Into the index.php in the root of your magento installation:
- Find

define('WP_USE_THEMES'true);
require(
'wordpress/wp-blog-header.php');

Replace by:

require('wordpress/wp-blog-header.php');

(I got a bug with the previous configuration so that I can’t connect anymore to my admin?)

2. Create in your magento directory a new directory named: blog
3. Copy then paste the index.php from your magento directory to the blog directory
4. Modify the index.php file in the blog directory like this:
- Find:

$mageFilename 'app/Mage.php';
- Replace by:
$mageFilename '../app/Mage.php';

- Find:

echo "app/Mage.php not found";
- Replace by:
echo "../app/Mage.php not found";

- Find:

require_once $mageFilename;
require(
'wordpress/wp-blog-header.php');
- Replace by:
require_once $mageFilename;
define('WP_USE_THEMES'true);
require(
'../wordpress/wp-blog-header.php');

5. Into the Magento Admin, Go to CMS->Manage Pages->Home Page. In the left menu click on Custom Design. If you have already some XHTML code uncommented:
- Find:

<reference name="content">
after add:
<block type="core/template" name="blog" template="blog/blog.phtml"/>

Or If you didn’t uncomment the XHTML code then, at the end, add:

<reference name="content">
<
block type="core/template" name="blog" template="blog/blog.phtml"/>
</
reference>

Save the configuration and that’s it, you can go to your home page and see all your wordpress posts!!! Not very strict but this can help testing the extension!

Hope this is enough clear!

Now trying to put the code in another page than home page and fix footer link too wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

could someone post a link to the site having a problem. its hard for me to tell the problem without having a good look.

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

Sorry, I included the link above, but didn’t “link” it. But, I don’t have everything activated right now because it’s a LIVE site.

It’s http://heritagefineart.com/shop

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

@ wasa1977,

I tried your changes, but unfortunately was still having the same problem :(

Actually reading my error messages wink I made the following changes to remove the errors:

In wp-config.php

Before:

// Enable the WordPress Object Cache:
define(ENABLE_CACHEtrue);

After:

// Enable the WordPress Object Cache:
//define(ENABLE_CACHE, true);

In wp-settings.php

Before:

$wp_locale =& new WP_Locale();

After:

$wp_locale = new WP_Locale();

So, now my errors are gone, but the blog is not showing up anywhere… and when I try http://heritagefineart.com/shop/blog/ it just goes to the shop home page. In viewing the source files, I don’t see any hint of wordpress anywhere....

I’m using a custom theme, do I need to do anything special in my files to get the blog portions to show up??

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

your second change is one of the steps detailed in the instructions. As for your first change. i will see if it causes and problems for other installs and if its ok ill include it in the next release.

As for just showing the home page. have you removed wasa1977s changes?

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

Sorry, I had missed that one line in the original instructions.

And no, I didn’t remove the wasa1977s changes… do I need to remove ALL of them?

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

Okay, I backed out all of wasa1977s changes, but I still don’t get any blog content showing up.

What’s next?

Thanks! smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

the only thing i can really suggest is that you go through and recheck all the steps have been done correctly, that the blog url in wordpress is set correctly (which would be http://heritagefineart.com/shop/blog/) and that you have wordpress set to use the magento theme.

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

another thing you can try is creating a cms page (called anything you like) and add the following code as the page content.

{{block type="core/template" name="home.blog" alias="blog" template="blog/blog.phtml"}}

this will display the module as a block then. if that shows wordpress content then it narrows down the problem a little.

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

Yes, I double-checked all changes in your instructions. Sorry this is long, but trying to put all the info I can…

ALL of my WordPress plugins are disabled, to help narrow things down.

Hm, weird. In the admin, when I try to add a new CMS page by clicking the + Add New Page, it takes me to one of my blog pages (http://heritagefineart.com/shop/blog/events/new-beginnings)—or tries to and shows a 404 not found… I tried this in both IE7 and FF.

When I click the “About Us” link in the footer, it is now trying to go to: http://heritagefineart.com/shop/blog/about-us --? (Yes, I have an about us page in my blog, but why would the footer link change in Magento?) In the Admin, Configuration, I set Enable Footer Link to No and refreshed the Cache. Still same problem.

I tried adding your code to the bottom of the content of my customer service page, I got the following error when I tried to view the page:

There has been an error processing your request.WarningMage_Core_Block_Template::include(/home/heritcom/public_html/shop/app/design/frontend/heritage/default/template/blog/blog.phtml[function.Mage-Core-Block-Template-include]failed to open streamNo such file or directory  in /home/heritcom/public_html/shop/app/code/core/Mage/Core/Block/Template.php on line 131
Trace
:
#0 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Block/Template.php(131): mageCoreErrorHandler(2, 'Mage_Core_Block...', '/home/heritcom/...', 131, Array)
#1 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Block/Template.php(131): Mage_Core_Block_Template::fetchView()
#2 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Block/Template.php(163): Mage_Core_Block_Template->fetchView('frontend/herita...')
#3 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Block/Template.php(180): Mage_Core_Block_Template->renderView()
#4 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Core_Block_Template->_toHtml()
#5 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Model/Email/Template/Filter.php(56): Mage_Core_Block_Abstract->toHtml()
#6 /home/heritcom/public_html/shop/lib/Varien/Filter/Template.php(122): Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#7 /home/heritcom/public_html/shop/app/code/core/Mage/Cms/Block/Page.php(75): Varien_Filter_Template->filter(Array, Array)
#8 /home/heritcom/public_html/shop/app/code/core/Mage/Core/Block/Abstract.php(554): Mage_Cms_Block_Page->_toHtml('

Okay, so I’m missing some files. I have now copied over the following files from default to heritage:
- /app/design/frontend/default/default/layout/blog.xml to /app/design/frontend/heritage/default/layout
- /app/design/frontend/default/default/template/blog/ (directory and files) to /app/design/frontend/heritage/default/template

What other files do I need to copy or changes in the standard files do I need to make?
Do I need to make some of the changes outlined in this thread?
http://www.magentocommerce.com/boards/viewthread/8736/

After I copied over those files, I re-added the code to the bottom of the Customer Service page and it now shows the following:

Not Found
Sorry
but you are looking for something that isnt here.
I’ve left the code in the page for now…

The other thing I noticed is that the index.php in the magento wordpress theme is blank. Is is supposed to be blank??

Finally, the .htaccess file in my /shop/wordpress directory contains the following. Could it be causing problems?

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase 
/shop/wordpress
RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
. /shop/wordpress/index.php [L]
</IfModule>
# END WordPress

Thank you for your help! smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

do you have translate inline turned on?

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

also try copying the blog folder from app/design/frontend/default/default/template
to /app/design/frontend/heritage/default/template/

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

No, I don’t have Translate Inline turned on… I don’t know what that is, should I turn it on?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

Anyone having problems with this module please ensure you have permalinks disabled in wordpress !

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  70
Joined:  2008-02-07
 

I was JUST about to give up.

I think it was the magento index.php file.

Before:

require_once $mageFilename;
define('WP_USE_THEMES'true);
require(
'wordpress/wp-blog-header.php');

After:
require_once $mageFilename;
define(’WP_USE_THEMES’, true);
require(’./wordpress/wp-blog-header.php’);

Now.... to change what shows up in the Blog menu in Magento… edit menu.phtml in \app\design\frontend\default\default\template\blog

Thanks!

--> Update: just in case you take a look at my site… I have temporarily disabled the Blog… I need a way to get my plugins to work before I enable it again… fyi

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