Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Catalog Folder Format - Why So Spidered? 
 
tunersedge
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-01-29
 

Hello! First off, I’m really enjoying Magento. We spent 8 mos trying to bend OSCommerce to our needs, and finally decided to scrap it. With Magento, we’ll be up and running as soon as we can load our catalog.

Speaking of loading the catalog, I’m finding the folder structure of the catalog to be most troublesome. Many pics I use are from the manufacturer. They might just be a part number, like 7340.jpg. The pic ends up in /7/3/7340.jpg. Now, when I want to do a mass upload, I’m left trying to manage the folder structure in my head. I wish we could dictate a structure based on an attribute, like manufacturer name. then I would know to dump all my jpegs into /mfg-name/, and I could more easily create the proper link to them using a .csv or .xls import. Plus, I could more easily find the pics via FTP later for replacement, if new pics are offered from the mfg.

It isn’t a huge complaint or issue, but there is definitely something lacking. Thanks for putting out such a wonderful storefront!

Aaron
Tuner’s Edge
http://www.tunersedge.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Greven
Member
 
Total Posts:  36
Joined:  2007-08-31
Florence, AL
 

I saw that, and it leaved me a bit lost as well.  Bulk XML import is work with some areas needing improvements, but bulk photo import and update looks to be lacking.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mark_Kimsal
Sr. Member
 
Total Posts:  186
Joined:  2007-09-12
Michigan, USA
 

You can bulk upload your photos into 1 spot and run a quick PHP script to put them in the proper folders. Maybe something like this…

<?php

  $myCatPics 
'./massupload/category/';
  
$myProdPics './massupload/product/';
  
$mageCatDir './media/category/';
  
$mageProdDir './media/product/';

  
$catDir = new dir$myCatPics );
  while (
$file $catDir->read()) {
      
if ($file == '..' || $file == '.'continue; }

      $dir1 
substr($file01).'/';
      
$dir2  substr($file11).'/';
      
mkdir($mageCatDir.$dir1);
      
mkdir($mageCatDir.$dir1.$dir2);

      
//copy or move the file?
      
copy($myCatPics.$file,   $mageCatDir.$dir1.$dir2.$file);
      
//rename($myCatPics.$file,   $mageCatDir.$dir1.$dir2.$file);
      
echo $myCatPics.$file" installed at ." $mageCatDir.$dir1.$dir2.$file"<br/>\n";
  
}
  $catDir
->close();

  
$prodDir = new dir$myProdPics );
  while (
$file $prodDir->read()) {
      
if ($file == '..' || $file == '.'continue; }

      $dir1 
substr($file01).'/';
      
$dir2  substr($file11).'/';
      
mkdir($mageCatDir.$dir1);
      
mkdir($mageCatDir.$dir1.$dir2);

      
//copy or move the file?
      
copy($myProdPics.$file,   $mageProdDir.$dir1.$dir2.$file);
      
//rename($myProdPics.$file,   $mageProdDir.$dir1.$dir2.$file);
      
echo $myProdPics.$file" installed at ." $mageProdDir.$dir1.$dir2.$file"<br/>\n";
  
}
  $ProdDir
->close();
 
Magento Community Magento Community
Magento Community
Magento Community
 
Ross
Guru
 
Avatar
Total Posts:  336
Joined:  2007-08-31
Scarborough, North Yorkshire, UK
 

@Mark - I tried something like your script example to copy images to the locations they would go if uploaded in Magento, and then tried a dataflow import that specified images just as they are in a sample export file - but it doesn’t seem to work.

I think there is more involved than just copying images into the same folder structure - I think we will need to wait until dataflow has better support for importing images (in which case there would not be much use for such a script).

 
Magento Community Magento Community
Magento Community
Magento Community
 
cibernoid
Sr. Member
 
Avatar
Total Posts:  208
Joined:  2008-02-12
 

Hi Ross.
Please, can you be more specific? What Magento version are you using? “It doesn’t seem to work” = what kind of error do you get?
Can you post your xml file used for profile ? (it may be corrupted, since some people had trouble with dataflow on latest magento’s version)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top