| applications_smartshop

# Class: Bs_Ss_Basket Source Location: /applications/smartshop/Bs_Ss_Basket.class.php
### Class Overview
    Bs_Object
       |
       --Bs_Ss_Basket
SmartShop Basket Class #### Author(s): andrej arn <at blueshoes dot org> #### Version: 4.3.$Revision: 1.4 $ $Date: 2003/08/09 15:22:35 $ #### Copyright: blueshoes.org | ### Variables $basketUrl $Bs_Number $includeOnce $mailOrderFrom $mailOrderTo $onLoadCode $serializeType | ### Methods Bs_Ss_Basket add change doItYourself flush getAmount getAsIcon getAsLayer getDesign getFormatted getFormattedUneditable getLayerIframe getNumItems getProductsAsHiddenFormFieldsForPaypal getValue output remove _getAsPlaintext _getOrderForm _loadOrderForm _parseFormattedLine
### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 27] SmartShop Basket Class dependencies: Bs_Number, Bs_Form, Bs_Smtp #### Tags:
copyright: | blueshoes.org
pattern: | singleton: (pseudostatic)
access: | public
version: | 4.3.$Revision: 1.4 $ $Date: 2003/08/09 15:22:35 $
author: | andrej arn <at blueshoes dot org>
[ Top ] ### Class Variables #### $basketUrl = '/en/shop/basket/' [line 77] the url where the shopping basket is. #### Tags:
access: | public
Type: | string
[ Top ] #### $Bs_Number = [line 43] pseudostatic instance of Bs_Number (reference to global one) #### Tags:
access: | public
Type: | object
[ Top ] #### $includeOnce = [line 129] used from the form.
Type: | mixed
[ Top ] #### $mailOrderFrom = 'andrej@blueshoes.org' [line 109] the sender address of the emails (for the admin and customer). #### Tags:
access: | public
Type: | string
[ Top ] #### $mailOrderTo = 'andrej@blueshoes.org' [line 118] the email address of the admin. if set to 'DEBUG' then the customer-address will be used. #### Tags:
access: | public
Type: | string
[ Top ] #### $onLoadCode = [line 124] used from the form.
Type: | mixed
[ Top ] #### $serializeType = 'wddx' [line 101] or 'php' which doesn't work on mars :/
Type: | mixed
[ Top ] ### Class Methods ### constructor Bs_Ss_Basket [line 136]
`Bs_Ss_Basket Bs_Ss_Basket( object &$shop)`
constructor #### Parameters:
object | &$shop |
[ Top ] ### method add [line 258]
`bool add( string $UID, string $orderCode, int $number)`
adds the given product with the given amount to the list. if the product is already listed, then the given number will be added. #### Tags:
access: | public
#### Parameters:
string | $UID |
string | $orderCode |
int | $number |
[ Top ] ### method change [line 286]
`bool change( string $orderCode, int $number)`
changes the amount of ordered items for the given product. if the product is not listed yet, it'll be added. #### Tags:
access: | public
#### Parameters:
string | $orderCode |
int | $number |
[ Top ] ### method doItYourself [line 155]
`void doItYourself( )`
deals with the user-submitted data. [ Top ] ### method flush [line 321]
`void flush( )`
empties the shopping basket (removes all products). note: empty is a reserved word and thus it cannot be used as function name. #### Tags:
access: | public
[ Top ] ### method getAmount [line 416]
`int getAmount( string $orderCode)`
returns the amount of products in the basket for that order code. #### Tags:
access: | public
#### Parameters:
string | $orderCode |
[ Top ] ### method getAsIcon [line 826]
`string getAsIcon( )`
returns the icon/text for the navigation (so the user remembers to order). returns an empty string if the basket is empty. #### Tags:
return: | (html)
access: | public
[ Top ] ### method getAsLayer [line 766]
`string getAsLayer( )`
returns the basket formatted as a movable layer. ie only. returns an empty string if the basket is empty. #### Tags:
return: | (html)
access: | public
[ Top ] ### method getDesign [line 522]
`void getDesign( mixed $format)`
[ Top ] ### method getFormatted [line 531]
`string getFormatted( )`
#### Tags:
access: | public
[ Top ] ### method getFormattedUneditable [line 588]
`string getFormattedUneditable( )`
#### Tags:
access: | public
[ Top ] ### method getLayerIframe [line 780]
`void getLayerIframe( )`
[ Top ] ### method getNumItems [line 354]
`int getNumItems( )`
returns the number of different products in the basket. #### Tags:
access: | public
[ Top ] ### method getProductsAsHiddenFormFieldsForPaypal [line 709]
`string getProductsAsHiddenFormFieldsForPaypal( )`
returns the products as hidden form fields, used to submit to paypal. #### Tags:
return: | (html code, part of a form)
throws: | bool FALSE (if no items in the cart)
access: | public
[ Top ] ### method getValue [line 368]
`double getValue( [string $orderCode = NULL], [int $decimal = 2])`
returns the value of all or one of the products in the basket. if $orderCode is not given, then it's for all. #### Tags:
throws: | double 0 (with decimal figures)
access: | public
#### Parameters:
string | $orderCode | (or set to NULL)
int | $decimal | (number of figures after the dot)
[ Top ] ### method output [line 220]
`string output( )`
returns the basket as html output to write to the page. #### Tags:
return: | (html output)
access: | public
[ Top ] ### method remove [line 308]
`void remove( string $orderCode)`
removes the product with the given UID. #### Tags:
access: | public
#### Parameters:
string | $orderCode |
[ Top ] ### method _getAsPlaintext [line 676]
`void _getAsPlaintext( )`
[ Top ] ### method _getOrderForm [line 984]
`void _getOrderForm( )`
[ Top ] ### method _loadOrderForm [line 1018]
`void _loadOrderForm( )`
[ Top ] ### method _parseFormattedLine [line 437]
`string _parseFormattedLine( object $xPath, object $prodObj)`
allowed tags: <bs:image name="overview"/> <bs:language name="caption"/> <bs:price/> <bs:basket/> __UID__ __ORDERCODE__ #### Parameters:
object | $xPath |
object | $prodObj |
[ Top ] Documentation generated on Mon, 29 Dec 2003 21:12:48 +0100 by phpDocumentor 1.2.3