68 Classifieds API

Features
class tree: 68Classifieds | index: 68Classifieds | all elements

 Class Orders

Description

Orders class handles everything for the products.

Located in /includes/classes/kernel/Orders.php (line 21)


	
			
Method Summary
 void adminEditOrder (array $data)
 boolean changeDisplay (str $status, int $id)
 void deductCoupon (int $id)
 boolean deleteOrder (int $id)
 void deleteTransactions (int $orderid)
 boolean editOrder (int $id, array $data)
 void emailCustomer (int $orderid)
 int generateOrder (array $data)
 array getAllOrders (array $options, integer $current_row, integer $max)
 int getMonthlyTotal (string $date)
 void getOrderById (int $id)
 array getOrderByListingID (int $id)
 array getPendingOrders ()
 array getProductList ()
 str getStatusByValue (int $id)
 array getTotalAfterDiscount (string $grandtotal, [string $coupon = ""])
 array getTransactionsByOrderID (int $id)
 void logTransaction (int $gatewayid, int $orderid, string $status, int $userid, string $transactionid, string $amount, [string $notes = ''])
 void updateNotification (int $orderid)
 boolean updateOrder (int $orderid, string $approved)
Methods
adminEditOrder (line 397)

Change the order status from admin.

  • uses: Orders::changeDisplay
void adminEditOrder (array $data)
  • array $data: The order data
changeDisplay (line 599)

Change the order status. Also changes the listing status.

Available options for status is:

  • Y = Active
  • N = Inactive
  • 5 = Delete

boolean changeDisplay (str $status, int $id)
  • int $id: The listing id to get.
  • str $status: The new status.
deductCoupon (line 273)

Deduct a coupon or discount from the database.

void deductCoupon (int $id)
  • int $id: The Coupon Code.
deleteOrder (line 659)

Delete Order

boolean deleteOrder (int $id)
  • int $id: The order id to delete.
deleteTransactions (line 693)

Delete any Gateway transactions.

void deleteTransactions (int $orderid)
  • int $orderid: The order id
editOrder (line 411)

Edit an order

  • return: True or False
boolean editOrder (int $id, array $data)
  • int $id: The order id.
  • array $data: An array of data to add.
emailCustomer (line 833)

Email a customer receipt

void emailCustomer (int $orderid)
  • int $orderid: The order id
generateOrder (line 445)

Generate an order

  • return: The new order id.
int generateOrder (array $data)
  • array $data: An array of order data
getAllOrders (line 100)

Gets all orders by the parameters.

  • return: List of listings to be displayed
array getAllOrders (array $options, integer $current_row, integer $max)
  • array $options: The search parameters
  • integer $current_row: The current page number
  • integer $max: The maximum number of rows per page
getMonthlyTotal (line 77)

Get the total amount of sales from a date.

int getMonthlyTotal (string $date)
  • string $date: ISO Date. Ex: 2008-10
getOrderById (line 477)

Get an order by its id

void getOrderById (int $id)
  • int $id: The order id.
getOrderByListingID (line 526)

Get an order by a listing id

array getOrderByListingID (int $id)
  • int $id: The listing id.
getPendingOrders (line 50)

Get a list of pending orders

array getPendingOrders ()
getProductList (line 29)

Get a list of products

  • return: Array of products
array getProductList ()
getStatusByValue (line 242)

Gets the order status by its ID

  • return: The status.
  • access: public
str getStatusByValue (int $id)
  • int $id: The status id.
getTotalAfterDiscount (line 304)

Get the total price after any discounts have been applied.

array getTotalAfterDiscount (string $grandtotal, [string $coupon = ""])
  • string $grandtotal: The grand total to start with.
  • string $coupon: The coupon code. Can be null.
getTransactionsByOrderID (line 555)

Get a transaction from order id

array getTransactionsByOrderID (int $id)
  • int $id: The order id.
logTransaction (line 711)

Log Transaction

void logTransaction (int $gatewayid, int $orderid, string $status, int $userid, string $transactionid, string $amount, [string $notes = ''])
  • int $gatewayid: The unique id of the gateway.
  • int $orderid: The order id.
  • string $status: The transaction status
  • int $userid: The users id
  • string $transactionid: The transaction id from the gateway itself.
  • string $amount: The amount of this transaction
  • string $notes: Any transaction notes.
updateNotification (line 818)

Update the notification field so renewals are sent again. Issue #99

void updateNotification (int $orderid)
  • int $orderid: The order id.
updateOrder (line 740)

Update An Order

boolean updateOrder (int $orderid, string $approved)
  • int $orderid: The order id
  • string $approved: Y or N