Cart Boxx – All the Session Vars and Definitions

THE SESSION VARS

Session Var Description
$_SESSION[‘cart’] The current shopping cart in an array of [PRODUCT ID => QUANTITY]
$_SESSION[‘user’] Contains the user data if the user is signed in – Simply contains all the user fields as per the user table in the database.

 

THE DEFINITIONS

Definition Description
DB_HOST [core/config.php] The database host address.
DB_NAME [core/config.php] The database name.
DB_CHARSET [core/config.php] The database charset to use.
DB_USER [core/config.php] The database user.
DB_PASSWORD [core/config.php] The database password.
SECRET_KEY [core/config.php] The secret key used for encryption.
URL_ROOT [core/config.php] The root URL of your website.
PATH_ROOT [index.php] Base directory path to Cart Boxx, automatically adapted.
PATH_CORE [index.php] Directory path to cart_boxx/core
PATH_UPLOAD [index.php] Directory path to cart_boxx/uploads
PATH_LIB [index.php] Directory path to cart_boxx/core/lib
PATH_API [index.php] Directory path to cart_boxx/core/api
PATH_HOOK [index.php] Directory path to cart_boxx/core/hook
PATH_ADMIN [index.php] Directory path to cart_boxx/core.admin
PATH_THEME [index.php] Directory path to the currently selected theme.
URL_UPLOADS [index.php] URL of the uploads folder.
URL_API [index.php] URL of the API endpoint.
URL_ADMIN [index.php] URL of the admin panel.
URL_THEME [index.php] Root URL of the currently selected theme.

 

DATABASE CONFIG DEFINITIONS

Definition Description
CART_MAX Max quantity of each item allowed in the shopping cart.
PER_PAGE For pagination, max number of entries per page.
SITE_NAME Website name.
SITE_THEME Currently selected website theme.
MAIL_FROM Email sender identity.
TITLE_USER_REG Email title – Successfully registered
TITLE_USER_RESET Email title – Password reset
TITLE_USER_FORGOT Email title – Forgot password
TITLE_USER_ACTIVATE Email title – Activation required
EMAIL_USER_REG Email template – Successfully registered
EMAIL_USER_RESET Email template – Password reset
EMAIL_USER_FORGOT Email template – Forgotten password
EMAIL_USER_ACTIVATE Email template – Activation required
ACTIVATE_EXPIRE Activation email expiry in hours
SLUG_API API URL slug E.g. http://site.com/api
SLUG_ADMIN Admin URL slug E.g. http://site.com/admin
SLUG_ACTIVATE Email activation URL E.g. http://site.com/activate

 

CART BOXX ENGINE

Variable Description
$_CB->sysmsg System message, JSON

  • cb-status – 1 for success, 0 for fail
  • cb-mod – The related module that caused an error or responded successfully
  • cb-msg – The system/error message
  • cb-more – Container for extra data, for example, user data on an API call to fetch users
$_CB->url Array, the current URL path. For example, https://your-site.com/admin/users/2

  • $_CB->url[0] = “admin”
  • $_CB->url[1] = “users”
  • $_CB->url[0] = “2”

 

ORDERS CODE

These are the “default” order status code – You can ignore and invent your own though.

Code Status
1 Pending Payment
2 Processing
3 Closed
4 Canceled
5 Refunded
6 Partially Refunded

 

USER LEVELS

These are the “default” user levels – Invent more of your own if you want.

Code Level
USR User
ADM Administrator

 

USER STATUS CODE

These are the “default” user status codes – Invent more of your own if you want.

Code Level
1 Active
2 Pending account activation
0 Suspended

Leave a Comment

Your email address will not be published. Required fields are marked *