class CartSessionManager implements CartSessionInterface (View source)

Methods

__construct(SessionManager $sessionManager, AuthManager $authManager, $channel = null, $currency = null, $cart = null)

No description

Cart|null
current()

Return the current cart.

void
forget()

Forget the current cart session.

manager()

{@inheritDoc}

void
associate(Cart $cart, Authenticatable $user, string $policy)

Associate a cart to a user.

void
use(Cart $cart)

Set the cart to be used for the session.

string
getSessionKey()

Get the cart session key.

setChannel(Channel $channel)

Set the current channel.

setCurrency(Currency $currency)

Set the current currency.

getCurrency()

Return the current currency.

getChannel()

Return the current channel.

Collection
getShippingOptions()

Return available shipping options for the current cart.

createOrder(bool $forget = true)

Create an order from a cart instance.

createNewCart()

Create a new cart instance.

__call($method, $args)

No description

Details

__construct(SessionManager $sessionManager, AuthManager $authManager, $channel = null, $currency = null, $cart = null)

No description

Parameters

SessionManager $sessionManager
AuthManager $authManager
$channel
$currency
$cart

Cart|null current()

Return the current cart.

Return Value

Cart|null

void forget()

Forget the current cart session.

Return Value

void

manager()

{@inheritDoc}

void associate(Cart $cart, Authenticatable $user, string $policy)

Associate a cart to a user.

Parameters

Cart $cart
Authenticatable $user
string $policy

Return Value

void

void use(Cart $cart)

Set the cart to be used for the session.

Parameters

Cart $cart

Return Value

void

string getSessionKey()

Get the cart session key.

Return Value

string

CartSessionInterface setChannel(Channel $channel)

Set the current channel.

Parameters

Channel $channel

Return Value

CartSessionInterface

CartSessionInterface setCurrency(Currency $currency)

Set the current currency.

Parameters

Currency $currency

Return Value

CartSessionInterface

Currency getCurrency()

Return the current currency.

Return Value

Currency

Channel getChannel()

Return the current channel.

Return Value

Channel

Collection getShippingOptions()

Return available shipping options for the current cart.

Return Value

Collection

Order createOrder(bool $forget = true)

Create an order from a cart instance.

Parameters

bool $forget

Return Value

Order

protected Cart createNewCart()

Create a new cart instance.

Return Value

Cart

__call($method, $args)

No description

Parameters

$method
$args