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

Random Image or Random Products - Category Specific

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #51  
Old 10-24-2012, 07:33 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Random Image or Random Products - Category Specific

If you have the product id then you have the URL. the URL is product.php?productid={$productid} Look at the template, what is the code for the link look like?
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #52  
Old 10-24-2012, 07:40 PM
 
franki franki is offline
 

Member
  
Join Date: Aug 2005
Posts: 13
 

Default Re: Random Image or Random Products - Category Specific

I'm using the exact template as provided in this thread, but a href is blank in the rendered HTML.

Code:
[random.tpl] {capture name=dialog} {if $r_products ne ""} {include file="customer/main/products.tpl" products=$r_products} {/if} {/capture} {include file="dialog.tpl" content=$smarty.capture.dialog extra="width=100%"}

Do we need to pass more parameters herein?

and customer/main/products.tpl is the stock xcart file without any mods...
__________________
Version: 4.5.x
Reply With Quote
  #53  
Old 10-25-2012, 01:34 AM
 
franki franki is offline
 

Member
  
Join Date: Aug 2005
Posts: 13
 

Default Re: Random Image or Random Products - Category Specific

Code:
<a href="{$product.alt_url|default:$product.page_url|amp}" class="product-title">{$product.product|amp}</a>

the above is the a href code from products.tpl

and by changing it to (and create a new template file so not to wreck products.tmp; e.g. products_random.tpl:

Code:
<a href="product.php?productid={$product.productid}" class="product-title">{$product.product|amp}</a>

This now fixes the problems.

One other thing is, this only display the product name (and link) and it's thumbnail, but it doesn't display the price, buy now button, etc...
__________________
Version: 4.5.x
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 12:10 PM.

   

 
X-Cart forums © 2001-2020