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)
-   -   Show recommended and related products in 3 columns (in one row) (https://forum.x-cart.com/showthread.php?t=58191)

just_me 11-18-2009 07:37 AM

Re: 3 column layout with thumbnail for Related Products
 
Just wanted to share my edit to show recommended and related products in 3 columns (in one row) simplified. Works for 4.2
First related products:
Code:

{*
$Id: related_products.tpl,v 1.20 2008/10/07 10:52:42 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{if $product_links ne ""}
  {capture name=dialog}
    <table class="uproducts">
   
        <tr>
{section name=cat_num loop=$product_links}
                    <td><a href="product.php?productid={$product_links[cat_num].productid}"{if $config.Upselling_Products.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.product tmbn_url=$product_links[cat_num].tmbn_url}<br /><br />{$product_links[cat_num].product|amp}</a></td>
{/section}
        </tr>
 
    </table>
  {/capture}
  {include file="customer/dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog additional_class="uproducts"}
{/if}

and this code for recommended products:
Code:

{*
$Id: recommends.tpl,v 1.14 2008/10/07 10:52:42 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{if $recommends}
  {capture name=recommends}
    <table class="rproducts">
<tr>
{section name=num loop=3}
<td>
              <a href="product.php?productid={$recommends[num].productid}&cat={$cat}&page={$navigation_page}">
{include file="product_thumbnail.tpl" productid=$recommends.productid image_x=$config.Appearance.thumbnail_width product=$recommends.product tmbn_url=$recommends[num].tmbn_url}<br /><br />
{$recommends[num].product|amp}</a>
    </td>

{/section}
</tr>
</table>
  {/capture}
  {include file="customer/dialog.tpl" title=$lng.txt_recommends_comment content=$smarty.capture.recommends additional_class="rproducts-dialog"}
{/if}


JWait 02-22-2011 08:04 AM

Re: 3 column layout with thumbnail for Related Products
 
Quote:

Originally Posted by just_me
Just wanted to share my edit to show recommended and related products in 3 columns (in one row) simplified. Works for 4.2
First related products:


Umm.. your code is for "recommended" products(Recommended_Products). This thread is about "related" products (Upselling_Products). They are two entirely different modules and people are liable to confuse them.

qualiteam 02-24-2011 06:54 AM

Re: Show recommended and related products in 3 columns (in one row)
 
Moving to separate forum (source forum -> http://forum.x-cart.com/showthread.php?t=10773&page=10)


All times are GMT -8. The time now is 07:34 AM.

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