add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 72a7b270f9
commit 0879b0abf0
459 changed files with 6219 additions and 5416 deletions

View File

@@ -7,12 +7,14 @@ class Basket
public static function first($key)
{
$data = self::get($key);
return array_shift($data);
}
public static function last($key)
{
$data = self::get($key);
return $data ? array_pop($data) : false;
}
@@ -33,6 +35,7 @@ class Basket
array_push($data, $value);
self::set($key, $data);
}
return count($data);
}
@@ -42,6 +45,7 @@ class Basket
if (($index = array_search($value, $data)) !== false) {
unset($data[$index]);
}
return self::set($key, $data);
}