-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't attach images on product update #64
Comments
Hi ... sorry I do not work commercially with Spree at present so I think the gem is lagging behind the Spree data model but the bulk attach of images should work It looks like it could not match the value in teh SKU field to a product
Could you share the images spreadsheet ? or just a couple of rows with the headers ? |
Hi and thanks! The images spreadsheet can be represented as below. I can confirm that both sku values are present in the back-office.
Please let me know if I can provide more information on this. |
I further tested and was eventually able to upload a new product by adding an However the problem persists when trying to update a product
returns logfile ` I, [2017-09-17T12:59:11.313939 #21262] INFO -- : Processing attachment file product_images.xls |
Ahhh I see the issue now, misunderstanding of use case - this Task is not driven by a spreadsheet It's for a different use case, bulk uploading based on file names Create paperclip attachments and attach to a Model from files in a directory. -i, --input=INPUT # The input path containing images The file name is used to lookup the instance of :attach_to_klass to assign the new attachment to So the filenames should contain the SKU (somewhere) so these would work e.g ABCD.jpg or coming_soon_ABCD.jpg or ABCD_coming_soon.jpg etc So currently its treating vendor/datashift/templates/product_images.xls as the input image I think you want -i /home/Downloads/ |
Ok thanks! I will give a try to this method as you have mentioned. Regarding spreadsheet usage is this syntax correct? |
I can't attach images during Product creation. I've added theimage
field and attempted with both url for the file or full path. Runningthor datashift_spree:load:products -i filepath.xls
does create the product but the image is now.When
insteadtrying to add the image to existing products withthor datashift_spree:load:attach_images -i filepath.xls
I get the following argument error complaint. The spreadsheet uses asku
and anattachment
bundler/gems/datashift_spree-8fb9c3ae017a/lib/loaders/spree/image_loader.rb:26:in `initialize': wrong number of arguments (given 2, expected 0) (ArgumentError)
thor datashift:paperclip:attach -a Spree::Image -k Spree::Variant -f images --attach-to-find-by-field=sku -i filepath.xls --split_file_name_on _
returns
WARNING : 1 of 1 files could not be attached to a Spree::Image For your convenience copying files with MISSING Spree::Variant to : MissingAttachmentRecords Created 0 / 1 attachments of type Spree::Image attached to Spree::Variant
with this log output
The text was updated successfully, but these errors were encountered: