Zen Cart Most Important Variables

September 9, 2007 by hejian

If you want to customize a Zen Cart site, these are the most import information variables for quick reference:

HTTP_SERVER . DIR_WS_CATALOG
Root URL.

$_SESSION variables

$_SESSION['cart']
shoppingCart Object:

["contents"]=>
array() {
["PRODUCT_ID"]=>
array(2) {
["qty"]=>
string()
["attributes"]=>
string() {
[ID]=>
string()
}
}
……
}
["total"]=>
float()
["weight"]=>
int()
["cartID"]=>
NULL
["content_type"]=>
string()
["free_shipping_item"]=>
int()
["free_shipping_weight"]=>
int()
["free_shipping_price"]=>
int()
["observers"]=>
array() {
}

$_SESSION['customer_id']

$_SESSION['customer_default_address_id']
customer default address id.

$_SESSION['sendto']
Shipping address id.

$_SESSION['shipping']
The selected shipping method:

array(3) {
["id"]=>
string()
["title"]=>
string()
["cost"]=>
float()
}

$_SESSION['billto']
billto address

DIR_WS_LANGUAGES . $_SESSION['language']
the value is includes/languages/english

Order Object

["info"]=>
array(18) {
["currency"]=>
string()
["currency_value"]=>
string()
["payment_method"]=>
string()
["payment_module_code"]=>
string()
["shipping_method"]=>
string()
["shipping_module_code"]=>
string()
["coupon_code"]=>
string()
["cc_type"]=>
string()
["cc_owner"]=>
string()
["cc_number"]=>
string()
["cc_cvv"]=>
NULL
["cc_expires"]=>
string()
["date_purchased"]=>
string()
["orders_status"]=>
string(1)
["total"]=>
string()
["tax"]=>
string()
["last_modified"]=>
NULL
["ip_address"]=>
string()
}
["totals"]=>
array(3) {
[0]=>
array(3) {
["title"]=>
string(10) “Sub-Total:”
["text"]=>
string()
["class"]=>
string(11) “ot_subtotal”
}
[1]=>
array(3) {
["title"]=>
string(20) “Per Item (Best Way):”
["text"]=>
string()
["class"]=>
string(11) “ot_shipping”
}
[2]=>
array(3) {
["title"]=>
string(6) “Total:”
["text"]=>
string()
["class"]=>
string(8) “ot_total”
}
}
["products"]=>
array(1) {
[0]=>
array(9) {
["qty"]=>
int()
["id"]=>
string()
["name"]=>
string()
["model"]=>
string()
["tax"]=>
string()
["price"]=>
string()
["onetime_charges"]=>
string()
["final_price"]=>
string()
["product_is_free"]=>
string(1) “0″
}
}
["customer"]=>
array(12) {
["name"]=>
string()
["id"]=>
string()
["company"]=>
string()
["street_address"]=>
string()
["suburb"]=>
string()
["city"]=>
string()
["postcode"]=>
string()
["state"]=>
string()
["country"]=>
string()
["format_id"]=>
string(1) “1″
["telephone"]=>
string()
["email_address"]=>
string()
}
["delivery"]=>
array(9) {
["name"]=>
string()
["company"]=>
string()
["street_address"]=>
string()
["suburb"]=>
string()
["city"]=>
string()
["postcode"]=>
string()
["state"]=>
string()
["country"]=>
string()
["format_id"]=>
string()
}
["billing"]=>
array(9) {
["name"]=>
string()
["company"]=>
string()
["street_address"]=>
string()
["suburb"]=>
string()
["city"]=>
string()
["postcode"]=>
string()
["state"]=>
string()
["country"]=>
string()
["format_id"]=>
string(1) “1″
}

Leave a Reply

You must be logged in to post a comment.

Wordpress template made by HeJian