Order manager. Performs creation assigning, updating, deleting and other order functions.
Definition at line 8 of file oxorder.php.
oxOrder.__construct | ( | ) |
Class constructor, initiates parent constructor (parent.oxBase()).
Reimplemented from oxBase.
Definition at line 232 of file oxorder.php.
oxOrder.__get | ( | $ | sName | ) |
Getter made for order delivery set object access
string | $sName parameter name |
Reimplemented from oxBase.
Definition at line 249 of file oxorder.php.
oxOrder._addArticlesToBasket | ( | $ | oBasket, | |
$ | aArticles | |||
) | [protected] |
Adds new products to basket/order
oxbasket | $oBasket basket to add articles | |
array | $aArticles article array |
Definition at line 1852 of file oxorder.php.
oxOrder._addOrderArticlesToBasket | ( | $ | oBasket, | |
$ | aOrderArticles | |||
) | [protected] |
Adds order articles back to virtual basket. Needed for recalculating order.
oxBasket | $oBasket basket object | |
array | $aOrderArticles order articles |
Definition at line 1834 of file oxorder.php.
oxOrder._checkOrderExist | ( | $ | sOxId = null |
) | [protected] |
Checking if this order is already stored.
string | $sOxId order ID |
Definition at line 1677 of file oxorder.php.
oxOrder._convertVat | ( | $ | sVat | ) | [protected] |
Converts string VAT representation into float e.g. 7,6 to 7.6
string | $sVat vat value |
Definition at line 620 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.
oxBasket | $oBasket basket object | |
object | $oUserpayment user payment object |
Definition at line 936 of file oxorder.php.
oxOrder._getArticles | ( | $ | blExcludeCanceled = false |
) | [protected] |
returned assigned orderarticles from order
bool | $blExcludeCanceled excludes canceled items from list |
Definition at line 309 of file oxorder.php.
oxOrder._getCounterIdent | ( | ) | [protected] |
oxOrder._getCountryTitle | ( | $ | sCountryId | ) | [protected] |
Gets country title by country id.
string | $sCountryId country ID |
Definition at line 290 of file oxorder.php.
oxOrder._getGateway | ( | ) | [protected] |
Returns the correct gateway. At the moment only switch between default and IPayment, can be extended later.
Definition at line 970 of file oxorder.php.
oxOrder._getOrderBasket | ( | $ | blStockCheck = true |
) | [protected] |
Returns basket object filled up with discount, delivery, wrapping and all other info
bool | $blStockCheck perform stock check or not (default true) |
Definition at line 1400 of file oxorder.php.
oxOrder._insert | ( | ) | [protected] |
Inserts order object information in DB. Returns true on success.
Reimplemented from oxBase.
Definition at line 1241 of file oxorder.php.
oxOrder._loadFromBasket | ( | oxBasket $ | oBasket | ) | [protected] |
Gathers and assigns to new oxOrder object customer data, payment, delivery and shipping info, customer order 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.
oxBasket | $oBasket Shopping basket object |
Definition at line 650 of file oxorder.php.
oxOrder._markVouchers | ( | $ | oBasket, | |
$ | oUser | |||
) | [protected] |
Marks voucher as used (oxvoucher.markAsUsed()) and sets them to $this->_aVoucherList.
Definition at line 1133 of file oxorder.php.
oxOrder._resetVats | ( | ) | [protected] |
Reset Vat info
Definition at line 634 of file oxorder.php.
oxOrder._sendOrderByEmail | ( | $ | oUser = null , |
|
$ | oBasket = null , |
|||
$ | oPayment = null | |||
) | [protected] |
Send order to shop owner and user
oxUser | $oUser order user | |
oxBasket | $oBasket current order basket | |
oxUserPayment | $oPayment order payment |
Definition at line 1700 of file oxorder.php.
oxOrder._setFolder | ( | ) | [protected] |
Assigns oxfolder as new
Definition at line 1044 of file oxorder.php.
oxOrder._setNumber | ( | ) | [protected] |
Tries to fetch and set next record number in DB. Returns true on success
Definition at line 1279 of file oxorder.php.
oxOrder._setOrderArticles | ( | $ | aArticleList | ) | [protected] |
Creates oxorderarticle objects and assigns to them basket articles. Updates quantity of sold articles (oxarticle.updateSoldAmount()).
array | $aArticleList article list |
Definition at line 834 of file oxorder.php.
oxOrder._setOrderStatus | ( | $ | sStatus | ) | [protected] |
Updates order transaction status. Faster than saving whole object
string | $sStatus order transaction status |
Definition at line 603 of file oxorder.php.
oxOrder._setPayment | ( | $ | sPaymentid | ) | [protected] |
Creates and returns user payment.
string | $sPaymentid used payment id |
Definition at line 982 of file oxorder.php.
oxOrder._setTsProtection | ( | oxBasket $ | oBasket | ) | [protected] |
Assigns Trusted Shops Protection product id and costs
oxBasket | $oBasket basket object |
Definition at line 2147 of file oxorder.php.
oxOrder._setUser | ( | $ | oUser | ) | [protected] |
Assigns to new oxorder object customer delivery and shipping info
object | $oUser user object |
Definition at line 758 of file oxorder.php.
oxOrder._setWrapping | ( | oxBasket $ | oBasket | ) | [protected] |
Assigns wrapping VAT and card price + card message info
oxBasket | $oBasket basket object |
Definition at line 805 of file oxorder.php.
oxOrder._update | ( | ) | [protected] |
oxOrder._updateNoticeList | ( | $ | aArticleList, | |
$ | oUser | |||
) | [protected] |
After order is finished this method cleans up users notice list, by removing bought items from users notice list
array | $aArticleList array of basket products | |
oxuser | $oUser basket user object |
Definition at line 1095 of file oxorder.php.
oxOrder._updateOrderDate | ( | ) | [protected] |
Updates order date to current date
Definition at line 1117 of file oxorder.php.
oxOrder._updateWishlist | ( | $ | aArticleList, | |
$ | oUser | |||
) | [protected] |
aAdds/removes user chosen article to/from his noticelist or wishlist (oxuserbasket.addItemToBasket()).
array | $aArticleList basket products | |
object | $oUser user object |
Definition at line 1057 of file oxorder.php.
oxOrder.assign | ( | $ | dbRecord | ) |
Assigns data, stored in DB to oxorder object
mixed | $dbRecord DB record |
Reimplemented from oxBase.
Definition at line 271 of file oxorder.php.
oxOrder.cancelOrder | ( | ) |
Performs order cancel process
Definition at line 1961 of file oxorder.php.
oxOrder.delete | ( | $ | sOxId = null |
) |
Updates stock information, deletes current ordering details from DB, returns true on success.
string | $sOxId Ordering ID (default null) |
Reimplemented from oxBase.
Definition at line 1315 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 recalculation, 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.
oxBasket | $oBasket Shopping basket object | |
object | $oUser Current user object | |
bool | $blRecalculatingOrder Order recalculation |
Definition at line 483 of file oxorder.php.
oxOrder.genPdf | ( | $ | sFilename, | |
$ | iSelLang = 0 | |||
) |
Fake entries, pdf is generated in modules.. myorder.
string | $sFilename file name | |
int | $iSelLang selected language |
Definition at line 1547 of file oxorder.php.
oxOrder.getBasket | ( | ) |
oxOrder.getBillCountry | ( | ) |
Get billing country name from billing country id
Definition at line 1915 of file oxorder.php.
oxOrder.getDelAddressInfo | ( | ) |
Loads and returns delivery address object or null if deladrid is not configured, or object was not loaded
Definition at line 1175 of file oxorder.php.
oxOrder.getDelCountry | ( | ) |
Get delivery country name from delivery country id
Definition at line 1929 of file oxorder.php.
oxOrder.getDelSet | ( | ) |
oxOrder.getFormattedDeliveryCost | ( | ) |
oxOrder.getFormattedDiscount | ( | ) |
oxOrder.getFormattedeliveryCost | ( | ) |
Get Delivery cost sum formatted
Definition at line 2221 of file oxorder.php.
oxOrder.getFormattedGiftCardCost | ( | ) |
oxOrder.getFormattedPayCost | ( | ) |
oxOrder.getFormattedTotalBrutSum | ( | ) |
oxOrder.getFormattedTotalNetSum | ( | ) |
oxOrder.getFormattedTotalOrderSum | ( | ) |
oxOrder.getFormattedTotalVouchers | ( | ) |
oxOrder.getFormattedWrapCost | ( | ) |
oxOrder.getGiftCard | ( | ) |
oxOrder.getInvoiceNum | ( | ) |
oxOrder.getLastUserPaymentType | ( | $ | sUserId | ) |
Get users payment type from last order
string | $sUserId order user id |
Definition at line 1819 of file oxorder.php.
oxOrder.getNextBillNum | ( | ) |
Returns next possible (free) order bill number.
Definition at line 1568 of file oxorder.php.
oxOrder.getOrderArticles | ( | $ | blExcludeCanceled = false |
) |
Assigns data, stored in oxorderarticles to oxorder object .
bool | $blExcludeCanceled excludes canceled items from list |
Definition at line 331 of file oxorder.php.
oxOrder.getOrderCnt | ( | $ | blToday = false |
) |
Returns orders count
bool | $blToday if true calculates only current day orders |
Definition at line 1657 of file oxorder.php.
oxOrder.getOrderCurrency | ( | ) |
Returns actual order currency object. In case currency was not recognized due to changed name returns first shop currency object
Definition at line 1982 of file oxorder.php.
oxOrder.getOrderDeliveryPrice | ( | ) |
Returns order delivery expenses price object
Definition at line 360 of file oxorder.php.
oxOrder.getOrderGiftCardPrice | ( | ) |
Returns order wrapping expenses price object
Definition at line 396 of file oxorder.php.
oxOrder.getOrderLanguage | ( | ) |
Returns language id of current order object. If order already has language defined - checks if this language is defined in shops config
Definition at line 740 of file oxorder.php.
oxOrder.getOrderNetSum | ( | ) |
Returns order netto sum (total order price - VAT)
Definition at line 451 of file oxorder.php.
oxOrder.getOrderPaymentPrice | ( | ) |
Returns order payment expenses price object
Definition at line 415 of file oxorder.php.
oxOrder.getOrderSum | ( | $ | blToday = false |
) |
Returns orders total price
bool | $blToday if true calculates only current day orders |
Definition at line 1638 of file oxorder.php.
oxOrder.getOrderTsProtectionPrice | ( | ) |
Returns order TS protection price object
Definition at line 433 of file oxorder.php.
oxOrder.getOrderUser | ( | ) |
oxOrder.getOrderWrappingPrice | ( | ) |
Returns order wrapping expenses price object
Definition at line 378 of file oxorder.php.
oxOrder.getPayment | ( | ) |
oxOrder.getPaymentType | ( | ) |
oxOrder.getProductVats | ( | $ | blFormatCurrency = true |
) |
Returns array of plain formatted VATs stored in order
bool | $blFormatCurrency enables currency formatting |
Definition at line 1889 of file oxorder.php.
oxOrder.getShipmentTrackingUrl | ( | ) |
Returns shipment tracking url if oxtrackcode and shipment tracking url are supplied
Definition at line 2301 of file oxorder.php.
oxOrder.getShippingSetList | ( | ) |
Loads possible shipping sets for this order
Definition at line 1580 of file oxorder.php.
oxOrder.getTotalOrderSum | ( | ) |
oxOrder.getTrackCode | ( | ) |
oxOrder.getVoucherList | ( | ) |
oxOrder.getVoucherNrList | ( | ) |
Get vouchers numbers list which were used with this order
Definition at line 1615 of file oxorder.php.
oxOrder.isNettoMode | ( | ) |
oxOrder.pdfFooter | ( | $ | oPdf | ) |
Fake entries, pdf is generated in modules.. myorder.
mixed | $oPdf pdf object |
Definition at line 1519 of file oxorder.php.
oxOrder.pdfHeader | ( | $ | oPdf | ) |
Fake entries, pdf is generated in modules.. myorder.
mixed | $oPdf pdf object |
Definition at line 1537 of file oxorder.php.
oxOrder.pdfHeaderplus | ( | $ | oPdf | ) |
Fake entries, pdf is generated in modules.. myorder.
mixed | $oPdf pdf object |
Definition at line 1528 of file oxorder.php.
oxOrder.recalculateOrder | ( | $ | aNewArticles = array() |
) |
Recalculates order. Starts transactions, deletes current order and order articles from DB, adds current order articles to virtual basket and finally recalculates order by calling oxorder.finalizeOrder() If no errors, finishing transaction.
array | $aNewArticles article list of new order |
Exception |
Definition at line 1355 of file oxorder.php.
oxOrder.reloadDelivery | ( | $ | blReload | ) |
Tells to keep old or reload delivery costs while recalculating order
bool | $blReload reload state marker |
Definition at line 1943 of file oxorder.php.
oxOrder.reloadDiscount | ( | $ | blReload | ) |
Tells to keep old or reload discount while recalculating order
bool | $blReload reload state marker |
Definition at line 1953 of file oxorder.php.
oxOrder.save | ( | ) |
Updates/inserts order object and related info to DB
Reimplemented from oxBase.
Definition at line 1153 of file oxorder.php.
oxOrder.setDelivery | ( | $ | sDeliveryId | ) |
Sets new delivery id for order and forces order to recalculate using new delivery type. Order is not recalculated automatically, to do this oxOrder.recalculateOrder() must be called ;
string | $sDeliveryId new delivery id |
Definition at line 1471 of file oxorder.php.
oxOrder.setOrderArticleList | ( | $ | oOrderArticleList | ) |
Order article list setter
oxOrderArticleList | $oOrderArticleList |
Definition at line 350 of file oxorder.php.
oxOrder.setSeparateNumbering | ( | $ | blSeparateNumbering = null |
) |
Set usage of separate orders numbering for different shops
bool | $blSeparateNumbering use or not separate orders numbering |
Definition at line 1807 of file oxorder.php.
oxOrder.validateBasket | ( | $ | oBasket | ) |
Validates basket. Currently checks if minimum order price > basket price
oxBasket | $oBasket basket object |
Definition at line 2045 of file oxorder.php.
oxOrder.validateDelivery | ( | $ | oBasket | ) |
Checks if delivery set used for current order is available and active. Throws exception if not available
oxbasket | $oBasket basket object |
Definition at line 2098 of file oxorder.php.
oxOrder.validateOrder | ( | $ | oBasket, | |
$ | oUser | |||
) |
Validates order parameters like stock, delivery and payment parameters
oxbasket | $oBasket basket object | |
oxuser | $oUser order user |
Definition at line 2010 of file oxorder.php.
oxOrder.validatePayment | ( | $ | oBasket | ) |
Checks if payment used for current order is available and active. Throws exception if not available
oxbasket | $oBasket basket object |
Definition at line 2127 of file oxorder.php.
oxOrder.$_aSkipSaveFields = array('oxtimestamp') [protected] |
Reimplemented from oxBase.
Definition at line 80 of file oxorder.php.
oxOrder.$_aVoucherList = null [protected] |
Definition at line 122 of file oxorder.php.
oxOrder.$_blReloadDelivery = true [protected] |
Definition at line 199 of file oxorder.php.
oxOrder.$_blReloadDiscount = true [protected] |
Definition at line 206 of file oxorder.php.
oxOrder.$_blSeparateNumbering = null [protected] |
Definition at line 185 of file oxorder.php.
oxOrder.$_iOrderLang = null [protected] |
Definition at line 192 of file oxorder.php.
oxOrder.$_oArticles = null [protected] |
Definition at line 87 of file oxorder.php.
oxOrder.$_oBasket = null [protected] |
Definition at line 143 of file oxorder.php.
oxOrder.$_oDelPrice = null [protected] |
Definition at line 129 of file oxorder.php.
oxOrder.$_oDelSet = null [protected] |
Definition at line 94 of file oxorder.php.
oxOrder.$_oGiftCard = null [protected] |
Definition at line 101 of file oxorder.php.
oxOrder.$_oGiftCardPrice = null [protected] |
Definition at line 157 of file oxorder.php.
oxOrder.$_oOrderBasket = null [protected] |
Definition at line 1391 of file oxorder.php.
oxOrder.$_oOrderCurrency = null [protected] |
Definition at line 213 of file oxorder.php.
oxOrder.$_oOrderFiles = null [protected] |
Definition at line 220 of file oxorder.php.
oxOrder.$_oPayment = null [protected] |
Definition at line 115 of file oxorder.php.
oxOrder.$_oPaymentPrice = null [protected] |
Definition at line 164 of file oxorder.php.
oxOrder.$_oPaymentType = null [protected] |
Definition at line 108 of file oxorder.php.
oxOrder.$_oTsProtectionPrice = null [protected] |
Definition at line 171 of file oxorder.php.
oxOrder.$_oUser = null [protected] |
Definition at line 136 of file oxorder.php.
oxOrder.$_oWrappingPrice = null [protected] |
Definition at line 150 of file oxorder.php.
oxOrder.$_sClassName = 'oxorder' [protected] |
Reimplemented from oxBase.
Definition at line 178 of file oxorder.php.
oxOrder.$_sShipTrackUrl = null [protected] |
Definition at line 227 of file oxorder.php.
const oxOrder.ORDER_STATE_BELOWMINPRICE = 8 |
Definition at line 73 of file oxorder.php.
Definition at line 66 of file oxorder.php.
const oxOrder.ORDER_STATE_INVALIDDELIVERY = 4 |
Definition at line 45 of file oxorder.php.
const oxOrder.ORDER_STATE_INVALIDPAYMENT = 5 |
Definition at line 52 of file oxorder.php.
const oxOrder.ORDER_STATE_INVALIDTSPROTECTION = 6 |
Definition at line 59 of file oxorder.php.
const oxOrder.ORDER_STATE_MAILINGERROR = 0 |
Definition at line 17 of file oxorder.php.
const oxOrder.ORDER_STATE_OK = 1 |
Definition at line 24 of file oxorder.php.
const oxOrder.ORDER_STATE_ORDEREXISTS = 3 |
Definition at line 38 of file oxorder.php.
const oxOrder.ORDER_STATE_PAYMENTERROR = 2 |
Definition at line 31 of file oxorder.php.