oxOrder Class Reference

Inheritance diagram for oxOrder:

Inheritance graph
[legend]
Collaboration diagram for oxOrder:

Collaboration graph
[legend]

List of all members.


Detailed Description

Inlcudes PDF class. Order manager. Performs creation assigning, updating, deleting and other order functions.

Definition at line 12 of file oxorder.php.


Public Member Functions

 __construct ()
 __get ($sName)
 assign ($dbRecord)
 getOrderArticles ()
 getOrderDeliveryPrice ()
 getOrderWrappingPrice ()
 getOrderPaymentPrice ()
 getOrderNetSum ()
 finalizeOrder (oxBasket $oBasket, $oUser, $blRecalculatingOrder=false)
 getOrderLanguage ()
 save ()
 getDelAddressInfo ()
 validateStock ($oBasket)
 delete ($sOxId=null)
 recalculateOrder ($aNewOrderArticles=array(), $blChangeDelivery=false, $blChangeDiscount=false)
 pdfFooter ($oPdf)
 pdfHeaderplus ($oPdf)
 pdfHeader ($oPdf)
 genPdf ($sFilename, $iSelLang=0)
 getInvoiceNum ()
 getNextBillNum ()
 getShippingSetList ()
 getVoucherNrList ()
 getOrderSum ($blToday=false)
 getOrderCnt ($blToday=false)
 getUser ()
 getBasket ()
 getPayment ()
 getVoucherList ()
 getDelSet ()
 getPaymentType ()
 getGiftCard ()
 setSeparateNumbering ($blSeparateNumbering=null)
 getLastUserPaymentType ($sUserId)
 getTotalOrderSum ()
 getBillCountry ()
 getDelCountry ()

Protected Member Functions

 _getCountryTitle ($sCountryId)
 _setOrderStatus ($sStatus)
 _loadFromBasket (oxBasket $oBasket)
 _setUser ($oUser)
 _setWrapping (oxBasket $oBasket)
 _setOrderArticles ($aArticleList)
 _executePayment (oxBasket $oBasket, $oUserpayment)
 _getGateway ()
 _setPayment ($sPaymentid)
 _setFolder ()
 _updateWishlist ($aArticleList, $oUser)
 _updateNoticeList ($aArticleList, $oUser)
 _updateStock ()
 _markVouchers ($oBasket, $oUser)
 _insert ()
 _update ()
 _checkOrderExist ($sOxId=null)
 _sendOrderByEmail ($oUser=null, $oBasket=null, $oPayment=null)
 _makeSelListArray ($sArtId=null, $sOrderArtSelList=null)
 _addOrderArticlesToBasket ($oUser=null, $aOrderArticles=null, $blChangeDelivery=false, $blChangeDiscount=false, $blStockCheck=true)
 _setDeprecatedValues ()

Protected Attributes

 $_aSkipSaveFields = array( 'oxorderdate' )
 $_oArticles = null
 $_oDelSet = null
 $_oGiftCard = null
 $_oPaymentType = null
 $_oPayment = null
 $_aVoucherList = null
 $_oDelPrice = null
 $_oUser = null
 $_oBasket = null
 $_oWrappingPrice = null
 $_oPaymentPrice = null
 $_sClassName = 'oxorder'
 $_blSeparateNumbering = null
 $_iOrderLang = null

Constructor & Destructor Documentation

oxOrder.__construct (  ) 

Class constructor, initiates parent constructor (parent.oxBase()).

Reimplemented from oxBase.

Definition at line 123 of file oxorder.php.


Member Function Documentation

oxOrder.__get ( sName  ) 

Getter made for order deliveryset object access

Parameters:
string $sName parameter name
Returns:
mixed

Reimplemented from oxBase.

Definition at line 140 of file oxorder.php.

oxOrder.assign ( dbRecord  ) 

Assigns data, stored in DB to oxorder object

Parameters:
mixed $dbRecord DB record
Returns:
null

Reimplemented from oxBase.

Definition at line 162 of file oxorder.php.

oxOrder._getCountryTitle ( sCountryId  )  [protected]

Gets country title by country id.

Parameters:
string $sCountryId Cuntry ID
Returns:
string

Definition at line 184 of file oxorder.php.

oxOrder.getOrderArticles (  ) 

Assigns data, stored in oxorderarticles to oxorder object .

Returns:
null

Definition at line 201 of file oxorder.php.

oxOrder.getOrderDeliveryPrice (  ) 

Returns order delivery expenses price object

Returns:
oxprice

Definition at line 223 of file oxorder.php.

oxOrder.getOrderWrappingPrice (  ) 

Returns order wrapping expenses price object

Returns:
oxprice

Definition at line 240 of file oxorder.php.

oxOrder.getOrderPaymentPrice (  ) 

Returns order payment expenses price object

Returns:
oxprice

Definition at line 257 of file oxorder.php.

oxOrder.getOrderNetSum (  ) 

Returns order netto sum (total price, including delivery, payment etc - VAT) (A. this is very unprecise :())

Returns:
double

Definition at line 275 of file oxorder.php.

oxOrder.finalizeOrder ( oxBasket oBasket,
oUser,
blRecalculatingOrder = false 
)

Order checking, processing and saving method. Before saving performed checking if order is still not executed (checks in database oxorder table for order with know ID), if yes - returns error code 3, if not - loads payment data, assigns all info from basket to new oxorder object and saves full order with error status. Then executes payment. On failure - deletes order and returns error code 2. On success - saves order (oxorder.save()), removes article from wishlist (oxorder._updateWishlist()), updates voucher data (oxorder._markVouchers()). Finally sends order confirmation email to customer (oxemail.SendOrderEMailToUser()) and shop owner (oxemail.SendOrderEMailToOwner()). If this is order racalculation, skipping payment execution, marking vouchers as used and sending order by email to shop owner and user Mailing status (1 if OK, 0 on error) is returned.

Parameters:
oxBasket $oBasket Shopping basket object
object $oUser Current user object
bool $blRecalculatingOrder Order recalculation
Returns:
integer

Definition at line 307 of file oxorder.php.

oxOrder._setOrderStatus ( sStatus  )  [protected]

Updates order transaction status. Faster than saving whole object

Parameters:
string $sStatus order transaction status
Returns:
null

Definition at line 392 of file oxorder.php.

oxOrder._loadFromBasket ( oxBasket oBasket  )  [protected]

Gathers and assigns to new oxorder object customer data, payment, delivery and shipping info, customer odere remark, currency, voucher, language data. Additionally stores general discount and wrapping. Sets order status to "error" and creates oxorderarticle objects and assigns to them basket articles.

Parameters:
oxBasket $oBasket Shopping basket object
Returns:
null

Definition at line 408 of file oxorder.php.

oxOrder.getOrderLanguage (  ) 

Returns language id of current order object. If order allready has language defined - checks if this language is defined in shops config

Returns:
int

Definition at line 483 of file oxorder.php.

oxOrder._setUser ( oUser  )  [protected]

Assigns to new oxorder object customer delivery and shipping info

Parameters:
object $oUser user object
Returns:
null

Definition at line 502 of file oxorder.php.

oxOrder._setWrapping ( oxBasket oBasket  )  [protected]

Assigns wrapping VAT and card price + card message info

Parameters:
oxBasket $oBasket basket object
Returns:
null

Definition at line 549 of file oxorder.php.

oxOrder._setOrderArticles ( aArticleList  )  [protected]

Creates oxorderarticle objects and assigns to them basket articles. Updates quantity of sold articles (oxarticle.updateSoldAmount()).

Parameters:
array $aArticleList article list
Returns:
null

Definition at line 578 of file oxorder.php.

oxOrder._executePayment ( oxBasket oBasket,
oUserpayment 
) [protected]

Executes payment. Additionally loads oxPaymentGateway object, initiates it by adding payment parameters (oxPaymentGateway.setPaymentParams()) and finally executes it (oxPaymentGateway.executePayment()). On failure - deletes order and returns * error code 2.

Parameters:
oxBasket $oBasket basket object
object $oUserpayment user payment object
Returns:
integer 2 or an error code

Definition at line 671 of file oxorder.php.

oxOrder._getGateway (  )  [protected]

Returns the correct gateway. At the moment only switch between default and IPayment, can be extended later.

Returns:
object $oPayTransaction payment gateway object

Definition at line 704 of file oxorder.php.

oxOrder._setPayment ( sPaymentid  )  [protected]

Creats and returns user payment.

Parameters:
string $sPaymentid used payment id
Returns:
object $oUserpayment payment object

Definition at line 716 of file oxorder.php.

oxOrder._setFolder (  )  [protected]

Assigns oxfolder as new

Returns:
null

Definition at line 777 of file oxorder.php.

oxOrder._updateWishlist ( aArticleList,
oUser 
) [protected]

aAdds/removes user chosen article to/from his noticelist or wishlist (oxuserbasket.addItemToBasket()).

Parameters:
array $aArticleList basket products
object $oUser user object
Returns:
null

Definition at line 792 of file oxorder.php.

oxOrder._updateNoticeList ( aArticleList,
oUser 
) [protected]

After order is finished this method cleans up users notice list, by removing bought items from users notice list

Parameters:
array $aArticleList array of basket products
oxuser $oUser basket user object
Returns:
null

Definition at line 832 of file oxorder.php.

oxOrder._updateStock (  )  [protected]

Bought item stock updater

Returns:
null

Definition at line 856 of file oxorder.php.

oxOrder._markVouchers ( oBasket,
oUser 
) [protected]

Markes voucher as used (oxvoucher.markAsUsed()) and sets them to $this->_aVoucherList.

Parameters:
oxBasket $oBasket basket object
oxUser $oUser user object
Deprecated:
sets deprecated values for usage in mail templates
Returns:
null

Definition at line 881 of file oxorder.php.

oxOrder.save (  ) 

Updates/inserts order object and related info to DB

Returns:
null

Reimplemented from oxBase.

Definition at line 908 of file oxorder.php.

oxOrder.getDelAddressInfo (  ) 

Loads and returns delivery adress object or null if deladrid is not configured, or object was not loaded

Returns:
object

Definition at line 930 of file oxorder.php.

oxOrder.validateStock ( oBasket  ) 

Function whitch cheks if article stock is valid. If not displays error and returns false.

Parameters:
object $oBasket basket object
Exceptions:
oxOutOfStockException exception
Returns:
null

Definition at line 958 of file oxorder.php.

oxOrder._insert (  )  [protected]

Inserts order object information in DB. Returns true on success.

Returns:
bool

Reimplemented from oxBase.

Definition at line 980 of file oxorder.php.

oxOrder._update (  )  [protected]

Updates object parameters to DB.

Returns:
null

Reimplemented from oxBase.

Definition at line 1014 of file oxorder.php.

oxOrder.delete ( sOxId = null  ) 

Updates stock information, deletes current ordering details from DB, returns true on success.

Parameters:
string $sOxId Ordering ID (default null)
Returns:
bool

Reimplemented from oxBase.

Definition at line 1028 of file oxorder.php.

oxOrder.recalculateOrder ( aNewOrderArticles = array(),
blChangeDelivery = false,
blChangeDiscount = false 
)

Recalculates order. Starts transactions, deletes current order and order articles from DB, adds current order articles to virtual basket and finaly recalculates order by calling oxorder.finalizeOrder() If no errors, finishing transaction.

Parameters:
array $aNewOrderArticles article list of new order
bool $blChangeDelivery if delivery was changed in admin
bool $blChangeDiscount if discount was changed in admin
Returns:
null

Definition at line 1079 of file oxorder.php.

oxOrder.pdfFooter ( oPdf  ) 

Fake entries, pdf is generated in modules.. myorder.

Parameters:
mixed $oPdf pdf object
Returns:
null

Definition at line 1190 of file oxorder.php.

oxOrder.pdfHeaderplus ( oPdf  ) 

Fake entries, pdf is generated in modules.. myorder.

Parameters:
mixed $oPdf pdf object
Returns:
null

Definition at line 1201 of file oxorder.php.

oxOrder.pdfHeader ( oPdf  ) 

Fake entries, pdf is generated in modules.. myorder.

Parameters:
mixed $oPdf pdf object
Returns:
null

Definition at line 1212 of file oxorder.php.

oxOrder.genPdf ( sFilename,
iSelLang = 0 
)

Fake entries, pdf is generated in modules.. myorder.

Parameters:
string $sFilename file name
int $iSelLang selected language
Returns:
null

Definition at line 1224 of file oxorder.php.

oxOrder.getInvoiceNum (  ) 

Returns order invoice number.

Returns:
integer

Definition at line 1233 of file oxorder.php.

oxOrder.getNextBillNum (  ) 

Returns next possible (free) order bill number.

Returns:
integer

Definition at line 1244 of file oxorder.php.

oxOrder.getShippingSetList (  ) 

Loads possible shipping sets for this order

Returns:
oxdeliverysetlist

Definition at line 1255 of file oxorder.php.

oxOrder.getVoucherNrList (  ) 

Get vouchers numbers list which were used with this order

Returns:
array

Definition at line 1280 of file oxorder.php.

oxOrder.getOrderSum ( blToday = false  ) 

Returns orders total price

Parameters:
bool $blToday if true calculates only current day orders
Returns:
int

Definition at line 1302 of file oxorder.php.

oxOrder.getOrderCnt ( blToday = false  ) 

Returns orders count

Parameters:
bool $blToday if true calculates only current day orders
Returns:
int

Definition at line 1321 of file oxorder.php.

oxOrder._checkOrderExist ( sOxId = null  )  [protected]

Checking if this order is already stored.

Parameters:
string $sOxId order ID
Returns:
bool

Definition at line 1341 of file oxorder.php.

oxOrder._sendOrderByEmail ( oUser = null,
oBasket = null,
oPayment = null 
) [protected]

Send order to shop owner and user

Parameters:
oxUser $oUser order user
oxBasket $oBasket current order basket
oxPayment $oPayment order payment
Returns:
bool

Definition at line 1363 of file oxorder.php.

oxOrder.getUser (  ) 

Returns order user

Returns:
oxUser

Reimplemented from oxSuperCfg.

Definition at line 1391 of file oxorder.php.

oxOrder.getBasket (  ) 

Returns order basket

Returns:
oxBasket

Definition at line 1401 of file oxorder.php.

oxOrder.getPayment (  ) 

Returns order payment

Returns:
oxBasket

Definition at line 1411 of file oxorder.php.

oxOrder.getVoucherList (  ) 

Returns order vouchers marked as used

Returns:
array

Definition at line 1421 of file oxorder.php.

oxOrder.getDelSet (  ) 

Returns order deliveryset object

Returns:
oxDeliverySet

Definition at line 1431 of file oxorder.php.

oxOrder.getPaymentType (  ) 

Get payment type

Returns:
oxPayment

Definition at line 1447 of file oxorder.php.

oxOrder.getGiftCard (  ) 

Get gift card

Returns:
oxWrapping

Definition at line 1462 of file oxorder.php.

oxOrder.setSeparateNumbering ( blSeparateNumbering = null  ) 

Set usage of seperate orders numbering for different shops

Parameters:
bool $blSeparateNumbering use or not separate orders numbering
Returns:
bool

Definition at line 1479 of file oxorder.php.

oxOrder.getLastUserPaymentType ( sUserId  ) 

Get users payment type from last order

Parameters:
string $sUserId order user id
Returns:
string $sLastPaymentId payment id

Definition at line 1491 of file oxorder.php.

oxOrder._makeSelListArray ( sArtId = null,
sOrderArtSelList = null 
) [protected]

Make select list array from oxorderarticles__oxselvariant string. This select list array is used when recalculating order and adding items to basket (oxBasket.addToBaske())

Parameters:
string $sArtId order article ID
string $sOrderArtSelList select list string stored in oxorderarticles__oxselvariant
Returns:
array()

Definition at line 1508 of file oxorder.php.

oxOrder._addOrderArticlesToBasket ( oUser = null,
aOrderArticles = null,
blChangeDelivery = false,
blChangeDiscount = false,
blStockCheck = true 
) [protected]

Adds order articles back to virtual basket. Needed for recalculating order.

Parameters:
oxUser $oUser basket user object
array $aOrderArticles order articles
bool $blChangeDelivery if delivery was changed in admin
bool $blChangeDiscount if discount was changed in admin
bool $blStockCheck to check stock
Returns:
oxBasket

Definition at line 1572 of file oxorder.php.

oxOrder._setDeprecatedValues (  )  [protected]

Sets deprecate values

Deprecated:
This method as well as all deprecated class variables is deprecated
Returns:
null

Definition at line 1656 of file oxorder.php.

oxOrder.getTotalOrderSum (  ) 

Get total sum from last order

Returns:
string

Definition at line 1689 of file oxorder.php.

oxOrder.getBillCountry (  ) 

Get billing country name from billing country id

Returns:
oxField

Definition at line 1700 of file oxorder.php.

oxOrder.getDelCountry (  ) 

Get delivery country name from delivery country id

Returns:
oxField

Definition at line 1713 of file oxorder.php.


Member Data Documentation

oxOrder.$_aSkipSaveFields = array( 'oxorderdate' ) [protected]

Reimplemented from oxBase.

Definition at line 20 of file oxorder.php.

oxOrder.$_oArticles = null [protected]

Definition at line 27 of file oxorder.php.

oxOrder.$_oDelSet = null [protected]

Definition at line 34 of file oxorder.php.

oxOrder.$_oGiftCard = null [protected]

Definition at line 41 of file oxorder.php.

oxOrder.$_oPaymentType = null [protected]

Definition at line 48 of file oxorder.php.

oxOrder.$_oPayment = null [protected]

Definition at line 55 of file oxorder.php.

oxOrder.$_aVoucherList = null [protected]

Definition at line 62 of file oxorder.php.

oxOrder.$_oDelPrice = null [protected]

Definition at line 69 of file oxorder.php.

oxOrder.$_oUser = null [protected]

Definition at line 76 of file oxorder.php.

oxOrder.$_oBasket = null [protected]

Definition at line 83 of file oxorder.php.

oxOrder.$_oWrappingPrice = null [protected]

Definition at line 90 of file oxorder.php.

oxOrder.$_oPaymentPrice = null [protected]

Definition at line 97 of file oxorder.php.

oxOrder.$_sClassName = 'oxorder' [protected]

Reimplemented from oxBase.

Definition at line 104 of file oxorder.php.

oxOrder.$_blSeparateNumbering = null [protected]

Definition at line 111 of file oxorder.php.

oxOrder.$_iOrderLang = null [protected]

Definition at line 118 of file oxorder.php.


The documentation for this class was generated from the following file:

Generated on Wed Apr 22 12:32:01 2009 for OXID eShop CE by  doxygen 1.5.5