Zen Cart Logo
Forums / General Questions / Where is the product image location stored?

Where is the product image location stored?

Locked

Views: 1,455

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
8 Jul 2010, 3:39 AM
#1
pstarling avatar

pstarling

New Zenner

Join Date:
Sep 2005
Location:
New Zealand
Posts:
92
Plugin Contributions:
0

Where is the product image location stored?

I'm in the process of upgrading to the latest version and have noticed that I have images all over the place and would like to tidy them up into a subfolder by supplier.

In the Products in Category 'xxxxx' view, in section : Product Image and field : Upload to directory <Main Directory> the user can select the image location.

My preference is to use a SQL update statement to update the relevant field in order to standardise the image location, however I can't identify the relevant table/field combination.

Can anyone identify it for me?

Thanks

Paul

8 Jul 2010, 4:01 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Where is the product image location stored?

See the products_image field in the products table.

8 Jul 2010, 7:31 AM
#3
pstarling avatar

pstarling

New Zenner

Join Date:
Sep 2005
Location:
New Zealand
Posts:
92
Plugin Contributions:
0

Re: Where is the product image location stored?

The products_image field in the products table contains the file name of the image.

I am looking for the data field containg the folder name

i.e.

../<storename>/images/large/<supplier name>
../<storename>/images/medium<supplier name>
../<storename>/images/<supplier name>

Cheers

8 Jul 2010, 5:51 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Where is the product image location stored?

The ../<storename>/images/ path is considered the root path for your images. You should NOT change that. (It comes from DIR_WS_IMAGES define).
The '/large/' and '/medium/' parts are hard-coded values.
And, the products_image value is simply appended to those paths.

So, if you just pre-pend your "supplier_name" folder onto the beginning of the products_image value, and then create all the corresponding supplier_name folders under /images/ and /images/medium/ and /images/large/ then it'll all work just fine.

Example:

  • you have 2 products, one supplied by Canon, with products_image set to abc_product.jpg .... and the other from Kodak, with products_image as def_product.jpg
  • you would change the products_image field from 'abc_product.jpg' to 'canon/abc_product.jpg' .... and from 'def_product.jpg' to 'kodak/def_product.jpg'.
  • then you would arrange your images into the corresponding folders, like this:
    /images/canon/abc_product.jpg
    /images/kodak/def_product.jpg
    /images/medium/canon/abc_product_MED.jpg
    /images/medium/kodak/def_product_MED.jpg
    /images/large/canon/abc_product_LRG.jpg
    /images/large/kodak/def_product_LRG.jpg

ref: https://www.zen-cart.com/tutorials/index.php?article=58