PHP Интерфейс LukePOLO\LaraCart\Contracts\LaraCartContract

Показать файл Открыть проект

Открытые методы

Метод Описание
add ( $itemID, null $name = null, integer $qty = 1, string $price = '0.00', array $options = [], boolean | false $taxable = true, boolean | false $lineItem = false ) : CartItem Creates a CartItem and then adds it to cart.
addCoupon ( LukePOLO\LaraCart\Contracts\CouponContract $coupon ) Applies a coupon to the cart.
addFee ( $name, $amount, boolean | false $taxable = false, array $options = [] ) Allows to charge for additional fees that may or may not be taxable ex - service fee , delivery fee, tips.
addItem ( CartItem $cartItem ) : CartItem Adds the cartItem into the cart session.
addLine ( string | integer $itemID, null $name = null, integer $qty = 1, string $price = '0.00', array $options = [], boolean | true $taxable = true ) : CartItem Creates a CartItem and then adds it to cart.
count ( boolean $withItemQty = true ) : integer Get the count based on qty, or number of unique items.
destroyCart ( ) Completely destroys cart and anything associated with it.
emptyCart ( ) Empties the carts items.
feeTotals ( boolean $format = true ) : string Gets all the fee totals.
findCoupon ( $code ) : mixed Finds a specific coupon in the cart.
formatMoney ( $number, $locale = null, $internationalFormat = null, $format = true ) : string Formats the number into a money format based on the locale and international formats.
get ( string $instance = 'default' ) Gets the instance in the session.
getAttribute ( $attribute, $defaultValue = null ) : mixed Gets an an attribute from the cart.
getAttributes ( ) : mixed Gets all the carts attributes.
getCoupons ( ) : array Gets the coupons for the current cart.
getFee ( $name ) : mixed Gets a speific fee from the fees array.
getFees ( ) : mixed Getes all the fees on the cart object.
getItem ( $itemHash ) : CartItem | null Finds a cartItem based on the itemHash.
getItems ( ) : array Gets all the items within the cart.
removeAttribute ( $attribute ) Removes an attribute from the cart.
removeCoupon ( $code ) Removes a coupon in the cart.
removeFee ( $name ) Reemoves a fee from the fee array.
removeItem ( $itemHash ) Removes a CartItem based on the itemHash.
setAttribute ( $attribute, $value ) Adds an Attribute to the cart.
setInstance ( string $instance = 'default' ) : LaraCart Sets and Gets the instance of the cart in the session we should be using.
subTotal ( boolean $format = true, boolean $withDiscount = true ) : string Gets the subtotal of the cart with or without tax.
taxTotal ( boolean | true $format = true ) : string Gets the total tax for the cart.
total ( boolean $format = true, boolean $withDiscount = true ) : string Gets the total of the cart with or without tax.
totalDiscount ( boolean | true $format = true ) : integer | string Gets the total amount discounted.
update ( ) Updates cart session.
updateItem ( $itemHash, $key, $value ) : CartItem Updates an items attributes.

Описание методов

add() публичный Метод

Creates a CartItem and then adds it to cart.
public add ( $itemID, null $name = null, integer $qty = 1, string $price = '0.00', array $options = [], boolean | false $taxable = true, boolean | false $lineItem = false ) : CartItem
$itemID
$name null
$qty integer
$price string
$options array
$taxable boolean | false
$lineItem boolean | false
Результат LukePOLO\LaraCart\CartItem

addCoupon() публичный Метод

Applies a coupon to the cart.
public addCoupon ( LukePOLO\LaraCart\Contracts\CouponContract $coupon )
$coupon LukePOLO\LaraCart\Contracts\CouponContract

addFee() публичный Метод

Allows to charge for additional fees that may or may not be taxable ex - service fee , delivery fee, tips.
public addFee ( $name, $amount, boolean | false $taxable = false, array $options = [] )
$name
$amount
$taxable boolean | false
$options array

addItem() публичный Метод

Adds the cartItem into the cart session.
public addItem ( CartItem $cartItem ) : CartItem
$cartItem LukePOLO\LaraCart\CartItem
Результат LukePOLO\LaraCart\CartItem

addLine() публичный Метод

Creates a CartItem and then adds it to cart.
public addLine ( string | integer $itemID, null $name = null, integer $qty = 1, string $price = '0.00', array $options = [], boolean | true $taxable = true ) : CartItem
$itemID string | integer
$name null
$qty integer
$price string
$options array
$taxable boolean | true
Результат LukePOLO\LaraCart\CartItem

count() публичный Метод

Get the count based on qty, or number of unique items.
public count ( boolean $withItemQty = true ) : integer
$withItemQty boolean
Результат integer

destroyCart() публичный Метод

Completely destroys cart and anything associated with it.
public destroyCart ( )

emptyCart() публичный Метод

Empties the carts items.
public emptyCart ( )

feeTotals() публичный Метод

Gets all the fee totals.
public feeTotals ( boolean $format = true ) : string
$format boolean
Результат string

findCoupon() публичный Метод

Finds a specific coupon in the cart.
public findCoupon ( $code ) : mixed
$code
Результат mixed

formatMoney() публичный статический Метод

Formats the number into a money format based on the locale and international formats.
public static formatMoney ( $number, $locale = null, $internationalFormat = null, $format = true ) : string
$number
$locale
$internationalFormat
$format
Результат string

get() публичный Метод

Gets the instance in the session.
public get ( string $instance = 'default' )
$instance string

getAttribute() публичный Метод

Gets an an attribute from the cart.
public getAttribute ( $attribute, $defaultValue = null ) : mixed
$attribute
$defaultValue
Результат mixed

getAttributes() публичный Метод

Gets all the carts attributes.
public getAttributes ( ) : mixed
Результат mixed

getCoupons() публичный Метод

Gets the coupons for the current cart.
public getCoupons ( ) : array
Результат array

getFee() публичный Метод

Gets a speific fee from the fees array.
public getFee ( $name ) : mixed
$name
Результат mixed

getFees() публичный Метод

Getes all the fees on the cart object.
public getFees ( ) : mixed
Результат mixed

getItem() публичный Метод

Finds a cartItem based on the itemHash.
public getItem ( $itemHash ) : CartItem | null
$itemHash
Результат LukePOLO\LaraCart\CartItem | null | null

getItems() публичный Метод

Gets all the items within the cart.
public getItems ( ) : array
Результат array

removeAttribute() публичный Метод

Removes an attribute from the cart.
public removeAttribute ( $attribute )
$attribute

removeCoupon() публичный Метод

Removes a coupon in the cart.
public removeCoupon ( $code )
$code

removeFee() публичный Метод

Reemoves a fee from the fee array.
public removeFee ( $name )
$name

removeItem() публичный Метод

Removes a CartItem based on the itemHash.
public removeItem ( $itemHash )
$itemHash

setAttribute() публичный Метод

Adds an Attribute to the cart.
public setAttribute ( $attribute, $value )
$attribute
$value

setInstance() публичный Метод

Sets and Gets the instance of the cart in the session we should be using.
public setInstance ( string $instance = 'default' ) : LaraCart
$instance string
Результат LukePOLO\LaraCart\LaraCart

subTotal() публичный Метод

Gets the subtotal of the cart with or without tax.
public subTotal ( boolean $format = true, boolean $withDiscount = true ) : string
$format boolean
$withDiscount boolean
Результат string

taxTotal() публичный Метод

Gets the total tax for the cart.
public taxTotal ( boolean | true $format = true ) : string
$format boolean | true
Результат string

total() публичный Метод

Gets the total of the cart with or without tax.
public total ( boolean $format = true, boolean $withDiscount = true ) : string
$format boolean
$withDiscount boolean
Результат string

totalDiscount() публичный Метод

Gets the total amount discounted.
public totalDiscount ( boolean | true $format = true ) : integer | string
$format boolean | true
Результат integer | string

update() публичный Метод

Updates cart session.
public update ( )

updateItem() публичный Метод

Updates an items attributes.
public updateItem ( $itemHash, $key, $value ) : CartItem
$itemHash
$key
$value
Результат LukePOLO\LaraCart\CartItem