OXID eShop CE
6.1.5
|
Public Attributes | |
const | ORDER_STATE_MAILINGERROR = 0 |
const | ORDER_STATE_OK = 1 |
const | ORDER_STATE_PAYMENTERROR = 2 |
const | ORDER_STATE_ORDEREXISTS = 3 |
const | ORDER_STATE_INVALIDDELIVERY = 4 |
const | ORDER_STATE_INVALIDPAYMENT = 5 |
const | ORDER_STATE_INVALIDDElADDRESSCHANGED = 7 |
const | ORDER_STATE_INVALIDDELADDRESSCHANGED = 7 |
const | ORDER_STATE_BELOWMINPRICE = 8 |
Protected Member Functions | |
_getCountryTitle ($sCountryId) | |
_getArticles ($blExcludeCanceled=false) | |
_setOrderStatus ($sStatus) | |
_convertVat ($sVat) | |
_resetVats () | |
_loadFromBasket (\OxidEsales\Eshop\Application\Model\Basket $oBasket) | |
_setUser ($oUser) | |
_setWrapping (\OxidEsales\Eshop\Application\Model\Basket $oBasket) | |
_setOrderArticles ($aArticleList) | |
_executePayment (\OxidEsales\Eshop\Application\Model\Basket $oBasket, $oUserpayment) | |
_getGateway () | |
_setPayment ($sPaymentid) | |
_setFolder () | |
_updateWishlist ($aArticleList, $oUser) | |
_updateNoticeList ($aArticleList, $oUser) | |
_updateOrderDate () | |
_markVouchers ($oBasket, $oUser) | |
_insert () | |
_getCounterIdent () | |
_setNumber () | |
_update () | |
_getOrderBasket ($blStockCheck=true) | |
_checkOrderExist ($sOxId=null) | |
_sendOrderByEmail ($oUser=null, $oBasket=null, $oPayment=null) | |
_addOrderArticlesToBasket ($oBasket, $aOrderArticles) | |
_addArticlesToBasket ($oBasket, $aArticles) | |
Protected Attributes | |
$_aSkipSaveFields = ['oxtimestamp'] | |
$_oArticles = null | |
$_oDelSet = null | |
$_oGiftCard = null | |
$_oPaymentType = null | |
$_oPayment = null | |
$_aVoucherList = null | |
$_oDelPrice = null | |
$_oUser = null | |
$_oBasket = null | |
$_oWrappingPrice = null | |
$_oGiftCardPrice = null | |
$_oPaymentPrice = null | |
$_sClassName = 'oxorder' | |
$_blSeparateNumbering = null | |
$_iOrderLang = null | |
$_blReloadDelivery = true | |
$_blReloadDiscount = true | |
$_oOrderCurrency = null | |
$_oOrderFiles = null | |
$_sShipTrackUrl = null | |
$_oOrderBasket = null | |
Private Member Functions | |
isValidPaymentId ($paymentId) | |
isValidPayment ($basket) | |
getDynamicValues () | |
getDynamicValuesFromPaymentType () | |
Order manager. Performs creation assigning, updating, deleting and other order functions.
OxidEsales\EshopCommunity\Application\Model\Order::__construct | ( | ) |
Class constructor, initiates parent constructor (parent::oxBase()).
OxidEsales\EshopCommunity\Application\Model\Order::__get | ( | $sName | ) |
Getter made for order delivery set object access
string | $sName | parameter name |
|
protected |
Adds new products to basket/order
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket to add articles |
array | $aArticles | article array |
|
protected |
Adds order articles back to virtual basket. Needed for recalculating order.
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
array | $aOrderArticles | order articles |
|
protected |
Checking if this order is already stored.
string | $sOxId | order ID |
|
protected |
Converts string VAT representation into float e.g. 7,6 to 7.6
string | $sVat | vat value |
|
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.
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
object | $oUserpayment | user payment object |
|
protected |
returned assigned orderarticles from order
bool | $blExcludeCanceled | excludes canceled items from list |
|
protected |
creates counter ident
|
protected |
Gets country title by country id.
string | $sCountryId | country ID |
|
protected |
Returns the correct gateway. At the moment only switch between default and IPayment, can be extended later.
|
protected |
Returns basket object filled up with discount, delivery, wrapping and all other info
bool | $blStockCheck | perform stock check or not (default true) |
|
protected |
Inserts order object information in DB. Returns true on success.
|
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.
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | Shopping basket object |
|
protected |
Marks voucher as used (oxvoucher::markAsUsed()) and sets them to $this->_aVoucherList.
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
\OxidEsales\Eshop\Application\Model\User | $oUser | user object |
|
protected |
Reset Vat info
|
protected |
Send order to shop owner and user
\OxidEsales\Eshop\Application\Model\User | $oUser | order user |
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | current order basket |
\OxidEsales\Eshop\Application\Model\UserPayment | $oPayment | order payment |
|
protected |
Assigns oxfolder as new
|
protected |
Tries to fetch and set next record number in DB. Returns true on success
|
protected |
Creates OrderArticle objects and assigns to them basket articles. Updates quantity of sold articles (\OxidEsales\Eshop\Application\Model\Article::updateSoldAmount()).
array | $aArticleList | article list |
|
protected |
Updates order transaction status. Faster than saving whole object
string | $sStatus | order transaction status |
|
protected |
Creates and returns user payment.
string | $sPaymentid | used payment id |
|
protected |
Assigns to new oxorder object customer delivery and shipping info
object | $oUser | user object |
|
protected |
Assigns wrapping VAT and card price + card message info
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
|
protected |
Updates object parameters to DB.
|
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 |
\OxidEsales\Eshop\Application\Model\User | $oUser | basket user object |
|
protected |
Updates order date to current date
|
protected |
aAdds/removes user chosen article to/from his noticelist or wishlist (oxuserbasket::addItemToBasket()).
array | $aArticleList | basket products |
object | $oUser | user object |
OxidEsales\EshopCommunity\Application\Model\Order::assign | ( | $dbRecord | ) |
Assigns data, stored in DB to oxorder object
mixed | $dbRecord | DB record |
OxidEsales\EshopCommunity\Application\Model\Order::cancelOrder | ( | ) |
Performs order cancel process
OxidEsales\EshopCommunity\Application\Model\Order::delete | ( | $sOxId = null | ) |
Updates stock information, deletes current ordering details from DB, returns true on success.
string | $sOxId | Ordering ID (default null) |
OxidEsales\EshopCommunity\Application\Model\Order::finalizeOrder | ( | \OxidEsales\Eshop\Application\Model\Basket | $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 Order object and saves full order with error status. Then executes payment. On failure - deletes order and returns error code 2. On success - saves order (\OxidEsales\Eshop\Application\Model\Order::save()), removes article from wishlist (\OxidEsales\Eshop\Application\Model\Order::_updateWishlist()), updates voucher data (\OxidEsales\Eshop\Application\Model\Order::_markVouchers()). Finally sends order confirmation email to customer (\OxidEsales\Eshop\Core\Email::SendOrderEMailToUser()) and shop owner (\OxidEsales\Eshop\Core\Email::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.
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | Basket object |
object | $oUser | Current User object |
bool | $blRecalculatingOrder | Order recalculation |
OxidEsales\EshopCommunity\Application\Model\Order::genPdf | ( | $sFilename, | |
$iSelLang = 0 |
|||
) |
Fake entries, pdf is generated in modules.. myorder.
string | $sFilename | file name |
int | $iSelLang | selected language |
OxidEsales\EshopCommunity\Application\Model\Order::getBasket | ( | ) |
Returns order basket
OxidEsales\EshopCommunity\Application\Model\Order::getBillCountry | ( | ) |
Get billing country name from billing country id
OxidEsales\EshopCommunity\Application\Model\Order::getDelAddressInfo | ( | ) |
Loads and returns delivery address object or null if deladrid is not configured, or object was not loaded
OxidEsales\EshopCommunity\Application\Model\Order::getDelCountry | ( | ) |
Get delivery country name from delivery country id
OxidEsales\EshopCommunity\Application\Model\Order::getDelSet | ( | ) |
Returns order deliveryset object
|
private |
|
private |
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedDeliveryCost | ( | ) |
Get Delivery cost sum formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedDiscount | ( | ) |
Get Discount formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedeliveryCost | ( | ) |
Get Delivery cost sum formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedGiftCardCost | ( | ) |
Get wrap cost sum formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedPayCost | ( | ) |
Get pay cost sum formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedTotalBrutSum | ( | ) |
Get total brut sum formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedTotalNetSum | ( | ) |
Get total net sum formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedTotalOrderSum | ( | ) |
Get formatted total sum from last order
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedTotalVouchers | ( | ) |
Get total vouchers formatted
OxidEsales\EshopCommunity\Application\Model\Order::getFormattedWrapCost | ( | ) |
Get wrap cost sum formatted
OxidEsales\EshopCommunity\Application\Model\Order::getGiftCard | ( | ) |
Get gift card
OxidEsales\EshopCommunity\Application\Model\Order::getInvoiceNum | ( | ) |
Returns order invoice number.
OxidEsales\EshopCommunity\Application\Model\Order::getLastUserPaymentType | ( | $sUserId | ) |
Get users payment type from last order
string | $sUserId | order user id |
OxidEsales\EshopCommunity\Application\Model\Order::getNextBillNum | ( | ) |
Returns next possible (free) order bill number.
OxidEsales\EshopCommunity\Application\Model\Order::getOrderArticles | ( | $blExcludeCanceled = false | ) |
Assigns data, stored in oxorderarticles to oxorder object .
bool | $blExcludeCanceled | excludes canceled items from list |
OxidEsales\EshopCommunity\Application\Model\Order::getOrderCnt | ( | $blToday = false | ) |
Returns orders count
bool | $blToday | if true calculates only current day orders |
OxidEsales\EshopCommunity\Application\Model\Order::getOrderCurrency | ( | ) |
Returns actual order currency object. In case currency was not recognized due to changed name returns first shop currency object
OxidEsales\EshopCommunity\Application\Model\Order::getOrderDeliveryPrice | ( | ) |
Returns order delivery expenses price object
OxidEsales\EshopCommunity\Application\Model\Order::getOrderGiftCardPrice | ( | ) |
Returns order wrapping expenses price object
OxidEsales\EshopCommunity\Application\Model\Order::getOrderLanguage | ( | ) |
Returns language id of current order object. If order already has language defined - checks if this language is defined in shops config
OxidEsales\EshopCommunity\Application\Model\Order::getOrderNetSum | ( | ) |
Returns order netto sum (total order price - VAT)
OxidEsales\EshopCommunity\Application\Model\Order::getOrderPaymentPrice | ( | ) |
Returns order payment expenses price object
OxidEsales\EshopCommunity\Application\Model\Order::getOrderSum | ( | $blToday = false | ) |
Returns orders total price
bool | $blToday | if true calculates only current day orders |
OxidEsales\EshopCommunity\Application\Model\Order::getOrderUser | ( | ) |
Returns current order user object
OxidEsales\EshopCommunity\Application\Model\Order::getOrderWrappingPrice | ( | ) |
Returns order wrapping expenses price object
OxidEsales\EshopCommunity\Application\Model\Order::getPayment | ( | ) |
Returns order payment
OxidEsales\EshopCommunity\Application\Model\Order::getPaymentType | ( | ) |
Get payment type
OxidEsales\EshopCommunity\Application\Model\Order::getProductVats | ( | $blFormatCurrency = true | ) |
Returns array of plain formatted VATs stored in order
bool | $blFormatCurrency | enables currency formatting |
OxidEsales\EshopCommunity\Application\Model\Order::getShipmentTrackingUrl | ( | ) |
Returns shipment tracking url if oxtrackcode and shipment tracking url are supplied
OxidEsales\EshopCommunity\Application\Model\Order::getShippingSetList | ( | ) |
Loads possible shipping sets for this order
OxidEsales\EshopCommunity\Application\Model\Order::getTotalOrderSum | ( | ) |
Get total sum from last order
OxidEsales\EshopCommunity\Application\Model\Order::getTrackCode | ( | ) |
Returns shipment tracking code
OxidEsales\EshopCommunity\Application\Model\Order::getVoucherList | ( | ) |
Returns order vouchers marked as used
OxidEsales\EshopCommunity\Application\Model\Order::getVoucherNrList | ( | ) |
Get vouchers numbers list which were used with this order
OxidEsales\EshopCommunity\Application\Model\Order::isNettoMode | ( | ) |
Return true if order store in netto mode
|
private |
Returns true if payment is valid.
\OxidEsales\Eshop\Application\Model\Basket | $basket |
|
private |
Returns true if paymentId is valid.
int | $paymentId |
OxidEsales\EshopCommunity\Application\Model\Order::pdfFooter | ( | $oPdf | ) |
Fake entries, pdf is generated in modules.. myorder.
mixed | $oPdf | pdf object |
OxidEsales\EshopCommunity\Application\Model\Order::pdfHeader | ( | $oPdf | ) |
Fake entries, pdf is generated in modules.. myorder.
mixed | $oPdf | pdf object |
OxidEsales\EshopCommunity\Application\Model\Order::pdfHeaderplus | ( | $oPdf | ) |
Fake entries, pdf is generated in modules.. myorder.
mixed | $oPdf | pdf object |
OxidEsales\EshopCommunity\Application\Model\Order::recalculateOrder | ( | $aNewArticles = [] | ) |
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 \OxidEsales\Eshop\Application\Model\Order::finalizeOrder() If no errors, finishing transaction.
array | $aNewArticles | article list of new order |
Exception |
OxidEsales\EshopCommunity\Application\Model\Order::reloadDelivery | ( | $blReload | ) |
Tells to keep old or reload delivery costs while recalculating order
bool | $blReload | reload state marker |
OxidEsales\EshopCommunity\Application\Model\Order::reloadDiscount | ( | $blReload | ) |
Tells to keep old or reload discount while recalculating order
bool | $blReload | reload state marker |
OxidEsales\EshopCommunity\Application\Model\Order::save | ( | ) |
Updates/inserts order object and related info to DB
OxidEsales\EshopCommunity\Application\Model\Order::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 \OxidEsales\Eshop\Application\Model\Order::recalculateOrder() must be called ;
string | $sDeliveryId | new delivery id |
OxidEsales\EshopCommunity\Application\Model\Order::setOrderArticleList | ( | $oOrderArticleList | ) |
Order article list setter
\OxidEsales\Eshop\Application\Model\OrderArticleList | $oOrderArticleList |
OxidEsales\EshopCommunity\Application\Model\Order::setSeparateNumbering | ( | $blSeparateNumbering = null | ) |
Set usage of separate orders numbering for different shops
bool | $blSeparateNumbering | use or not separate orders numbering |
OxidEsales\EshopCommunity\Application\Model\Order::validateBasket | ( | $oBasket | ) |
Validates basket. Currently checks if minimum order price > basket price
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
OxidEsales\EshopCommunity\Application\Model\Order::validateDelivery | ( | $oBasket | ) |
Checks if delivery set used for current order is available and active. Throws exception if not available
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
OxidEsales\EshopCommunity\Application\Model\Order::validateDeliveryAddress | ( | $oUser | ) |
Checks if delivery address (billing or shipping) was not changed during checkout Throws exception if not available
\OxidEsales\Eshop\Application\Model\User | $oUser | user object |
OxidEsales\EshopCommunity\Application\Model\Order::validateOrder | ( | $oBasket, | |
$oUser | |||
) |
Validates order parameters like stock, delivery and payment parameters
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
\OxidEsales\Eshop\Application\Model\User | $oUser | order user |
OxidEsales\EshopCommunity\Application\Model\Order::validatePayment | ( | $oBasket | ) |
Checks if payment used for current order is available and active. Throws exception if not available
\OxidEsales\Eshop\Application\Model\Basket | $oBasket | basket object |
OxidEsales\EshopCommunity\Application\Model\Order::validateStock | ( | $oBasket | ) |
Function which checks if article stock is valid. If not displays error and returns false.
object | $oBasket | basket object |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_BELOWMINPRICE = 8 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_INVALIDDElADDRESSCHANGED = 7 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_INVALIDDELADDRESSCHANGED = 7 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_INVALIDDELIVERY = 4 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_INVALIDPAYMENT = 5 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_MAILINGERROR = 0 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_OK = 1 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_ORDEREXISTS = 3 |
const OxidEsales\EshopCommunity\Application\Model\Order::ORDER_STATE_PAYMENTERROR = 2 |