Jump to content
Sign in to follow this  
Digibooks

I Just don't get it!

Recommended Posts

Hi

 

I have had an OSC site running for some time now and made loads of mods.

 

Looking through the various addons I decided to install a fresh copy of 2.3.3.4 and redesign the site with the most useful addons and then relink the database to this site.

 

One of the most frustrating things is that all Manufacturer and Product images get stored by default in the images directory so when I'm backing up over 5,000 products it's a nightmare to separate these into relevant offline folders.

 

Now I know there are various addons out there that should enable a choice of directory to store various groups of images but so far everyone has crashed my site - presumably not 2.3.3.4 compatible.

 

What makes it even more frustrating is that a clean install of v2.3.3.4 sets up a sample database with images stored under manufacturer / product image folders yet if you try to amend these images they all revert back to the main images folder.

 

Is there any easy way ................... PLEASE!!!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites

Hi,

 

maybe "Easy Populate" (http://addons.oscommerce.com/info/500) can help you with putting your existing product-images into sub-folders, though this won't help you with new images.

 

That's why I modified the upload- and categories-script, so that it uploads the product-images to a sub-folder and creates a thumbnail in the same process.

 

AD

Share this post


Link to post
Share on other sites

Have you read the documentation that is available from the main website. There is a section in the tips area that explains how this should be done. I have not tried it as I use an addon on my 2.3 store.

 

The actual files are here http://library.oscommerce.com/public/sites/Library/pdf/oscom23-old.pdf

 

Go down the left and column until you find the tops for admin area and click it. There should be something there about adding an image to a folder.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

@@14steve14: Thanks, but this doesn't work for me.

 

 

I can't modify the path of the file to upload in the file-input field. Clicking the input field to edit the path opens the upload-file dialog again.

Changing the path in the upload-file dialog gives me an invalid filename error in Windows.

 

 

I tried Linux, but the OS displays the path differently than Windows (C:\path\to\file.jpg <> /path/to/file.jpg).

 

Either I'm doing something terribly wrong, or this trick just doesn't work (anymore).

 

AD

Share this post


Link to post
Share on other sites

How are you trying to upload the images?  Through the osc admin or with easy populate?

 

What I have done which is real easy to do is change the code on the appropriate pages to store the images in the rightful folders and make sure the images folders that you are using has the proper permissions for your environment.  I will give you an example:

 

In /admin/categories.php  when you upload an image it is saved and stored with these 2 lines:  Osc 2.3.4


        $categories_image = new upload('categories_image');
        $categories_image->set_destination(DIR_FS_CATALOG_IMAGES);

You can do different things here.  You can do it according to osc standards and open up /includes/configure.php and create a  Category define statement or you can simply replace DIR_FS_CATALOG_IMAGES with the full path to where you want the categories image to be stored in between ''.

 

Example:

$categories_image = new upload('categories_image');
$categories_image->set_destination(DIR_FS_CATALOG_IMAGES);

//Replace With
$categories_image = new upload('categories_image');
$categories_image->set_destination(DIR_FS_CATALOG_CATEGORIES_IMAGES);

//OR REPLACE WITH
$categories_image = new upload('categories_image');
$categories_image->set_destination('/home/username/public_html/catalog/images/categories/');


And if you use NotePad +, phpdesigner or any other ide of similiar you can search for all files that contain DIR_FS_CATALOG_IMAGES and do a replace with DIR_FS_CATALOG_CATEGORIES_IMAGES. 

Just make sure that when you do it, you do not replace the one in the configure.php in /includes or /admin/includes and remember to create the new location in the /includes/configure.php and /admin/includes/configure.php files.

 

And the change is just that simple as well for Manufacturers, and even product photos.  When it comes to product photos, being some products have multiple products I have mine coded even worse than this because I have the following structure with mine:

 

/images/products/(oscommerce product_id)/

 

Hope this helps out,

Shawn Mulligan

 

P.S.  It bugged me to that oscommerce out of the box install has seperate image folders for manufacturers and category images etc, but the coding does not use them, they store all the images in the same folder.  I have no clue what they were thinking.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×