[bug] Wrong thumbnail image

Hello guys, I’m having a problem with my client’s site. They began adding items to the shopping cart and they started to notice a problem…



When they choose an image from their computer to upload to the cart, the thumbnail and the big image shows well in the admin preview. But when you got to the shopping cart frontend the thumbnail image is replaced by that of another item not related to this one.



I don’t know what could be causing this.



The store is password protected, so I’ll post a temporary password so you can take a look at the problem. I hope if it is a bug it was fixed on the new version.



The URL: www.willbethinc.com/shop

Username: cscart

Password: visit



Do a search for these items and then click on the description. You’ll see what I’m talking about right away (Separated by a dash):



77288-77289-13117-13118-39391



Thank you for your help,



-David.



USING VERSION 1.3.3

I took a look and i see the problem, but not exactly sure what may be causing it. Have you tried switching the skin to a default skin to see if the error still occurs? If it doesn’t then at least we know that it has to do with custom coding and can try to go from there.

I found this problem when beta testing, reported as a bug.



[url]http://vb.cs-cart.com/vbugs.php?do=view&vbug_id=136[/url]

[quote name=‘compernicus’]I took a look and i see the problem, but not exactly sure what may be causing it. Have you tried switching the skin to a default skin to see if the error still occurs? If it doesn’t then at least we know that it has to do with custom coding and can try to go from there.[/QUOTE]



Hi Compernicus, Thanks for answering.



I’m afraid of switching skins because I think I will lose all the design changes made to the one I’m currently using. Correct me if I’m wrong.



But I tried something. On item 77288 these are the URLS for the images, and I noticed each thumbnail had something different:



[COLOR=“Red”]Wrong[/COLOR] thumbnail:

[url]http://www.willbethinc.com/shop/image.php?object_id=1847[/url]



Right Thumbnail:

[url]http://www.willbethinc.com/shop/image.php?object_id=1847&image_id=[/url][B]5704[/B]



Big Image:

[url]http://www.willbethinc.com/shop/image.php?object_id=1847&image_id=[/url][B]5683[/B]&mode=detailed



That number in bold changes from one to the other, I don’t know if that’s normal but either way, the item code remains the same… It’s weird.

Let me know if I can safely switch from themes without loosing the modifications on this one. Thank you!

[quote name=‘davidnetk’]

I’m afraid of switching skins because I think I will lose all the design changes made to the one I’m currently using. Correct me if I’m wrong.



Let me know if I can safely switch from themes without loosing the modifications on this one. Thank you![/QUOTE]



I am not sure how you setup your template, but you can have multiple templates installed on your site without a problem. For example if you installed the default_blue skin when you installed the cart, and then decided to change it later to default_red, it would create a new skin directory with the default_red name and will not overwrite the original default_blue folder or delete it. Therefore, you could then easily switch back to the original skin at a later time.



So, if you choose one of the default skins that you are not using as a base, then I can see no reason why you would have a problem switching back later. Of course it is a good idea to do a backup of your files anyway.

9:09PM : Alright, I will download a backup of my modified template, and I will reset the theme to the original one and see if that changes anything.





9:19PM : Okay. I did and the problem is still there. Also, I did not lose any changes made to my previous template. At least that’s good.

Found where the error was, I’ll try to explain, try to keep up.



It was found in the database, in the " cscart_product_images_links " table.



Now,



-The product_id code for all the items in my shopping cart ascends to the number 1880, so far.



-However, in the image links table, the product_id code ascended to the number 2245. So when I new item was created, say, item 1881, the image pair links already existed in the " cscart_product_images_links " table. So the cart would create a duplicate entry with new images, yet the old one would be the one that showed in the frontend.



---------



So, what I did was to manually delete every entry in this table from 1881 to 2245. Then I tested to add a new product and voila! The right image shows.



Now, this is the fix for the new items to come. As for the old ones I believe I will have to manually find the duplicates and delete the obsolete one.



I think this mistake happened when I first added the products to the database since I didn’t do it one by one but instead loaded them up from a CVS file.



I do appreciate all your help guys. Thank you for bearing with me.

I also had this problem whilst initialising my inventory. I found that if you simply delete the image in both product pages (using ‘delete image’) and then reupload the image, that it will correct itself.