-
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
Spree 2.4.3: Count on hand not being loaded with products (.xls) #35
Comments
Spree added a whole new stock keeping layer to Spree 2 The old count_on_hand is no longer on Variant. Have you tried using the master branch ... I have been working to get full 2 support in master .. If you still have issues, see from line 138 of https://github.com/autotelik/datashift_spree/blob/master/lib/loaders/spree/product_loader.rb - v.stock_items.first.count_on_hand |
I'm running from master (git assignment). This is a row form my .xls:
My log states:
I'm trying to pass a column as "stock_location_name" before sotck_items one... Will look into this code and thank you for your support :) |
To manage stock you need at least one Stock Location defined in your store. IF yuo cleared out the defautl seeds etc you may not have the default ... you can add one via the admin GUI ... .. see https://guides.spreecommerce.com/user/configuring_inventory.html I did come across another potential call you might try..adjust_count_on_hand : variant.stock_items.first.adjust_count_on_hand(quantity) |
I have 2 stock locations defined on my DB. I tried to select one in my .xls with column "stock_location" and value "name:casa_susana" to no avail. I would have to replace product_loader.rb to accomplish that right? (variant.stock_items.first.adjust_count_on_hand(quantity)) |
yes something like ... inherit from product_loader implement ... your own def process(method_detail, value) if(current_value && (current_method_detail.operator?('count_on_hand') || current_method_detail.operator?('on_hand')) )
else |
Forking your project and gonna try this. Thanks for the pointers :) |
I've forked datashift_spree and made some changes so that we can load stock with Spree version >= 2.2. already tested. sure it needs some code cleanup but it works, at least for me https://github.com/redglory/datashift_spree/blob/master/lib/loaders/spree/product_loader.rb Please check :) |
Hi .. thanks so much for contributing .. please submit a pull request, will be easier to visualize diffs and I will merge into main gem cheers |
Hey sure thing. Not at home right nos but will pull request lateral at night. Cheers EDIT: #36 |
I'm trying to load some products and everything goes as expected except for the count_on_hand stock items. It remains 0. My column looks liem this:
Variants | StockItem
newborn-clothes-size:0M;color:branco | count_on_hand:1
Spree v2.4.3
What am I missing here?!
The text was updated successfully, but these errors were encountered: