Skip to content
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

Update existing rows #30

Open
chriscarpenter12 opened this issue Sep 24, 2014 · 4 comments
Open

Update existing rows #30

chriscarpenter12 opened this issue Sep 24, 2014 · 4 comments

Comments

@chriscarpenter12
Copy link

Is it not possible to update existing rows?

Fore instance this works

"sku","name","description","price","cost_price","map","shipping_category_id","tax_category_id"
"SIMPLE_003","Simple third row avail in future","more blah blah",50.34,23.34,300,1,1

but running the same thing again with a price change

"sku","name","description","price","cost_price","map","shipping_category_id","tax_category_id"
"SIMPLE_003","Simple third row avail in future","more blah blah",60.34,23.34,300,1,1

fails. It creates a duplicate row in spree_products

~/Documents/sites/rvw(branch:develop*) » bundle exec thor datashift_spree:load:products -i products.csv
DataShift::Product starting upload from file: products.csv
["sku", "name", "price"]
["sku", "name", "description", "price", "cost_price", "map", "shipping_category_id", "tax_category_id"]



Loading from CSV file: products.csv
Processing 1 rows
DEBUG: insistent_assignment : sku= => SIMPLE_003 (String)
DEBUG: insistent_assignment : price= => 50.34 (String)
DEBUG: insistent_assignment : cost_price= => 23.34 (String)
DEBUG: insistent_assignment : map= => 300 (String)

Processing Summary Report
>>>>>>>>>>>>>>>>>>>>>>>>>
Processed total of 1 entry
1 objects were succesfully processed.
There were NO failures.
------------------------------------------------------------
~/Documents/sites/rvw(branch:develop*) » bundle exec thor datashift_spree:load:products -i products.csv
DataShift::Product starting upload from file: products.csv
["sku", "name", "price"]
["sku", "name", "description", "price", "cost_price", "map", "shipping_category_id", "tax_category_id"]



Loading from CSV file: products.csv
Processing 1 rows
DEBUG: insistent_assignment : sku= => SIMPLE_003 (String)
DEBUG: insistent_assignment : price= => 60.34 (String)
DEBUG: insistent_assignment : cost_price= => 23.34 (String)
DEBUG: insistent_assignment : map= => 300 (String)

Processing Summary Report
>>>>>>>>>>>>>>>>>>>>>>>>>
Processed total of 1 entry
0 objects were succesfully processed.
WARNING : Check logs : 1 rows contained errors and 1 records NOT created.
@IslamAzab
Copy link

@chriscarpenter12 Did you find any solution for this issue ?

@IslamAzab
Copy link

@autotelik Is there any way to do so ? That would be really great.

@chriscarpenter12
Copy link
Author

@IslamAzab I ended up not using datashift_spree at all. I ended up using a rake file and the Spree classes directly to import/update products.

@IslamAzab
Copy link

@chriscarpenter12 Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants