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

Pictures in recommends.tpl for 3 column format

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #91  
Old 03-26-2009, 08:19 PM
 
jharwood jharwood is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 67
 

Default Re: Pictures in recommends.tpl for 3 column format

Is it a big deal to include specific extra field data in the recommended items display? What would be the format to call extra fields for v4.1.12?

Thanks

XCart 4.1.12
__________________
John Harwood
v3.5.14, v4.0.17, v4.1.8
Reply With Quote
  #92  
Old 03-26-2009, 09:45 PM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Pictures in recommends.tpl for 3 column format

Quote:
Originally Posted by balinor
Just a little update on this thread. Here's the code for 4.x that breaks the display up into rows of 3, allowing as many recommended products as you want (as set in General Settings/Modules Options). Just change the thumbnail width as you would like (in pixels). You can also adjust the number of columns by changing the width of the td and the 'div by x' where x is the number of columns:

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=100 product=$recommends[num].product tmbn_url=$recommends[num].tmbn_url} <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}

Thanks balinor for such a fine code.Is it possible to display all images in a revolving way in Recommended products list option?
Thanks to all.
__________________
4.6.1 Platinum


Reply With Quote
  #93  
Old 04-22-2009, 06:37 PM
 
dmic dmic is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 63
 

Default Re: Pictures in recommends.tpl for 3 column format

Thanks

This worked great for me in 4.1.11

Dave
Reply With Quote
  #94  
Old 09-04-2009, 06:37 AM
 
aurimasdulskis aurimasdulskis is offline
 

Advanced Member
  
Join Date: May 2009
Posts: 45
 

Default Re: Pictures in recommends.tpl for 3 column format

Hello,

Maybe someone can help how to do correct "Market price", because with "Our price" all is ok, but "Market price" for all products is the same and this price is detail product price. If you can't understand, i think screenshot will helps.

Thank you so much! As you can see my version is 4.1.11

http://img44.imageshack.us/img44/1381/33404334.jpg
__________________
My X-cart version 4.1.11 GOLD
Reply With Quote
  #95  
Old 09-04-2009, 06:44 AM
 
aurimasdulskis aurimasdulskis is offline
 

Advanced Member
  
Join Date: May 2009
Posts: 45
 

Default Re: Pictures in recommends.tpl for 3 column format

MY code:

{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}
<table border=0 width=100%>
<tr>

{section name=num loop=3}
<td width=33% align=center valign=top>
<div style=" margin-bottom:5px;"><a href="product.php?productid={$recommends[num].productid}" class="ItemsList2">{$recommends[num].product}</a></font></div>
<a href="product.php?productid={$recommends[num].productid}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}</a>
<br>

<div style=" margin-top:5px;">

<span >Rinkos kaina:</span> <s><span>{include file="currency.tpl" value=$product.taxed_price}</span></s>
<span class="market-price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</span>
</div>
<font class="ProductPrice">
{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].taxed_price}</font><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>



</td>
{/section}

</tr>
</table>

{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{/if}
__________________
My X-cart version 4.1.11 GOLD
Reply With Quote
  #96  
Old 09-05-2009, 06:55 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Pictures in recommends.tpl for 3 column format

You've mixed products.tpl, product.tpl and recommends.tpl variables. In recommends.tpl the product information for the recommended products list is in $recommends, not in $products or $product. To refer to the current product in the loop you should be using $recommends[num]. You need to change several things:

$products[product].product to $recommends[num].product
$products[product].tmbn_url to $recommends[num].tmbn_url
$products[product].taxed_price to $recommends[num].taxed_price

And finally the one which will actually fix the problem you are asking about:
$product.taxed_price to $recommends[num].list_price
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #97  
Old 12-03-2009, 03:30 PM
  hoosierglass's Avatar 
hoosierglass hoosierglass is offline
 

X-Adept
  
Join Date: Aug 2006
Location: Zionsville, IN
Posts: 974
 

Default Re: Pictures in recommends.tpl for 3 column format

I was playing around with this for version 4.3

While it worked ok I was getting the word "array" for the alt on the product images. I did a little bit of altering and came up with a code that works just fine.

Code:
{* $Id: recommends.tpl,v 1.16 2009/04/18 06:33:07 max Exp $ vim: set ts=2 sw=2 sts=2 et: *} {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=0 width="100%"> <tr> {/if} {if $smarty.section.num.index is div by 3} </tr><tr valign="top"> {/if} <td width="33%" align="center" valign="top"> <a href="product.php?productid={$recommends[num].productid}" class="ItemsList">{$recommends[num].product}</a> <br /> <a href=product.php?productid={$recommends[num].productid}&cat={$cat}&page={$navigation_page}> {include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=75 product=$recommends[num].product tmbn_url=$recommends[num].tmbn_url}</a> <br /> <font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].taxed_price}</font> </td> { if %num.last% }</tr> </table>{/if} {/section} {/capture} {include file="customer/dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"} {/if}

If you want the product images to be larger just change the image_x=75 to whatever size you want. Also if you want to go to four wide change the div number to 4 and the width to 25% and for two wide switch div number to 2 and the width to 50%

I hope this is of some use to those playing around with 4.3
__________________
X-Cart Gold 4.7.7
Custom Work from www.luminointernet.com
www.indy-pen-dance.com
Reply With Quote

The following 2 users thank hoosierglass for this useful post:
Babydoll (01-21-2010), eddy (02-18-2010)
  #98  
Old 02-20-2010, 08:27 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Pictures in recommends.tpl for 3 column format

I used Balinor's code in 4.1.12 but I made it so it will verify as XHTML 1.0 Transitional

Code:
{if $recommends} {capture name=recommends} {section name=num loop=$recommends} { if %num.first% } <h1>People who bought the {$product.manufacturer} {$extra_fields[0].field_value} were also interested in...</h1><p /><br /><p /> <table border="0" width="100%"><tr><td></td>{/if} {if %num.index% is div by 3}</tr><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=90 product=$recommends[num].product tmbn_url=$recommends[num].tmbn_url}</a> <br /> <a href="product.php?productid={$recommends[num].productid}&cat={$cat}&page={$navigation_page}">{$recommends[num].product|escape}</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%"'} {/if}
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
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 06:41 AM.

   

 
X-Cart forums © 2001-2020