Joel Male
8d04d18b48
test: add withCoupon test and fix withItems ID collision
2026-05-27 21:33:35 +10:00
Joel Male
61863e0bd5
feat: add Cart::fake(), assertion methods, and CartFactory
...
Adds Cart::fake() which swaps the active driver to NullDriver and returns
a CartFactory fluent test builder. Adds assertion methods (assertContains,
assertCount, assertTotalQuantity, assertSubTotal, assertTotal,
assertConditionApplied, assertEmpty, assertNotEmpty) to Cart for use in
tests. CartFactory provides withItems(), withCondition(), and withCoupon()
as chainable helpers for seeding cart state.
2026-05-27 21:31:54 +10:00
Joel Male
c3a734bd7f
feat: add Cart::coupon(), Cart::tax(), Cart::shipping()
...
Proxy methods that accept first-class Coupon, TaxRule, and ShippingRate
objects and delegate to Cart::condition() via toCondition().
2026-05-27 21:27:23 +10:00
Joel Male
2513e07436
feat: add ShippingRate base class
2026-05-27 21:24:44 +10:00
Joel Male
b5edbb8ec0
feat: add TaxRule base class
2026-05-27 21:24:09 +10:00
Joel Male
867daaf328
feat: add Coupon base class
2026-05-27 21:23:39 +10:00
Joel Male
4877911cdd
fix: serialize conditions to arrays before storage; type \$events
...
- serializeConditions() now maps CartCondition objects to arrays via
toArray() before passing to the driver, preventing json_encode()
producing {} for object values in the DatabaseDriver
- Add Dispatcher type hint to \$events property and constructor parameter
- Add database round-trip test for cart-level conditions
- Fix CartConditionsTest to retrieve condition objects from the cart
rather than relying on object-reference side-effects that no longer
hold after proper serialization
2026-05-27 21:21:44 +10:00
Joel Male
0c27ac4d9a
test: update existing tests to use CartDriver
2026-05-27 21:09:40 +10:00
Joel Male
71213d51f5
fix: null-safe json_decode in RedisDriver; add getSessionModel test to MultiDriverTest
2026-05-27 21:01:34 +10:00
Joel Male
83aa9a1431
feat: add MultiDriver
2026-05-27 20:59:45 +10:00
Joel Male
9fcd50f81f
test: add setSessionKey test to DatabaseDriverTest
2026-05-27 20:58:24 +10:00
Joel Male
4702cf98ab
feat: add DatabaseDriver
...
Implements CartDriver for Eloquent-backed persistence using firstOrNew
pattern. Includes 9 unit tests covering CRUD, flush, clearItems, and
model retrieval.
2026-05-27 20:55:01 +10:00
Joel Male
8927ef08a0
fix: guard null writes in SessionDriver::setSessionKey
2026-05-27 20:53:19 +10:00
Joel Male
c9f48d7e88
feat: add SessionDriver
2026-05-27 20:50:47 +10:00
Joel Male
11e23a946e
test: fix strict_types and test name in NullDriverTest
2026-05-27 20:49:36 +10:00
Joel Male
b3c4c53e63
feat: add NullDriver
2026-05-27 20:47:14 +10:00
Joel Male
aaa3360d1f
chore: add test bootstrap, update phpunit config, and add Laravel 13 support to README
...
- Add tests/bootstrap.php to suppress PHP 8.4 vendor deprecation notices (Mockery implicit-nullable)
- Update phpunit.xml.dist to reference bootstrap, use PHPUnit 11.5 schema, and ignore indirect deprecations
- Note Laravel 13 support in README
2026-05-27 19:50:09 +10:00
Joel Male
8f442f51e0
chore: migrate to wearepixel/laravel-cart
2026-03-24 14:04:48 +10:00
Joel Male
4c02310bf7
feat: rough session re-implementation
2025-04-14 16:53:35 +10:00
Joel Male
4cf078277d
feat: finish tests & docs
2025-02-25 16:54:03 +10:00
Joel Male
7adf5ecd1f
feat: add tests and fix item level conditions for database storage
2025-02-25 16:31:42 +10:00
Joel Male
0f07b9ae8a
feat: database support
2025-02-25 16:03:17 +10:00
Joel Male
ec99aa0563
feat: clean up and starting documentation
2025-02-25 14:53:49 +10:00
Joel Male
b92dce9ca4
wip: initial working database support
2025-02-25 11:47:10 +10:00
Joel Male
599051631c
wip: rename package to joelwmale
2024-11-28 13:06:24 +10:00
Joel Male
5505f121c7
fix subtotal always being used
2024-09-23 07:45:59 +10:00
Joel Male
472d505041
wip: fix issue with conditions not being properly removed
2024-09-18 15:56:12 +10:00
Pixel Tech
b7381573e8
Apply Laravel Pint
...
Signed-off-by: Pixel Tech <tech@wearepixel.com.au >
2024-09-08 02:21:01 +00:00
Joel Male
d4d4df7d58
pint fixes
2024-09-08 12:20:36 +10:00
Pixel Tech
6ea2cb3b8b
Apply Laravel Pint
...
Signed-off-by: Pixel Tech <tech@wearepixel.com.au >
2024-09-07 22:36:00 +00:00
Joel Male
7a2c41e02d
add better livewire support
...
- and reset collection indexes properly
2024-09-08 08:32:51 +10:00
Joel Male
ab9eb6c873
fix tests
2024-09-04 09:16:15 +10:00
Joel Male
7ee26add8d
undo extra changes
2024-09-04 09:14:23 +10:00
Joel Male
05318b7b13
working on deprecations and code cleanup
2024-09-03 21:41:45 +10:00
Joel Male
a269c188e4
initial functionality
2024-09-03 20:22:03 +10:00
Joel Male
313a4f7aa2
Revert "1.0.7"
...
This reverts commit 4a312a37e2 .
2024-08-30 10:08:27 +10:00
Joel Male
4a312a37e2
1.0.7
2024-08-30 09:44:40 +10:00
Joel Male
6604cf984d
fix tests & validation errors
2024-08-26 10:57:02 +10:00
Joel Male
54d94d8d12
Add items with no price
2024-08-26 10:38:20 +10:00
Joel Male
f6447ad4d9
feat: add failing tests
2024-08-20 16:57:06 +10:00
Joel Male
b102dd2356
1.0.3
2024-08-19 10:35:54 +10:00
Joel Male
0a9bcc2832
quantities now support decimals (so adding 1.1, or setting it to 1.1)
2024-08-16 16:49:59 +10:00
Joel Male
d12a566366
cart item orders never change
2024-08-16 16:29:46 +10:00
Joel Male
24f64e712c
code cleanup
2024-08-16 14:55:54 +10:00
Joel Male
85ae0c30c5
test updates & working on calculating condition values based on orders
2024-08-15 17:21:19 +10:00
Joel Male
77fa8601b9
init commit :rocket
2024-08-14 10:46:23 +10:00