skip to Main Content

I had recently imported over 1000 products from osCommerce to Magento 1.6.1, now all I need to do is to assign the default thumb image to each, all of them got an image and it shows on the product page, however the thumbs are not set and I have to set them manually on each product, I know it is possible to make this with some code all at once, but not so sure how to do it.

I don’t want to export and import again as CSV, since it got html on descriptions, etc and the CSV always breaks putting everything on the wrong columns.

I will appreciate some help, and if I got to create a .php file I will also appreciate if you also include the includes I need to do.

Thanks a lot!

2

Answers


  1. You don’t have to import all columns in the csv. In fact, for updating, I believe you only will need to use ‘sku’. Then just specify the thumbnail image in a second column and import that.

    Try importing it with the same filenames as you used for the main image. Magento is supposed to process the images into thumbnails automatically. There are also some good import extensions.

    Login or Signup to reply.
  2. i do this via the API. With catalog_product_attribute_media.create

    my newImage Array looks like this:

    $newImage = array(
        'file' => array(
            'name' => 'file_name',
            'content' => base64_encode(file_get_contents('product.jpg')), // you can indicate your oscommerce link to the image
            'mime'    => 'image/jpeg'
        ),
        'label'    => 'testimage',
        'position' => 2,
        'types'    => array('thumbnail'),
        'exclude'  => 0
    );
    

    http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product_attribute_media#catalog_product_attribute_media.create
    for futher information.

    The call is with your Magento ProductSKU and the NewArray. You should do a query to your OsCommerce Database to get the right Image for the SKU.

    Regards boti

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search