![]() |
Thumbnail values and resizing
When I create a new product X-Cart automatically inputs the x and y image values in the products table. Consequently, when I physically resize and reupload the image, my product.tpl is giving the wrong height and width values. I normally change this using PHPMyAdmin but the problem is I've just resized all my thumbnails and am wondering the easiest way to update the database?
I also notice that the code for displaying the thumbnails in products.tpl is different from the product.tpl code and I'm wondering which one I should be using. Products.tpl doesn't take into account the x and y values in the database so displays the image correctly. product: Code:
{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url} products: Code:
{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url} This is a 3.5.4 store that X-Cart upgraded to 4.0.12 so I'm not sure what the default should be. Thanks Dan |
Products.tpl uses the setting in General settings/Appearance options to resize the image. Product.tpl defaults to the image size. Are your images in the DB or filesystem? You could just remove this from the product.tpl template to get them to resize automatically:
image_x=$product.image_x image_y=$product.image_y |
Thanks Balinor, they're in the filesystem. I've also got the appearance options to default to actual image size (00) as they don't turn out to well when resized.
Dan |
Quote:
i was having exact same issue. this worked perfectly. thanks! now i notice its doing it on the admin side when editing a product, the thumbnail is still trying to show at the old size (300 px wide when the image is actuall only 200 now). any idea what (and where) to modify the code "image_x=$product.image_x image_y=$product.image_y" on the admin side? can't seem to find it. |
All times are GMT -8. The time now is 02:37 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.