View Single Post
  #5  
Old 05-24-2008, 03:42 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: Image Path MOD for 4.1.x

As the original X-Cart codes shows in the func.backoffice.php, you need to specify your "$files_dir_name" (i.e. files directory name).

This is the name of your main files directory. For us, we just upgraded from a 4.0.x cart, so it was the main /files/ folder. Then in that folder we have sub-folders with our product images in them. This link is only concerned with the main folder that holds your image sub-folders.

To get the rest of the link (the part before the /files/ directory), go to the Administration --> Summary page of your X-Cart back-end. Look under the Component column for your X-Cart directory, and enter the value you see in the Status column.

NOTE: If you only do this Step 1, it will have the correct image path for existing images, but if you want it to have the correct image path to that same folder for new products (and not the standard X-Cart lettered sub-folders), then you have to complete Step 2 (in post #1 above).

When you complete Step 2 in the func.image.php file, be sure to keep these 2 lines of code:
Code:
$prepared['image_path'] = $file_path; }
That will set the image path to the file path you specify. When you add a new product (or clone a product) and add a thumbnail (or detailed image), it will first generate a tmp image link until you Save the New Product, and then the actual File Path and File Name you specified will be written into the Database and stored as the product's image path.

Our T, P, D, etc. image folders all remain empty at this point, and images for our newly added products are all existing in our files/imageABC folders.

Note: This has only been tested on X-Cart 4.1.9 on an Apache server (we're using a Dedicated IP).

Robert
__________________
X-cart 4.1.10
Reply With Quote