PHP Class ShoppingCart_Controller, silvershop-core

Inheritance: extends Controller
Afficher le fichier Open project: burnbright/silverstripe-shop Class Usage Examples

Protected Properties

Свойство Type Description
$cart

Méthodes publiques

Méthode Description
add ( SS_HTTPRequest $request ) : SS_HTTPResponse Action: add item to cart
add_item_link ( Buyable $buyable, $parameters = [] )
clear ( $request ) : AjaxHTTPResponse | boolean Action: clear the cart
debug ( ) Displays order info and cart contents.
direct ( boolean | string $status = true ) : boolean This is used here and in VariationForm and AddProductForm
index ( ) Handle index requests
init ( )
remove ( SS_HTTPRequest $request ) : SS_HTTPResponse Action: remove a certain number of items from the cart
remove_all_item_link ( Buyable $buyable, $parameters = [] )
remove_item_link ( Buyable $buyable, $parameters = [] )
removeall ( SS_HTTPRequest $request ) : SS_HTTPResponse Action: remove all of an item from the cart
set_quantity_item_link ( Buyable $buyable, $parameters = [] )
setquantity ( $request ) : AjaxHTTPResponse | boolean Action: update the quantity of an item in the cart

Méthodes protégées

Méthode Description
build_url ( $action, $buyable, $params = [] ) Helper for creating a url
buyableFromRequest ( ) : Product | ProductVariation | Buyable
params_to_get_string ( $array ) Creates the appropriate string parameters for links from array
updateLocale ( $request )

Method Details

add() public méthode

Action: add item to cart
public add ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
Résultat SS_HTTPResponse

build_url() protected static méthode

Helper for creating a url
protected static build_url ( $action, $buyable, $params = [] )

buyableFromRequest() protected méthode

protected buyableFromRequest ( ) : Product | ProductVariation | Buyable
Résultat Product | ProductVariation | Buyable

clear() public méthode

Action: clear the cart
public clear ( $request ) : AjaxHTTPResponse | boolean
$request
Résultat AjaxHTTPResponse | boolean

debug() public méthode

Displays order info and cart contents.
public debug ( )

direct() public static méthode

This is used here and in VariationForm and AddProductForm
public static direct ( boolean | string $status = true ) : boolean
$status boolean | string
Résultat boolean

index() public méthode

Handle index requests
public index ( )

init() public méthode

public init ( )

params_to_get_string() protected static méthode

Produces string such as: MyParam%3D11%26OtherParam%3D1 ...which decodes to: MyParam=11&OtherParam=1 you will need to decode the url with javascript before using it.
protected static params_to_get_string ( $array )

remove() public méthode

Action: remove a certain number of items from the cart
public remove ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
Résultat SS_HTTPResponse

removeall() public méthode

Action: remove all of an item from the cart
public removeall ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
Résultat SS_HTTPResponse

setquantity() public méthode

Action: update the quantity of an item in the cart
public setquantity ( $request ) : AjaxHTTPResponse | boolean
$request
Résultat AjaxHTTPResponse | boolean

updateLocale() protected méthode

protected updateLocale ( $request )

Property Details

$cart protected_oe property

protected $cart