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
  #41  
Old 10-24-2006, 04:03 PM
 
TJ Stephens TJ Stephens is offline
 

Advanced Member
  
Join Date: May 2005
Location: California
Posts: 94
 

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

Tuan,

Thanks for your post #37. Worked great on 4.1.3!
__________________
X-Cart Pro 4.1.11 (Live)
XRMA
XAFF
XAOM
DSEFU Pro
XGift Reg
Firetank Feed Manager
BCSE Shipping Calculator
XcartMod Dynamic Images
Reply With Quote
  #42  
Old 10-24-2006, 09:12 PM
 
TJ Stephens TJ Stephens is offline
 

Advanced Member
  
Join Date: May 2005
Location: California
Posts: 94
 

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

I am testing 4.1.3 right now. I am using the code on post #37 and was getting a smarty error when there were no bestsellers or related products (I have incorporated this mod into my related products). In order to fix the smarty error, I had to wrap some of the language in modules/Bestsellers/bestsellers.php in an if statement. I used the following code and it seemed to work.
Put this at the bottom of modules/Bestsellers/bestsellers.php
Code:
if ($bestsellers) { foreach ($bestsellers as $i=>$item) { $bestsellers[$i]["tmbn_url"] = func_get_image_url($item[productid],"T"); } } $smarty->assign("bestsellers",$bestsellers); ?>
I also added a similar line to the bottom of my modules/Upselling_Products/related_products.php file so that a tmbn_url would get passed so I could have images on my related products.
Code:
if ($product_links) { foreach ($product_links as $i=>$item) { $product_links[$i]["tmbn_url"] = func_get_image_url($item[productid],"T"); } } $smarty->assign("product_links",$product_links); ?>
Hope this helps.
__________________
X-Cart Pro 4.1.11 (Live)
XRMA
XAFF
XAOM
DSEFU Pro
XGift Reg
Firetank Feed Manager
BCSE Shipping Calculator
XcartMod Dynamic Images
Reply With Quote
  #43  
Old 11-10-2006, 11:43 AM
  SusanMoore's Avatar 
SusanMoore SusanMoore is offline
 

Advanced Member
  
Join Date: Aug 2006
Posts: 51
 

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

I took Balinor's "fix" and was nearly satisfied with the results. However, I moved the <a href> link higher in the code so that the user could click the figure as well as the text to go to the upsell product, and I inserted a <br> to force the text to the following line: Here's my modified code that seems to work fine in 4.0.19:

{* $Id: related_products.tpl,v 1.7.6.1 2004/12/06 svowl 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=5 width=100%>
{/if}

{if $smarty.section.cat_num.index is div by 3}
</tr><tr valign="top">
{/if}

<td width="250" 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>
<span class="ProductTitle">{ $product_links[cat_num].product|escape}</span>
</a></td>
{ if %cat_num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra="width=100%"}

{else}
{capture name=dialog}
No related products.
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra="width=100%"}
{/if}

Cheers,
Susan
__________________
X-Cart Gold 4.0.19 -- finally LIVE!!
http://www.fanent.com
Reply With Quote
  #44  
Old 11-20-2006, 10:10 AM
 
summitmn summitmn is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Manitou Springs, CO USA
Posts: 105
 

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

Quote:
Originally Posted by mlfnet
I was looking around the forums to display pictures in the recommends.tpl and came across some code, but it had prices and was setup for 1 column. I edited it so it would display in a 3 colums with just the picture and title.

Where did you find this original set of code? I have searched but cannot find it. I want to add prices and pictures but for only 1 column.
__________________
Using 4.4.0
Reply With Quote
  #45  
Old 01-24-2007, 08:12 AM
 
Cankus Cankus is offline
 

Member
  
Join Date: May 2006
Posts: 27
 

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

skin1/modules/Recommended_Products/recommends.tpl

This is workign on 4.3.1



{* $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}
__________________
www.elitmarket.com
Pro 4.4.3
Reply With Quote
  #46  
Old 02-04-2007, 09:33 AM
 
Acquamarina Acquamarina is offline
 

X-Adept
  
Join Date: Aug 2006
Location: USA
Posts: 811
 

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

Cankus,

Did you mean 4.1.3? Has anyone tested it in 4.1.6? Also, can this be used for the Related Products?

I don't use the recommended products because they are random. I only use the related products that are chosen to appear on the product page (upselling links) and I really need to add columns there.
If this code does not work, does any one know where I can find the right one?

Thanks!
__________________
Vera B
4.4.5
CFLSystems.com mods, Kosmos eBay Integration, Feed Manager Pro, custom mods, BCSEngineering Mods, CDSEO PRO
Hosting by EWDHosting - The best home for your x-cart.
Reply With Quote
  #47  
Old 02-04-2007, 11:41 PM
 
Cankus Cankus is offline
 

Member
  
Join Date: May 2006
Posts: 27
 

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

This code for related products and working on 4.3.1

File : skin1/modules/Upselling_Products/related_products.tpl


{* $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=$product_links}
{if $$product_links[num].productid}{assign var="tmp" value="1"}{/if}
{/section}

{section name=num loop=$product_links}

{ if %num.first% }
<table border=0 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=$product_links[num].productid image_x=100 product=$product_links[num].product tmbn_url=$product_links[num].tmbn_url}
<a href="product.php?productid={ $product_links[num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>

<BR>

<span class="ProductTitle">{ $product_links[num].product|escape}</span><br>

</a></td>
{ if %num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No related products.
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.recommends extra='width="100%"'}
{/if}
__________________
www.elitmarket.com
Pro 4.4.3
Reply With Quote
  #48  
Old 02-19-2007, 03:42 AM
  Pantalonas's Avatar 
Pantalonas Pantalonas is offline
 

Member
  
Join Date: Aug 2006
Posts: 28
 

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

Thank you for the code, works great!

Mark
__________________
X-Cart 4.2.2 / PHP 5.2.9 / Webserver Apache 2.0.63 (FreeBSD) / MySQL 5.0.77
http://www.hemmaplanet.eu
Reply With Quote
  #49  
Old 02-20-2007, 01:10 PM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

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

Sorry if this has been covered already but is it possible to just show related products from the same category of the page it is on?
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #50  
Old 04-21-2007, 05:26 PM
  mitash's Avatar 
mitash mitash is offline
 

X-Adept
  
Join Date: Jan 2006
Location: Australia
Posts: 450
 

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

This mod is great... I just installed it on 4.1.6 and looks great.

Thanks!!
__________________
eCommerce - Strategy / Design / Development / Marketing / Maintenance

Call within Australia:
Phone: 1300 648 274 | Mobile: 0417 241 950
Call outside Australia:
+61 417 241 950 |

Email:
results@mitash.com | Skype: mitashau | Web: www.mitash.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 05:05 AM.

   

 
X-Cart forums © 2001-2020