VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
VirtueMartModelOrders Class Reference
Inheritance diagram for VirtueMartModelOrders:
Inheritance graph
[legend]
Collaboration diagram for VirtueMartModelOrders:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 
 populateState ()
 
 getOrderIdByOrderPass ($orderNumber, $orderPass)
 
 getOrderNumber ($virtuemart_order_id)
 
 getOrderId ($order_id, $direction='DESC')
 
 getMyOrderDetails ($orderID=0, $orderNumber=false, $orderPass=false, $userlang=false)
 
 getOrder ($virtuemart_order_id)
 
 getOrdersList ($uid=0, $noLimit=false)
 
 updateSingleItem ($virtuemart_order_item_id, &$orderdata, $orderUpdate=false, &$vatTax=false, $itemTaxes=array())
 
 calculateRow ($data, $taxCalcValue, $rounding, $daTax=true, $withTax=true, $overrideDiscount=false)
 
 updateBill ($virtuemart_order_id, $vattax)
 
 updateOrderStatus ($orders=0, $order_id=0, $order_status=0)
 
 updateStatusForOneOrder ($virtuemart_order_id, $inputOrder, $useTriggers=true)
 
 createOrderFromCart ($cart)
 
 reUsePendingOrder ($_cart, $customer_number=false)
 
 handleStockAfterStatusChangedPerProduct ($newState, $oldState, $tableOrderItems, $quantity)
 
 _updateOrderHist ($_id, $_status= 'P', $_notified=0, $_comment= '')
 
 notifyCustomer ($virtuemart_order_id, $newOrderData=0)
 
 createInvoiceByOrder ($order)
 
 getOrderLineDetails ($orderId, $orderLineId)
 
 saveOrderLineItem ($data)
 
 removeOrderItems ($virtuemart_order_id, $auth=true)
 
 removeOrderLineItem ($orderLineId)
 
 remove ($ids)
 
 UpdateOrderHead ($virtuemart_order_id, $_orderData)
 
 CreateOrderHead ()
 
 createInvoiceNumber ($orderDetails, &$invoiceNumber)
 
 renameInvoice ($order_id)
 
 deleteInvoice ($order_id)
 
- Public Member Functions inherited from VmModel
 __construct ($cidName='cid', $config=array())
 
 setDebugSql ($b)
 
 getName ()
 
 setState ($property, $value=null)
 
 getState ($property=null, $default=null)
 
 getTable ($name= '', $prefix= 'Table', $options=array())
 
 setIdName ($idName)
 
 getIdName ()
 
 getId ()
 
 setId ($id)
 
 setMainTable ($maintablename, $maintable=0)
 
 getDefaultOrdering ()
 
 addvalidOrderingFieldName ($add)
 
 removevalidOrderingFieldName ($name)
 
 setDefaultValidOrderingFields ($defaultTable=null)
 
 _getOrdering ($preTable='')
 
 checkFilterOrder ($toCheck, $view=0, $task= '')
 
 checkValidOrderingFieldName ($toCheck)
 
 checkFilterDir ($toCheck, $view=0, $task= '')
 
 getPagination ($perRow=5)
 
 setPaginationLimits ()
 
 getTotal ()
 
 setGetCount ($withCount)
 
 exeSortSearchListQuery ($object, $select, $joinedTables, $whereString= '', $groupBy= '', $orderBy= '', $filter_order_Dir= '', $nbrReturnProducts=false)
 
 emptyCache ()
 
 getData ($id=0)
 
 store (&$data)
 
 remove ($ids)
 
 setToggleName ($togglesName)
 
 toggle ($field, $val=NULL, $cidname=0, $tablename=0, $view=false)
 
 move ($direction, $filter=null)
 
 saveorder ($cid=array(), $order, $filter=null)
 
 addImages ($obj, $limit=0)
 
 resetErrors ()
 
- Public Member Functions inherited from vObject
 __toString ()
 
 get ($prop, $def=null)
 
 set ($prop, $value=null)
 
 setProperties ($props)
 

Static Public Member Functions

static getOrderIdByOrderNumber ($orderNumber)
 
static isEmptyDec ($d, $n)
 
static isNotEmptyDec ($d, $n)
 
static genStdOrderPass ()
 
static genStdCreateInvoicePass ()
 
static genStdOrderNumber ($virtuemart_vendor_id=1, $length=4)
 
static generateOrderNumber ($uid=0, $length=5, $virtuemart_vendor_id=1)
 
static getInvoiceNumber ($virtuemart_order_id)
 
- Static Public Member Functions inherited from VmModel
static addTablePath ($path)
 
static addIncludePath ($path= '', $prefix= '')
 
static getInstance ($type, $prefix= '', $config=array())
 
static getModel ($name=false)
 
static joinLangTables ($tablename, $prefix, $on, $method=0)
 
static joinLangSelectFields ($langFields, $as=true)
 
static joinLangLikeFields ($langFields, $keyword)
 
static joinLangLikeField ($searchField, $keyword)
 

Public Attributes

 $useDefaultEmailOrderStatus = true
 
- Public Attributes inherited from VmModel
 $_id = 0
 
 $_data = null
 
 $_query = null
 
 $_total = null
 
 $_pagination = 0
 
 $_limit = 0
 
 $_limitStart = 0
 
 $_maintable = ''
 
 $_maintablename = ''
 
 $_idName = ''
 
 $_cidName = 'cid'
 
 $_togglesName = null
 
 $_selectedOrderingDir = 'DESC'
 
 $_noLimit = false
 
 $_tablePreFix = ''
 
 $_validOrderingFieldName = array()
 
 $_validFilterDir = array('ASC','DESC')
 

Private Member Functions

 getOrdersListQuery ()
 
 _createOrder ($_cart, $_usr)
 
 getVendorCurrencyId ($vendorId)
 
 _writeUserInfo ($_id, &$_usr, $_cart)
 
 _createOrderLines ($virtuemart_order_id, $cart)
 
 _createOrderCalcRules ($order_id, $_cart)
 
 _updateOrderItemHist ($_id, $status= 'P', $notified=1, $comment= '')
 

Additional Inherited Members

- Protected Member Functions inherited from VmModel
 populateState ()
 
 _createTable ($name, $prefix= 'Table', $config=array())
 
 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 
- Static Protected Member Functions inherited from VmModel
static _createFileName ($type, $parts=array())
 
- Protected Attributes inherited from VmModel
 $__state_set = null
 
 $name
 
 $option = null
 
 $state
 
 $event_clean_cache = null
 
 $_maxItems = 1000
 

Constructor & Destructor Documentation

VirtueMartModelOrders::__construct ( )

constructs a VmModel setMainTable defines the maintable of the model

Author
Max Milbers

Member Function Documentation

VirtueMartModelOrders::_createOrder (   $_cart,
  $_usr 
)
private

Write the order header record

Author
Oscar van Eijk
Parameters
object$_cartThe cart data
object$_usrUser object
array$_pricesPrice data
Returns
integer The new ordernumber
VirtueMartModelOrders::_createOrderCalcRules (   $order_id,
  $_cart 
)
private

Create the ordered item records

Author
Valerie Isaksen
Parameters
integer$_idinteger Order ID
object$_cartarray The cart data
Returns
boolean True on success
VirtueMartModelOrders::_createOrderLines (   $virtuemart_order_id,
  $cart 
)
private

Create the ordered item records

Author
Oscar van Eijk
Kohl Patrick
Parameters
integer$_idinteger Order ID
object$_cartarray The cart data
Returns
boolean True on success
VirtueMartModelOrders::_updateOrderHist (   $_id,
  $_status = 'P',
  $_notified = 0,
  $_comment = '' 
)

Update the order history

Author
Oscar van Eijk
Parameters
$_idOrder ID
$_statusNew order status (default: P)
$_notified1 (default) if the customer was notified, 0 otherwise
$_comment(Customer) comment, default empty
VirtueMartModelOrders::_updateOrderItemHist (   $_id,
  $status = 'P',
  $notified = 1,
  $comment = '' 
)
private

Update the order item history

Author
Oscar van Eijk,kohl patrick
Parameters
$_idOrder ID
$_statusNew order status (default: P)
$_notified1 (default) if the customer was notified, 0 otherwise
$_comment(Customer) comment, default empty
VirtueMartModelOrders::_writeUserInfo (   $_id,
$_usr,
  $_cart 
)
private

Write the BillTo record, and if set, the ShipTo record

Author
Oscar van Eijk
Parameters
integer$_idOrder ID
object$_usrUser object
object$_cartCart object
Returns
boolean True on success
VirtueMartModelOrders::calculateRow (   $data,
  $taxCalcValue,
  $rounding,
  $daTax = true,
  $withTax = true,
  $overrideDiscount = false 
)
VirtueMartModelOrders::createInvoiceByOrder (   $order)
VirtueMartModelOrders::createInvoiceNumber (   $orderDetails,
$invoiceNumber 
)

returns true if an invoice number has been created returns false if an invoice number has not been created due to some configuration parameters

VirtueMartModelOrders::createOrderFromCart (   $cart)

Get the information from the cart and create an order from it

Author
Oscar van Eijk
Parameters
object$_cartThe cart data
Returns
mixed The new ordernumber, false on errors
VirtueMartModelOrders::CreateOrderHead ( )

Create empty order head record from admin only

Author
Ondřej Spilka
Returns
ID of the newly created order
VirtueMartModelOrders::deleteInvoice (   $order_id)

Delete Invoice when an item is updated

Author
Valérie Isaksen
Parameters
$order_idId of the order
Returns
boolean true if deleted successful, false if there was a problem
static VirtueMartModelOrders::generateOrderNumber (   $uid = 0,
  $length = 5,
  $virtuemart_vendor_id = 1 
)
static

Generate a unique ordernumber. This is done in a similar way as VM1.1.x, although the reason for this is unclear to me :-S

Deprecated:
Parameters
integer$uidThe user ID. Defaults to 0 for guests
Returns
string A unique ordernumber
static VirtueMartModelOrders::genStdCreateInvoicePass ( )
static
static VirtueMartModelOrders::genStdOrderNumber (   $virtuemart_vendor_id = 1,
  $length = 4 
)
static

Generate a unique ordernumber using getHumanToken, which is a random token with only upper case chars and without 0 and O to prevent missreadings

Author
Max Milbers
Parameters
integer$virtuemart_vendor_idFor the correct count
Returns
string A unique ordernumber
static VirtueMartModelOrders::genStdOrderPass ( )
static

Creates a standard order password

static VirtueMartModelOrders::getInvoiceNumber (   $virtuemart_order_id)
static
VirtueMartModelOrders::getMyOrderDetails (   $orderID = 0,
  $orderNumber = false,
  $orderPass = false,
  $userlang = false 
)

This is a proxy function to return an order safely, we may set the getOrder function to private Maybe the right place would be the controller, cause there are JRequests in it. But for a fast solution, still better than to have it 3-4 times in the view.html.php of the views.

Author
Max Milbers
Returns
array
VirtueMartModelOrders::getOrder (   $virtuemart_order_id)

Load a single order, Attention, this function is not protected! Do the right manangment before, to be certain we suggest to use getMyOrderDetails

VirtueMartModelOrders::getOrderId (   $order_id,
  $direction = 'DESC' 
)

Was also broken, actually used?

get next/previous order id

static VirtueMartModelOrders::getOrderIdByOrderNumber (   $orderNumber)
static

This function gets the orderId, for payment response author Valerie Isaksen

VirtueMartModelOrders::getOrderIdByOrderPass (   $orderNumber,
  $orderPass 
)

This function gets the orderId, for anonymous users

Author
Max Milbers
VirtueMartModelOrders::getOrderLineDetails (   $orderId,
  $orderLineId 
)

Retrieve the details for an order line item.

Author
RickG
Parameters
string$orderIdOrder id number
string$orderLineIdOrder line item number
Returns
object Object containing the order item details.
VirtueMartModelOrders::getOrderNumber (   $virtuemart_order_id)

This function seems completly broken, JRequests are not allowed in the model, sql not escaped This function gets the secured order Number, to send with paiement

VirtueMartModelOrders::getOrdersList (   $uid = 0,
  $noLimit = false 
)

Select the products to list on the product list page

Parameters
$uidinteger Optional user ID to get the orders of a single user
$_ignorePaginationboolean If true, ignore the Joomla pagination (for embedded use, default false)
VirtueMartModelOrders::getOrdersListQuery ( )
private

List of tables to include for the product query

VirtueMartModelOrders::getVendorCurrencyId (   $vendorId)
private
VirtueMartModelOrders::handleStockAfterStatusChangedPerProduct (   $newState,
  $oldState,
  $tableOrderItems,
  $quantity 
)
static VirtueMartModelOrders::isEmptyDec (   $d,
  $n 
)
static
static VirtueMartModelOrders::isNotEmptyDec (   $d,
  $n 
)
static
VirtueMartModelOrders::notifyCustomer (   $virtuemart_order_id,
  $newOrderData = 0 
)

Notifies the customer that the Order Status has been changed

Author
Christopher Roussel, Valérie Isaksen, Max Milbers
VirtueMartModelOrders::populateState ( )
VirtueMartModelOrders::remove (   $ids)

Delete all record ids selected

Author
Max Milbers
Patrick Kohl
Returns
boolean True is the delete was successful, false otherwise.
VirtueMartModelOrders::removeOrderItems (   $virtuemart_order_id,
  $auth = true 
)
Author
Max Milbers

remove product from order item table

Parameters
$virtuemart_order_idOrder to clear
$auth
Returns
boolean True of remove was successful, false otherwise
VirtueMartModelOrders::removeOrderLineItem (   $orderLineId)

Remove an order line item.

Author
RickG
Parameters
string$orderLineIdOrder line item number
Returns
boolean True of remove was successful, false otherwise
VirtueMartModelOrders::renameInvoice (   $order_id)

Rename Invoice (when an order is deleted)

Author
Valérie Isaksen
Max Milbers
Parameters
$order_idId of the order
Returns
boolean true if deleted successful, false if there was a problem
VirtueMartModelOrders::reUsePendingOrder (   $_cart,
  $customer_number = false 
)
VirtueMartModelOrders::saveOrderLineItem (   $data)

Save an order line item.

Author
RickG
Returns
boolean True of remove was successful, false otherwise
VirtueMartModelOrders::updateBill (   $virtuemart_order_id,
  $vattax 
)
VirtueMartModelOrders::UpdateOrderHead (   $virtuemart_order_id,
  $_orderData 
)

Update order head record

Author
Ondřej Spilka
Maik Künnemann
Returns
boolean True is the update was successful, otherwise false.
VirtueMartModelOrders::updateOrderStatus (   $orders = 0,
  $order_id = 0,
  $order_status = 0 
)
VirtueMartModelOrders::updateSingleItem (   $virtuemart_order_item_id,
$orderdata,
  $orderUpdate = false,
$vatTax = false,
  $itemTaxes = array() 
)

Update an order item status $vatTax was $orderUpdate boolean, keeps now the vattaxes

Author
Max Milbers
Ondřej Spilka - used for item edit also
Maik Künnemann
VirtueMartModelOrders::updateStatusForOneOrder (   $virtuemart_order_id,
  $inputOrder,
  $useTriggers = true 
)

Attention, if you use this function within your trigger take care of the last parameter, you should define it, this parameter maybe set to false in future releases

IMPORTANT: The $inputOrder can contain extra data by plugins

Parameters
$virtuemart_order_id
$inputOrder
bool$useTriggers
Returns
bool

If an order gets cancelled, fire a plugin event, perhaps some authorization needs to be voided

Member Data Documentation

VirtueMartModelOrders::$useDefaultEmailOrderStatus = true

Strange name is just temporarly

Parameters
unknown_type$order_id
unknown_type$order_status
Author
Max Milbers

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