-
Notifications
You must be signed in to change notification settings - Fork 288
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
Merge 0.8 #1743
Merge 0.8 #1743
Conversation
using same listener name as filament panel
Fixes a typo in the example of CartSession::addLines usage. The implementation of [addLines](https://github.com/lunarphp/lunar/blob/7f41cf66ebc96ee7465a84c8a4c4dd24228bf47d/packages/core/src/Models/Cart.php#L337C10-L337C10) currently expects a purchasable instance as below: ```php public function add(Purchasable $purchasable, int $quantity = 1, array $meta = [], bool $refresh = true): Cart { foreach (config('lunar.cart.validators.add_to_cart', []) as $action) { // Throws a validation exception? app($action)->using( cart: $this, purchasable: $purchasable, quantity: $quantity, meta: $meta )->validate(); } return app( config('lunar.cart.actions.add_to_cart', AddOrUpdatePurchasable::class) )->execute($this, $purchasable, $quantity, $meta) ->then(fn () => $refresh ? $this->refresh()->calculate() : $this); } public function addLines(iterable $lines): Cart { DB::transaction(function () use ($lines) { collect($lines)->each(function ($line) { $this->add( purchasable: $line['purchasable'], quantity: $line['quantity'], meta: (array) ($line['meta'] ?? null), refresh: false ); }); }); return $this->refresh()->calculate(); } ``` Co-authored-by: Alec Ritson <hello@itsalec.co.uk>
This PR adds a command `lunar:prune:carts` and some new config params under `lunar.cart.prune_tables` to determine how pruning should be carried out. I opted for using a pipeline for amending the query, as we ultimately always seem to end up there. I've tried to default to some sensible settings (90 days, dont prune carts with orders associated). If pruning is enabled we automatically add a daily task rather then needing the developer to do it. --------- Co-authored-by: Glenn Jacobs <glenn@neondigital.co.uk>
This PR adds the ability to reset the DiscountManager query cache - this is necessary if you add a discount coupon and want to update the cart totals in the same request. --------- Co-authored-by: Glenn Jacobs <glenn@neondigital.co.uk>
I am getting an error when the transaction model is null when viewing an order with only an intent transaction. Adding this null check fixes the error. Co-authored-by: Glenn Jacobs <glenn@neondigital.co.uk>
Regression test to ensure that `mappedAttributes` returns the correct class and also the `collections` relationship on products has the correct model referenced Co-authored-by: Glenn Jacobs <glenn@neondigital.co.uk>
Merge 0.7 into 0.8
@alecritson do you think we should have the |
I assume we need them because they have specific workflows which auto close PRs? |
Yeah, they're to auto-close PRs on the read-only repos. It could be argued that all the packages should have them. |
Merges changes from the
0.8
branch into1.x
.