Jump to content

Duplicate Image Files - Products not picking up correct image


ecuyetx

Recommended Posts

This is a little complicated.  The basic problem is that our Products should all have 2 images, but in the majority of cases they are not showing any images. 
This has all been working fine for a few years, and there are a few reasons why it may now not be working, but I cannot figure it out.
I am not exactly sure what the problem is however this background may help. 

We have loaded a lot of new images and did a complete Inventory load from a CSV file (removing the existing inventory first). 

The image file names were incorrect for many images, so we removed the inventory and started again. 

Things were not working well (images not showing, and very slow response in File Manager) and I realised our version of Cubecart was out of date and so updated it to the latest version. 

The .CSV file used to create the inventory contains all the file names, and each product has 2 images. In the CSV file all the file names have a lower case extension .jpg. 
The actual images in the images / source file have a mixture of upper and lower case extensions, .jpg and .JPG

I have realised in File Manager > Images that there are duplicates, with upper and lower case .jpg and .JPG.   Many of these files have a size of 0.0 kb and they do not have the appropriate icon next to them, and these are the files that a lot of the Products seem to be linked to. 

I decided to delete the Cache files from images / cache file (although I think a lot of them did not get deleted). I did consider maybe trying to edit the images tables in the database, but don't really know where to start … 

the website is kbcoins.com 

Any help or guidance much appreciated. 

Regards

Tony E.

Link to comment
Share on other sites

Hi Tony

The file manager table holding the image references could be in a real mess after all of that - how many entries are there in that table. Having duplicates with differing suffixes is not right nor is having entries at zero bytes

Also if the Admin File manager option is slow it probably indicates that you have far too many images all at the one level (I have seen tens of thousands all in one directory many times !) - so many people keep uploading product images into the one top level directory and CubeCart takes forever to read that listing.  Ideally I suggest never more than a few hundred per directory - split them up into sub and sub-sub directories and the structure will depend on your products.  It could be by category and sub-category, some do it by manufacturer etc

Ian

Link to comment
Share on other sites

The Latest Products have links to images that have blank src attributes.

I'm wondering if the fact that you seem to have another active CubeCart store in the root, as well as the store in /store/, that there is some confusion about which /cache/ folder to use.

In admin, Error Log, System Error Log tab, see if there are any entries related to "No image (mode or path) set".

Link to comment
Share on other sites

16 hours ago, havenswift-hosting said:

Hi Tony

The file manager table holding the image references could be in a real mess after all of that - how many entries are there in that table. Having duplicates with differing suffixes is not right nor is having entries at zero bytes

Also if the Admin File manager option is slow it probably indicates that you have far too many images all at the one level (I have seen tens of thousands all in one directory many times !) - so many people keep uploading product images into the one top level directory and CubeCart takes forever to read that listing.  Ideally I suggest never more than a few hundred per directory - split them up into sub and sub-sub directories and the structure will depend on your products.  It could be by category and sub-category, some do it by manufacturer etc

Ian

Hi Ian

Thanks for the reply. I didn't actually realise the image files had upper and lower case suffixes. Someone else has been creating the image files, and I think he changed methods. 

I didn't realise until reading the forums about my problem that the source folder could have sub folders. I didn't think the system would find them unless they were in the source folder. I could split them by image number but yes there are around 13,000 images, but it would be impossible to split them in to categories, without looking at each image individually. Each image has a sequential number based on the order it was photgraphed in so I could just split them between, 1-3000, 3001-6000, etc. Would that help?

But that won't solve my problem of the products picking up these spurious files with 0.0kbs.

Thanks again for taking the time to reply

Tony E. 

Link to comment
Share on other sites

19 hours ago, bsmither said:

The Latest Products have links to images that have blank src attributes.

I'm wondering if the fact that you seem to have another active CubeCart store in the root, as well as the store in /store/, that there is some confusion about which /cache/ folder to use.

In admin, Error Log, System Error Log tab, see if there are any entries related to "No image (mode or path) set".

Hi

Thanks for the reply. I have had a look and I cannot see more than one Store on the server. 

There is a store at the root, but I cannot find a store within a store.  There are some static html pages at the front in the route but they are just an entry to the store which I have made to look the same in terms of style and layout so the pages look like one big store.

But yes the images are just not showing. I think it is because the links between Products and Images in the database are pointing to empty files, which are duplicates of the original but with a different suffix, e.g. .jpg rather than .JPG

Is it possible to just clear out the database tables that hold the images and reload them?

Any help much appreciated, and thanks for the reply.

Regards

Tony E. 

I have looked in the error logs and I have got thousands of these errors: 

File: [seo.class.php] Line: [685] "UPDATE `CubeCart_seo_urls` SET `type` = 'prod',`item_id` = '3622',`path` = 'florins-1936-george-v',`custom` = '0' WHERE CubeCart_seo_urls.id = '138626';" - Duplicate entry 'florins-1936-george-v' for key 'PRIMARY'

I am not sure how relevant this is to my problem? 

Regards

Tony E.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...