Skip to content

Commit facaa1e

Browse files
committed
🐛 save cart where lines have been removed but collection retained an index for the items
1 parent e1d2089 commit facaa1e

File tree

3 files changed

+52
-42
lines changed

3 files changed

+52
-42
lines changed

classes/Kart/Cart.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ public function releaseStock(?array $data = null): bool
448448

449449
public function save(bool $writeToUser = true): void
450450
{
451+
$this->lines = $this->lines->filterBy(fn ($i) => ! empty($i));
452+
451453
$this->kirby->session()->set($this->id, $this->lines->toArray());
452454

453455
// NOTE: no impersonation as that would shift to the kirby user.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby-kart",
33
"type": "kirby-plugin",
4-
"version": "5.7.0",
4+
"version": "5.7.1",
55
"description": "Streamlined E-Commerce Shopping Cart Solution",
66
"license": "proprietary",
77
"authors": [

composer.lock

Lines changed: 49 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)