-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: shipping surcharges #4829
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
Merged
Merged
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
create fulfillment surcharges
…eckhafer-surcharges
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
kieckhafer
referenced
this pull request
Feb 8, 2019
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
@aldeed all comments addressed. The only one I did not take action on was the indexing, I'm not sure it's needed. Maybe you see a place it is? Also, I added a new field to the Order schema, as a recent change was causing an issue.
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Contributor
|
@kieckhafer That change looks good, but a few more things I see now (so close!):
|
…ge schema Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Member
Author
Updated. Restrictions were merged in ~November, they are in a release.
Added
Fixed: 72abacf |
Merged
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.
Impact: minor
Type: feature
There is a matching PR in the starterkit to go along with this PR. It might be beneficial to test them both at the same time, as the starterkit PR requires the changes made in this PR: reactioncommerce/example-storefront#449
Issue
Shops should be able to apply surcharges based on shipping location and attributes of items inside an order (price, brand, type of item, etc). This is a similar feature, and could be seen as an extension of the work done for shipping restrictions: #4821
Solution
Surchargescollection, and applying the surcharges to an order if criteria matches.Breaking changes
None. These are add-on features. If no surcharges are found, nothing is different.
Testing
By default, surcharges can be tested against tags, and any product attribute listed here, any any user info such as shipping address.
Creating / modifying surcharges
Use the following GQL queries / mutations to test
creating,deleting,updatingandgettinga single surcharge, andgettingall surcharges.Get all surcharges for a shop
Get a single surcharge
Use the
Get all surcharges for a shopquery to get the ID of a surcharge, then preform the following:Get a single surcharge in a non-default language (be sure to have added a surcharge message with a second language)
Use the
Get all surcharges for a shopquery to get the ID of a surcharge, then preform the following:Create a surcharge
Update a surcharge
Delete a surcharge
Applying surcharges to checkout
destination: { region: ["CA"] }, and then use a California address for your shipping address.attributes: [ { "property": "productVendor", "value": "Surcharge", "propertyType": "string", "operator": "eq" },], and then add a product to your cart that has a vendor of "Surcharge"Note that a surcharge must match ALL attributes AND destinations for it to apply. If you want to test just a destination, leave the attributes array empty. If you want to test just an attribute, leave the destination object empty. If you want to test both, then provide both, but note that they must both match (i.e. the product must have
titlevalue asBasic Reaction ProductAND it must be shipped toCA)