Hi guys, I'm receiving a '1002' failure code when trying to import product's via MartPlug Product Importer. In particular, I am specifying an image file in the CSV, but this is failing every time. I have removed the optional subdirectory in the product field 'Image'. In the CSV file I specify 'sites/default/files/.jpg' as the image location. I have been working on for the last couple of days and hoping that you have seen this before, thanks!

Comments

recidive’s picture

@noles: hi, 'sites/default/files/.jpg' doesn't seem like a correct file path, i.e. ".jpg" doesn't seem like a correct filename (though it could be, as regular hidden files).

recidive’s picture

If, you can, please provide us with the line in the CSV file that's returning this error when processing. Also, are you sure the image file is in there?

noles’s picture

Here is an example of the CSV file;

SKU,Title,Image,Price
1,Nike Air Max Moto,sites/default/files/nike_air_max_moto.jpg,$50.00

Also, the file is located in the proper dir:

:/var/www/sites/default/files$ pwd
/var/www/sites/default/files
:/var/www/sites/default/files$ ls -l | grep nike
-rw-rw-r-- 1 www-data www-data 79723 2011-12-18 06:10 nike_air_max_moto.jpg

*Note I change the .jpg file perm's to 'o+x' and the import was successful, although when I double checked the Product, there were a few problems:
-no image attached
-the price was '0.00'
-It did not show under Main Menu -> Products (like the sample content)

So I guess, my next question is, Have you guys seen the above issues when using this importer? And should I import the same CSV using the MartPlug Product Display Importer?

Thanks

recidive’s picture

Status: Active » Fixed

Yes, you should import the same cvs twice, once using Products and other using Product Displays. This is for allowing multiple product variations on same display. E.g. the color dropdown when adding an item to the cart.

recidive’s picture

For the price, you don't need the "$" and you should pass the price without the ".", e.g. 5000 for $50.00. You should see a sample of CVS file in profiles/martplug/files/sample-products.csv or you can see it's contents here:

http://drupalcode.org/project/martplug.git/blob_plain/refs/heads/7.x-1.x...

noles’s picture

Thanks for the help so far! Using this method, by uploading the same CSV two times, one for product and one for display, I am getting multiple nodes of the same product showing, each node for a different size. Any hints on aggregating a single product for multiple sizes? And creating a dropdown list on the product page for all sizes? Your sample CSV file does not have size or color variations for single products? I have attached my methods, but these are not the solution.

recidive’s picture

@noles, yes this is possible. I'm not sure the current importers will handle that out-of-the-box though.

You may need to adjust the Product Display importer to allow multiple values for SKU, and you should make two CSV files, one for the products as they are in your inventory, e.g. 1 product per sku/size/color, and other for the product displays with just product title and description and the multiple products/SKU values.

Please submit patches if you need to change the importers, so we can add support for this to MartPlug.

Thanks!

noles’s picture

So, after playing with this, I think MartPlug can be easily adjusted to manage attributes per product. I would suggest adding to the out of the box support for

-the content type for product display that simply display's the Product w/ 'Add to Cart Form' and this should work to add attributes based on the Product the user imports.
-Also, it seems like the contrib module 'Commerce (Product Display Manager)' is trying to handle this in one step, maybe you guys could add this module to the MartPlug profile.

Please point me in the right direction for submitting patches and I'll try my best.

recidive’s picture

Hi, yes, MartPlug support attributes out of the box. There's already a color attribute for products. For managing variations, we will be relying on Commerce IPF:

http://drupal.org/sandbox/rszrama/1181848

Check here to see the designs for this module widget:

http://drupal.org/node/1181862

For creating a patch you should clone the git repo and recreate the MartPlug Importer feature using the UI in admin/structure/features. Then replace the one in the cloned repo with the new one, and generate a patch.

noles’s picture

StatusFileSize
new196 bytes

ran into a couple of problems when trying to apply the patch, so I've attached a tgz of the martplug_importer. I was seeing something like the following when trying to apply the patch:

~/martplug$ git diff --staged martplug_importer-7.x-1.patch
~/martplug$ git apply -v martplug_importer-7.x-1.patch
Checking patch martplug_importer-7.x-1.0-dev.tar...
error: cannot apply binary patch to 'martplug_importer-7.x-1.0-dev.tar' without full index line
error: martplug_importer-7.x-1.0-dev.tar: patch does not apply

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.