CubeCart and WordPress Integration
Following my 100% CubeCart orientated posts, here's another late night hack.
It integrates a WordPress blog into your store's homepage.
You need a working WordPress installation to start with, I installed mine in the standard /wordpress/ folder, none of your customers will see it anyway.
You will also need SimplePie which is a very fast and simple RSS Parser for PHP. Just download and place in any directory.
First off, edit includes/content/index.inc.php and put this about line 55
require('LOCATION TO SIMPLE PIE/simplepie.inc');$feed = new SimplePie('LOCATION TO WORDPRESS FEED');
$feed->handle_content_type();$i = 1;
$posts = Array();
foreach ($feed->get_items() as $item) {
$posts[$i]['LINK'] = $item->get_permalink();
$posts[$i]['TITLE'] = $item->get_title();
$posts[$i]['CONTENT'] = $item->get_content();
$posts[$i]['DATE'] = $item->get_date('j F Y | g:i a');
// assign array data
$index->assign('DATA', $posts[$i]);
$index->assign('ROW_NR', $i);
// parse a row
$index->parse('index.table.row');
$i++;
}
$index->parse('index.table');
Make sure you replace "LOCATION TO SIMPLE PIE" with the correct page.
Make sure you replace "LOCATION TO WORDPRESS FEED" with your wordpress feed. Don't know what this is? Goto your WordPress blog and hit the RSS icon in the location bar to go to the feed location.
Next, edit yourskin/styleTemplates/content/index.tpl. I replaced the following
{HOME_TITLE}
{HOME_CONTENT}
with
{DATA.TITLE}
{DATA.CONTENT}
{DATA.DATE}
This will replace the "Home Page" text with your blog entries.
Simple, huh?
If any one needs any help, customisation etc, contact me.
Related posts
- WP-O-Matic Bug Fixes Round Up
I've run into quite a few issues in the latest 1.0RC3-7 release of WP-O-Matic. Here's... - Cleaning up WordPress Header
WordPress implements some HTML standards compliant code in the top of every page. Sometimes you... - SEO Friendly URLs for CubeCart in Windows
I have a client hosting CubeCart on a Windows server. Unfortunately the built in Apache... - Splitting WordPress content with ‘more’ on single pages
WordPress uses the "More" button to create a small snippet of content, usually used on... - Unique home page mod CubeCart 4
Here's a quick modification to allow you to have a unique home page. A page...




July 25th, 2008 - 07:37
i have been trying to your wordpress integration but i get this error:
Parse error: syntax error, unexpected ‘&’ in /home/ourspot/public_html/includes/content/index.inc.php on line 60
s
July 25th, 2008 - 08:11
ok so i sorted that bit out by replacing > with > but unfortunatley now i get this in the space where the blog should be
[XTemplate]
* parse: blockname [index.welcome_note] does not exist
* parse: blockname [index.table] does not exist
* parse: blockname [index] does not exist
November 28th, 2008 - 05:29
Hi
I want to integrate wordprss blog with my wholesale store? Would you be able to help me on this matter? how much you will charge for this integration and customazation?
Thank you
abdu
http://www.simsimgate.com
May 8th, 2010 - 19:53
i cant get this to link to my homepage please help!!!
July 23rd, 2010 - 22:44
This is very out dated technique and does not help (you can’t even find index.inc.php anymore…)
The latest code would be appriciated.
Thanks a lot,
KrishSai