
If you wonder what the variable $vars is: it's just a working copy of the superglobal $_REQUEST Array and
used as the array $d inside of the functions.
3.3.3. Other important Environment variables
Array $cart The current cart contents. The array has the following structure:
[cart] => Array (
[idx] => 1
[0] => Array (
[quantity] => 1
[product_id] => 10
[description] => Size:big; Power:100W
)
)
In this example, the car contains one product with the quantity of 1, the product ID 10
and a description.
The index "idx" is an integer and contains the size of the cart (number of different
products in it, regardless of their quantity). This variable is always available in the
global $_SESSION array: $_SESSION['cart'].
Array $auth All the user information in one Array, always available in the global $_SESSION ar-
ray.
[auth] => Array (
[show_prices] => 1
[user_id] => 0
[username] => demo
[perms] =>
[first_name] => guest
[last_name] =>
[shopper_group_id] => 5
[shopper_group_discount] => 0.00
[show_price_including_tax] => 1
[default_shopper_group] => 1
[is_registered_customer] =>
)
These are the example settings for an unregistered, not-logged-in user.
ps_session $sess Mainly used to format and print URLs for the Shop.
3.3.4. Logging events with the vmLogger object
VirtueMart allows logging events that occur during the execution of the script. The global variable
$vmLogger, which is used for logging purposes is an object of the class Log_display. This class is a child
class of the Log class, which is a PEAR extension.
Note
You must declare
global $vmLogger;
to be able to use this variable inside of a function.
VirtueMart Developer Manual
7
Commenti su questo manuale