View Single Post
  #3  
Old 02-22-2008, 08:20 AM
  BunnyburyBaby's Avatar 
BunnyburyBaby BunnyburyBaby is offline
 

Advanced Member
  
Join Date: Nov 2007
Location: Los Angeles
Posts: 32
 

Default Re: Bestsellers with short descriptions...

Holub,

I made the changes you suggested but the module still does not show me the descriptions. Could I be doing something wrong?

Here is the code for the tpl I am working with. I should have named the template in my last post, I apologize for that. This only needs to work with the bestsellers.tpl, I do not use the menu_bestseller.tpl

bestsellers.tpl

Code:
{* $Id: bestsellers.tpl,v 1.8.2.1 2006/11/16 13:12:29 max Exp $ *} {if $bestsellers} <font color="#6C8197" style="font: bold 14px Verdana, Arial, Helvetica, Sans-Serif;"><b>More Best Selling Products:</b></font> <br clear="left"><img src="http://www.bunnyburybaby.com/images/line.jpg" width=619 height=1 alt="Featured Baby Gift Basket Line" align="left"><br clear="left"> {capture name=bestsellers} <table cellpadding="0" cellspacing="2"> {foreach from=$bestsellers item=bestseller} <tr> {if $config.Bestsellers.bestsellers_thumbnails eq "Y"} <td width="30"> <a href="product.php?productid={$bestseller.productid}&amp;cat={$cat}"> {include file="product_thumbnailbs.tpl" productid=$bestseller.productid image_x=25 product=$bestseller.product tmbn_url=$bestseller.tmbn_url}</a> </td> {/if} <td> <b><a href="product.php?productid={$bestseller.productid}&amp;cat={$cat}">{$bestseller.product}</a></b><br /> {$bestseller.descr} <br /> {$lng.lbl_our_price}: {include file="currency.tpl" value=$bestseller.taxed_price}<br /> </td> </tr> {/foreach} </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_bestsellers content=$smarty.capture.bestsellers extra='width="100%"'} {/if}

Here is the code for my bestsellers.php after the change you suggested:

Code:
<?php /*****************************************************************************\ +-----------------------------------------------------------------------------+ | X-Cart | | Copyright (c) 2001-2007 Ruslan R. Fazliev <rrf@rrf.ru> | | All rights reserved. | +-----------------------------------------------------------------------------+ | PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" | | FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE | | AT THE FOLLOWING URL: http://www.x-cart.com/license.php | | | | THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE | | THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. | | FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING | | AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). | | PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT | | CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, | | COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY | | (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS | | LICENSE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THIS | | AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND | | OTHER INTELLECTUAL PROPERTY RIGHTS PROTECT THE SOFTWARE. THIS | | AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE | | THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.| | THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2007 | | Ruslan R. Fazliev. All Rights Reserved. | +-----------------------------------------------------------------------------+ \*****************************************************************************/ # # $Id: bestsellers.php,v 1.31.2.3 2007/03/28 08:06:39 max Exp $ # # Bestsellers # if (!defined('XCART_SESSION_START')) { header("Location: ../../"); die("Access denied"); } x_load('product'); if (!is_numeric($config["Bestsellers"]["number_of_bestsellers"]) || $config["Bestsellers"]["number_of_bestsellers"] < 0) $config["Bestsellers"]["number_of_bestsellers"] = 0; # # Get products data for current category and store it into $products array # $avail_condition = ""; if ($config["General"]["unlimited_products"] == "N" && $config["General"]["disable_outofstock_products"] == "Y") $avail_condition = " AND $sql_tbl[products].avail>0 "; $cat = intval($cat); $search_query = ''; $threshold = 0; if ($cat) { $category_data = func_query_first("SELECT categoryid_path, threshold_bestsellers FROM $sql_tbl[categories] USE INDEX (PRIMARY) WHERE categoryid = '$cat'"); $result = func_query_hash("SELECT categoryid, threshold_bestsellers FROM $sql_tbl[categories] USE INDEX (pa) WHERE categoryid_path LIKE '$category_data[categoryid_path]/%' AND avail = 'Y'", "categoryid", false, true); $threshold = intval($category_data["threshold_bestsellers"]); $cat_ids = array(); if (is_array($result) && !empty($result)) { $cat_ids = array_keys($result); foreach ($result as $threshold_bestsellers) { if ($threshold_bestsellers > 0 && $threshold > $threshold_bestsellers) $threshold = intval($threshold_bestsellers); } } else { $cat_ids[] = $cat; } if ($threshold) $threshold -= 1; $search_query['where'][] = " $sql_tbl[products_categories].categoryid IN ('".implode("','", $cat_ids)."')"; unset($result); } # # Search the bestsellers # $search_query['where'][] = "$sql_tbl[products].views_stats > '0' AND $sql_tbl[products].sales_stats >= '".$threshold."'"; $search_query['fields'][] = "xcart_products.descr"; $bestsellers = func_search_products($search_query, @$user_account["membershipid"], "$sql_tbl[products].sales_stats DESC, $sql_tbl[products].views_stats DESC", $config["Bestsellers"]["number_of_bestsellers"] ); $smarty->assign("bestsellers", $bestsellers); ?>

The descriptions are still not showing up. Not sure why. I have a short description on the product pages.

Here is my /product_thumbnailbs.tpl for those interested:

Code:
<img src="phpThumb.php?src={$tmbn_url|replace:' ':'%20'|replace:'http://www.bunnyburybaby.net/':''|replace:'http://www.bunnyburybaby.com/':''|replace:'images/products':'images/Products'}&w=75" alt="{$images[image].alt}" style="BORDER-RIGHT: #b7b7b7 1px solid; BORDER-TOP: #b7b7b7 1px solid; BORDER-LEFT: #b7b7b7 1px solid; BORDER-BOTTOM: #b7b7b7 1px solid" alt="$bestseller.product">

This is a 4 year old site with over 1000 products. The folks working on it before me liked to use spaces, capitals etc in the image names, urls and other places you should not. I had to put some replace commands in to correct past errors.

I will moving the excess html to a css once I have the mod working.

Any help you can give is much appreciated.

Herb
__________________
X-Cart Version 4.1.8
Reply With Quote