Comments (3)
Hi Jupiter
The thing with sku and cost price is that they are actually on the Variant class
and are only delegated methods on Product rather than real DB columns
hence why the don't currently show up
in the spec/fixtures directory are lots of example csv/excel files that are good basis for the Spree imports
especially if you want to create taxons, properties etc on the fly
On the error, looks like a bug in datashift so first I'd try with the latest from github so
in your Gemfile use
gem 'datashift', :git => 'http://github.com/autotelik/datashift'
gem 'datashift_spree', :git => 'http://github.com/autotelik/datashift_spree'
if still an issue would you mind sending me the first few lines of the csv file ?
cos it looks to be failing where it tries to assign a value from a column so need to
work out how to handle that data properly
I need more real world cases so many thanks for the feedback, really helps improve things
cheers
tom
From: Jupiter Jones [email protected]
To: autotelik/datashift_spree [email protected]
Sent: Thursday, 20 December 2012, 3:35
Subject: [datashift_spree] 1.3 findings (#8)
Hello,
This is my first time using data shift, and I'm wanting to migrate products from a spree 1.2.2 site to test a new 1.3 site. Please excuse any basic misunderstandings :)
I've installed a spree 1.3 site and run both a datashift:generate:excel and datashift:export:excel on Spree:Product
Neither of these files contained a sku or a price column, so attempting to import the empty exported file generates the error:
ERROR: Mandatory column missing - expected column 'sku'
ERROR: Mandatory column missing - expected column 'price'
When I manually add the columns to the generated and exported file and re-import I get:
Loading from CSV file: export.xls
Processing 1 rows
/Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/datashift/method_detail.rb:147:in is_a?': class or module required (TypeError)
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/datashift/method_detail.rb:147:inassign'
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/loaders/loader_base.rb:381:in process'
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift_spree-0.3.0/lib/loaders/spree/product_loader.rb:109:inprocess'
from /Users/jupiter/.rvm/gems/ruby-1.9.3-p327@spree13/gems/datashift-0.11.1/lib/loaders/csv_loader.rb:67:in `block (3 levels) in perform_csv_load'
etc...
Am I missing something simple here? Or will this plugin need updating to support 1.3?
Thanks for the great work. This is one of those essential plugins so I really appreciate the work you've done on it to date.
Thanks for your time.
Cheers,
Jupiter
—
Reply to this email directly or view it on GitHub.
from datashift_spree.
Hi Tom,
Thanks - much appreciated.
I've not got the import working nicely :)
I don't think this is the right place for semi-related questions, but here goes...
The docs mention a -c configFile option and specify # Configuration file containg defaults or over rides in YAML
Can you point me to the docs for the options and format of this file?
Bottom line - the import worked perfectly, however the images were not sized correctly. I was wondering how to provide that info to the importer.
Thanks again.
Cheers,
Jupiter
from datashift_spree.
ok glad that worked. I'll get a new version of the gem released
Not really any good docs on config yet .. just https://github.com/autotelik/datashift/wiki/Import-facilities
This enables you to over ride the values of database fields during the import but
the Image dimensions cannot be set via this type of config anyway.
They are part of the paperclip definition(has_attached_file) for Images - held in the Spree::Image class
To change these generally what you need to do is create a decorator : models/spree/image_decorator.rb
copy the whole has_attached_file definition from the spree core code and then set the dimensions
that you want for each style used by Spree .. for example
module Spree
Image.class_eval do
has_attached_file :attachment,
:styles => { :mini => '120x1020>', :small => '180x180>', :product => '340x340>', :large => '600x600>' },
:default_style => :product,
:url => '/spree/products/:id/:style/:basename.:extension',
:path => ':rails_root/public/spree/products/:id/:style/:basename.:extension'
end
end
hope that helps
cheers
tom
From: Jupiter Jones [email protected]
To: autotelik/datashift_spree [email protected]
Cc: tom statter [email protected]
Sent: Friday, 21 December 2012, 4:42
Subject: Re: [datashift_spree] 1.3 findings (#8)
Hi Tom,
Thanks - much appreciated.
I've not got the import working nicely :)
I don't think this is the right place for semi-related questions, but here goes...
The docs mention a -c configFile option and specify # Configuration file containg defaults or over rides in YAML
Can you point me to the docs for the options and format of this file?
Bottom line - the import worked perfectly, however the images were not sized correctly. I was wondering how to provide that info to the importer.
Thanks again.
Cheers,
Jupiter
—
Reply to this email directly or view it on GitHub.
from datashift_spree.
Related Issues (20)
- Spree verison 3.0.4 HOT 7
- Feature: spree_related_products support HOT 2
- No Thor commands available HOT 5
- #<NoMethodError: undefined method `stock_location_name=' for #<Spree::Product:0x00000007ecd9a0>> HOT 2
- change count_on_hand in templates to stock_items
- master price is reset if using variants
- Product assigned to every parent taxonomy
- thor datashift_spree:load:products fails to render values from xls formulas HOT 1
- Paperclip not working for spree 3? HOT 6
- Error to upload images using datashift_spree:load:images HOT 3
- how to upload order and users HOT 1
- Products price get a trailing zero in import
- Failed to import supplier_id (spree_drop_ship) HOT 6
- uninitialized constant DataShift::CsvLoading (NameError) HOT 3
- can't attach images on product update HOT 5
- ERROR: "thor csv" was called with arguments ["-i,", "-m,"] Usage: "thor datashift:import:csv -i, --input=INPUT -m, --model=MODEL" HOT 9
- uninitialized constant DataShift::Spree HOT 1
- Failed to import Products. Error: undefined method `type_cast_from_database' HOT 10
- Variants are not updated with variant SKU
- how do i generate compatible csv files HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datashift_spree.