Méthode | Description | |
---|---|---|
__clone ( ) | singleton protection | |
__wakeup ( ) | ||
add ( Buyable $buyable, number $quantity = 1, unknown $filter = [] ) : boolean | OrderItem | Adds an item to the cart | |
archiveorderid ( integer | null $requestedOrderId = null ) | Store old cart id in session order history | |
clear ( boolean $write = true ) : boolean | Empty / abandon the entire cart. | |
clearMessage ( ) | ||
curr ( ) : Order | Shortened alias for ShoppingCart::singleton()->current() | |
current ( ) : Order | Get the current order, or return null if it doesn't exist. | |
get ( Buyable $buyable, $customfilter = [] ) : OrderItem | Finds an existing order item. | |
getCorrectBuyable ( Buyable $buyable ) : Buyable | Ensure the proper buyable will be returned for a given buyable… This is being used to ensure a product with variations cannot be added to the cart… a Variation has to be added instead! | |
getMessage ( ) | ||
getMessageType ( ) | ||
remove ( Buyable $buyable, integer $quantity = null, $filter = [] ) : boolean | Remove an item from the cart. | |
setCurrent ( Order $cart ) : ShoppingCart | Set the current cart | |
setQuantity ( Buyable $buyable, integer $quantity = 1, $filter = [] ) : boolean | OrderItem | Sets the quantity of an item in the cart. | |
singleton ( ) : ShoppingCart | Access for only allowing access to one (singleton) ShoppingCart. |
Méthode | Description | |
---|---|---|
error ( $message ) | Store a new error. | |
findOrMake ( ) : Order | Helper that only allows orders to be started internally. | |
message ( string $message, string $type = "good" ) | Store a message to be fed back to user. |
Méthode | Description | |
---|---|---|
findOrMakeItem ( Buyable $buyable, integer $quantity = 1, array $filter = [] ) : OrderItem | Finds or makes an order item for a given product + filter. |
public archiveorderid ( integer | null $requestedOrderId = null ) | ||
$requestedOrderId | integer | null | optional parameter that denotes the order that was requested |
public static curr ( ) : Order | ||
Résultat | Order |
public current ( ) : Order | ||
Résultat | Order |
protected findOrMake ( ) : Order | ||
Résultat | Order |
public get ( Buyable $buyable, $customfilter = [] ) : OrderItem | ||
$buyable | Buyable | |
Résultat | OrderItem | the item requested, or false |
public getCorrectBuyable ( Buyable $buyable ) : Buyable | ||
$buyable | Buyable | |
Résultat | Buyable |
public setCurrent ( Order $cart ) : ShoppingCart | ||
$cart | Order | |
Résultat | ShoppingCart |
public setQuantity ( Buyable $buyable, integer $quantity = 1, $filter = [] ) : boolean | OrderItem | ||
$buyable | Buyable | |
$quantity | integer | |
Résultat | boolean | OrderItem | false or the new/existing item |
public static singleton ( ) : ShoppingCart | ||
Résultat | ShoppingCart |