PHP Class TI_Cart, TastyIgniter

Inheritance: extends CI_Cart
Datei anzeigen Open project: tastyigniter/tastyigniter

Public Properties

Property Type Description
$product_name_rules string These are the regular expression rules that we use to validate the product ID and product name alpha-numeric, dashes, underscores, colons or periods

Protected Properties

Property Type Description
$_cart_totals

Public Methods

Method Description
__construct ( $params = [] )
add_coupon ( array $coupon = [] ) : boolean Add Coupon *** TASTYIGNITER
add_total ( array $total = [] ) : integer Add additional cart total
calculate_tax ( ) : float Calculate tax if enabled
contents ( boolean $newest_first = FALSE ) : integer Cart Contents *** TASTYIGNITER
coupon ( ) : integer Coupon Amount *** TASTYIGNITER
coupon_code ( ) : integer Coupon Code *** TASTYIGNITER
coupon_discount ( ) : integer Coupon Discount *** TASTYIGNITER
delivery ( ) : integer Delivery Charge *** TASTYIGNITER
destroy ( ) : void Destroy the cart
get_item_by_id ( string $id ) : array Get cart item by id
get_total ( string $total_name = '' ) : array Get cart total
order_total ( ) : integer Order Total *** TASTYIGNITER
product_options_ids ( $row_id )
product_options_string ( $row_id, $split = '<br />' ) --------------------------------------------------------------------
remove_coupon ( string $coupon_code = '' ) : boolean Remove Coupon *** TASTYIGNITER
remove_total ( string $total_name = '' ) : boolean Remove Total
set_delivery ( integer $charge ) : boolean Set Delivery Charge *** TASTYIGNITER
tax_amount ( ) : integer Get Taxes Amount
tax_array ( ) : integer Get Taxes
tax_percent ( ) : integer Get Taxes Percentage
tax_title ( ) : integer Get Taxes Title
total_items ( ) : integer Total Items
totals ( ) : integer Get Cart Totals

Protected Methods

Method Description
_save_cart ( ) : boolean Save the cart array to the session DB

Method Details

__construct() public method

public __construct ( $params = [] )

_save_cart() protected method

Save the cart array to the session DB
protected _save_cart ( ) : boolean
return boolean

add_coupon() public method

This function permits calculates the coupon coupon from code.
public add_coupon ( array $coupon = [] ) : boolean
$coupon array
return boolean

add_total() public method

This function adds new total to cart totals.
public add_total ( array $total = [] ) : integer
$total array
return integer

calculate_tax() public method

Calculate tax if enabled
public calculate_tax ( ) : float
return float

contents() public method

Cart Contents *** TASTYIGNITER
public contents ( boolean $newest_first = FALSE ) : integer
$newest_first boolean
return integer

coupon() public method

Returns coupon
public coupon ( ) : integer
return integer

coupon_code() public method

Returns the coupon code
public coupon_code ( ) : integer
return integer

coupon_discount() public method

Returns coupon discount
public coupon_discount ( ) : integer
return integer

delivery() public method

Returns the delivery charge amount
public delivery ( ) : integer
return integer

destroy() public method

Empties the cart and kills the session
public destroy ( ) : void
return void

get_item_by_id() public method

Returns the details of a specific item in the cart
public get_item_by_id ( string $id ) : array
$id string
return array

get_total() public method

Returns the total from the cart totals array
public get_total ( string $total_name = '' ) : array
$total_name string
return array

order_total() public method

Order Total *** TASTYIGNITER
public order_total ( ) : integer
return integer

product_options_ids() public method

public product_options_ids ( $row_id )

product_options_string() public method

--------------------------------------------------------------------
public product_options_string ( $row_id, $split = '<br />' )

remove_coupon() public method

This function removes coupon from cart.
public remove_coupon ( string $coupon_code = '' ) : boolean
$coupon_code string
return boolean

remove_total() public method

This function removes total from totals.
public remove_total ( string $total_name = '' ) : boolean
$total_name string
return boolean

set_delivery() public method

This function permits calculates the delivery charge.
public set_delivery ( integer $charge ) : boolean
$charge integer
return boolean

tax_amount() public method

Returns the taxes amount
public tax_amount ( ) : integer
return integer

tax_array() public method

Returns taxes array
public tax_array ( ) : integer
return integer

tax_percent() public method

Returns the taxes percentage
public tax_percent ( ) : integer
return integer

tax_title() public method

Returns the taxes title
public tax_title ( ) : integer
return integer

total_items() public method

Returns the total item count
public total_items ( ) : integer
return integer

totals() public method

Returns the cart totals array
public totals ( ) : integer
return integer

Property Details

$_cart_totals protected_oe property

protected $_cart_totals

$product_name_rules public_oe property

These are the regular expression rules that we use to validate the product ID and product name alpha-numeric, dashes, underscores, colons or periods
public string $product_name_rules
return string