Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Related Products - Can I link to a folder?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-09-2004, 08:57 PM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default 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.
Reply With Quote
  #2  
Old 01-10-2004, 08:37 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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.
Reply With Quote
  #3  
Old 01-11-2004, 06:49 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

moved
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #4  
Old 01-11-2004, 07:58 PM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default

I figured it out! If anyone was actually trying to figure this out, I thank you for the effort.
Reply With Quote
  #5  
Old 01-11-2004, 08:00 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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

I'd love to know the answer you figured out.
Reply With Quote
  #6  
Old 01-11-2004, 08:45 PM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default

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.
Reply With Quote
  #7  
Old 01-12-2004, 02:44 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Awesome, sounds like one for Custom Mods.

Thanks for sharing.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:14 AM.

   

 
X-Cart forums © 2001-2020