Thread: Newest Products
View Single Post
  #80  
Old 01-14-2005, 01:17 PM
 
roccons roccons is offline
 

Member
  
Join Date: Nov 2004
Posts: 16
 

Default

First of all
thanks for the great mod!
I installed it yesterday and runs pretty well both as a welcome page and as a newest.php linkeable page.
I'm interested in being able to show the result of newest products in several pages.
I know I need to do something related with the products_per_page variable but don't know how or where.
Here is my newest.tpl code:
Code:
{* $Id: newest.tpl,v 1.13 2002/05/20 06:55:20 lucky Exp $ *} {*sцЁlo si el template es llamado desde newest_display.php muestra la barra location*} {if $main eq "newest"} {include file="location.tpl" last_location=$lng.lbl_new_products} {/if} {capture name=dialog} {if $newproducts ne ""} {include file="customer/main/products.tpl" products=$newproducts} {else} {$lng.txt_no_new} {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_new_products content=$smarty.capture.dialog extra="width=100%"}
And here is my newest_display.php code:
Code:
<? //para que pueda presentarse sola require "./auth.php"; require $xcart_dir."/include/categories.php"; if (!empty($cat)) require "./products.php"; // set variables $daterange = 9000000; // (60*60*24=86400)*(nц╨mero de dц╜as) ej. 7 dц╜as = 86400*7 = 604800 unix time $nowtime = time(); $oldtime = $nowtime - $daterange ; // the database query $query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid AND add_date > " . $oldtime . " AND add_date < " . $nowtime . " ORDER BY xcart_products.productID DESC LIMIT 0,12 "; // change the LIMIT 0,x above to indicate max number of items // give the product array to smarty to make it available sitewide. $newproducts = func_query($query); $smarty->assign("newproducts",$newproducts); //para que pueda presentarse sola $smarty->assign("main","newest"); $smarty->display("customer/home.tpl"); ?>
Any ideas?
Thanks in advance.
__________________
x-cart 3.5.12 (Unix)
Reply With Quote