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
2.7 - Discount calculation classes #11889
Closed
Closed
Conversation
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
# Conflicts: # includes/abstracts/abstract-wc-data.php # includes/abstracts/abstract-wc-order.php # includes/class-wc-cart.php # includes/class-wc-coupon.php # includes/class-wc-customer.php # includes/class-wc-form-handler.php # includes/class-wc-order-item-product.php # includes/class-wc-order-item-tax.php # includes/class-wc-shipping-zone.php # includes/class-wc-shipping.php # includes/wc-cart-functions.php
I'm closing this in favor of #12006. I did the rebase/merge in a new branch because of the amount of conflicts here and I wanted this as a starting point/reference incase I screwed up. |
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.
This is a WIP - do not merge. Raising PR to track progress for #4404.
#4404 is not possible with the current codebase, so I am refactoring our cart code to allow totals to be calculated from a dedicated class, to clean up the codebase, and to allow more unit tests.
WC_Cart_Totals will handle total calculation.
WC_Cart_Session handles session data.
WC_Cart is the controller and returns some data from subclasses and various totals.
WC_Cart_Coupons stores coupons.
WC_Cart_Items stores items.
WC_Cart_Fees stores fees.
I’m currently refactoring the newer WC_Order_item Classes so they can be used for cart items too since they are very similar.
TODO: