-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Vouchers part 2 #11003
Closed
Matt-Yorkley
wants to merge
24
commits into
openfoodfoundation:voucher-prep
from
Matt-Yorkley:vouchers
Closed
Vouchers part 2 #11003
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d9153f2
Introduce "zero priced order" concept with no required payment
Matt-Yorkley 24b2ff3
Simplify voucher controller
Matt-Yorkley da11241
Move form definition down into each checkout step
Matt-Yorkley 3501101
Move voucher section out of main checkout form
Matt-Yorkley 7978aa8
Add separate voucher form
Matt-Yorkley 0e93946
Move voucher processing out of checkout controller
Matt-Yorkley 2b98d2e
Move voucher adjustment calculations out of checkout controller
Matt-Yorkley 930d4b1
Don't apply tax calculations if there's no tax
Matt-Yorkley 28a8aa7
Drop superfluous method
Matt-Yorkley 2e5ae8a
Extract voucher tests to separate controller spec
Matt-Yorkley f23cda5
Introduce "zero priced orders" to checkout UI and order state flow
Matt-Yorkley 0c3877e
Introduce "zero priced orders" in admin order payments UI and helper
Matt-Yorkley 53e5ee5
Move loading of saved cards out of checkout concern
Matt-Yorkley f92ceb6
Remove @voucher_adjustment instance variable
Matt-Yorkley 49499a9
Show/hide payment methods if voucher changes order total to zero
Matt-Yorkley 264abcc
Clarify named vouchers in UI
Matt-Yorkley 0bf0f38
Re-enable voucher test
Matt-Yorkley 657a9a3
Improve feature toggling
Matt-Yorkley 472cf6f
Fix rubocop complaint
Matt-Yorkley 3d3370f
Update use of params
Matt-Yorkley 821b579
Fix CSS/layout issues
Matt-Yorkley eced839
Fix flaky test
Matt-Yorkley 1085557
Add nil safety in reports for zero priced orders with no payment method
Matt-Yorkley a211605
Use pre_discount_total when comparing to voucher amount
Matt-Yorkley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.medium-6#checkout-payment-methods | ||
- if @order.distributor.vouchers.present? | ||
- if feature?(:vouchers, spree_current_user) && @order.distributor.vouchers.present? | ||
%div.checkout-substep | ||
= render partial: "split_checkout/voucher_section", locals: { order: @order, voucher_adjustment: @order.voucher_adjustments.first } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as my previous comment, I did it that way so the view "isn't the one doing the query". |
||
|
||
|
This file contains 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
This file contains 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
This file contains 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
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.
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.
For context, we though that wasn't necessary as unless you have access to Vouchers in backoffice (which is behind a feature toggle.), a user wouldn't be able to add a voucher to an enterprise, so the voucher section wouldn't show on the payment step.