| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
HOW TO: show different images for listed/featured products | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
HOW TO: show different images for listed/featured products
[edit] For a how-to see 3rd post [/edit]
Hi, How hard would the following be? The way it is now the featured product window takes my product images and sizes them down in the browser to 70x71. My images are rather detailed, so this process really make the images look pretty bad. I use the filesystem BTW, so it uses URL's for pictures. Now what I would like to do is have 2 images for everything. The normal image that shows in the product details is product.jpg, and for my featured products I would like x-cart to use product_f.jpg (for example, if it's easier this file could also be named to something else). Anyone have any ideas on how I should should go at this? Thanks in advance! |
|||||||
#2
|
|||||||
|
|||||||
Nevermind this was pretty easy after I looked into it further. If anyone wants to know how I did it let me know.
|
|||||||
#3
|
|||||||
|
|||||||
How did you do it?
How did you do it?
Thanks |
|||||||
#4
|
|||||||
|
|||||||
[EDIT] THERE IS A MUCH EASIER AND BETTER WAY POSTED BELOW! THIS ONE IS GOOD IF YOU WANT ALL THE PICTURES SEPERATED FROM EACH OTHER. [/EDIT]
Ok I used this method for both product listings (20x29 pics, example @ http://www.madtech.org/customer/home.php?cat=53) and featured products (70x70 pics, example @ http://www.madtech.org/customer/home.php?cat=103). This is a very dirty hack simply involving file names, it could probably be done better and more cleanly, but fuck it this works. This hack assumes you're using the filesystem to store pics. I won't provide any support for people who cant get it to work, I'm posting this and you can figure it out from there. First edit your /include/func.php and add the following function at the bottom (anywhere actually). You will need to edit the home directory in the function below. Code:
Now create a file called product_thumbnail_feat.tpl in /skin1/. Code:
Now I don't remember what the original line was, but in /costumer/products_t.tpl basically where it calls for product_thumbnail.tpl replace that with the following. All that's changed is that it points to product_thumbnail_feat.tpl and passes a parameter that we created the function for earlier (tmbn_name=$products[product].tmbn_name). Now you should be all set, simply get some application that will bath resize all your pics for you, and then rename all the files (there are also tools that will do this for you) to the following. If your original product pic is called example.jpg the new sized photo should be called example.jpg_f.jpg. So all this hack does is add a tag to a filename. If you want to to this to product listings thumnbails, just follow the above steps and instead create a file called product_thumnbail_list.tpl, make products.tpl call for _list.tpl and pass the tmbn_name parameter. That's it! Good luck to everyone who will attempt this, if you come up with a cleaner hack share the wealth! Enjoy the hack! |
|||||||
#5
|
|||||||
|
|||||||
OK here is the easier way. It's much faster to implement, but it assumes that all files (normal, featured & listed) are all in one directory, instead the above way allows you to have they sorted out in different directories. So here we go.
Create a file called /product_thumbnail_feat.tpl Code:
Now all you have to do is look through /customer/main/products_t.tpl and replace the call for product_thumbnail.tpl to our newly created file. That's it! No extra functions to create or anything. I'm still using the original way because I have a lot of products and it's easier to have pics in different directories. Again this will show the featured product images from example.jpg to example_f.jpg. Also it's best to have all files in one format, but if not creating a function that checks if a file is .gif or .jpg wouldn't be hard. |
|||||||
|
|||
X-Cart forums © 2001-2020
|