| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
create thumbs from large image | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
create thumbs from large image
This mod has been tested in 4.1.0. It will allow you to only upload a product image and display a thumb and multiple size images from one. So you do not have to upload a product image and a product thumb image. If a thumbnail image exists, then it will use it instead of the product image.
I did this because I did not want to upload product images and then have to create a new image for thumbs for each of my products. I wanted to buy the Telefirma mod, but does not work in 4.1.x yet and I did not know when it will be ready for 4.1.x. It took me about 20 hours to create this, so I figured I should share it and let others benefit from this also. Where you are calling product_thumbnail.tpl, you can pass these parameters: tmbn_height - height of image to be created tmbn_width - width of image to be created tmbn_link (true or false) - whether or not to make the image a link to the original size of the image All of the parameters that the mod takes is listed in the link in step 1, you would just need to modify the product_thumbnail.tpl to accept the parameter and pass it to thumb mod. Here are the steps: 1. Goto this site: http://www.cerdmann.com/thumb/ and download function.thumb.php and copy into your smarty -> plugins directory 2. Replace contents of skin1\product_thumbnail.tpl with Code:
3. This step modifies the product.php page so that when you are searching, it returns the path to the product image. In include\func\func.product.php find the following: Code:
and add this after: Code:
4. This modification passes the product and thumb image paths to product_thumbnail.tpl In Skin1\customer\main\product.tpl find the following: Code:
and replace with this: Code:
5. This step passes the product and thumb paths to the product_thumbnail.tpl file if use popup images is checked (in admin side). In skin1\modules\Detailed_Product_Images\popup_image. tpl find this: and replace it with this: 6. This step allows the thumb image to be created for the product listing page. If you are not using the DSEFU mod, then only find and replace what is in the else statement. In skin1\customer\main\products.tpl find this: Code:
and replace with this: Code:
7. In include\search.php find this: Code:
and after that, add: Code:
8. This step gets the product image path for the recommended products - I modified my recommended products to show the product image, not just a link. If you do not show a product image in recommended products, then just skip this step. In recommends.php find this: Code:
and replace with this: Code:
9. This step passes the product image path to the product_thumbnail.tpl file for recommended products (upsell). Again, if you do not show the product images for recommended products, then skip this. Also, I have a tabs mod installed, so it will be a different file than listed and the code might be slightly different. Find where you are calling product_thumbnail.tpl (using an include) and replace it with this: Code:
You should be done. I will try to post some screen shots later. Let me know if you have any questions or problems.
__________________
Mike Kenzie X Cart Gold Ver. 4.1.3 X-RMA X-AOM X-Product Comparison |
|||||||
#2
|
|||||||
|
|||||||
Re: create thumbs from large image
Hi,
This is great one. I want to ask one thing. Can we use this mod with Product variants image? If it yes, will be perfect. Thanks...
__________________
X Cart Gold Ver. 4.1.6 |
|||||||
#3
|
|||||||
|
|||||||
Re: create thumbs from large image
I have not coded it to work with product variants.
__________________
Mike Kenzie X Cart Gold Ver. 4.1.3 X-RMA X-AOM X-Product Comparison |
|||||||
#4
|
|||||||
|
|||||||
Re: create thumbs from large image
Great- can't wait to try this! As for product variants, they have to be loaded as individual images anyways. They display in the cart, but use the main product variant image as there is no appointed thumbnail. I would like to see X-cart implement the ability to have thumbnails for product variant images.
I did here Telafirma mention a while back that his developing 4.1 version was going to include variant capabilities, so that may still be a reason to buy it... TF, any progress? - Mike
__________________
4.1.9 |
|||||||
#5
|
|||||||
|
|||||||
Re: create thumbs from large image
Step 3 causing SQL error messages and I got also this error:
Fatal error: Smarty error: [in product_thumbnail.tpl line 3]: syntax error: unrecognized tag: $type|default:["/img"]{/if (Smarty_Compiler.class.php, line 436) in /home/httpd/vhosts/sample.com/httpdocs/Smarty-2.6.12/Smarty.class.php on line 1095
__________________
Jay S Xcart 4.1.3 & Mysql 5.0.20 Xcart 4.0.17 & Mysql 4.1 Apache 2.0 & Linux Whitebox 3 |
|||||||
#6
|
|||||||
|
|||||||
Re: create thumbs from large image
Try this:
2. Replace contents of skin1\product_thumbnail.tpl with Code:
When they changed the forum over, the img tags got messed up in the forums. Also, this was done in 4.1.0, not 4.0.17. The SQL code is probably different.
__________________
Mike Kenzie X Cart Gold Ver. 4.1.3 X-RMA X-AOM X-Product Comparison |
|||||||
#7
|
|||||||||
|
|||||||||
Re: create thumbs from large image
Quote:
Yes - there is progress. The new Mod will: * Have the ability to Enable or Disable mod (just like all other built in X-Cart Modules) * Work with Product Variant images * Have selectable JPG image quality * Select to use the Unsharp mask or not * Properly preserves Alpha transparency for PNG files * Watermark images with Company Name (as specified in General Settings) * Select to display Variant Images as Detail Image thumbs below the main product image on the product page * Select to display Main Product Image as first Detail Image thumb below the main product image on the product page * and more... |
|||||||||
#8
|
|||||||
|
|||||||
Re: create thumbs from large image
When will the new mod for 4.1.x be available?
__________________
Mike Kenzie X Cart Gold Ver. 4.1.3 X-RMA X-AOM X-Product Comparison |
|||||||
#9
|
|||||||
|
|||||||
Re: create thumbs from large image
i get this error:
Fatal error: Smarty error: [in product_thumbnail.tpl line 2]: syntax error: unrecognized tag 'thumb' (Smarty_Compiler.class.php, line 580) in /home/vulcan/public_html/xcart/Smarty-2.6.12/Smarty.class.php on line 1095 im using 4.1.2 |
|||||||
#10
|
|||||||
|
|||||||
Re: create thumbs from large image
Did you copy function.thumb.php into your Smarty -> plugins directory?
__________________
Mike Kenzie X Cart Gold Ver. 4.1.3 X-RMA X-AOM X-Product Comparison |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|