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

Top Ten List - a favorites or "fake" bestsellers list - everywhere!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-06-2006, 04:31 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Top Ten List - a favorites or "fake" bestsellers list - everywhere!

Here is a mod that was developed with the help of many forum members. The goal was a side menu box that contained the products of a single category, ranked in the orderby POS established for the category. This menu box appears throughout the store. It is NOT tied to featured poducts or bestsellers (these modules can be disabled if you like).

I can certify this works with 4.1.3 and 4.0.18; there is no reason it won't work with other versions...

1. Define a category, assign products to it. I called mine, "Top Ten List". I added 10 products (duh!).

2. make a file in the xcart_root directory, name it "toptenlist.php"
Code:
<? $query = "SELECT $sql_tbl[products].productid, $sql_tbl[products].product FROM $sql_tbl[products],$sql_tbl[products_categories] WHERE $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail > 0 AND $sql_tbl[products].productid = $sql_tbl[products_categories].productid AND $sql_tbl[products_categories].categoryid = 10 ORDER BY $sql_tbl[products_categories].orderby ASC LIMIT 10" ; $toptenlist = func_query($query); $smarty->assign("toptenlist",$toptenlist); ?> // Note: categoryid = 10 is the id for the category you want to query // change this to the categoryid you are using
3. Open xcart_root/home.php

FIND:
Code:
if ($active_modules["Bestsellers"]) include $xcart_dir."/modules/Bestsellers/bestsellers.php";

ADD:
Code:
include "./toptenlist.php";
4. Create a file called skin1/customer/main/toptenlist.tpl with the following:

Code:
{* $Id: toptenlist.tpl,v 1.00.0.1 2006/09/06 18:08:01 *} <div id="categories"> {capture name=menu} {section name=num loop=$toptenlist} <A href="product.php?productid={$toptenlist[num].productid}&cat=10" class=VertMenuItems><B>{math equation="value+1" value=$smarty.section.num.index}.</B> {$toptenlist[num].product}</A><br /> {/section} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Top Ten List" menu_content=$smarty.capture.menu } </div> {* Again note the cat=10 in this file *} {* Change menu_title="Top Ten List" to the desired menu title *}
5. in xcart_root/include/categories.php

Find:
Code:
$smarty->assign("cat", $cat);
Add the following underneath:
Code:
require $xcart_dir."/toptenlist.php";
6. in skin1/customer/home.tpl add this wherever you want the menu to display. For example, if you want it on the right menu, under the authentication box, you would put it here:

After these lines
Code:
{if $login eq "" } {include file="auth.tpl" } {else} {include file="authbox.tpl" } {/if}
...insert
Code:
{if $toptenlist} <br /> {include file="customer/main/toptenlist.tpl" } {/if}

DONE!

Thanks to the many forum members who contributed to this.

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #2  
Old 11-21-2006, 01:07 PM
 
summitmn summitmn is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Manitou Springs, CO USA
Posts: 105
 

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

Is there a way to organize this list by "best selling" rather than alaphabetical?
__________________
Using 4.4.0
Reply With Quote
  #3  
Old 11-21-2006, 01:12 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

Whatever order your "POS" is in your category list.

/admin/category_products.php?cat=XXX

It's a fake bestsellers list -- so it's just like any category.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #4  
Old 05-03-2009, 05:57 PM
 
rayjohnson rayjohnson is offline
 

Member
  
Join Date: Apr 2009
Posts: 17
 

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

I know this an old thread...but I liked the idea of making your own Top Ten List...

I followed the instructions here and I got it working...I show the Product Title and Thumbnail...but I cannot get the Our Price included like on the original bestseller.tpl

Here is my toptenlist.tpl
Quote:
{* $Id: toptenlist.tpl,v 1.00.0.1 2006/09/06 18:08:01 *}

<div id="categories">
{capture name=bestsellers}
{section name=num loop=$toptenlist}
<A href="product.php?productid={$toptenlist[num].productid}&cat=12" class=VertMenuItems><B>{math equation="value+1" value=$smarty.section.num.index}.</B> {$toptenlist[num].product}</A><br />
<TR>
<TD width="40">
{include file="product_thumbnail.tpl" productid=$toptenlist[num].productid image_x=50 product=toptenlist[num].product}
</TD>
{/section}
{/capture}
{include file="customer/menu_dialog.tpl" title="Top Ten List" content=$smarty.capture.bestsellers }
</div>

{* Again note the cat=10 in this file *}
{* Change menu_title="Top Ten List" to the desired menu title *}
__________________
v 4.2.1
Reply With Quote
  #5  
Old 05-03-2009, 06:02 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

yikes! this thread was created for version 4.0.x -- so html was not xhtml compliant. GET RID of the UPPERCASE html tags. For 4.2.x do not use the tables. I pulled this code from my store years ago... decided that there was too much clutter and a side box was not the place for this. Sorry I can't be of more help.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #6  
Old 05-03-2009, 07:30 PM
 
rayjohnson rayjohnson is offline
 

Member
  
Join Date: Apr 2009
Posts: 17
 

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

Thanks for the reply...I guess I'll go back to the bestseller.....shucks...

Ray
__________________
v 4.2.1
Reply With Quote
  #7  
Old 02-09-2010, 02:07 AM
 
Rob Barclay Rob Barclay is offline
 

Advanced Member
  
Join Date: Mar 2008
Posts: 38
 

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

just used principles of this on 4.3.1 without a problem, apart from having problems getting the ratings in it
__________________
Version 4.6.1
Reply With Quote
  #8  
Old 11-03-2011, 02:35 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 758
 

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

did you also get the 'Our Price' section correct? I am interested in implementing this in 4.4.x and I wonder what modifications to the mod code should be done.
Reply With Quote
  #9  
Old 11-03-2011, 07:32 AM
  JWait's Avatar 
JWait JWait is offline
 

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

Default Re: Top Ten List - a favorites or "fake" bestsellers list - everywhere!

Quote:
Originally Posted by carpeperdiem
yikes! this thread was created for version 4.0.x -- so html was not xhtml compliant. GET RID of the UPPERCASE html tags. For 4.2.x do not use the tables. I pulled this code from my store years ago... decided that there was too much clutter and a side box was not the place for this. Sorry I can't be of more help.

Just more proof that once something is on the internet it will be there forever.
__________________
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 10:06 AM.

   

 
X-Cart forums © 2001-2020