I also wanted to use BBClone with Opencart, but could never seem to get it working so that it recorded the pages that were viewed. So I started coding on my development server and here is what I've come up with:
Code: Select all
$mark_title = "";
// Parse out the QUERY STRING into pieces
$qs = $_SERVER['QUERY_STRING'];
$qs1 = substr($qs,0,8);
$qs2 = substr($qs,8,strlen($qs));
$route_str = "_route_=";
$kill_str = "product/product/captcha";
if (strcasecmp($qs1, $route_str) != 0) {
$mark_title = "INDEX";
} else {
if (strcasecmp($qs1, $kill_str) != 0) {
$mark_title = $qs2;
}
}
define("_BBC_PAGE_NAME", "$mark_title");
define("_BBCLONE_DIR", "/home/mydir/public_html/bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if ($mark_title != "INDEX") {
if (is_readable(COUNTER)) { include_once(COUNTER);};
}
Edit your "index.php" file and insert the code near the top.
Important: Make sure that you have SEO turned ON in Store Settings!
This code will record pages viewed EXCEPT for the main INDEX page, and CAPTCHA requests.
You can record those as well if you want by changing the code.
I've tested this using Opencart version 1.5.6 and it works well.
I'm posting this mostly because I spent HOURS searching the net for something like this, and finally gave up and wrote this to work with the best shopping cart software available (IMHO).
It's my hope that this will help others struggling with integrating OC and BBClone.
Cheers!
Max @ Toronto Emporium