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

3 column layout with thumbnail for Related Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #81  
Old 04-01-2009, 09:52 PM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: 3 column layout with thumbnail for Related Products

Quote:
Originally Posted by balinor
For anyone who wants this to work for 4.0.18, here's the code to use:

Code:
{if $product_links ne ""} {capture name=dialog} {assign var="tmp" value="0"} {section name=cat_num loop=$product_links} {if $product_links[cat_num].productid}{assign var="tmp" value="1"}{/if} {/section} {section name=cat_num loop=$product_links} { if %cat_num.first% } <table border="0" cellspacing="5" width="100%"> {/if} {if $smarty.section.cat_num.index is div by 3} </tr><tr valign="top"> {/if} <TD width="33%" align="center"> <A href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}> {include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=$config.Appearance.thumbnail_width product=$product_links[cat_num].product tmbn_url=$product_links[cat_num].tmbn_url}<br> { $product_links[cat_num].product} </A> </TD> { if %cat_num.last% } </tr></table><br> {/if} {/section} {/capture} {include file="dialog.tpl" title="You may also like..." content=$smarty.capture.dialog extra="width=100%"} {/if}

It is set for 3 columns, but you can change that by changing the number 3 to whatever you want, and also change the percentage for the width of the table cell (currently set to 33%).

Thanks Balinor for such a fine code. Now is it possible for category/sub category for making related category?
__________________
4.6.1 Platinum


Reply With Quote
  #82  
Old 04-08-2009, 03:13 PM
 
Jay Brown Jay Brown is offline
 

Member
  
Join Date: Apr 2008
Posts: 26
 

Default Re: 3 column layout with thumbnail for Related Products

Can someone share a live example of this display?
__________________
Version 4.1.9
Reply With Quote
  #83  
Old 04-08-2009, 03:20 PM
  clik's Avatar 
clik clik is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: Canada
Posts: 30
 

Default Re: 3 column layout with thumbnail for Related Products

Quote:
Originally Posted by Jay Brown
Can someone share a live example of this display?

sure http://www.clikinternational.com/product.php?productid=206 and click on "Related Products" Tab
__________________
__________________
XC5: 5.3.4.4
PHP: 7.0.26
MySQL server: 5.5.56-MariaDB
Reply With Quote
  #84  
Old 04-16-2009, 10:22 AM
 
pedstest pedstest is offline
 

Newbie
  
Join Date: Apr 2009
Posts: 1
 

Default Re: 3 column layout with thumbnail for Related Products

First off, I am a total newb with X-Cart so go easy on me

On the surface seems pretty straight forward, however I can't get it to work. Do I just replace my /modules/Upselling_Products/product_links.tpl file with this code? When I try and do that, it fails to save. Any ideas?
__________________
X-Cart Gold v4.2.0
*Special Offers
Reply With Quote
  #85  
Old 05-09-2009, 05:20 PM
 
Christofer Christofer is offline
 

eXpert
  
Join Date: Apr 2009
Location: Thessaloniki, Greece
Posts: 202
 

Default Re: 3 column layout with thumbnail for Related Products

does this works for v4.2.1?
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql)
Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server
Modules : X-Offer & X-Aom & One page checkout
Product tabs & Product downloads & many more
Reply With Quote
  #86  
Old 06-27-2009, 05:56 PM
 
jason.zhang jason.zhang is offline
 

Member
  
Join Date: Apr 2009
Posts: 20
 

Default Re: 3 column layout with thumbnail for Related Products

who can provide the code work for version 4.21?

thanks in advance
__________________
X-cart 4.4.1
www.wondcam.com
www.ahdcameras.com
www.chinaoppo.com
wholesale electronics gadgets cameras and so on
Reply With Quote
  #87  
Old 07-10-2009, 08:19 AM
 
steewu steewu is offline
 

Member
  
Join Date: Sep 2007
Posts: 26
 

Default Re: 3 column layout with thumbnail for Related Products

FOR VERSION 4.2.2

change file under ---> skin1/modules/Upselling_Products/related_products.tpl


PHP Code:
{* $Idrelated_products.tpl,v 2.0 2005/12/07 14:07:32 max Exp $ *}
{if 
$product_links ne ""}
{
capture name=dialog}
{
assign var="tmp" value="0"}
{
section name=cat_num loop=$product_links}
{if 
$product_links[cat_num].productid}{assign var="tmp" value="1"}{/if}
{/
section}
{
section name=cat_num loop=$product_links}
{if %
cat_num.first%}
<
table border=0 width="100%">
<
tr>
{/if}
{if 
$smarty.section.cat_num.index is div by 3}
</
tr><tr valign="top">
{/if}
<
td width=33align=center valign=top>
<
a href="product.php?productid={$product_links[cat_num].productid}class="ItemsList">{$product_links[cat_num].product}</a><br />
<
a href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Modules.upselling_new_window eq 'Y'target="_blank"{/if}>
{include 
file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=$config.Appearance.thumbnail_width product=$product_links[cat_num].product type="T"}</a>
<
br />
<
font style="color:grey">{$lng.lbl_our_price}:</font> <font style="color:red">{include file="currency.tpl" value=$product_links[cat_num].price}</font>
{if 
$product.taxes}
{include 
file="customer/main/taxed_price.tpl" 
taxes=$product.taxes}
</
td>
{/if}
{if %
cat_num.last%}
</
tr></table>
{/if}
{/
section}
{/
capture}
  {include 
file="customer/dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog additional_class="uproducts"}
{else}
{
capture name=dialog
No related products.
{/
capture
{/if} 
__________________
Version Xcart5 5.2.XX
Reply With Quote

The following user thanks steewu for this useful post:
ramdial (06-05-2010)
  #88  
Old 07-22-2009, 10:59 AM
 
artuli artuli is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 32
 

Default Re: 3 column layout with thumbnail for Related Products

Steewu, I am on X-Cart 4.2.2, I tried your code and it had no effect what-so-ever. Any tips?
__________________
Young Reinette: What do monsters have nightmares about?
The Doctor: Me!

X-Cart Gold 4.1.10
X-Cart Gold 4.2
Mac OS X 10.5.7
Reply With Quote
  #89  
Old 08-05-2009, 06:13 AM
 
steewu steewu is offline
 

Member
  
Join Date: Sep 2007
Posts: 26
 

Default Re: 3 column layout with thumbnail for Related Products

Quote:
Originally Posted by artuli
Steewu, I am on X-Cart 4.2.2, I tried your code and it had no effect what-so-ever. Any tips?

Check on your upsell item... Does work...
__________________
Version Xcart5 5.2.XX
Reply With Quote
  #90  
Old 09-12-2009, 11:29 PM
 
mydls mydls is offline
 

Member
  
Join Date: Mar 2007
Posts: 25
 

Default Re: 3 column layout with thumbnail for Related Products

Quote:
Originally Posted by steewu
Check on your upsell item... Does work...

I just copied the code to related_products.tpl in my xcart version v4.2.2, it couldn't show product thumbnails in the upselling product section: 'Customers who bought this product also bought'. It still show the product links as before. Any suggestion to get it work?
__________________
xCart Pro Version 4.4.2
Download Expander
Buy Together
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 08:10 AM.

   

 
X-Cart forums © 2001-2020