The important thing to remember is that the "recommended products" feature is
supposed to be a list of items that are recommended if you like the product you're currently viewing. It's supposed to be a "people who bought this product also bought..." type of feature. I'm not entirely sure whether the logic for this type of feature is fully implemented. I know it wasn't in older versions of x-cart. Anyway, with that in mind, it doesn't make any sense to have a "recommended products" box on the front page, or on another web site.
However... You can configure the recommends module to just pick products randomly. In that case, the recommends box is really just a "hey, here are some other products we sell" box. In that case, why not put it on the front page or another site?
So, for the front page... I *think* that the following mod will work. I haven't tested it. Make backups and give it a shot.
Add the following code to '/skin1/customer/main/welcome.tpl'...
Code:
{if $active_modules.Recommended_Products ne ""}
{include file="modules/Recommended_Products/recommends.tpl" }
{/if}
Then, add the following code...
Code:
if($active_modules["Recommended_Products"])
include "./recommends.php";
to '/customer/home.php' somewhere before the line:
Code:
$smarty->display("customer/home.tpl");
It's not a very elegant hack, but I think it'll work.
As for adding the recommends box to another site there are a few options...
Option 1. If you are extremely proficient in php and mysql, you could write a php script that would query the data from the mysql database on the server that runs x-cart. You'd have to have all the security settings right to make it work. It's the nicest way to do it, but it would be a pain.
Option 2. You could use javascript. I've never worked with phpBB, but I'm sure there's an administrative area where you can add lines of html code to a section that will be thrown above or below the main content. You would add a line that looks something like this...
Code:
<SCRIPT LANGUAGE="javascript" SRC="http://www.your-xcart-server.com/recommends.js.php"></SCRIPT>
Then you'd have to write the 'recommends.js.php'. The file would take the recommends list and turn it into HTML code. Then you could echo each of the lines of HTML as javascript document.write lines. The function would look something like this...
Code:
foreach ($html_lines as $line) {
$line = str_replace('\'', '\\\'', $line);
echo "document.write('", $line, "');\n";
}
Option 3. Similar to option 2, you'd have to make a custom php script that takes the recommends list and turns it into HTML code. Then you could add an <IFRAME> call to your phpBB. To see how this would work, try adding the following code to your phpBB...
Code:
<IFRAME SRC="http://www.your-xcart-server.com/customer/home.php" WIDTH=450 HEIGHT=100> This content appears if the browser is not IFRAME compatible. </IFRAME>