PHP Класс ShoppingCart_Controller, silvershop-core

Наследование: extends Controller
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cart

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

Метод Описание
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

Защищенные методы

Метод Описание
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 )

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

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

Action: add item to cart
public add ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
Результат SS_HTTPResponse

build_url() защищенный статический Метод

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

buyableFromRequest() защищенный Метод

protected buyableFromRequest ( ) : Product | ProductVariation | Buyable
Результат Product | ProductVariation | Buyable

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

Action: clear the cart
public clear ( $request ) : AjaxHTTPResponse | boolean
$request
Результат AjaxHTTPResponse | boolean

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

Displays order info and cart contents.
public debug ( )

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

This is used here and in VariationForm and AddProductForm
public static direct ( boolean | string $status = true ) : boolean
$status boolean | string
Результат boolean

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

Handle index requests
public index ( )

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

public init ( )

params_to_get_string() защищенный статический Метод

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() публичный Метод

Action: remove a certain number of items from the cart
public remove ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
Результат SS_HTTPResponse

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

Action: remove all of an item from the cart
public removeall ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
Результат SS_HTTPResponse

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

Action: update the quantity of an item in the cart
public setquantity ( $request ) : AjaxHTTPResponse | boolean
$request
Результат AjaxHTTPResponse | boolean

updateLocale() защищенный Метод

protected updateLocale ( $request )

Описание свойств

$cart защищенное свойство

protected $cart