-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix stock configuration examples in documentation #3487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Maybe Spree.config.spree.stock.location_filter_class = 'Spree::Stock::LocationFilter::SameOrderCountry'
without the block is enough?
@kennyadsl, I tried that but didn't work for me neither. |
Just to be sure, are you restarting the rails server after these changes? |
yes |
Sorry, my fault, it should be:
|
Ok, that worked. I can change it with a new commit if you prefer that way |
Yes, I think it's better. And please, can you also squash commits into a single one before pushing? Thanks again! 🙂 |
97be617
to
62c9777
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Out of curiosity, I tried to verify the issue locally. So, I generated a sandbox app with class CustomAllocator
end
class CustomFilter
end
class CustomSorter
end
Spree.config do |config|
config.stock.allocator_class = 'CustomAllocator'
config.stock.location_filter_class = 'CustomFilter'
config.stock.location_sorter_class = 'CustomSorter'
# ...
end then starting the sandbox console with Loading development environment (Rails 6.0.2.1)
2.6.3 :001 > Spree::Config.stock.allocator_class
=> CustomAllocator
2.6.3 :002 > Spree::Config.stock.location_filter_class
=> CustomFilter
2.6.3 :003 > Spree::Config.stock.location_sorter_class
=> CustomSorter So, in this case it seems that following the existing documentation work properly. @gugaiz can you explain in detail what kind of issues you experienced? |
@spaghetticode that works and that was my first proposal, but @kennyadsl preferred the way is documented on this PR ( |
@gugaiz thanks for the clarification. So, the documentation is wrong only for the two files that used
and
I have no idea if we should prefer one way or the other(s) for this case, maybe we should document them all? |
@spaghetticode I guess someone else might answer that. If you ask me, I prefer the way below because is what you find when you open the
|
I also prefer that way |
I'm fine with both, so 👍 if @gugaiz has time to change it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gugaiz thanks 👍
Fix an issue with the documentation related to the custom configuration of the stock location filter and sorter. The way it was documented didn't work.
a92fd92
to
f64b507
Compare
@kennyadsl I think is done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gugaiz thank you ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fix an issue with the documentation related to the custom configuration
of the stock location filter and sorter. The way it was documented
didn't work.
Checklist: