Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to change Recommendslist?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 08-12-2003, 10:17 PM
 
jeeya jeeya is offline
 

X-Adept
  
Join Date: May 2003
Location: USA
Posts: 807
 

Default .

Hi,
I am running phpBB on my other website on different server. Is there a Way to Put Recommended Product List on phpBB from my x-cart store?

Also How can I set to display recommended list on main store page.
Reply With Quote
  #12  
Old 08-17-2003, 06:52 PM
 
jeeya jeeya is offline
 

X-Adept
  
Join Date: May 2003
Location: USA
Posts: 807
 

Default .

Reply With Quote
  #13  
Old 08-18-2003, 06:44 AM
 
slimmedia slimmedia is offline
 

Member
  
Join Date: May 2003
Posts: 23
 

Default

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>
Reply With Quote
  #14  
Old 03-26-2009, 04:08 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: How to change Recommendslist?

Quote:
Originally Posted by slimmedia
Again, it may need a little bit of tweaking depending upon your version of x-cart, but something like this should work:

In 'modules/Recommended_Products/recommends.tpl' replace the lines from {section} to {/section} with:
Code:
<TABLE BORDER="0" WIDTH="100%"><TR> {section name=num loop=$recommends} <TD VALIGN="TOP" WIDTH=33%> <A HREF="product.php?productid={$recommends[num].productid}&cat={$cat}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product tmbn_url=$products[product].tmbn_url} <font class="ProductTitle">{$recommends[num].product}</FONT></TD> {/section} </TR></TABLE>

For version 3.4.3, the whole file would look like this:

Code:
{if $recommends} {capture name=recommends} <TABLE BORDER="0" WIDTH="100%"><TR> {section name=num loop=$recommends} <TD VALIGN="TOP" WIDTH=33%> <A HREF="product.php?productid={$recommends[num].productid}&cat={$cat}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product tmbn_url=$products[product].tmbn_url} <font class="ProductTitle">{$recommends[num].product}</FONT></TD> {/section} </TR></TABLE> {/capture} {include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"} {/if}

Thanks slimmedia for fine codes. Now can those images been possible to see in a slide show or in a rotating way? Also is it possible to see small images(just for indicative only)?Please help me.
__________________
4.6.1 Platinum


Reply With Quote
  #15  
Old 03-26-2009, 07:22 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: How to change Recommendslist?

You do realize that the post you are responding to is over 5 years old, right?

Try this thread http://forum.x-cart.com/showthread.php?t=7506
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:58 AM.

   

 
X-Cart forums © 2001-2020