Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

images in subdirectory...


Guest

Recommended Posts

Posted

I want to do something that seems simple and straight forward, in fact, the default installed product images are organized this way.

 

How do I place my product images in subdirectories inside of the images directory when they are uploaded? i.e. I want a directory images/bathouses/ to contain all my bat house photos, then images/educational/ to contain all the books and so forth. I can browse my local drive but it always uploads into the base image directory.

 

Robert

http://www.HabitatForBats.org

Posted

When you download the osCommerce package, you will find a documentation.pdf in the package. In the pdf file, go to page 110, at the bottom, you will find a section called "Upload Images to Their Own Folder in the Admin". That's it.

Posted

Seems not work.

 

You can try this way, and it also what I do.

 

in admin/categories.php, replace

$products_image_name = ( isset($HTTP_POST_VARS['products_previous_image'])? $HTTP_POST_VARS['products_store_image'] : '');

with

$products_image_name = (file_exists(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_store_image']) ? $HTTP_POST_VARS['products_store_image'] : $HTTP_POST_VARS['products_previous_image']);

 

find javascript function updateNet(), after that, add a new function

function storeImage() {

document.forms["new_product"].products_store_image.value = document.forms["new_product"].products_image.value;

}

 

find the file uploading input box around line 570, replace it with

tep_draw_input_field('products_image', '', 'onKeyUp="storeImage()"', false, 'file') . tep_draw_hidden_field('products_store_image')

Posted

I will give that a shot. I'd found the reference you'd spoke of but thought I didn't understand it. It seemed simple enough but my upload will not allow me to look at server files nor can I manually enter anything as the preview button stops working.

  • 3 months later...
Posted

find the file uploading input box around line 570, replace it with

tep_draw_input_field('products_image', '', 'onKeyUp="storeImage()"', false, 'file') . tep_draw_hidden_field('products_store_image')

 

Where can I find this part? Novice here. Did a search for tep_draw_input_field. What does the file uploading input box line look like? Have something at line 556 or line 580??

 

Thanks

Shelley

Archived

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

×
×
  • Create New...