lmjacques Posted May 29, 2011 Share Posted May 29, 2011 I have tried using this on osCommerce V2.3.1 but for some reason when ever I try to upload new images even if I select a directory it only uploads the images to the main images box. Did anyone get it working with V2.3.1 Cheers Quote Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted June 10, 2011 Share Posted June 10, 2011 CAN SOME ONE POST BOTH PHP FILES UP PLEASE. Need a fully working version for 2.3.1 FROM THE INSTRUCTIONS: Find(366) case 'new_product_preview': // copy image only if modified $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { $products_image_name = $products_image->filename; } else { $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : ''); } break; ------------------------------- This doe not appear in my code, so finding and replacing it is not possible. ANY HINTS OUT THERE PEEPS- I NEED THIS ADDON BIG TIME! Quote Link to comment Share on other sites More sharing options...
ecommforum Posted October 19, 2011 Share Posted October 19, 2011 Will this contribution work with 2.3.1. Its something that may be usefull. Hi..did u find something useful for 2.3.1???..thanks Quote Link to comment Share on other sites More sharing options...
ecommforum Posted October 19, 2011 Share Posted October 19, 2011 Did someone know what should I do if I have 2.3.1 .......I want to use this but its not working on 2.3.1....thanks in advance Quote Link to comment Share on other sites More sharing options...
vprasinos Posted October 27, 2011 Share Posted October 27, 2011 I have also been looking for a solution. What changes need to be made for this to work with 2.3.1? Quote Link to comment Share on other sites More sharing options...
vprasinos Posted October 27, 2011 Share Posted October 27, 2011 Never mind, found it here http://addons.oscommerce.com/info/8150/v,23 Will try to see if it works ok Quote Link to comment Share on other sites More sharing options...
vprasinos Posted October 27, 2011 Share Posted October 27, 2011 Works in my test environment (wamp) but not fully in Apache on my server. The reason is because the script creates the folders with owner 'apache' and mod 500 and as a result the images cannot be uploaded into. Is there any way to create folders with user credentials that work? What needs to be changed? Quote Link to comment Share on other sites More sharing options...
dreamwalker Posted November 11, 2011 Share Posted November 11, 2011 On the new folder in admin/languages/english/categories.php it says Parse error: syntax error, unexpected T_STRING The version is 2.0 and it says works on 2.3.1 and are corrected in language, but it gives me the error. Where can be the problem? Anyway if the developer contact me, I have a GREAT modification that would be useful for ALL people. But I need a little help to fix it, since I'm not a programmer. //BOF Select Product Image Directory define('TEXT_PRODUCTS_DIRECTORY_DONT_EXIST_1', 'ERROR - The provided \'images\' directory '); define('TEXT_PRODUCTS_DIRECTORY_DONT_EXIST_2', ' does not exist on the server!!.'); define('TEXT_PRODUCTS_IMAGE_DIRECTORY', 'Image Directory:'); define('TEXT_PRODUCTS_IMAGE_ROOT_DIRECTORY', 'Default Folder); define('TEXT_PRODUCTS_IMAGE_NEW_FOLDER', 'New Folder: '); HERE IT SAYS THERE'S ERROR. define('TEXT_PRODUCTS_UPDATE_PRODUCT', 'Update'); define('TEXT_PRODUCTS_INSERT_PRODUCT', 'Insert'); define('TEXT_PRODUCTS_WITHOUT_PREVIEW', ' without preview '); define('SUCCESS_CREATED_DIRECTORY', 'Folder %s created in %s.', 'success'); //EOF Select Product Image Directory Quote Link to comment Share on other sites More sharing options...
Dager Posted December 29, 2011 Share Posted December 29, 2011 Check the line before, << ' >> is missing at the end of the line: define('TEXT_PRODUCTS_IMAGE_ROOT_DIRECTORY', 'Default Folder); fix: define('TEXT_PRODUCTS_IMAGE_ROOT_DIRECTORY', 'Default Folder'); Quote Link to comment Share on other sites More sharing options...
Melhor Posted February 9, 2012 Share Posted February 9, 2012 like Dager say's is just one missing character. The right code must be : IN Admin/includes/languages/english/categories.php ************************************************************************************************ ***Before the final '?>': *** ***Add:*** //BOF Select Product Image Directory define('TEXT_PRODUCTS_DIRECTORY_DONT_EXIST_1', 'ERROR ERROR - The provided \'images\' directory '); define('TEXT_PRODUCTS_DIRECTORY_DONT_EXIST_2', ' does not exist on the server!!.'); define('TEXT_PRODUCTS_IMAGE_DIRECTORY', 'Image Directory:'); define('TEXT_PRODUCTS_IMAGE_ROOT_DIRECTORY', 'Default Folder'); define('TEXT_PRODUCTS_IMAGE_NEW_FOLDER', 'New Folder: '); define('TEXT_PRODUCTS_UPDATE_PRODUCT', 'Update'); define('TEXT_PRODUCTS_INSERT_PRODUCT', 'Insert'); define('TEXT_PRODUCTS_WITHOUT_PREVIEW', ' without preview '); define('SUCCESS_CREATED_DIRECTORY', 'Folder %s created in %s.', 'success'); //EOF Select Product Image Directory Quote Link to comment Share on other sites More sharing options...
♥14steve14 Posted May 13, 2012 Share Posted May 13, 2012 I am using this with 2.3.1. It installed and works fine. Great add on. I was wondering if it is possible to show the sub folders in the drop down list. At present it only shows the top level folders. Eduardo9350 1 Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
ce7 Posted September 19, 2012 Share Posted September 19, 2012 Hi, I had installed this addons, there are two version one is original one and one is modified for 2.3.1 I tried both and both has the same problem. 1st problem: it does show up the drop down menu and a blank filed that you can create new folder name. the problem is that it doesn't save the value, and the image still save in the main catalog/images and also if I save the product and it will automatically save it as red light (inactive). 2nd problem: if I turn the red light inactive to green light active, then my front page gone missing. it doesn't show infoboxes, it doesn't show the products list at all. Only show the welcome message. Can someone please help? Many thanks in advance. Lyn Quote Link to comment Share on other sites More sharing options...
ce7 Posted September 19, 2012 Share Posted September 19, 2012 Hi, I had installed this addons, there are two version one is original one and one is modified for 2.3.1 I tried both and both has the same problem. 1st problem: it does show up the drop down menu and a blank filed that you can create new folder name. the problem is that it doesn't save the value, and the image still save in the main catalog/images and also if I save the product and it will automatically save it as red light (inactive). 2nd problem: if I turn the red light inactive to green light active, then my front page gone missing. it doesn't show infoboxes, it doesn't show the products list at all. Only show the welcome message. Can someone please help? Many thanks in advance. Lyn problem solved, thanks! Quote Link to comment Share on other sites More sharing options...
LadyShark Posted February 16, 2013 Share Posted February 16, 2013 I've installed this addon, but when I try to access "Categories/Products" in the admin tool I get a blank page. Could someone please post the admin/categories.php files.. (or mail them to me) LS Quote LadyShark Link to comment Share on other sites More sharing options...
''B'' Posted July 7, 2014 Share Posted July 7, 2014 I installed this add-on for osCommerce version 2.3.3.4 It worked in that the menu created over at the admin panel showed all the sub-folders in the root of the images folder (except for those listed in the $exclude_folders variable). What I needed was for the sub-folders in the images/products/pens folder to show up instead. This is what I did to achieve that: In the admin/categories.php file, there was a line of code from the install that read $images_dir = DIR_WS_IMAGES;. I changed that line of code from $images_dir = DIR_WS_IMAGES to $images_dir = DIR_WS_PRODUCTS; Then in the includes/configure.php and in the admin/includes/configure.php, I created this line of code: define('DIR_WS_PRODUCTS', DIR_WS_IMAGES . 'products/pens/'); This works just fine in that the menu in the admin panel now shows the subfolders in the images/products/pens folder, and I was able to upload files to the correct manufacturer folder (bargain-corner, conway-stewart, waterman, etcetera) The problem is, when I upload new images, they don’t display on the product listing page or the product details page or in the shopping cart – they are broken image links. In looking at the source code in the browser, the image source for these newly uploaded images point to images/folderName/imageName.jpg when it should be pointing to images/products/pens/folderName/imageName.jpg I'm not sure how to fix this issue. Any advice would be very appreciated!! Quote Link to comment Share on other sites More sharing options...
''B'' Posted July 8, 2014 Share Posted July 8, 2014 I figured it out. Here's my solution: In the admin/includes/configure.php file, I inputted this: define('DIR_WS_PRODUCTS2', 'products/pens/'); Then in the admin/categories.php file, I inputted this: $images_dir2 = DIR_WS_PRODUCTS2; Then right around line 537 in the categories.php file, there's a line of code that reads... $sql_data_array['products_image'] = $dir . tep_db_prepare_input($products_image->filename); I changed it to: $sql_data_array['products_image'] = $images_dir2 . $dir . tep_db_prepare_input($products_image->filename); I've tested it and so far so good. Hopefully this code is sound and won't cause issues elswhere. Quote Link to comment Share on other sites More sharing options...
''B'' Posted July 21, 2014 Share Posted July 21, 2014 After testing, there is one more line of code that needs to be changed. Right around line 676 there is a line of code that says: $sql_data_array['image'] = $dir . tep_db_prepare_input($t->filename); (there are two of these in the file. Make sure you are changing the one under the SECOND $t = new upload($key);) Change it to: $sql_data_array['image'] = $images_dir2 . $dir . tep_db_prepare_input($t->filename); Quote Link to comment Share on other sites More sharing options...
jimmylaz Posted November 14, 2014 Share Posted November 14, 2014 Select Product Image Directory & Instant Update For Products This simple contribution does three things. A drop down is added to the product edit page of sub-folders of the images folder to allow you to select where the product image is to be stored Hi Spooks: How to do I make it so inside the dropdown the first choice is a specific folder. I added subfolders but it defaults to the first one I made. Thanks Bro! Quote Link to comment Share on other sites More sharing options...
''B'' Posted November 14, 2014 Share Posted November 14, 2014 (edited) Here's what I did in the admin/categories.php file: Right after the following td... <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td> I placed a series of if statements that identifies the category selected in the admin panel. In order for this to work, you need to find out the category id of each product category. So do this: Right after the <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>, input the following script: <?php echo "<script type='text/javascript'>alert('$current_category_id');</script>"; ?> Then go into your admin panel and choose each category one by one. An alert will pop up giving the category id. Write down the category name and the id that pops up in the alert. Once you have all the id's, replace the echo alert above with the following script: if($current_category_id==categoryNumber) $defaultFolder = 'folderName1'; } elseif($current_category_id==categoryNumber) { $defaultFolder = 'folderName2'; } elseif($current_category_id==categoryNumber) { $defaultFolder = 'folderName3'; } else { //default folder will be chosen } Make sure that you input the actual id number in place of the items above that say categoryNumber and the actual folder name where it says folderName. Edited November 14, 2014 by ''B'' Quote Link to comment Share on other sites More sharing options...
mafiouso Posted August 22, 2015 Share Posted August 22, 2015 (edited) if anyone can help with this issue? http://www.oscommerce.com/forums/topic/408217-234-separate-large-image-folder/ also i have fixed a typo in the install for this addon http://addons.oscommerce.com/info/8150 i did find a possible issue. when the folder is made or selected is saving in the database like this :/test1/item_1.jpgall the other stock images where : dvd/lethal_weapon_large.jpg when it loads in the page its: catalog//test1/item_1.jpg what i dont understand is in the stock cart install/. how did some items save images in separate folders? Edited August 22, 2015 by mafiouso Quote Link to comment Share on other sites More sharing options...
mafiouso Posted August 24, 2015 Share Posted August 24, 2015 (edited) just wondering, what if the correct way to do this?If you wish to alter the image directory, or change the exclude list, edit the lines at the start of categories.php. $images_dir = DIR_WS_IMAGES; // default catalog images folder; $exclude_folders = array("banners","default","icons","mail","infobox","js"); how do i change it? $images_dir = DIR_WS_IMAGES; // default catalog images folder; $images_dir = DIR_WS_IMAGES; /images_2/ ???; or is it more complex? also is it possible to automatically have all the large images goto a set folder? what i would like is thumbs /thumbs (default) large /large (large image) thanks Edited August 24, 2015 by mafiouso Quote Link to comment Share on other sites More sharing options...
porrier Posted September 22, 2015 Share Posted September 22, 2015 Hello! I was trying to install the modul, but the docu mentiones a part of the categories.php in admin, that does not exist in mine. case 'new_product_preview': // copy image only if modified $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { $products_image_name = $products_image->filename; } else { $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : ''); } break; It should be replaced by // section moved, instant update The part in my categories.php seems to be: $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { $sql_data_array['products_image'] = tep_db_prepare_input($products_image->filename); } I installed the categories.php nevertheless and the page appears and the input-filed is there to create a new folder, but the folder is not created and the image is uploaded to the default images directroy. Any help in this? Regards Andreas Quote Link to comment Share on other sites More sharing options...
mafiouso Posted September 25, 2015 Share Posted September 25, 2015 you should explain what version you are on etc. Here's what I did in the admin/categories.php file: Right after the following td... <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td> I placed a series of if statements that identifies the category selected in the admin panel. In order for this to work, you need to find out the category id of each product category. So do this: Right after the <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>, input the following script: <?php echo "<script type='text/javascript'>alert('$current_category_id');</script>"; ?> Then go into your admin panel and choose each category one by one. An alert will pop up giving the category id. Write down the category name and the id that pops up in the alert. Once you have all the id's, replace the echo alert above with the following script: if($current_category_id==categoryNumber) $defaultFolder = 'folderName1'; } elseif($current_category_id==categoryNumber) { $defaultFolder = 'folderName2'; } elseif($current_category_id==categoryNumber) { $defaultFolder = 'folderName3'; } else { //default folder will be chosen } Make sure that you input the actual id number in place of the items above that say categoryNumber and the actual folder name where it says folderName. Quote Link to comment Share on other sites More sharing options...
''B'' Posted September 25, 2015 Share Posted September 25, 2015 Look further up in one of my other replies to this thread and you will see I wrote: "I installed this add-on for osCommerce version 2.3.3.4" Quote Link to comment Share on other sites More sharing options...
porrier Posted September 25, 2015 Share Posted September 25, 2015 Tell you what. My troubles installing the module came from the mod "Select Product Image Directory & Instant Update - Multilanguage V1.15.zip" This evening I found the module "Install Select Product Image Directory.zip" (Select Product Image Directory 2.2.4) from Mafiouso previoulsy lildog. Installed it and it works flawless so far. I am very glad I have that thing running! It works great even with mutliple images in a subfolder! Good work, fine thing! Thank you all! Andreas Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.