Forums / General Questions / image issue - force images o be daved in sub-directory of main images folder

image issue - force images o be daved in sub-directory of main images folder

Locked

Started by nigelt74 on 30 Mar 2009, 12:23 AM · Views: 1,400

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
30 Mar 2009, 12:23 AM
#1
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

image issue - force images o be daved in sub-directory of main images folder

Zencart 1.37 (php 4)

The issue is this, the store works perfectly, no probs there, we have image handler installed works fine

basically the main image directory has 5000 images in it, I would prefer that any new images that are added go into the images/products/ folder, however as it is not the default setting of the dropdown box in the add products screen nobody does it, is it possible to alter this so that on the dropdown box the products subdirectory is the default selection?

Thanks

Webzings Design
Semi retired from Web Design

30 Mar 2009, 12:42 AM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: image issue - force images o be daved in sub-directory of main images folder

You just need to edit the appropriate file in admin: for the standard product-general product type, edit admin/includes/modules/product/collect_info.php and find this line of code (about line 449):

  $default_directory = substr( $pInfo->products_image, 0,strpos( $pInfo->products_image, '/')+1);
``` and change it to:

$default_directory = (zen_not_null($pInfo->products_image) ? substr( $pInfo->products_image, 0,strpos( $pInfo->products_image, '/')+1) : 'products/');

This makes the dropdown auto-selected as the images/products/ folder for new products, but retains the original folder name for existing products.

Neville
An assumption is what you arrive at when you get tired of thinking...

30 Mar 2009, 2:02 AM
#3
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: image issue - force images o be daved in sub-directory of main images folder

Cheers Bunyip that works fine

Webzings Design
Semi retired from Web Design