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

Add call to sort_packages and method placeholder #49

Merged
merged 1 commit into from
Jul 31, 2013

Conversation

rubenrails
Copy link

Adding sort_packages (as in spree core's prioritizer) so developers don't need to override prioritized_packages in order to add that call.

cc @huoxito

@huoxito
Copy link

huoxito commented Jul 30, 2013

Out of curiosity have you found a use case for that method? I read this issue on spree-guides and couldn't think of a good use for it spree/spree-guides#144 In a way packages are already sorted in Adjuster that's why I didn't add the sort_packages method in AssemblyPriotirizer.

@rubenrails
Copy link
Author

Actually we're doing something in that method to ensure we give priority to one stock location for some products. Problem is that if we don't do anything then the adjuster will create a package for the undesired location leaving the right location's package as quantity=0 for the parts of the assembly.

@huoxito huoxito merged commit 45e50e4 into spree-contrib:master Jul 31, 2013
@huoxito
Copy link

huoxito commented Jul 31, 2013

That sounds ok to me @rubenrails thanks for pointing out. Do you think you could submit a PR with an example code to spree-guides? That would be great too. Thanks!

@rubenrails
Copy link
Author

Will do! Thanks :)

@rubenrails rubenrails deleted the sort-packages branch July 31, 2013 00:20
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

Successfully merging this pull request may close these issues.

2 participants