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
  #71  
Old 06-07-2008, 05:54 PM
 
paul@dimoda.com.au paul@dimoda.com.au is offline
 

Senior Member
  
Join Date: Aug 2007
Location: Perth, Australia
Posts: 148
 

Default Re: 3 column layout with thumbnail for Related Products

Quote:
Originally Posted by MoonDog
Hi Acquamarina,


Just replace your skin1/modules/Upselling_Products/related_products.tpl file with the file below. It works in v4.1.8 and v4.1.9

Code:
{* $Id: related_products.tpl,v 1.15 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=33% align=center valign=top class="PListCell" style="border: 2px dashed #cccccc;"> <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 class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$product_links[cat_num].price}</font> {if $product.taxes}<font class="ProductPriceVatRelated"> {include file="customer/main/taxed_price.tpl" taxes=$product.taxes}</font> </td> {/if} {if %cat_num.last%} </tr></table> {/if} {/section} {/capture} {include file="dialog.tpl" title="Related products" content=$smarty.capture.dialog extra="width=100%"} {else} {capture name=dialog} No related products. {/capture} {/if}

- MoonDog -

Moondof, any idea how to get my images showing in 4.17 using telafirma's image mod?
__________________
X-Cart Gold 4.1.10, 4.1.18, 4.4.4, 4.4.5
Reply With Quote
  #72  
Old 07-17-2008, 01:10 AM
 
Vinsinfo Vinsinfo is offline
 

Member
  
Join Date: Sep 2007
Posts: 20
 

Default Re: 3 column layout with thumbnail for Related Products

I want to change my table name in xcart database.(ex. xcart_classes to xcart_new_classes).So definitly i should change some other files also.please advice what are the files i should change??
__________________
version:upgrade 4.1.8 to 4.1.11
Vinsinfo
Ranjith@vinsinfo.com
Reply With Quote
  #73  
Old 07-21-2008, 11:16 AM
  clik's Avatar 
clik clik is offline
 

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

Wink Re: 3 column layout with thumbnail for Related Products

Thank you very much the code works even for my older version of x-cart:
http://clikinternational.com/store/product.php?productid=106

Quote:
Originally Posted by JWait
On a related note, how can I show 3,and only 3, regardless of how many related items I have?

Here is my related_products.tpl, and it works like a champ (in 4.1.8, but should work in newer versions also) except for the limit I want. What do I change?
Code:
{* $Id: related_products.tpl,v 1.15 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" cellspacing="0" width="100%"> <tr> {/if} {if $smarty.section.cat_num.index is div by 3} </tr><tr valign="top"> {/if} <td width=33% align=center valign=top class="PListCell";> <a href="product.php?productid={ $product_links[cat_num].productid }" class="ItemsList" {if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>{$product_links[cat_num].product}</a> <br /> <a href="product.php?productid={ $product_links[cat_num].productid }"> {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 class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$product_links[cat_num].price}</font> </td> { if %cat_num.last% } </tr></table> {/if} {/section} {/capture} {include file="dialog.tpl" title="Related products" content=$smarty.capture.dialog extra="width=100%"} {/if}

BTW, to the person that wanted the price to be linked, just replicate the links to the "title" and the image. I just chose not to do that.
Code:
<a href="product.php?productid={ $product_links[cat_num].productid }">{$lng.lbl_our_price}: {include file="currency.tpl" value=$product_links[cat_num].price}</a>
__________________
__________________
XC5: 5.3.4.4
PHP: 7.0.26
MySQL server: 5.5.56-MariaDB
Reply With Quote
  #74  
Old 08-29-2008, 10:29 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default Re: 3 column layout with thumbnail for Related Products

To use TelaFirma's module for Related Products:

In /modules/Upselling_Products/related_products.tpl

Change this code:
Code:
{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"}

To this code:
Code:
{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=$config.Dynamic_Images.di_thumbnail_image_width product=$product_links[cat_num].product tmbn_url=$product_links[cat_num].tmbn_url}

Louise
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #75  
Old 10-07-2008, 08:14 AM
  LoveHurts's Avatar 
LoveHurts LoveHurts is offline
 

Advanced Member
  
Join Date: Mar 2007
Posts: 39
 

Default Re: 3 column layout with thumbnail for Related Products

Hi peepz, thanks for code

How can i show only the products that in stock in recommended list ?? (if-statement?)
because i have 1000'en products that are not on stock.

i like to use this code (thanks for)

{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}
{assign var="tmp" value="0"}
{section name=num loop=$recommends}
{if $recommends[num].productid}{assign var="tmp" value="1"}{/if}
{/section}
{section name=num loop=$recommends}
{ if %num.first% }
<table border=1 cellspacing=5 width=100%>
{/if}
{if $smarty.section.num.index is div by 3}
</tr><tr valign="top">
{/if}
<td width="250" align="center">

{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=100 product=$recommends[num].product tmbn_url=$recommends[num].tmbn_url}
<a href="product.php?productid={ $recommends[num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>
<BR>
<span class="ProductTitle">{ $recommends[num].product|escape}</span><br>
</a></td>
{ if %num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No related products.
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{/if}


thx Y
__________________
Core version: 5.3.4.4
PHP: 5.6
Web server: Apache
---stll running a---
x-cart PRO 4.1.6 [unix] updated to 4.1.9
Belgium
Reply With Quote
  #76  
Old 10-07-2008, 01:25 PM
 
modibaba modibaba is offline
 

Senior Member
  
Join Date: Mar 2008
Location: UK
Posts: 108
 

Default Re: 3 column layout with thumbnail for Related Products

Hi, just wondering how do I use this addon for the featured products, I noticed Lingerieblowout has done it nicely on his website..
Thanks
__________________
X-Cart DB Version: 4.1.9 GOLD

Addons:
Amazon skin;
Fancy Categories;
Magnifier (enabled);
Survey (enabled);
CDSEO Pro;
Category SEO Map;
One Page Checkout;
Greet Visitor;
On_Sale;
Reply With Quote
  #77  
Old 10-07-2008, 07:25 PM
  alarnold's Avatar 
alarnold alarnold is offline
 

Advanced Member
  
Join Date: Jan 2008
Posts: 33
 

Default Re: 3 column layout with thumbnail for Related Products

Still works for version 4.1.11

Many thanks......
__________________
X-Cart version 4.7.12 Platinum

arnoldcoin.com

Change is inevitable, except from a vending machine
Reply With Quote
  #78  
Old 10-20-2008, 10:16 AM
 
modibaba modibaba is offline
 

Senior Member
  
Join Date: Mar 2008
Location: UK
Posts: 108
 

Default Re: 3 column layout with thumbnail for Related Products

MoonDog
Thanks for your all your posts they are very helpful.
__________________
X-Cart DB Version: 4.1.9 GOLD

Addons:
Amazon skin;
Fancy Categories;
Magnifier (enabled);
Survey (enabled);
CDSEO Pro;
Category SEO Map;
One Page Checkout;
Greet Visitor;
On_Sale;
Reply With Quote
  #79  
Old 11-17-2008, 11:51 PM
  SamsonWebDesign's Avatar 
SamsonWebDesign SamsonWebDesign is offline
 

Senior Member
  
Join Date: Oct 2008
Location: East Sussex, UK
Posts: 101
 

Default Re: 3 column layout with thumbnail for Related Products

Quote:
Originally Posted by whsu716
this is great!

Is there a way to include a part of the product detail?
--

got it - simple modification of the related_products.php

replace the sql code with this


and in your related_products.tpl you just need to add this wherever you want:



hope that helps!

-edit-
and if the description is too long..then add this:



and then add a 'read more here' link to the end of the dots...



you can see the example here:
http://www.yoyonation.com/product.php?productid=63&cat=0&page=1 - it's still in testing and we haven't loaded in our yoyo products yet...

if anyone can help me out with the comment thing below..
would like to add an edit/delete option in the admins..having trouble programming that - but if i get it, will definitely add it into the mod page.!

I'm trying to display a product description in my related_products.tpl and have tried the above but just get an SQL error thrown back at me when I change the code in related_products.php.

Has anyone managed to get a drescription displayed in the related product yet?
__________________
Versions 4.1.11 to 4.6.4 ... when will the new versions end!

Custom X-Cart driven e-commerce sites, skins and installations at www.samsonwebdesign.co.uk
Reply With Quote
  #80  
Old 11-25-2008, 07:59 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: 3 column layout with thumbnail for Related Products

Quote:
Originally Posted by SamsonWebDesign
I'm trying to display a product description in my related_products.tpl and have tried the above but just get an SQL error thrown back at me when I change the code in related_products.php.

Has anyone managed to get a drescription displayed in the related product yet?

Little mode for Related Product on the detail product page:
a) a "PRODUCT THUMBNAIL PHOTO", will appear in related products
b) they can specify "HOW MANY PRODUCTS, WILL APPEAR" in related products (you can specify this option in the admin area)
c) allow for the "BUY NOW" BUTTON, to appear in related products (you can specify this option in the admin area)


http://forum.x-cart.com/showthread.php?t=43179
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:44 PM.

   

 
X-Cart forums © 2001-2020