4

Currently, practically every Magento import is yielding a frustrating experience in this particular project.

Most product data is already in the system, configurables setup, each with all their associated simple products.

What we'd like to do is update all the product weights for all the products - quickest way is to bulk update in CSV.

First things first, we export our product data from the system.

Now, we'd like to think that the CSV format it spews out at of the system would be the correct format to reimport back in again but no - even Magento doesn't seem to be able to give us something to work with. If we reimport all the same CSV back into the system that it exports, none of the products show up on the front end (this is if we do it via dataflow).

As this store is a multistore, the CSV format we have is like the following:-

sku     _store     _attribute_set     _type     _category     _root_category    _product_websites     name     weight    
sku-01             Default            simple                  Default Category  retail                name-01  weight-01
                                                Category 1    Default Category  wholesale
sku-02             Default            simple                  Default Category  retail                name-02  weight-02
                                                Category 1    Default Category  wholesale
sku-03             Default            simple                  Default Category  retail                name-03  weight-03
                                                Category 1    Default Category  wholesale

So as can be seen from the above dummy sample, each product has a minimum of two rows, the majority of the rows for the wholesale store is always blank though - presumably because this store just uses the default config and has no wholesale store overrides.

In the event that a product has more than two rows, this is when it has multiple simple products associated to it or custom options set. One row per associated product (granted, the CSV sample above does not show configurables) and one additional row per product for each custom option that it has as well - which is somewhere like column QAZT of CSV!

All pretty normal stuff so far I gather, at least, I've always seen complex product data in a Magento export formatted this way.

The problem comes when we try to reimport back into the system and I'm guessing the issue lies somewhere between the multiple rows per product with options/associated products and additional store(s).

If I were to import the above back into the system, Magento returns:-

Skipping import row, required field “sku” is not defined.

For what seems like every product but I'm guessing, it is probably for every row that does not contain a SKU value - which in the event of complex CSV data, is more that doesn't contain a SKU value than does. Is this to be expected behaviour - the system often screws everything up come the end of this dataflow import when this error is being returned.

I'm after the most stable and recommended way of just simply importing product weights for all products and as per the sample above, I have a CSV in the format exported with all the product weights entered for all the relevant products. Importing as is just causes every product to disappear from the catalog (wtf).

What is the next step? Normal import? Dataflow import? What is the bare minimum of column headers required for just importing weight? (Just importing the SKU column and the weights was a total disaster).

Your thoughts, opinions, feedback and recommendations greatly welcome. Thanks.

  • Make sure the encoding of the file is UTF-8 without BOM. If the format is WTF-8 with BOM then the characters of the 'BOM' are read an associated to the first column 'sku' forming a different string that is not recognized as sku. – Marius Aug 26 '13 at 13:47
  • Hey @Marius, when I had this issue I tried every encoding option available in both MS Excel, Open Office Calc and Notepad - there was no improvement whichever encoding option was selected. Thanks. – zigojacko Aug 27 '13 at 8:05
  • It would be handy to make this one a community wiki question actually so various input on importing/exporting with Magento could be contributed to. It could be linked to for a number of answers to related questions on Magento SE. – zigojacko Aug 27 '13 at 8:08
  • I usually use notepad++ to edit these kind of files. It's easier to set the encoding with that. I think you should put a sample of your file somewhere on the web and add a link to it to your question so people can test with your actual file. – Marius Aug 27 '13 at 8:20
2

The file you generated through Magento Export (whether this is default import/export module or default dataflow profile) is NOT going to work if you import it back, because it doesn't preserve the format.

If you want to update weights, I would recommend this:
1) filter your CSV in Excel, filter only those which have "sku" field assigned
2) copy-paste the filtered rows into new spreadsheet
3) leave only 2 columns - "sku", "weight"
4) import it back.

I'm pretty sure it's the easiest flow to solve your concrete task.

For those who are looking for tool for Magento that allows both export and import while having similar format for both routines, check out this one.

  • Thanks for your comment Rob. I actually tried importing just rows with a 'sku' and 'weight' and it didn't work at all. It royally screwed up the entire catalog. Whether this was because this was a multistore or hundreds of parent products (visible) each with many child products (not visible) perhaps, I don't know... – zigojacko Oct 10 '13 at 7:21
  • Well yes, the native import/export functionality is quite messy I'd say. What kind of products you're trying to assign "weight" for (configurable/grouped etc)? I think my flow is going to work at least for existing simple products. Let me know – Alexey Shchur Oct 10 '13 at 18:55
  • Whilst this is an old question and one we got around a while ago now, at the time, we would have been trying to bulk update all weights for child (simple) products associated to the parent products (configurables). A single store with only simple products I'm sure would probably prove much easier to bulk update weights within the CSV (although I'd have to retest this). – zigojacko Oct 11 '13 at 8:10
  • Just noticed that import/export extension you linked to which looks promising and I hadn't come across this one so may give this a try on our next Magento project. – zigojacko Oct 11 '13 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.