Home

Embedding WordPress into OS Commerce Part II

– It has been almost twelve months since I published my first tutorial on embedding WordPress into OS Commerce. At the time, I was relatively new to working with OSC, so I was unaware of the many different template modules available for the software. Through the comments on my post, I learned that the OSC install that I was working with used the Basic Template Structure (BTS). However, people inquired about adjusting my tutorial for use with the Simple Template System (STS). Still more persons asked questions pertaining to default installs of OSC MS2.2.

osc_wordpress.jpgKeeping all of these comments in mind, this month I put together a default install of OSC MS2.2 with an integrated WordPress blog. What follows is a step-by-step tutorial (with the novice in mind) showing you how to do this. For the many people who are looking for an effective way to integrate OS Commerce and WordPress, I hope this tutorial proves to be a valuable and effective contribution to the OSC Community.

  1. First, you will need to install OSC MS2.2 on your web server. This tutorial will assume that your OSC install is located in the default location for a typical OSC install: http://yourdomain.com/catalog/.
  2. Next, install WordPress in the /catalog/ directory (i.e. http://yourdomain.com/catalog/wordpress/). Once you’ve installed WordPress, login to your WordPress admin and set Options > General > Blog address (URI) to “http://yourdomain.com/catalog/blog.php” (Note: If you would prefer to have your blog file named something other than blog.php, be sure to set this value accordingly and rename the file that you upload in step 4).
  3. Now, just after the opening comments of the /catalog/includes/application_top.php file, add the following PHP code:
    // turn off WordPress themes and include the WordPress core:
    define('WP_USE_THEMES', false);
    require('./wordpress/wp-blog-header.php');
  4. Next, download these two files (blog.php and stylesheet.blog.css) and place them in the root of your OSC install.

Additional Refinement: Displaying Blog Headlines on your Catalog Homepage
For added functionality, here are instructions for including a WordPress static page and blog headlines on the homepage of your OSC store:

  1. Before making this edit, you’ll want to make a backup of your default OSC homepage by renaming the file /catalog/index.php to index.ORIGINAL.php
  2. Now, download this new index.php file and upload it to your /catalog/ directory. This new index file will display your last 4 blog headlines in a column on the right of the page body. Plus, the value for TEXT_MAIN found in /catalog/includes/languages/english/index.php will display in the left column of the page body.
  3. In addition, starting on line 292 of this new index file, I have a switch inserted that will check for the presence of Vito Tardia’s Improved Include Page WordPress Plugin. If you install Vito’s plugin in WordPress, you can edit the iinclude_page() function call on line 294 to include the contents of any WordPress static page by simply editing the page ID in the function’s arguements.

Needing Additional Help?
If you’re a total novice when it comes to the web, you can hire me to perform the aforementioned services for you. At the demonstration website mentioned in this post, you can purchase one of these options:

79 Comments

  1. ShaneReply to this comment
    Oct. 12, 2006, 7:08 pm
    Permalink

    Thanks for the great tutorial! Just what I needed. :)


  2. Oct. 15, 2006, 7:45 am
    Permalink

    do we not need the language file now?


  3. Oct. 15, 2006, 6:20 pm
    Permalink

    Mike,
    You are correct. My tutorial no longer requires a language file.

    After I tracked down the errors everyone was experiencing, I realized that all these errors could be solved by removing the standard language file requirement that was found on line 15 of blog.php.

    This made sense because blog.php doesn’t require any constants from a language file. Instead, I use WordPress functions to generate such variables as the page title. Therefore, language portability issues for this file will be handled in WordPress itself.


  4. Oct. 17, 2006, 3:08 am
    Permalink

    If I wanted to run the wp blog from an existing blog or wanted to run wp and osc off the same database would I only need to edit the path in the application top code?


  5. Oct. 17, 2006, 10:30 am
    Permalink

    Mike,
    In theory, you are correct. For example, in my demonstration of this technique, I am running OSC and Wordpress off of the same database.

    Basically, when you edit the path mentioned in step 3 above, you are simply telling OSC where to find the WordPress file that is required to embed the blog. On the WordPress side of things, you would need to make sure that it is configured correctly to do what you are asking.

    In the case you mention, you would need to make sure that your Blog Address URI is set correctly as explained in step 2, and you would use the same database by specifying the same credentials in wp-config.php under your WordPress root folder.


  6. Oct. 31, 2006, 4:56 pm
    Permalink

    Hi, I’ve been wanting to do something like this with our site, but I am concerned that if someone ads a product to their shopping cart, then reads a blog item, the shopping cart becomes empty. Is there any way to have it remember what was in the shopping cart so a user can click back and forth from product pages to the blog?
    Thanks,
    Aaron


  7. finnReply to this comment
    Oct. 31, 2006, 5:35 pm
    Permalink

    thanks for your tutorial!!!
    i have one problem: the first page of my blog is integrated with my oscommerce installation, but if i click on a link, i get the normal wordpress layout for that page. What did i do wrong?


  8. finnReply to this comment
    Nov. 1, 2006, 8:39 am
    Permalink

    got it finally working with the comments of seg : http://wordpress.org/support/topic/47148


  9. Nov. 1, 2006, 12:35 pm
    Permalink

    Aaron,
    You pointed out something that I wasn’t aware of. However, after looking into the issue of the shopping cart dropping items whenever a user clicks on a blog article, I realized that this is because the permalinks to the blog do not include the OSC Session ID.

    Therefore, I went in and added the query string “?osCsid=OSC-SESSION-ID” to all the article permalinks. In addition, I added this to the links that appear in the OSC breadcrumbs.

    That addition covers most instances of the links in this integration; however, the side column links in the blog and any inline site links in blog articles do not include this variable. Therefore, I plan to write a Wordpress plugin that will append this variable to all URLs processed by Wordpress.

    In the meantime, I have updated the ZIP files associated with this tutorial to include the OSC Session ID in all blog permalinks and OSC bread crumb links.


  10. Nov. 3, 2006, 1:16 pm
    Permalink

    Fantastic! Thanks so much for this! There will be so many people interested in this once all the cart issues are solved!


  11. JoshReply to this comment
    Nov. 18, 2006, 11:37 pm
    Permalink

    Great tutorial. Thanks.

    I have successfully followed your instructions, and almost everything is working properly.

    However, I seem to be having an issue with my images.

    From blog.php, the images show up just fine (images/m07.jpg, etc.)…….but if I follow a link to any of the links on my blog’s “home” page none of the images show up (mysite.com/blog.php/?m=20061118).

    Any ideas why this could be happening? How can I fix it? Thanks.


  12. Nov. 21, 2006, 11:01 am
    Permalink

    Josh,

    Can you supply me with a link to your site? Perhaps your problem can be solved by supplying absolute URLs for your images, or your problem may have some other cause.


  13. Nov. 28, 2006, 7:52 pm
    Permalink

    Aaron,
    In regards to the shopping cart emptying when a user clicks on a link in the blog, I realized there is a better solution than what I have already discussed. Do this:

    In the OSC Admin, go to Configuration > Sessions and set “Force Cookie Use” to true. This solves the problem without having to add the OSC Session ID to the URL (furthermore, from a security standpoint, this is the preferred solution).


  14. Dec. 16, 2006, 9:45 am
    Permalink

    I had a lot of problems trying to get this working as I have ultimate seo urls installed also.

    Solved problems by reinstalling wordpress, following the instructions above and putting the blog.php -> /blog/index.php as described here.
    Michael, I now have wordpress, your code and seo ultimate urls working by starting from scratch following the instructions through again and then putting the blog.php -> /blog/index.php

    Thanks for a great piece of work
    Alistair


  15. Dec. 18, 2006, 11:44 pm
    Permalink

    Does this works with the CRELoaded ? That would definitely rock if your solution can work with CRELoaded, anyone has tested this out ?

    Thanks.


  16. Dec. 19, 2006, 9:49 am
    Permalink

    Mitamins,
    For part one of this tutorial, I used CRELoaded. Perhaps that tutorial might help you out?


  17. Dec. 19, 2006, 9:03 pm
    Permalink

    Thank you for the information, I’ll give it a try today and will see if it works out properly.

    Thanks for your help.


  18. Dec. 20, 2006, 7:06 pm
    Permalink

    I was having trouble maintaining my existing WordPress style sheet and after implementing the suggestions located at http://wordpress.org/support/topic/47148 posted by seg. Thanks for a great intergration method.


  19. Dec. 21, 2006, 5:10 pm
    Permalink

    David,
    Sorry I haven’t had time to answer your question. If I don’t find time tomorrow, I will look into it next week.


  20. RanoReply to this comment
    Jan. 19, 2007, 3:18 am
    Permalink

    Hello Michael,
    great contribution.
    I’ve done the embedding but now i’m facing to another challenge,
    how to couple the 2 databases (wordpress and osc) to have only one login for the two sites.
    I don’t want to le the commentary without registration so i would like a one account registration for the customers.

    Do you know how it’s possible?
    regards


  21. Jan. 24, 2007, 7:43 am
    Permalink

    Rano,
    I would imagine that what you’re proposing would require someone to code an additional contribution/plugin for either OSC or WordPress.


  22. RanoReply to this comment
    Jan. 29, 2007, 6:22 am
    Permalink

    Thanx for your answer Michael,

    so i think it will be difficult to find something like this :-/


  23. Jan. 30, 2007, 2:46 pm
    Permalink

    I had a problem with the edit of the application_top.php file. After following Michael’s instructions, it was not sending Credit card information through properly, when I reverted to the former ‘application_top.php’ file, everything worked okay…

    Can I get some help in making sure that I edited that file properly?


  24. Jan. 30, 2007, 3:56 pm
    Permalink

    Bill,
    See if this fixes your problem:

    In your WordPress root folder, edit the file: wp-settings.php.

    Around line 19 of this file, you should see a line which reads:

    unregister_GLOBALS();

    Comment out this line by adding a double slash to the beginning of it. Then check and see if your CC data gets passed correctly.


  25. Mar. 2, 2007, 12:32 pm
    Permalink

    Michael,
    Thanks for your work on integrating WordPress with OSC! I’ve been working on getting this set up over the past few days and appear to have most of my glitches worked out, with a few notable exceptions. First, the Page, Category, and Archive links in the side column open to blank pages (there’s probably an error message, but I’m not seeing it in IE). In addition,
    the RSS and Comments RSS links appear somewhat squirrelly as well—they both generate a “page not found” screen with an url starting with feed:http://….is that just so someone can copy the url into their feed reader, and actually working properly? Finally, I’m not following Alistair MacNeil’s post about getting Ultimate SEO Urls working with this by putting blog.php into /blog/index.php. Did he paste the code from blog.php into index.php? If you can shed any light on that it would be greatly appreciated as well. My blog page is at http://laurelcoveoutfitters.com/catalog/blog.php and I installed the latest WordPress version 2.1.1. Thanks again!


  26. GijsReply to this comment
    Mar. 14, 2007, 9:23 am
    Permalink

    This contribution is awesome. I’m currently testing this plugin locally before I will use it on my site. It’s great that even all WP plugins just work!

    - I have managed to get the wp sidebar within a oscommerce box, looks and works perfect!
    - How can i integrate blog.php inside of my index.php cause the blog is the first thing that I want users to see.
    - I will work and contribute something that will integrate the oscommerce users into the wp-blog. I thing the best idea is to let the system fully function on oscommerce users and get rid of the wp-users. So once a os commerce user logs in he /she can comment. Any suggestions would be welcome. Starting the project soon.


  27. GijsReply to this comment
    Mar. 16, 2007, 3:16 am
    Permalink

    ow, and I forgot to mention to integrate the wordpress search into oscommece since the osc search very bad and does only search products. Can somebody please help me with this?

    Thanks,


  28. Mar. 19, 2007, 2:34 pm
    Permalink

    I’m sure it’s just something little that I am overlooking, but when I do a default install of the above, my blog links are generated as such:
    http://www.yarian.com/catalog/blog.php/?p=3? to which I get an error ‘No input file specified.’
    If I copy and past it into the address bar minus the last / it works.
    http://www.yarian.com/catalog/blog.php?p=3?
    I’ve tried a couple different ways to fix this, but I am not able. Anyone point me in the right direction?


  29. Mar. 19, 2007, 3:05 pm
    Permalink

    Mark,
    What value do you have in the Wordpress Admin under:
    Options > General > Blog address (URI)


  30. Mar. 22, 2007, 12:37 pm
    Permalink

    Hi Michael,

    I’ve spent the last month or so working on a Wordpress Blog and was planning on using the WP Shopping Cart Gold (paid for) as my ecommerce solution. All of the sudden, the cart stopped updating and the plugin developers said my “AJAX was broke” and wanted to charge me a couple $100 to fix it. So, I’m looking for an easy method to integrating OS Commerce into my site without having to redo anything on the Wordpress side.

    After reviewing your material, which is good, it sounds like I may have to start from scratch by reinstalling both Wordpress and OS Commerce. So far, none of my files sit relative to how your tutorial goes. My Wordpress files sit in my root folder of mytelecomguru.com but that root folder sits in my public_html folder to another domain turner-tele.com. My OS Commerce folder sits in the root folder of the turner-tele.com. Can you make some suggestions so that I may use your tutorial given the steps you’ve outlined?

    Thank you,
    Shilo Case


  31. Mar. 22, 2007, 1:26 pm
    Permalink

    Shilo,

    Just to confirm, when you refer to having planned to use “WP Shopping Cart Gold”, is this a for pay version of WP e-Commerce Lite available at Instinct Entertainment: http://www.instinct.co.nz/?p=16 ? If your answer is no, then their shopping cart may be of interest to you as it is a Wordpress plugin and I believe that the sample installs that they link to show some promise.

    However, if the plugin that I link to above is the “lite” version of the exact plugin that is giving you problems then here is a quick overview* of what I would change in order for this tutorial to work with your install:

    1. Install OSC inside your Wordpress root folder** (If you are extracting the OSC archive on your server, then it will be inside a folder. You will need to use your FTP program to move those files from inside that folder to your Wordpress root folder.)
    2. Adjust the path settings in step 2 to match your install.
    3. Adjust the path for the Wordpress embed in step 3 to: require(’./wp-blog-header.php’);

    *Keep in mind, this is a quick overview. I haven’t actually attempted what you are proposing (i.e. installing WP and OSC in the same directory). While it is certainly possible to do this, I can’t guarantee that you won’t run into a headache or two.

    **PLEASE NOTE: Installing WP and OSC into the same folder will result in a lot of files co-mingling together. Upgrades or modifications to either your WP or OSC files could potentially be confusing.


  32. Mar. 22, 2007, 5:48 pm
    Permalink

    Thanks Michael. It is the Gold version (paid upgrade) of WP e-Commerce Lite version. I just don’t like paying for something and when it breaks being told I have to pay more. I can understand that if it was a used car but I haven’t even test drove the cart to the bank yet.

    I will give your steps above a shot and thank you for being so responsive. Let’s hope there are no headaches.


  33. Mar. 22, 2007, 6:51 pm
    Permalink

    Item 3 that references the previous item 3 gives me the following error:

    Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/turnerte/public_html/mytelecomguru/oscommerce/includes/application_top.php on line 15

    Fatal error: require() [function.require]: Failed opening required ‘./wp-blog-header.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/turnerte/public_html/mytelecomguru/oscommerce/includes/application_top.php on line 15

    I’m not a php programmer, sorry, but the path needs to move up one. Basically, require(’./url/wp-blog-header.php’). But that doesn’t work either.

    Thanks,
    Shilo


  34. stellaReply to this comment
    Mar. 22, 2007, 11:23 pm
    Permalink

    Ok, Thanks for the method.
    I first has the same problem as the above,

    like this
    http://www.yarian.com/catalog/blog.php/?p=3? to which I get an error


  35. Mar. 23, 2007, 10:40 am
    Permalink

    Shilo,
    To move up one directory use “../” (“./” = the current directory).

    Stella,
    I’ve seen the error you are talking about. I haven’t spent much time looking into it; however, the existence of that error varies among webhosts (e.g. my web server doesn’t have that problem). Therefore, I suspect that it is related to an Apache configuration. Furthermore, your suggestion to adjust the permalink structure is a good suggestion in regards to fixing this issue and SEO as well.


  36. Mar. 23, 2007, 11:10 am
    Permalink

    Excellent suggestions. Thank you.


  37. IainReply to this comment
    Mar. 23, 2007, 2:42 pm
    Permalink

    Hi ive just installed wordpress into my os and i worked fine after i put the wordpress table in to the os db.

    Ive there is now a problem with currency.

    After this

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

    My


  38. Mar. 23, 2007, 5:04 pm
    Permalink

    The latest error. It actually worked for a brief second and then clicked on a link (don’t remember which) but then it hasn’t worked since. I get the following error.

    Fatal error: main() [function.main]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "navigationHistory" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/turnerte/public_html/mytelecomguru/catalog/includes/application_top.php on line 313

    One thing came to mind. Is there a way to create a new page in WordPress and drop some code in the “Page Content” area and have the center area (product listing) of OS Commerce show up. That’s all I’m trying to do.


  39. Mar. 29, 2007, 12:12 pm
    Permalink

    The address that I am using in the Blog address is: http://www.yarian.com/catalog/blog.php


  40. Mar. 29, 2007, 12:30 pm
    Permalink

    Iain and Shilo,
    Sorry I haven’t had a chance to get back with either of you as I have been swamped in the office as of late.

    Iain,
    It appears you have some sort of charset problem. Probably a conflict between UTF-8 and ISO-8859-1. Unfortunately, I don’t have the time to look into the exact cause of your problem; however, if anyone else has successfully navigated the waters of charset conflicts with OSC and Wordpress, feel free to add a comment.

    Shilo,
    In your last paragraph, you are proposing to embed OSC into Wordpress which is the opposite of what I am doing in this tutorial. You could create a Wordpress page template to do this; however, this would take some PHP and MySQL coding to query the OSC DB tables and display the results. If you actually go about doing this, let me know.

    Mark Yarian,
    Since your last comment (#27), I have run into this same problem with one of my clients. The source of his problem was due to the fact that his site is hosted on GoDaddy, and they provide PHP as a CGI Module.

    The “No Input File Specified.” error is a known problem for installs of PHP running as a CGI Module (in addition, I read about other instances of this error with non-CGI module setups; however, in my client’s case, this seemed to be the mitigating factor).

    To fix this error, I edited the link generating functions in these two files:

    • wordpress/wp-includes/link-template.php
    • wordpress/wp-includes/category-template.php

    For the edit, I removed the “forward slash” that appeared before all instances of the query string (i.e. I removed the slash before the question mark). However, I am not sure if this edit will cause “pretty permalinks” to not work because all my client needed were the standard permalinks (i.e. ?p=123).


  41. Mar. 29, 2007, 9:02 pm
    Permalink

    Michael,

    Edit worked perfectly. Took me a few minutes to find, but I got it.


  42. Mar. 31, 2007, 11:25 pm
    Permalink

    Hi Michael,

    No worries on how long it took to get back. I got OS Commerce to show up as a page in WordPress. However, it’s far from working. I installed a plugin called runPHP. After installing and activating that, I copied the contents of the index.php from the OS Commerce main folder into a page in WordPress. There is a little checkbox in the lower left that has to be checked in order for WordPress to run the page as PHP. I had to correct a fair number of PHP errors (Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in - type errors), which were caused by where the OS Commerce directory was relative to the URL. I had to move everything back up one /../. I did get the first page of OS Commerce to show up. Unfortunately, none of the links work when I click on them because I started receiving more PHP errors similar to before. I’m pretty sure if I had the time to re-write the links (easy but monotonous), it would work. Then I would have to re-format the pages to fit with my theme since it narrows OS Commerce. If you’re interested you can visit the page at: http://www.mytelecomguru.com/?page_id=9 . When I removed the boxes on the right and re-organized the boxes on the left, it lost it’s vertical align top. Go figure, that’s the least of the worries.

    I will continue to play around with it. Thanks for you help.

    Shilo


  43. Apr. 8, 2007, 6:44 pm
    Permalink

    I want to say thank you for this. I was just about to start trying to hack out something like this myself when I figured I’d give Google a try and came across this page. You saved me hours, probably more.

    And one question… Has anyone figured out how to redirect from the /blog/ folder back to blog.php just in case a visitor gets froggy and goes to the /blog/ folder instead of clicking where they’re supposed to? I’m pretty sure it could be done with an .htaccess rule but figure somebody else may have already solved the problem.


  44. Apr. 16, 2007, 4:46 pm
    Permalink

    One more question. I’ve noticed that my Previous and Next links are going to /blog.php/blog.php/page/2/ which isn’t right. Any suggestions where to look to fix this?


  45. Jun. 26, 2007, 12:31 am
    Permalink

    Great code. Have you added a post to the osc forum? I’m having that SEO problem as well, if I add the code :

    // turn off WordPress themes and include the WordPress core:
    define(’WP_USE_THEMES’, false);
    require(’./wordpress/wp-blog-header.php’);

    the site will sometimes generate a 404 error, if i take this code out the site works perfectly again but the blog is of course not viewable.

    I am working on changing the path to catalog/blog/blog.php and adding the includes folder ( catalog/blog/includes ) so blog.php has its own application_top.php. It seems to have worked but isn’t ideal.

    Any ideas on how to get around the seo problem? is there a way to have a second application top file for wordpress in the root directory rather than in a seperate directory as i have done? cheers.


  46. Jul. 2, 2007, 1:47 am
    Permalink

    Interested in combining OScommerce and Wordpress and want to keep Wordpress’ ability to create static pages and sub categories for static pages. Will this method of combining remove that capability? Based on the description it appears as though your method removes Wordpress’ templates and uses that of OSC instead. This would lead me to believe that I would have to build the static pages in OSC or build them somewhere else and link them in.


  47. Jul. 13, 2007, 12:34 am
    Permalink

    Thanks for this tutorial. I followed the steps above but when i view blog.php i get this error:

    Fatal error: Cannot redeclare tep_show_category() (previously declared in /-path-to-my-install-/includes/header.php:154) in /-path-to-my-install-/includes/boxes/categories.php on line 13

    Any help would be much appreciated.


  48. Jul. 13, 2007, 5:06 pm
    Permalink

    Marc,
    That error indicates that the function tep_show_category() is being declared twice in your code. Open the includes/boxes/categories.php file and try commenting out the code:

    function tep_show_category(){ ... }


  49. Jul. 23, 2007, 7:16 am
    Permalink

    iain, it seems that if you change UTF-8 by ISO-8859-1 in your wordpress admin panel (Options/reading) you can resolve the problem with the characters. I test it and works.

    Michael, thank you very much for your work!

    Note: sorry about my very poor english…


  50. ValeeumReply to this comment
    Aug. 4, 2007, 4:58 pm
    Permalink

    When you disable the use of themes in the application_top.php, which files would you modify to change the way it is displayed, i.e., sidebar.php or something similar to that?? Does disabling themes force wordpress to use the default theme??

    Thanks for your help!


  51. Jan. 26, 2008, 12:56 am
    Permalink

    I love the direction this is going, but I’m having a couple problems. Could you help me figure out how to get my sidebar to work work correctly? Also, my comments are not visible, they are posting but they aren’t showing up on my blog page… any ideas?

    Hopefully you can help me, thanks!


  52. Jan. 27, 2008, 8:47 am
    Permalink

    @gautama - To get comments to display, add the following code:

    < ?php comments_template(); ?>

    Regarding the sidebar, I need to write a Part III to this tutorial that takes advantage of “widgetized” sidebars which are a part of the most recent versions of WordPress. When I wrote this tutorial two years ago, WordPress widgets were just coming onto the scene.


  53. noneReply to this comment
    Feb. 12, 2008, 2:52 pm
    Permalink

    Your Demo isn’t working!!! I’d like to see how the wordpress integration looks like!
    http://osc-wordpress.wh-demo.com/


  54. Feb. 12, 2008, 3:03 pm
    Permalink

    @none - Thanks for noticing! Your comment made me realize that I needed to make a server-side adjustment due to a recent upgrade from PHP4 to PHP5.


  55. Feb. 29, 2008, 5:06 pm
    Permalink

    Hi, I did the install, but when I finished I got this error on blog.php

    Fatal error: Call to undefined function: get_bloginfo() in /home/northcen/public_html/blog.php on line 14

    ?? :(


  56. Apr. 7, 2008, 1:03 pm
    Permalink

    Just to let you know this is exactly what I want to do and would love to see that demo ;)


  57. momotaReply to this comment
    Jun. 9, 2008, 2:46 pm
    Permalink

    everything is working, but when i update index.php with the one you provide, the last 4 blog headlines doesn’t display.

    It’s empty… any idea how to fix that?


  58. n00b0101Reply to this comment
    Jun. 19, 2008, 11:42 am
    Permalink

    I followed the instructions, but it seems there’s no css at all for my blog anymore. Is there something I should check?


  59. EmmaKReply to this comment
    Jun. 19, 2008, 11:53 am
    Permalink

    When I follow these instructions, the admin pages lose the css. I’d like it to retain it, since a non-css version is ugly and difficult to navigate. Did I miss something somewhere?


  60. Jun. 19, 2008, 2:33 pm
    Permalink

    @EmmaK - Hmm…I’m unsure of what you could have done to drop the CSS from your admin. I’ve never heard of this before.

    @n00b0101 - Check to see that stylesheet.css and stylesheet.blog.css are in the root folder of your OSC install.


  61. TinoReply to this comment
    Jun. 19, 2008, 2:34 pm
    Permalink

    Great contribution Michael. Thanks for sharing! :-)

    I had a problem though.
    Because I was using OsCommerce STS template system, and Header Tags SEO contributions. The meta tags were all the same for all blog pages.

    I have came up with a solution. Just add the code in the STS template file’s headers:

    
    <?php
    if (preg_match("/(.*)blog.php(.*)/", $_SERVER['REQUEST_URI'])) {
    	echo "<title>";
    	wp_title('');
    	if(wp_title('', false)) { echo ' :'; }
    	bloginfo('name');
    	echo "</title>";
    	wp_head();
    	wp_get_archives('type=monthly&format=link');
    	echo '<link rel="pingback" href="' .get_bloginfo('pingback_url'). '" />';
    	echo '<base href="http://www.YOURSITE.com" />';
    } else {
    	echo '<!--' .$headcontent. '-->';
    }
    ?>
    

    Basically this adds one header for the blog pages and the standard header for all other pages.

    I hope this helps someone. ;-)

    Cheers


  62. EmmaKReply to this comment
    Jun. 19, 2008, 4:12 pm
    Permalink

    Well, I’m just starting the whole thing from scratch, so maybe I mangled something at one point and this will solve it.

    By the way, did hackers really hack the demo? I can’t get to it. :-/


  63. Jun. 26, 2008, 11:58 am
    Permalink

    Thanks for this plug-in Michael! I just did an integration found here: http://www.calsk8.com/skateshop/

    Regarding the 404 errors and SEO problems… I ran into those as well. We run Ultimate SEO. Simple solution: turn off permalinks in wordpress. It appears that having mod-rewrite on both Oscommerce links and Wordpress links doesn’t work out well. No idea why that is.

    I put two dynamic sidebars within oscommerce boxes. We wanted the blog and pages accessible from everywhere. This eliminates a second “blog” sidebar (as your demo has).
    In “column_right.php” i put:
    require(DIR_WS_BOXES . ‘blog_sidebar.php’);

    I created a “blog_sidebar.php” in includes/boxes/. I put the stuff below… your milage may vary. This worked… our oscommerce design is not highly modified so it should look fairly good for you:

    
    <?php
    /* Blog Sidebar by Paul Ireland for Cal Skate Skateboards (http://www.calsk8.com/) 6/26/2008 */
    ?>
    <!-- blog sidebar //-->
    <tr><td>
    <?php
      $info_box_contents = array();
      $info_box_contents[] = array('text' => "Blog Stuff");
    
      new infoBoxHeading($info_box_contents, false, false);
    ?>
    <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
      <tr><td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
      <tr><td><img src="images/pixel_trans.gif" width="100%" height="1" border="0" alt="  "></td></tr>
      <tr><td align="left" class="boxText"><div id="blog_sidebar"><ul><?php  dynamic_sidebar('Main Sidebar'); ?></ul></div></td>
      </tr><tr><td><img src="images/pixel_trans.gif" width="100%" height="1" border="0" alt="  "></td></tr></table></td></tr></table></td></tr></td></tr>
    <!-- blog_sidebar_eof //-->
    

  64. basabiReply to this comment
    Jul. 26, 2008, 4:56 am
    Permalink

    We are having some problem displaying the blog RSS feed. In IE, it shows the following errors:

    Only one top level element is allowed in an XML document.
    Line: 64 Character: 2

    We noticed that in the RSS html source just after , it shows session error and then immediately include the entire html of the page where RSS link is located:

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\st\blog\wp-includes\feed-rss2.php:12) in C:\xampp\htdocs\st\includes\functions\sessions.php on line 102

    ………………..

    Any help will be much appreciated.


  65. BasabiReply to this comment
    Jul. 28, 2008, 12:59 am
    Permalink

    We are having some problem displaying the blog RSS feed. In IE, it shows the following errors:

    Only one top level element is allowed in an XML document.
    Line: 64 Character: 2

    We noticed that in the RSS html source just after , it shows session error and then immediately include the entire html of the page where RSS link is located:

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\st\blog\wp-includes\feed-rss2.php:12) in C:\xampp\htdocs\st\includes\functions\sessions.php on line 102

    ………………..

    Any help will be much appreciated.


  66. Aug. 9, 2008, 10:51 am
    Permalink

    Michael,

    Thanks so much for this contribution - excellent work!

    I’ve integrated the blog into my website and put the headline box in the body so people can link through to the blog, but I wondered if you could point me in the direction of placing the blog updates in the left column rather than the centre?

    Keep up the good work!

    B


  67. Aug. 31, 2008, 8:22 pm
    Permalink

    I’m having the same problem as Basabi. Feed Validator produces an XML parsing error, ‘junk after document element’. Interestingly, the following links seem to work:

    wordpress/wp-rss.php
    wordpress/wp-rss2.php
    wordpress/wp-commentsrss2.php

    although I don’t know how to get my blog to link to these addresses instead of blog.php?feed=rss2 and blog.php?feed=comments-rss2. I’ve tried upgrading WordPress and deactivating plugins, to no avail.

    Any help would be greatly appreciated.

    Many thanks for all the effort you’ve put into this tutorial.


  68. Sep. 3, 2008, 7:31 pm
    Permalink

    Hi Michael, great tutorial thanks. I have added links to this page in the OSC forum.

    I hope you can help me customise my install…. I’m not getting any comments show up. Also, the categories are not showing up on the right….

    http://www.boomclothing.com/store2/mobbblog.php

    PLEASE HELP - I really need to get this running asap!!


  69. Sep. 3, 2008, 8:01 pm
    Permalink

    @Sol - Here’s a possible solution for getting your comments to show up based on what I’m seeing over at the WordPress Codex. In blog.php, on the line just before the call to comments_template(), add the following:

    <?php $withcomments = 1; ?>

    To get the categories to show up, in blog.php, replace the call to wp_list_cats() with wp_list_categories().

    wp_list_cats() is deprecated. This tutorial is starting to show its age. Perhaps another update is in order this fall? We’ll see.


  70. Sep. 12, 2008, 9:12 pm
    Permalink

    Re: my earlier problem

    In case anyone else has the same problem, you can add a different feed link (eg. wp-rss.php) to blog.php before . I also deleted the meta links section to get rid of the original, broken feed link.


  71. Sep. 12, 2008, 9:25 pm
    Permalink

    before <!-- end sidebar -->


  72. Sep. 12, 2008, 11:30 pm
    Permalink

    Hi Michael

    Thank you for your suggestion, unfortunately, this didn’t solve it.

    I’m pretty desperate to get this sorted as I’ve people waiting to write their blogs!!

    For anyone who is interested, the blog is here:
    http://www.boomclothing.com/store2/mobbblog.php

    The problem is: the comments aren’t showing up and the categories don’t display on the right.

    I would be happy to pay someone to help sort this out
    Please contact me via the website.
    Regards
    Sol


  73. JayReply to this comment
    Oct. 7, 2008, 11:32 am
    Permalink

    Hi Michael,

    This is great. Thanks a lot for this guide! I dont no what i’d have done without it.
    I am encountering the same problem as Sol, - categories, pages and comments are not visible.
    If i turn on templates, they are visible again, but then the Oscommerce freaks out and says “Cannot send session cache limiter - headers already sent “.

    Please help me out with this thing, it would mean a lot to both me and Sol I’ll guess.
    Anyhow, many thanks to you for doing this for the Oscommerce community!

    Take care! / J


  74. Oct. 11, 2008, 8:23 am
    Permalink

    Hey Michael, thanks for the awesome contribution. However, I’m having a bit of difficulty. I’ve been searching everywhere, haven’t found a satisfactory solution and am at the end of the line so I’m hoping you can help me. I successfully installed the blog on my site, but when I click on an individual post, it opens into a new page without the rest of the store. I’d really like each post to stay within the site, how should I fix this? My blog is at lovethelimelight.com/blog.php


  75. RyanReply to this comment
    Oct. 30, 2008, 12:02 am
    Permalink

    @Lindsay - /blog/?p=75? = /blog.php?p=75


  76. Oct. 31, 2008, 6:46 am
    Permalink

    In the end I paid a programmer to get mine working… even then, he told me there are lots of issues with merging the two….


  77. Nov. 10, 2008, 1:33 am
    Permalink

    Hi Michael. Thanks for the great contribution. You saved my time for hours. Eventhoug your contrib looks nice and fitted to osC but i prefer to put it into either column_right or column_left. Could you help me? Thanks a lot. here is my web:
    http://senyumuslim.com


  78. Nov. 10, 2008, 1:35 am
    Permalink

    i mean the headlines box should be in column left/column right


  79. FranReply to this comment
    Nov. 16, 2008, 8:57 pm
    Permalink

    Hello, i have a problem. This hack works in my localhost but when I upload to my hosting (totalchoicehosting) WP_Query returns an array but empty


One Trackback

  1. By Photoshop template blog - Nutt.net on April 8, 2007 at 6:38 pm

Post a Comment

Your email is never published nor shared. Required fields are marked *

*