X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Related Products (https://forum.x-cart.com/showthread.php?t=48804)

mrerotic 07-24-2009 10:47 PM

Related Products
 
How can I add the product description in related products tpl? I have tried the following and nothing is coming from it:
PHP Code:

<div>{$product_links[num].descr|truncate:200:" ...":true}</div


I would appreciate anybody's suggestions or ideas. THX

cflsystems 07-25-2009 06:00 AM

Re: Related Products
 
In skin1/modules/Upselling_Products/related_products.tpl inside the foreach after
Code:

          <td><a href="product.php?productid={$p.productid}"{if $config.Upselling_Products.upselling_new_window eq 'Y'} target="_blank"{/if}>{$p.product|amp}</a></td>
add
Code:

<td>{$p.descr|truncate:200:"...":true}</td>


If you want this for upselling products the code to add will be
Code:

<td>$product_links[cat_num].descr|truncate:200:"...":true}</td>

See if that works for you

mrerotic 07-25-2009 06:19 AM

Re: Related Products
 
Sorry, but where are you getting $p and or [cat_num] in 4.2.1? The only variable in the related_products.tpl is $product_links[num] which I have already tried with no luck. Let me know. THX

cflsystems 07-25-2009 06:43 AM

Re: Related Products
 
there is no $product_links[num] in related_products.tpl (are you sure your version is 4.2.1?)
Here is related_products.tpl file
Code:

{*
$Id: related_products.tpl,v 1.20 2008/10/06 15:11:35 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{if $product_links ne ""}
  {capture name=dialog}
    <table cellspacing="0" summary="{$lng.lbl_related_products|escape}">
      {foreach from=$product_links item=p}
        <tr>
          <td class="item-number">#{$p.productid}</td>
          <td><a href="product.php?productid={$p.productid}"{if $config.Upselling_Products.upselling_new_window eq 'Y'} target="_blank"{/if}>{$p.product|amp}</a></td>
        </tr>
      {/foreach}
    </table>
  {/capture}
  {include file="customer/dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog additional_class="uproducts"}
{/if}


mrerotic 07-25-2009 09:09 AM

Re: Related Products
 
Ok when I add that though nothing shows up for any products even thought hey have descriptions. Can you verify this on your end?

Thanks

cflsystems 07-25-2009 09:27 AM

Re: Related Products
 
It turns out not all fields are available for related products. You need to make changes to php files to make descr and/or fulldescr fields available for recommended products and then the code I posted earlier will work

mrerotic 07-26-2009 12:02 PM

Re: Related Products
 
cflsystems any ideas how I can do this? I would appreciate your input on this and thanks for your input thus far.


All times are GMT -8. The time now is 05:41 AM.

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