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

Need help configuring "Best Sellers" module to call thumbnail images via filesystem!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 09-28-2006, 05:22 AM
 
TL408 TL408 is offline
 

X-Adept
  
Join Date: Jan 2005
Posts: 549
 

Default Re: Need help configuring "Best Sellers" module to call thumbnail images via filesystem!

Just to update everyone on this thread, I contacted the X-cart team and Eugene Kaznacheev in the technical support team was able to ressolve the issue. Of course that cost me some support point, but I thought it was well worth it. All of my images from the "Best Sellers" and "Recommended Products" are now being referenced via the direct filesystem path and no longer being pulled via "image.php" file. WOW, they are so much faster. Night and day difference!!!

With that being said, I'm posting the code modification required to make this work down below. Hopefully this will help someone in the future.

Cheers
-Tuan



1. Edit <xcart_dir>/modules/Bestsellers/bestsellers.php script and replace:

Code:
$smarty->assign("bestsellers",$bestsellers);

with

Code:
foreach ($bestsellers as $i=>$item) { $bestsellers[$i]["tmbn_url"] = func_get_image_url($item[productid],"T"); } $smarty->assign("bestsellers",$bestsellers);

2. Then edit <xcart_dir>/recommends.php file and replace:

Code:
$smarty->assign("recommends",$recommends);

with

Code:
foreach ($recommends as $i=>$item) { $recommends[$i]["tmbn_url"] = func_get_image_url($item[productid],"T"); } $smarty->assign("recommends",$recommends);

---------------------------------------------------------------------------------------------------------------------

After that, you would need to modify the "xcart_dir\skin1\modules\Bestsellers\bestsellers.t pl" and "xcart_dir\skin1\modules\Recommended_Products\reco mmends.tpl" files as well. And below is how I currently have those two files configure.

Cheers
-Tuan


"xcart_dir\skin1\modules\Bestsellers\bestsellers.t pl" File
Code:
{* $Id: bestsellers.tpl,v 1.8 2005/11/21 12:42:00 max Exp $ *} {if $bestsellers} {capture name=bestsellers} <table cellpadding="0" cellspacing="3"> {foreach from=$bestsellers item=bestseller} <tr> {if $config.Bestsellers.bestsellers_thumbnails eq "Y"} <td width="30"> <a href="product.php?productid={$bestseller.productid}&cat={$cat}&bestseller">{include file="product_thumbnail.tpl" productid=$bestseller.productid image_x=50 product=$bestseller.product tmbn_url=$bestseller.tmbn_url}</a> </td> {/if} <td> <font class="ProductPriceBestSellers"> <b><a href="product.php?productid={$bestseller.productid}&amp;cat={$cat}&amp;bestseller">{$bestseller.product}</a></b><br /> {$lng.lbl_our_price}: {include file="currency.tpl" value=$bestseller.price}<br /> </font> </td> </tr> {/foreach} </table> {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_bestsellers menu_content=$smarty.capture.bestsellers } {/if}
"xcart_dir\skin1\modules\Recommended_Products\reco mmends.tpl" File
Code:
{if $recommends} {capture name=recommends} {section name=num loop=$recommends} { if %num.first% } <table border=0 width=100%>{/if} { if %num.index% is div by 3}<tr>{/if} <td width="33%" align="center" valign="top"> <a href=product.php?productid={$recommends[num].productid}&cat={$cat}&page={$navigation_page}> {include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=80 product=$recommends[num].product tmbn_url=$recommends[num].tmbn_url} <br /> <SPAN class="ItemsList">{$recommends[num].product}</SPAN> </td> { if %num.last% }</tr> </table>{/if} {/section} {/capture} {include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"} {/if}
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9
Reply With Quote
  #12  
Old 10-19-2007, 08:55 AM
 
Chris B Chris B is offline
 

eXpert
  
Join Date: Oct 2002
Posts: 226
 

Default Re: Need help configuring "Best Sellers" module to call thumbnail images via filesystem!

In order to keep the markup valid while using this mod...

In the bestsellers.tpl change:

<a href="product.php?productid={$bestseller.productid }&cat={$cat}&bestseller">

to

<a href="product.php?productid={$bestseller.productid }&amp;cat={$cat}&amp;bestseller">


and in the recommends.tpl change:

<a href=product.php?productid={$recommends[num].productid}&cat={$cat}&page={$navigation_page}>

to

<a href=product.php?productid={$recommends[num].productid}&amp;cat={$cat}&amp;page={$navigation_p age}>
__________________
4.0x - 4.5x
Reply With Quote
  #13  
Old 10-29-2007, 09:20 AM
 
polren polren is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 35
 

Default Re: Need help configuring "Best Sellers" module to call thumbnail images via filesystem!

Has anyone tested the script on 4.1.7 or 4.1.8? Would it work?
__________________
Polren
x-cart 4.1.7,
On Sale from alteredcart.com
One Page Checkout from alteredcart.com
XC-SEO
Reply With Quote
  #14  
Old 10-29-2007, 10:24 AM
 
Chris B Chris B is offline
 

eXpert
  
Join Date: Oct 2002
Posts: 226
 

Default Re: Need help configuring "Best Sellers" module to call thumbnail images via filesystem!

I did add the bestsellers mod to 4.18.

I was having errors thrown from the addition of the following code to the bestsellers.php.

-------------------------------------------------------------------------------------------------

foreach ($bestsellers as $i=>$item) {
$bestsellers[$i]["tmbn_url"] = func_get_image_url($item[productid],"T");
}

$smarty->assign("bestsellers",$bestsellers);


---------------------------------------------------------------------------------------------------

Since it didn't make sense to me on why this was added, I just left the original code on that page and modified the .tpls. (Appears to work fine.)

http://www.naplesvalley.com/


PS. I didn't try the "recommends" mod.
__________________
4.0x - 4.5x
Reply With Quote
  #15  
Old 10-29-2007, 10:56 AM
 
polren polren is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 35
 

Default Re: Need help configuring "Best Sellers" module to call thumbnail images via filesystem!

Thanks Chris. I believe the code that causes errors is destined to show thumbnails in the bestsellers table in the left panel (nice feature to have), but someone needs to "convert" this code to the 4.1.x standard...
__________________
Polren
x-cart 4.1.7,
On Sale from alteredcart.com
One Page Checkout from alteredcart.com
XC-SEO
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:00 PM.

   

 
X-Cart forums © 2001-2020