Author Topic: No thumbnails on product page after update 1.1.3 -> 1.1.4  (Read 6084 times)

Engholm

  • Beginner
  • *
  • Posts: 28
    • pixeldiele mediendesign
No thumbnails on product page after update 1.1.3 -> 1.1.4
« on: January 24, 2010, 01:59:55 am »
Hi,

since updating (with J1.5 patch file) from 1.1.3 to 1.1.4 I've got trouble with the thumbnails on the product-pages. The dynamic thumbnails creation works fine for the category flypages but not for the product detail pages. When there is more than one image on the product page, the first image is shown full size without thumbnail, the following have got the correct thumbnails. With only one image on a product page, the full sized images is shown instead of the thumb.

I tried to clear the resize directory, insert the SQL command "update jos_vm_product set product_thumb_image = product_full_image", disabled Artio JoomSEF but nothing solves the problem. A downgrade to 1.1.3 works, but think this should not be the solution.

Has anybody an idea to solve this problem?

The URL: http://www.enok-shop.de/joomla

Theme: ja_larix
PHP Version: 5.2.9
GD Support is enabled (2.0.34)
(The server environment did not change with the update)

linux4me

  • Beginner
  • *
  • Posts: 19
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #1 on: January 25, 2010, 23:06:11 pm »
I have spent hours trying to figure this out, as I had a similar problem on three sites I upgraded from 1.1.3 to 1.1.4. All are using basic VM installations that worked great until the upgrade. None are using any SEF or any third-party VM plugins. For two of the sites, the only extension installed is VM.

I have no errors in my server error logs, all my folders are set with 755 permissions and the files are all 644. I have GD running on the server, and the 'Enable Dynamic Thumbnail Resizing' is checked on the Site tab of the Admin Configuration section of VM. Cycling the latter off and on made no difference. Deleting all the images in my resized folders did not result in new thumbnails being created. (That may be another issue.)

I have full-sized images displayed for the categories and for the products. I don't have any products with multiple images, so I can't say anything about that. What I discovered is that VM is correctly using the database fields jos_vm_category.category_thumb_image and jos_vm_product.product_thumb_image for the source of the thumbnails for categories and products, respectively, without prepending the 'resized/' and leaves off the '_150x150' (substitute the size of your thumbnails for the '150' at the end of the file name.

If you use the tried-and-true method of resizing your thumbnails by running the SQL statement:
Code: [Select]
update jos_vm_product set product_thumb_image = product_full_imageit only perpetuates the problem because it will show the full-sized image from the shop_image/category or shop_image/product folders. (There's a similar SQL statement for categories that I didn't show.)

I tried deleting a category image and then adding a new one and discovered that the current version of VM, 1.1.4, prepends the 'resized/' to the file name in jos_vm_category.category_thumb_image, so I wrote a couple of SQL statements to fix the existing categories and products. It works, but if whatever code the designers changed in this version is reverted to whatever it was in 1.1.3, the 'resized/' and the '_150x150' may no longer be needed and would need to be removed after the next upgrade. That, too, would be no big deal, and I will include the SQL for that below.

Note: All of the instructions below are based on the assumption that your thumbnails worked in 1.1.3 and then you got full-sized images instead of thumbnails after upgrading to 1.1.4. If that's not the case, this procedure probably won't help you. It also assumes that you didn't delete all your re-sized images. If you did, restore them from a backup. You do have a backup, don't you? If you're not experienced with MySQL and phpMyAdmin, or even if you are, it's a good idea to back up your database before doing this.

If you haven't already run the SQL statement (above) to copy the full-sized image name to the thumb field, all you may need to do is run this first SQL statement to prepend the file names with 'resized/', as you should have the correct file name without the 'resized/' in the database already. In that case, open phpMyAdmin and run the following SQL statement to fix your category images:
Code: [Select]
UPDATE jos_vm_category SET category_thumb_image = concat( 'resized/', category_thumb_image )Now do a Ctrl+F5 on your site to reload the images and see if the category thumbnails show up.

If you already ran the code to overwrite your thumb images with the full-sized image file, you need to identify the size of the thumbnails you're using. For me, they are 150 x 150, and VM appended a '_150x150' to all the automatically created thumbnails. You can either take a look in your shop_image/category/resized folder to see what was appended to yours, or if you're feeling lucky, take a look at the setting you have for thumbnails in Components -> Virtuemart -> Configuration -> Site. If the string based on your thumbnail size is appended to the files in the resized folder, but it's not in the database, you'll need to run the following SQL statement to fix the category images, substituting the '_150x150' for the size your're using:
Code: [Select]
UPDATE jos_vm_category SET category_thumb_image = replace( category_thumb_image, '.jpg', '_150x150.jpg' )
If that worked, and you need to fix the product images, using phpMyAdmin, take a look at the field product_thumb_image in jos_vm_product. If the image file name in that field doesn't start with 'resized/', you can fix it with this SQL statement:
Code: [Select]
UPDATE jos_vm_product SET product_thumb_image = concat( 'resized/', product_thumb_image )If you ran that SQL statement at the very top for products, you will also need to append the '_150x150'--or whatever you're using--to the end of the product thumbnail image file names to match the actual file names in the shop_image/product/resized folder on the server. You can do that with this SQL statement, again replacing the '_150x150' with whatever you're using:
Code: [Select]
UPDATE jos_vm_product SET product_thumb_image = replace( product_thumb_image, '.jpg', '_150x150.jpg' )
Now, suppose this didn't work for you, or when you upgrade next time none of your thumbnails show up. You can remove the 'resized/' and the '_150x150' from categories and products with the following SQL statements, substituting the size you're using for the '_150x150' that I use:
Code: [Select]
UPDATE jos_vm_category SET category_thumb_image = replace(category_thumb_image, 'resized/', '');
UPDATE jos_vm_category SET category_thumb_image = replace(category_thumb_image, '_150x150', '');
UPDATE jos_vm_product SET product_thumb_image = replace( product_thumb_image, 'resized/', '' );
UPDATE jos_vm_product SET product_thumb_image = replace( product_thumb_image, '_150x150', '' )

Engholm

  • Beginner
  • *
  • Posts: 28
    • pixeldiele mediendesign
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #2 on: February 01, 2010, 17:20:24 pm »
Thanx for this long description and explainations. Unfortunatley it doesn't help fixing my problem.

To upload again picture by picture seems to be the only way that works correctly :-/

linux4me

  • Beginner
  • *
  • Posts: 19
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #3 on: February 01, 2010, 19:33:17 pm »
Are you sure you have to re-load all the images? Have you checked the database to see what the difference in the path is between the newly loaded images and the ones that don't show thumbs? I hate to see you have to re-load all your images.

n3m3sys

  • Beginner
  • *
  • Posts: 7
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #4 on: February 04, 2010, 15:00:58 pm »

linux4me

  • Beginner
  • *
  • Posts: 19
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #5 on: February 04, 2010, 23:16:06 pm »
Engholm, if you aren't already following the other thread n3m3sys mentions, you should take a look. I have posted some more info regarding a potential fix.

Engholm

  • Beginner
  • *
  • Posts: 28
    • pixeldiele mediendesign
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #6 on: February 17, 2010, 00:37:53 am »
@ linux4me: We've re-uploaded all the images. It took some time, but the threshold to get completely frustrated by the problem has been reached. To start over again sometimes's better.

Anyway, thanks a lot for your effort and support!!

linux4me

  • Beginner
  • *
  • Posts: 19
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #7 on: February 17, 2010, 00:48:48 am »
I'm sorry you went to all that trouble, but I'm glad you got your shop working again. You may still want to take a look at the fix in the other post.

Engholm

  • Beginner
  • *
  • Posts: 28
    • pixeldiele mediendesign
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #8 on: February 17, 2010, 01:07:17 am »
yes, I changed the and/or code of ps_product.php additional  :)

worse luck, the next problem has been discovered:
http://forum.virtuemart.net/index.php?topic=60397.0

kreatif

  • Beginner
  • *
  • Posts: 4
Re: No thumbnails on product page after update 1.1.3 -> 1.1.4
« Reply #9 on: June 25, 2010, 12:26:51 pm »
Hi Guys,

Here is the solution:

* DO not change any permission settings!
* if you upgrade from 1.1.3 to 1.1.4, the thumbnails in the browse page don't show up (but they show inside fly page) OK!

1.Simply go to you Browse_1.php or Browse_2.php (depending on which one you selected as template for your category)

2.in the top of the php file you will see the php call to display the image of the product:

<?php echo $product_flypage ?>

replace it with this :

<?php echo ps_product::image_tag( $product_thumb_image, 'class="Your-Defined-Class" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ) ?>

3. Save and refresh.. TARARA! et voila

PS: browse_1.php or browse_2.php is located in com_virtuemart/themes/templates/browse

Gd luck
Abdel