avstudnitz / AvS_FastSimpleImport

Wrapper for Magento ImportExport functionality, which imports products and customers from arrays
306 stars 146 forks source link

AvS Image Upload #242

Open antonio2604 opened 9 years ago

antonio2604 commented 9 years ago

Hi I import image data on the AvS interface . I've taken the following array .

   $data = array(
           array(
           'sku' => $artikelnummer,
           '_media_attribute_id' => $GalleryID,
           '_media_image' => $BildPfad,
           '_media_is_disabled' => 0,

           'image' => $artikelbezeichnung,
           'small_image' => $artikelbezeichnung,
           'thumbnail' => $artikelbezeichnung,
           '_media_lable' => $artikelnummer,
           ),
           );

However, it will be each time you import the images more antsatt you overwrite or remain hidden and replaced . Why is that?

riker09 commented 9 years ago

Have you read the documentation? There is an option that is enabled by default, if I'm not mistaken, that might be the cause of your issue:

Allow renaming of files

If set to Yes, product images don't get overwritten. For example if there is already a file named example.jpg, it is renamed to example_1.jpg in order to avoid overwriting.

antonio2604 commented 8 years ago

Hi, i import images with AVS but sometimes the image size in the catalog/product folder is 0KB I do not know why.

  if($artikelbezeichnung != str_replace("_1.jpg","",$artikelbezeichnung)){        
           // Bilddaten Array
           $data = array(
                   array(
                   'sku' => $artikelnummer,
                   '_media_attribute_id' => $GalleryID,
                   '_media_image' => $BildPfad,
                   '_media_is_disabled' => 0,
                   'image' => $artikelbezeichnung,
                   'small_image' => $artikelbezeichnung,
                   'thumbnail' => $artikelbezeichnung,
                   '_media_lable' => $MediaLable,
                   ),
                   );

              }else{
                   $data = array(
                   array(
                   'sku' => $artikelnummer,
                   '_media_attribute_id' => $GalleryID,
                   '_media_image' => $BildPfad,
                   '_media_is_disabled' => 0,
                   '_media_lable' => $MediaLable,
                   ),
                   );
              }

Thanks for your help.

antonio2604 commented 8 years ago

Ok i have found the error, in my script it was a string with this value:

$BildPfad = Mage::getBaseUrl('web', true)."av_data_sync/neue_bilddaten/".$artikelbezeichnung;

that's wrong, here is the correct string

$BildPfad = Mage::getBaseUrl('web', false)."av_data_sync/neue_bilddaten/".$artikelbezeichnung;