forked from gemento/solidus_sale_prices
-
Notifications
You must be signed in to change notification settings - Fork 31
Fix solidus 4 compatibility #65
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
Open
JustShah
wants to merge
8
commits into
solidusio-contrib:master
Choose a base branch
from
TriodecSolutions:fix-solidus-4-compatibility
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix solidus 4 compatibility #65
JustShah
wants to merge
8
commits into
solidusio-contrib:master
from
TriodecSolutions:fix-solidus-4-compatibility
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00a59db
to
4d394ad
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
b121454
to
4517543
Compare
This commit removes Circle CI config, as the extension is now updated with dev support we have added github actions to the extension. Hence from now github actions will be used to execute test suites.
As SolidusSupport::Migration is deprecated, hence to avoid deprecation warning updated the migration using ActiveRecord::Migration.
Replaced manual currency and country ISO filtering with Solidus built-in `price_for_options` method to simplify logic and improve consistency. `price_for_options` will be used to detect the price of the variant and the options will be used to filter it in the price selector.
To improve the way price IDs are processed. Instead of splitting a string of price IDs, the method now directly maps the incoming `price_ids` parameter to integers and retrieves the corresponding prices using an ActiveRecord query. As the user could select multiple prices on sale price tabs and the parameter was receiving multiple price IDs as well but when the sale price was created it was created for the first ID itself hence to align the multiple selected prices to have a sale price created by user the query is updated.
Previously, discarding a record would destroy its related objects. However, Solidus now soft-deletes related objects instead of fully destroying them. This commit updates and adds test cases to align with the new behavior, ensuring consistency with Solidus's current soft-deletion flow.
4517543
to
c7326d4
Compare
Hey @kennyadsl, do you think you could spare some time to review this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the
solidus_sale_prices
extension to align with the latest behavior and expectations in Solidus 4.x. It includes compatibility improvements, test adjustments, and internal refactors.Summary of Changes
Modernize extension tooling
solidus_dev_support
for extension structure.SolidusSupport::Migration
withActiveRecord::Migration
in migration files.Refactor price detection
price_search
with Solidus’s built-invariant.price_for_options
method for cleaner and more maintainable logic.Improve sale price creation flow
selected_prices
method to use an ActiveRecord query instead of relying on string splitting.Update specs for soft deletion
Spree::Price
) are soft-deleted rather than destroyed.Code cleanup
bin/rubocop -A
to fix style and lint issues.