add shipping rules
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user