Modify New Product page to support image directories
This is a simple modification to /admin/categories.php It adds a new field to the new product page named:
Image Subdir. (images/...):
just above the
Product Image: field
There is also a very minor change to
/admin/includes/languages/english/categories.php. It adds only one line to define a new field name. This keeps the language defines stucture consistent with osC standards
In this field you can add the path to your image location, ie: /pets, pets/dogs, pets/dogs/brown and so on.
Add the path in that field, browse to to the correct image on your pc and the file will be uploaded to the correct directory and the image file name in the database will indicate the correct location, ie: /pets/kitty.jpg.
The operations are identical to using the standard categories.php but with the addition of image paths. Delete a product and the corresponding image is deleted.
The directories must exist on the server, it will not create them and they must be writable. If they can not be found or or not writable the standard osC error checking will give you a warning. You'll have to know/remember the directory names (sticky notes are good).
It's based on the 051113 update version of osC MS2 so it incorporates all current updates.
The changes are fairly simple and most users are using the stock categories.php file so this can just be used in its place.
There is one simple change to admin/includes/languages/categories.php to add the name for the field in keeping with osC language conventions.
I've only tested this on Unix/Linux systems but from my understanding it should be cross platform (it uses forward slashes in php for the subdirectory pointing).
The installation instructions are in the install document.
The support thread is found here: