X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Pictures in recommends.tpl for 3 column format (https://forum.x-cart.com/showthread.php?t=7506)

MythNReality 05-14-2005 02:53 PM

Quote:

Originally Posted by balinor

Hugs to Balinor, that's was exactly what I was looking for \:D/

balinor 07-16-2005 08:44 AM

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}


Lingerieblowout 07-16-2005 10:37 AM

Thanks balinor....

His last post also works in XC 3.4.6

Michael

balinor 07-16-2005 10:41 AM

Yea, code hasn't changed much in these templates since way back when :)

Bling 07-27-2005 06:11 PM

Hey there Balinor...I just tried this with 13 and it doesnt seem to do anything. I have hooters url app installed and I noticed he has some code in there. Have you tried this app with any of your customers with his url app?

This is exactly what the doctor ordered...pictures with the recomended products. :D

Thanks,
Bling

Lionel 02-25-2006 02:12 AM

Balinor, you code works perfect, thanks. However, the thumb_url value is not passed

Code:

tmbn_url=$recommends[num].tmbn_url


Please how can I build that array in recommends.php?

Thanks.

Lionel 02-25-2006 05:52 AM

I figured it out and am posting the soution in case someone else wants it.
(that's to use with TelaFirma's mod)

in recommends.php

after
Code:

if(!empty($products_id)) {
foreach($products_id as $p) {
$query_ids[] = $p['productid'];


simply put
Code:

$rec_thumb_url[]=func_get_thumbnail_url($p['productid']);
then at the bottom pass it on to smarty
Code:

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

finally in recommends.tpl

Code:

tmbn_url=$rec_thumb_url[num] id="product_thumbnail"

Now the images that we are able to display in recommends thanks to Balinor can take advantage of that most recommended mod of TelaFirma.

Lionel 02-25-2006 08:15 AM

ermm, the solution is not so good. It pulls the thumbs randomly too and does not match them with title.

Balinor, help?

Audiolines 07-06-2006 04:32 PM

ok, i love this code, but it want to display my prices along with my recommended products... i cant figure out the code to display that, as prices are stored in a seperate table

ecommerce 07-29-2006 08:26 PM

I kinda got lost with this mod.

Do i need to buy a mod or add on?

Whats the code and where do i put it?

I just want below the tabbed aread,

3 columns to list 3 products.

for each product i want to show
1. thumb pic
2. title of item
3. price

1 and 2 are cliackable so they go to the product page.\
im using 4.0.18


All times are GMT -8. The time now is 04:52 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.