Skip to content
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

Ticket-agnostic cart #3522

Merged
merged 81 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
04d84ec
Replace inheritdoc comments with actual comments
JPry Jan 21, 2025
7cae637
Use import for Cart class
JPry Jan 21, 2025
1541b94
Move cart hash to abstract cart
JPry Jan 21, 2025
b498435
Update return types
JPry Jan 21, 2025
523866b
Add return type to exists()
JPry Jan 22, 2025
22e6a2a
Move static method adjacent to other static method
JPry Jan 22, 2025
da2bb49
Tweak formatting
JPry Jan 23, 2025
835591c
Initial agnostic cart class
JPry Jan 23, 2025
9a8192c
Update example coupon code
JPry Jan 30, 2025
6290910
Create a trait for the transient key, and deprecate old method
JPry Jan 30, 2025
a6b2052
Allow passing null to the transient key
JPry Jan 31, 2025
567b95d
Add more description to interface docblocks
JPry Feb 1, 2025
c9c31b6
Create separate ticket mapping method
JPry Feb 1, 2025
7989392
Remove unnecessary multiplication by 1
JPry Feb 1, 2025
1b99fcd
Tweak logic for preparing tickets and use new method
JPry Feb 1, 2025
baa54f3
Move some methods to the abstract cart
JPry Feb 1, 2025
0c2d2a5
Slight tweaks to the formatting and descriptions of the cart logic
JPry Feb 1, 2025
5e759c5
Add an action after data has been processed
JPry Feb 1, 2025
42c9fda
Move mapping of cart objects to separate method
JPry Feb 1, 2025
42397a1
Update agnostic cart functionality
JPry Feb 1, 2025
6486a90
Update agnostic cart with total and subtotal
JPry Feb 1, 2025
c12b369
Separate ticket from item template files
JPry Feb 1, 2025
e95d604
Fix PHPCS issues
JPry Feb 3, 2025
969dc79
Update test snapshots to match new output
JPry Feb 3, 2025
b849b11
Rename filter
JPry Feb 3, 2025
e77ed8e
Update snapshots to match new spacing
JPry Feb 3, 2025
5e019af
Use Cart_Interface instead of Unmanaged_Cart
JPry Feb 4, 2025
529c983
Register Agnostic_Cart as the Cart_Interface object
JPry Feb 4, 2025
8006e28
Add initial Agnostic_Cart test, copied from Unmanaged_Cart
JPry Feb 4, 2025
63cbd7e
Use an import for the parent class
JPry Feb 4, 2025
9d0f386
Create add() method for Integer_Value
JPry Feb 4, 2025
eb57830
Remove import for deleted stringify interface
JPry Feb 4, 2025
54d2498
Add protection to seat selection handling
JPry Feb 4, 2025
42fa6f4
Use Cart_Interface in tests instead of Unmanaged_Cart
JPry Feb 4, 2025
4b420a2
Reformat the snapshot assertion to be more readable
JPry Feb 5, 2025
1dc3c78
Create Cart_Item class
JPry Feb 5, 2025
9dcae5f
Update cart logic to use cart item
JPry Feb 5, 2025
2749f17
Tweak formatting of agnostic cart test
JPry Feb 5, 2025
041613a
Overwrite extra data when it is supplied
JPry Feb 5, 2025
17d3c53
Fix the cart test to match cart behavior
JPry Feb 5, 2025
d77b171
Add the cart_subtotal property
JPry Feb 5, 2025
5ca504e
Change cart_total property to protected
JPry Feb 5, 2025
46f1901
Prevent the calculation methods from redoing their work on every call
JPry Feb 5, 2025
f96f036
Move logic for whether a ticket can be added to the cart to the ticke…
JPry Feb 5, 2025
d01ef89
Simplify dirname() call
JPry Feb 5, 2025
821c843
Remove unused import
JPry Feb 5, 2025
4dab7a1
Rename filter for the cookie expiration time
JPry Feb 5, 2025
b046fe5
Add new filter to allow filtering the transient expiration
JPry Feb 5, 2025
90051f4
Update docblock to reflect Cart_Interface object as the parameter
JPry Feb 5, 2025
a5b88d8
Fix PHPCS issues
JPry Feb 5, 2025
b49f5c2
Use silly alignment for = and ??=
JPry Feb 6, 2025
fb55d1c
Allow filtering the items in the cart by their type.
JPry Feb 6, 2025
ba3c3c9
Remove unused messages variable
JPry Feb 6, 2025
865c9c3
Sort imports, fix typo, and use consistent class references
JPry Feb 6, 2025
16886db
Add missing since tags
JPry Feb 7, 2025
b06f2ce
Update docblocks
JPry Feb 13, 2025
26c1c52
Use better names for non object cart item handling
JPry Feb 14, 2025
d510883
Rename $criteria variable to make it clear that it is unused
JPry Feb 14, 2025
a47840d
Add new method to the interface to get the quantity of an item.
JPry Feb 14, 2025
6c988df
Remove add_item() from interface
JPry Feb 14, 2025
e791068
Update parameters to remove_item()
JPry Feb 14, 2025
c5875a2
Add upsert_item() to the interface.
JPry Feb 14, 2025
7ec6690
Overhaul logic in Agnostic cart in various methods
JPry Feb 14, 2025
adc14a9
Use upsert instead of add for the cart
JPry Feb 14, 2025
b976f97
Tweak docblocks and remove extra variable
JPry Feb 14, 2025
d15d416
Use new methods for the test suite
JPry Feb 14, 2025
c9f0d8b
Fix method in other tests
JPry Feb 14, 2025
479f348
Resolve PHPCS issues
JPry Feb 14, 2025
fcdbf28
Update tests for Agnostic cart
JPry Feb 14, 2025
1d35d42
Remove unused imports
JPry Feb 14, 2025
59a9e73
Update add/remove ticket logic in cart page class
JPry Feb 14, 2025
3458858
Use method within abstract class
JPry Feb 14, 2025
cf79e2a
Simplify and correct logic in agnostic cart
JPry Feb 14, 2025
ae5ddf8
Work remove_ticket without try/catch
JPry Feb 14, 2025
8a6e372
Fix logic in order maker to not attempt pending status twice
JPry Feb 17, 2025
8a22d8d
Replace placehold_post_ids() with direct str_replace() call
JPry Feb 17, 2025
81a88e6
Move repetitive code into methods and make order report test easier t…
JPry Feb 17, 2025
5cef92b
Update snapshots for fixed test logic
JPry Feb 17, 2025
8702593
Add test for negative quantity and zero quantity, and update test logic
JPry Feb 17, 2025
de0a88e
Simplify items template based on review
JPry Feb 17, 2025
1bbec32
Add PHPCS exclusion to checkout/cart/ view directory
JPry Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<exclude-pattern>src/Tickets/Commerce/Order_Modifiers/*</exclude-pattern>
</rule>

<!-- Setting or modifying variables in templates is different than modifying WP globals elsewhere -->
<rule ref="WordPress.WP.GlobalVariablesOverride">
<exclude-pattern>src/views/v2/commerce/checkout/cart/*</exclude-pattern>
</rule>

<!-- General exclusions -->
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
Expand Down
Loading
Loading