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

Thumnails reduced by %

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 08-04-2003, 01:23 PM
 
slimmedia slimmedia is offline
 

Member
  
Join Date: May 2003
Posts: 23
 

Default

Although I agree that it's probably best to resize your images, I think it's possible to do what you're asking.

I think the following code will work in products.tpl (I haven't tested it). If you're wanting to make the change to the single product page, you'd use $product.image_x.

Code:
{math equation="x/3" x=$products[product].image_x assign="proportional" } <a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$proportional product=$products[product].product tmbn_url=$products[product].tmbn_url} {$lng.lbl_see_details}</a>
[/code]
Reply With Quote
  #12  
Old 08-04-2003, 11:21 PM
 
ambermoon ambermoon is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Perth Western Australia
Posts: 72
 

Default

Thanks for that. However, this code is not reducing the imagesize. Is there anything I have to add ?
Reply With Quote
  #13  
Old 08-05-2003, 08:55 AM
 
slimmedia slimmedia is offline
 

Member
  
Join Date: May 2003
Posts: 23
 

Default

I tested the code and it worked fine. I'm running x-cart version 3.4.3.

The one thing to check is that the widths of your images are being stored in the 'xcart_products' table. In newer versions this is added automatically when you upload your images. Older versions don't do it automatically. You could add the widths manually if you wanted.

One more thing, the line in my code:

Code:
{math equation="x/3" x=$products[product].image_x assign="proportional"}

Should be changed to:
Code:
{math equation="x/3" x=$products[product].image_x assign="proportional" format="%01d"}

By the way, this code will make all of your images 1/3 of their actual size. If you wanted them to be 1/4, you could change the equation to "x/4". For 30% you could change the equation to "30 * (x/100)".
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 03:10 AM.

   

 
X-Cart forums © 2001-2020