feat: finish tests & docs

This commit is contained in:
Joel Male
2025-02-25 16:54:03 +10:00
parent 7adf5ecd1f
commit 4cf078277d
5 changed files with 75 additions and 39 deletions
+15 -12
View File
@@ -268,18 +268,26 @@ public function remove($id)
return true;
}
/**
* clear cart
*
* @return bool
*/
public function clear()
{
if ($this->fireEvent('Clearing') === false) {
return false;
}
$this->session->putItems([]);
$this->session->clear();
$this->fireEvent('Cleared');
return true;
}
public function clearItems()
{
if ($this->fireEvent('Clearing') === false) {
return false;
}
$this->session->clearItems();
$this->fireEvent('Cleared');
@@ -654,12 +662,7 @@ public function getContent(): CartCollection
});
}
/**
* check if cart is empty
*
* @return bool
*/
public function isEmpty()
public function isEmpty($test = null)
{
return $this->getContent()->isEmpty();
}