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 - Can I link to a folder? (https://forum.x-cart.com/showthread.php?t=5944)

rackit 01-09-2004 08:57 PM

Related Products - Can I link to a folder?
 
For one product in my site, I would like the Related Products table to link to an entire category. My idea was to edit the database and add a related product with an odd product number, such as 77777 (This willl never be used). I then modified related_products.tpl as follows thinking this would do what I wanted. I was wrong.

Code:

{* $Id: related_products.tpl,v 1.7 2002/10/22 10:27:05 olga Exp $ *}
{if $product_links ne ""}
{capture name=dialog}
<table border=0 cellspacing=5>
{section name=cat_num loop=$product_links}
<tr class="ItemsList">

{if $product_links[cat_num].productid == 77777}
<td width=1%>asdf  </td>
<td width=99%>
<a href="home.php?cat=999" target=_blank>
Thule Fit Kits </a>

{else}
<td width=1%>#{$product_links[cat_num].productid}</td>
<td width=99%>
<a href="product.php?productid={ $product_links[cat_num].productid }" target=_blank>
{ $product_links[cat_num].product|escape} </a>
{/if}

</td>
</tr>
{/section}
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra="width=100%"}
{/if}


The result was that the Related Products box was gone completely. I would greatly appreciate any form of help.

adpboss 01-10-2004 08:37 PM

Post in Template Editing, not here.

This forum for sharing Custom Modifications only, not posting user problems with templates.

Quote:

Have you created a custom tool, feature or design that you want to show off? You can post your personally customized templates here and share your work with the forum. Please, no requests or wish lists here - this topic is only for posting customized X-cart files

You'll get a faster response in the correct forum.

shan 01-11-2004 06:49 AM

moved

rackit 01-11-2004 07:58 PM

I figured it out! If anyone was actually trying to figure this out, I thank you for the effort.

adpboss 01-11-2004 08:00 PM

Why not share your results? That is how we all learn.

I'd love to know the answer you figured out.

rackit 01-11-2004 08:45 PM

Good Idea. I figured out that the xcart_product_links table would delete an upselling link if the number did not correspond to an actual product. To remedy this, I created a new product with the "Not Available" option enabled. I then used a similar format as before using the product number of this "invisible". The invisible product's number was "77298" so the code looked like the following:
Code:

{if $product_links[cat_num].productid eq "77298"}
<td width=1%>  </td>
<td width=99%>
<a href="home.php?cat=999" target=_blank>
My Custom Category Title </a>

{else}
<td width=1%>#{$product_links[cat_num].productid}</td>
<td width=99%>
<a href="product.php?productid={ $product_links[cat_num].productid }" target=_blank>
{ $product_links[cat_num].product|escape} </a>
{/if}


999 being a generic number for the category I need to go to. It's a bit sloppy, but it works. The application for this is pretty wide as the link can take you to any place that is convenient for the product (even outside of your own site). This works a lot better than my previous direction too because there is no need to edit the database. The upselling link can be created using the normal method.

adpboss 01-12-2004 02:44 AM

Awesome, sounds like one for Custom Mods.

Thanks for sharing.


All times are GMT -8. The time now is 01:51 AM.

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