Difference between revisions of "Functions:orderGetSummary"
From Whirlwind eCommerce Wiki
(added itemCount) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Page Template Functions Shortcuts}} | ||
== Description == | == Description == | ||
Retrieves summary order information. Useful for perpetual shopping carts. | Retrieves summary order information. Useful for perpetual shopping carts. | ||
Line 21: | Line 22: | ||
[cancelDate] => DATETIME | [cancelDate] => DATETIME | ||
[itemTotal] => DECIMAL | [itemTotal] => DECIMAL | ||
+ | [itemCount] => DECIMAL | ||
[itemSurchargeTotal] => DECIMAL | [itemSurchargeTotal] => DECIMAL | ||
[totalQuantity] => INT | [totalQuantity] => INT | ||
[taxTotal] => DECIMAL | [taxTotal] => DECIMAL | ||
+ | [baseShipTotal] => DECIMAL | ||
[shipTotal] => DECIMAL | [shipTotal] => DECIMAL | ||
[paymentTotal] => DECIMAL | [paymentTotal] => DECIMAL | ||
[discountTotal] => DECIMAL | [discountTotal] => DECIMAL | ||
− | |||
[totalOrderCost] => DECIMAL | [totalOrderCost] => DECIMAL | ||
[totalDue] => DECIMAL | [totalDue] => DECIMAL | ||
Line 55: | Line 57: | ||
|DECIMAL dollar value of summed up quantities x price per item. The total value of the products in the shopping cart not including shipping, taxes or discounts. | |DECIMAL dollar value of summed up quantities x price per item. The total value of the products in the shopping cart not including shipping, taxes or discounts. | ||
|150.25 | |150.25 | ||
+ | |- | ||
+ | |itemCount | ||
+ | |INT total number of line items (not total quantities, but total unique items) | ||
+ | |6 | ||
|- | |- | ||
|itemSurchargeTotal | |itemSurchargeTotal | ||
Line 68: | Line 74: | ||
|24.67 | |24.67 | ||
|- | |- | ||
− | | | + | |baseShipTotal |
− | |DECIMAL | + | |DECIMAL shipping charges, not including item shipping surcharges, to this order |
|12.54 | |12.54 | ||
+ | |- | ||
+ | |shipTotal | ||
+ | |DECIMAL total shipping charges (baseShipTotal + itemSurchargeTotal) to this order | ||
+ | |37.99 | ||
|- | |- | ||
|paymentTotal | |paymentTotal | ||
Line 79: | Line 89: | ||
|DECIMAL total of all discount code dollar values attributed to this order | |DECIMAL total of all discount code dollar values attributed to this order | ||
|25.12 | |25.12 | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|totalOrderCost | |totalOrderCost |
Latest revision as of 17:45, 26 August 2009
Description
Retrieves summary order information. Useful for perpetual shopping carts.
Syntax
$orderArr = eV::orderGetSummary([INT $orderId]);
Paramaters
- orderId INTEGER (optional)
- unique order key of order information to retrieve. Defaults to the current sessions shopping cart's orderId.
Return Values
Returns associative array of summary order information. Return array is as follows:
Array ( [orderNumber] => INT [completeDate] => DATETIME [cancelDate] => DATETIME [itemTotal] => DECIMAL [itemCount] => DECIMAL [itemSurchargeTotal] => DECIMAL [totalQuantity] => INT [taxTotal] => DECIMAL [baseShipTotal] => DECIMAL [shipTotal] => DECIMAL [paymentTotal] => DECIMAL [discountTotal] => DECIMAL [totalOrderCost] => DECIMAL [totalDue] => DECIMAL )
Element details from the returned array are as follows:
Element | Description | Example |
orderNumber | INT order number for this order. This is a unique ID, but is nonsequential. Not to be confused with the orderId which is the sequential uniqueId. This orderNumber is what is presented to web site visitors referencing the orders to alleviate random attempts to access orders. | 6912834 |
completeDate | DATETIME string date time of if/when the order was completed (processed). This will be empty while it is still an active shopping cart that has not been purchased. | 2008-06-22 19:04:57 |
cancelDate | DATETIME string date time of if/when the order was canceled. This will be empty if the order has not been canceled. | 2008-06-22 23:22:08 |
itemTotal | DECIMAL dollar value of summed up quantities x price per item. The total value of the products in the shopping cart not including shipping, taxes or discounts. | 150.25 |
itemCount | INT total number of line items (not total quantities, but total unique items) | 6 |
itemSurchargeTotal | DECIMAL dollar value of summed up quantities x item shipping surcharges (as set at the product level) | 25.45 |
totalQuantity | INTEGER summed up item quantities in the order. For example if there are three different items in the cart, the first two have a quantity of 1 and the third has a quantity of 5, the totalQuantity will be 7. | 7 |
taxTotal | DECIMAL total taxes charged to this order | 24.67 |
baseShipTotal | DECIMAL shipping charges, not including item shipping surcharges, to this order | 12.54 |
shipTotal | DECIMAL total shipping charges (baseShipTotal + itemSurchargeTotal) to this order | 37.99 |
paymentTotal | DECIMAL total of all processed payments attributed to this order | 205.65 |
discountTotal | DECIMAL total of all discount code dollar values attributed to this order | 25.12 |
totalOrderCost | DECIMAL sum of all costs effecting this order - this is the order grand total (totalItemCost +taxTotal + shipTotal - discountTotal) | 175.86 |
totalDue | DECIMAL outstanding amount due on this order (totalOrderCost - paymentTotal) | 50.67 |
Examples
// get the cart summary data $orderArr = eV::orderGetSummary(); // output some of the results echo "YOUR SHOPPING CART <hr> Total Number of Items:" . $orderArr['totalQuantity'] . "<br> Total Value:" . eV::dollarFormat($orderArr['totalOrderCost']);