Article Contents Related Articles Tags
  • No tags found.
Was This Helpful? Last Updated
  • 2012/07/09

Technical Specifications

For PHP Inclusion custom actions, the program will pass a number of variables that you can use directly on the custom action.

Always Available

VariableWhat It Does
$userUsername of the member who triggered the action.
$action_idID of the custom action that ran.

Type: Cart Purchase

VariableTypeWhat It Does
$product_arrayArray
$componentsStringProvide you with the cart session ID, billing details, and cart totals (see "$components Variable" section below)

$components Variable

The $components variable includes three pieces of information separated by a vertical bar character "|".

<?php
$components_cut_up = explode('|',$components);
?>

You now have access to the following components, which themselves need to be processed into an array:

VariableWhat It DoesDelimiterElements Returned
$components_cut_up['0']Cart Session IDN/AN/A
$components_cut_up['1']Billing Information Fields---firstname
lastname
address1
address2
city
state
zip
country
email
phone
Last Four of Card
Card Expiration Month
Card Expiration Year
Credit Card ID
ship_firstname
ship_lastname
ship_address1
ship_address2
ship_city
ship_state
ship_zip
ship_country
ship_email
ship_phone
payment_type
$components_cut_up['2']Cart Totals---Subtotal
Savings
Tax
Total

Sample String-to-Array

<?php
$billing_components = explode('---',$components_cut_up['1']);
echo $billing_components['2']; // Address Line 1
?>

Type: Registration Complete

VariableTypeWhat It Does
$reg_pageStringID of the form from which the registration took place.

Type: Login

No additional data is receive.

Type: Logout

No additional data is receive.

Getting User's Account Details

The following can be used on any custom action to get a user's account information. The information is returned as a standard associative-array.

<?php
include $options['ppsd_sl'] . "/custom/custom_actions/functions.php";
$user_data = get_user($user);
?>