Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / How do I change images folder?

How do I change images folder?

Views: 8,052

Results 1 to 14 of 14
15 Mar 2009, 9:20 AM
#1
mk12 avatar

mk12

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

How do I change images folder?

I put absolute image paths into products_image field in the database (I had to do that because my wholesaler provided me with image links instead of images). Problem here is that php inserts default images folder name before absolute path of the image when a customer is looking at the page. My idea to solve this problem is to change default images folder to nothing. But the problem is that I can not find where zencart stores default images folder name.

15 Mar 2009, 9:27 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I change images folder?

Suggest you find a solution that allows you to obtain images and host them on your site as one does not want to rely upon anothers site for this most important segment of a site that is doing your business.

That said: In your configure.php files the path to the images dir is

define('DIR_WS_IMAGES', 'images/');

Not positive that making this blank will correct your issue
Do retain the pair of single quotes so as not to break things

15 Mar 2009, 11:19 AM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I change images folder?

Product images show up in many places in ZC, including popups, and ZC is not designed to call images from a remote host.

Look at how to solve this here:

http://www.zen-cart.com/forum/showpost.php?p=682618&postcount=9

16 Mar 2009, 6:14 AM
#4
mk12 avatar

mk12

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Re: How do I change images folder?

Thank you for the solutions. In case of downloading the images there is one drawback. When I am updating prices everyday I will need to check what merchandise is new and download pictures for it.

16 Mar 2009, 6:24 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I change images folder?

When I am updating prices everyday I will need to check what merchandise is new and download pictures for it.
Keeps you informed about what you have for sale!!
Think about what this would be like if it were a physical shop!

Keeping your current offerings in a spreadsheet and getting current availability- drops & adds daily in a sheet and a bit of VB to compare/add/drop is a way to manage

16 Mar 2009, 7:40 AM
#6
mk12 avatar

mk12

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Re: How do I change images folder?

is it possible to make and incorporate in zencart powered webshop a php script which will login to wholesaler webpage, grab a file with new prices, check for new products, download pictures for them and update database?

16 Mar 2009, 7:52 AM
#7
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: How do I change images folder?

I recently wrote a script to make zencart image database driven (meaning image locations are stored in db), this script can also be used to use remote image paths instead of locals. However, to do so it will need some tweaking, plus i have not finished the backend controller yet. If you are comfortable with php then you can PM me.

17 Mar 2009, 1:40 AM
#8
smjones316 avatar

smjones316

New Zenner

Join Date:
Jan 2009
Posts:
3
Plugin Contributions:
0

Re: How do I change images folder?

yellow1912:

I recently wrote a script to make zencart image database driven (meaning image locations are stored in db), this script can also be used to use remote image paths instead of locals. However, to do so it will need some tweaking, plus i have not finished the backend controller yet. If you are comfortable with php then you can PM me.

Very interested.

Need to use remote image paths for my daily update files from my supplier I upload through easy populate.

Dont care about backend.

14 Feb 2011, 1:14 PM
#9
nicktrini avatar

nicktrini

New Zenner

Join Date:
May 2010
Location:
Trinidad & Tobago
Posts:
6
Plugin Contributions:
0

Re: How do I change images folder?

schoolboy:

Product images show up in many places in ZC, including popups, and ZC is not designed to call images from a remote host.

Look at how to solve this here:

http://www.zen-cart.com/forum/showpost.php?p=682618&postcount=9

Hello,

I've hounded down the place for a solution to this, but can't seem to find it/don't know if it's possible.

I have my zen cart installed into a sub-directory of my root folder i.e. www.something/shop

images are defaulted to the images folder in the /shop. In my root folder, though, I have an images folder already. So, I was wondering a couple things -
in my includes/configure.php, i changed the define('DIR_WS_IMAGES', 'images/') to define('DIR_WS_IMAGES', '/images/'). This seemed to work at first, but then my category images were warped. usually at 250x300, they were now warped to 200x300. Product images seemed to work fine when I changed the path...and coincidentally, product images are 200x300. So my 2 questions -

  1. Is fixing this problem a simple task?
  2. Is it advisable in the first place to store images in an image directory in the root folder, or am I just messing to hard with the Zen Cart structure?

Thanks in advance!!
Nick

14 Feb 2011, 2:25 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I change images folder?

nicktrini,

nicktrini:

Is fixing this problem a simple task?
Just move the images in your /images dir to the /shop/images dir

22 Jan 2017, 6:48 PM
#11
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: How do I change images folder?

kobra:

nicktrini,

Just move the images in your /images dir to the /shop/images dir

But, what if you need the images directory to stay in the root, and do not want to copy them to the subdirectory because the folder is shared with the new root of the site? Example:

The Zen Cart site was moved from the root to http://site.com/shop

Everything in includes/configure.php has been updated to reflect this subdirectory:

define('HTTP_SERVER', 'https://site.com');
define('HTTPS_SERVER', 'https://site.com');
define('DIR_WS_CATALOG', '/shop/');
define('DIR_WS_HTTPS_CATALOG', '/shop/');
define('DIR_FS_CATALOG', 'host/account/public_html/shop/');

I want images to stay in the root, so I added this to includes/configure.php:

define('DIR_WS_IMAGES', 'http://site.com/images/');

Result so far: the main product image on listings pages and product pages works! The additional images do not work.

(Old thread, I know, but after reading all of the other ones, this thread really sums up the question I have.)

22 Jan 2017, 7:58 PM
#12
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: How do I change images folder?

Not exactly sure how the images Constant is used in all files but one of the following should work.

define('DIR_WS_IMAGES', '/shop/images/');
or
define('DIR_WS_IMAGES', '../images/');

Replace your line with one of the above.

Also note the change has to be made in two files:

ADMIN_NAME/includes/configure.php
includes/configure.php

22 Jan 2017, 9:39 PM
#13
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: How do I change images folder?

Website Rob:

Not exactly sure how the images Constant is used in all files but one of the following should work.

define('DIR_WS_IMAGES', '../images/');

Switching "http://site.com/images/" with "../images/" worked!

:bow:

23 Jan 2017, 3:04 PM
#14
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: How do I change images folder?

Glad it worked but I'm not sure what security result this may have or it's impact on PCI compliance. I just can't see where the necessity to do this comes from.
Are you running two sites, one in root and one in shop?
Are you running two separate sites using the same images and trying to only have to update one image?
Just makes my "this could maybe hurt rather than help" hairs stand up on the back of my neck.