![]() |
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" } |
Thanks for that. However, this code is not reducing the imagesize. Is there anything I have to add ?
|
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)". |
All times are GMT -8. The time now is 12:53 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.