PHP 클래스 CI_Cart, TastyIgniter

저자: ExpressionEngine Dev Team
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$product_id_rules string These are the regular expression rules that we use to validate the product ID and product name alpha-numeric, dashes, underscores, or periods
$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
$product_name_safe boolean only allow safe product names

보호된 프로퍼티들

프로퍼티 타입 설명
$CI object Reference to CodeIgniter instance
$_cart_contents array Contents of the cart

공개 메소드들

메소드 설명
__construct ( $params = [] ) : void Shopping Class Constructor
contents ( $newest_first = FALSE ) : array Cart Contents
destroy ( ) : void Destroy the cart
format_number ( $n = '' ) : string Format Number
get_item ( string $row_id ) : array Get cart item
has_options ( string $row_id = '' ) : boolean Has options
insert ( $items = [] ) : boolean Insert items into the cart and save it to the session table
product_options ( string $row_id = '' ) : array Product options
remove ( $rowid ) : boolean Remove Item
total ( ) : integer Cart Total
total_items ( ) : integer Total Items
update ( $items = [] ) : boolean Update the cart

보호된 메소드들

메소드 설명
_insert ( $items = [] ) : boolean Insert
_save_cart ( ) : boolean Save the cart array to the session DB
_update ( $items = [] ) : boolean Update the cart

메소드 상세

__construct() 공개 메소드

The constructor loads the Session class, used to store the shopping cart contents.
public __construct ( $params = [] ) : void
리턴 void

_insert() 보호된 메소드

Insert
protected _insert ( $items = [] ) : boolean
리턴 boolean

_save_cart() 보호된 메소드

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

_update() 보호된 메소드

This function permits changing item properties. Typically it is called from the "view cart" page if a user makes changes to the quantity before checkout. That array must contain the rowid and quantity for each item.
protected _update ( $items = [] ) : boolean
리턴 boolean

contents() 공개 메소드

Returns the entire cart array
public contents ( $newest_first = FALSE ) : array
리턴 array

destroy() 공개 메소드

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

format_number() 공개 메소드

Returns the supplied number with commas and a decimal point.
public format_number ( $n = '' ) : string
리턴 string

get_item() 공개 메소드

Returns the details of a specific item in the cart
public get_item ( string $row_id ) : array
$row_id string
리턴 array

has_options() 공개 메소드

Returns TRUE if the rowid passed to this function correlates to an item that has options associated with it.
public has_options ( string $row_id = '' ) : boolean
$row_id string = ''
리턴 boolean

insert() 공개 메소드

Insert items into the cart and save it to the session table
public insert ( $items = [] ) : boolean
리턴 boolean

product_options() 공개 메소드

Returns the an array of options, for a particular product row ID
public product_options ( string $row_id = '' ) : array
$row_id string = ''
리턴 array

remove() 공개 메소드

Removes an item from the cart
public remove ( $rowid ) : boolean
리턴 boolean

total() 공개 메소드

Cart Total
public total ( ) : integer
리턴 integer

total_items() 공개 메소드

Returns the total item count
public total_items ( ) : integer
리턴 integer

update() 공개 메소드

This function permits the quantity of a given item to be changed. Typically it is called from the "view cart" page if a user makes changes to the quantity before checkout. That array must contain the product ID and quantity for each item.
public update ( $items = [] ) : boolean
리턴 boolean

프로퍼티 상세

$CI 보호되어 있는 프로퍼티

Reference to CodeIgniter instance
protected object $CI
리턴 object

$_cart_contents 보호되어 있는 프로퍼티

Contents of the cart
protected array $_cart_contents
리턴 array

$product_id_rules 공개적으로 프로퍼티

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

$product_name_rules 공개적으로 프로퍼티

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
리턴 string

$product_name_safe 공개적으로 프로퍼티

only allow safe product names
public bool $product_name_safe
리턴 boolean