SPBAS v1.7 API Documentation


Order_Forms\order_forms
admin/modules/order_forms/lib/classes/order_forms.php at line 8

Class order_forms

order_forms

public class order_forms

SPBAS Order Forms

Author:
Andy Rockwell

Method Summary
integer|boolean

add(string status, integer price_sheet_id, string can_change_currency, string name, string url, string maintenance_message, integer email_configuration_id, integer default_pay_gateway_id, integer default_customer_area_id)

Add a order form

integer|boolean

add_category(integer order_form_id, string name, integer parent_id, string status, string icon)

Add a new category

boolean

add_customer_user_id2session(integer session_id, integer customer_id, integer user_id)

Add the order id to the session

boolean

add_invoice_to_cart_session(integer session_id, integer invoice_id)

Add the invoice to the cart

boolean

add_order_id2session(integer session_id, integer order_id)

Add the order id to the session

boolean

add_pricing(integer order_form_id, integer price_sheet_id, string name)

Add pricing to an order form

boolean

add_product_to_cart_session(integer session_id, integer product_id, integer sku_id, integer qty, string is_addon, integer package_id)

Add the product to the cart

array

apply_discounts(array cart)

Remove an item from the cart

array

apply_taxes(array cart, array taxes, mixed total_due_today, mixed total_order)

Apply taxes to the cart

string

breadcrumb(integer order_form_id, integer parent_id, array buffer)

Convert breadcrumb array to string

array

breadcrumb_array(integer id, array buffer, boolean no_root_category)

Get a breadcrumb array

string

breadcrumb_cart(integer order_form_id, integer parent_id, integer base_category_id)

Convert breadcrumb array to string for order/cart.php

array

cart_contents(mixed session_id)

Get the cart contents

boolean

category_display_order(integer category_id, integer display_order)

Change the category display order

array

category_products(integer order_form_id, integer category_id, mixed status)

Get all product IDs for a category

array

category_tree_select(integer parent_id, integer tick, string separator)

Category tree for select box

array

change_currency_option(string can_change_currency, integer order_form_id)

Get a list of all price sheets

array

compile_cart(array cart, string session)

Compile the cart into a usable array

integer|boolean

currency_changer(string session_id, integer price_sheet_id, integer order_form_id, integer customer_id)

Change the session status

array

customer_price_sheet(string session, mixed customer_session)

Add the customer & user ID to the session if logged and determine assigned price sheet, if any.

boolean

delete(integer id)

Delete an order form

boolean

delete_category(integer category_id)

Delete a category and all of it's children

boolean

delete_order_form_jcategories(integer category_id)

Delete a category and all of it's children from the join table

boolean

delete_price_sheets(integer order_form_id)

Delete the price sheets for an order form

string

download_conf(integer order_form_id)

Download the order form configuration file

array

excluded_addons(integer sku_id)

Get all excluded addons for a price tier

boolean

fix_qty(integer id, integer qty)

The qty in the cart is out of bounds with the min/max order limits

array|boolean

get(integer id)

Get the order form data

array

get_agreements(mixed id, integer order_form_id)

Get an agreements assigned to the order form

array

get_all()

Get a list of all order forms

array

get_all_pricing(integer order_form_id)

Get a list of all price sheets

array

get_all_pricing_wp(integer order_form_id, string sort, array link_extras)

Get a list of all price sheets with pagination.

array

get_all_wp(string sort, array link_extras)

Get a list of all order forms with pagination.

array|boolean

get_by(string api_key)

Get the order form data using the api key

array

get_categories(integer order_form_id, integer parent_id, mixed status)

Get all categories

array|boolean

get_category(integer id)

Get category details

array|boolean

get_customer_price_sheet(integer customer_id)

Get all price sheets assigned to a customer

array|boolean

get_session(integer session_id, integer order_id)

Get the session data

array|boolean

get_session_by_transaction_id(integer transaction_id)

Get the session data

array

get_session_extras(integer session_id)

Get the sessio ndata

array|boolean

get_session_order_notes(integer session_id)

Get the order notes

boolean

is_valid_customer_price_sheet(integer customer_id, integer price_sheet_id)

Make sure the customer is actually assigned the said price_sheet_id

boolean

is_valid_price_sheet_for_order_form(integer order_form_id, integer price_sheet_id)

Do we have a valid price sheet for the order form?

boolean

isset_product_in_cart_session(integer session_id, integer product_id, string sku_id, string is_addon)

Is the product already in the cart?

boolean

isset_product_in_category(integer product_id, integer category_id, integer order_form_id)

Is the product already assigned to the category?

boolean

isset_session(string session_id)

Does the session exist?

boolean

lock_session(integer session_id, integer transaction_id)

Lock the session

integer

make_default()

Get the default configuration asc

boolean

make_pay_gateway_default(integer order_form_id, integer default_pay_gateway_id)

Make a pay gateway the default for the order form

array

make_select()

Make a select box suitable for forms::select()

array

make_select_caa(array order_forms)

Make a select box suitable for forms::select()

array

order_complete_summary(string access_key)

Remove an item from the cart

boolean

product_display_order(integer product_id, integer category_id, integer order_form_id, integer display_order)

Change the product display order

boolean

remove_from_cart(integer cart_item_id, integer qty)

Remove an item from the cart

boolean

remove_invoice_from_cart_session(integer session_id, integer invoice_id)

Remove the invoice from the cart

boolean

remove_pricing(integer order_form_id, integer price_sheet_id)

Add pricing to an order form

boolean

remove_product_from_category(integer product_id, integer category_id, integer order_form_id)

Remove product from the category and order form

boolean

remove_promotion_code_to_session(integer session_id)

Remove a promotion code from the primary session

boolean

save_order_notes_to_session(integer session_id, string order_notes)

Save the order notes to the primary session

boolean

save_promotion_code_to_session(integer session_id, string promotion_code, string promotion_code_description)

Save a promotion code to the primary session

array

search(string terms, string sort_by, string order, array link_extras, integer id)

Search order forms

boolean

session_add_amount_due(integer session_id, decimal amount_due)

Add a promotional discount total

boolean

session_add_promotion_discounts(integer session_id, decimal promotion_discounts)

Add a promotional discount total

boolean

session_extras(string session_id, string key, string value)

Does the session exist?

boolean

session_price_sheet_id(integer session_id, string price_sheet_id)

Change the session status

boolean

session_status(integer session_id, string status)

Change the session status

string|boolean

start_session(string session_id)

Start a cart session

boolean

toggle_product_in_category(mixed product_id, integer category_id, mixed order_form_id, integer set_id)

Add product to order form and category

boolean

update(integer id, string status, string name, string url, string maintenance_message)

Update an order form

boolean

update_advanced(integer id, integer price_sheet_id, string can_change_currency, integer email_configuration_id, integer default_customer_area_id, string ion)

Update an order form

boolean

update_category(integer id, string name, string description, integer parent_id, string status, string is_default, integer order_form_id, string icon)

Add a new category

boolean

update_gateway_logs(integer session_id, integer order_id, integer customer_id, integer user_id)

Update the pay gateway logs

boolean

update_order_customer_id(integer session_id, integer order_form_id, integer customer_area_id)

Save the order form ID and the customer area id to the session

boolean

update_price_sheet_label(string name, integer order_form_id, integer price_sheet_id)

Update the price sheet label

boolean

update_product_in_cart_session(integer session_id, integer product_id, integer sku_id, integer qty, string is_addon)

Add the product to the cart

boolean

update_qty(integer cart_item_id, integer qty)

Update the item qty

boolean

update_session_TOS(integer session_id, string tos)

Change the Terms Of Service status for a session

array

validate_addons(interger sku_id, array addons)

Validate qty of an item in the cart

array

validate_qty(array cart)

Validate qty of an item in the cart

Method Detail

admin/modules/order_forms/lib/classes/order_forms.php at line 176

add

public integer|boolean add(string status, integer price_sheet_id, string can_change_currency, string name, string url, string maintenance_message, integer email_configuration_id, integer default_pay_gateway_id, integer default_customer_area_id)

Add a order form

Returns:
integer insert ID on success; boolean false on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 608

add_category

public integer|boolean add_category(integer order_form_id, string name, integer parent_id, string status, string icon)

Add a new category

Parameters:
status - Public; Private
Returns:
insert ID integer on success; boolean false on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 1185

add_customer_user_id2session

public boolean add_customer_user_id2session(integer session_id, integer customer_id, integer user_id)

Add the order id to the session


admin/modules/order_forms/lib/classes/order_forms.php at line 788

add_invoice_to_cart_session

public boolean add_invoice_to_cart_session(integer session_id, integer invoice_id)

Add the invoice to the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 1121

add_order_id2session

public boolean add_order_id2session(integer session_id, integer order_id)

Add the order id to the session


admin/modules/order_forms/lib/classes/order_forms.php at line 201

add_pricing

public boolean add_pricing(integer order_form_id, integer price_sheet_id, string name)

Add pricing to an order form


admin/modules/order_forms/lib/classes/order_forms.php at line 761

add_product_to_cart_session

public boolean add_product_to_cart_session(integer session_id, integer product_id, integer sku_id, integer qty, string is_addon, integer package_id)

Add the product to the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 1196

apply_discounts

public array apply_discounts(array cart)

Remove an item from the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 1333

apply_taxes

public array apply_taxes(array cart, array taxes, mixed total_due_today, mixed total_order)

Apply taxes to the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 508
public string breadcrumb(integer order_form_id, integer parent_id, array buffer)

Convert breadcrumb array to string


admin/modules/order_forms/lib/classes/order_forms.php at line 486
public array breadcrumb_array(integer id, array buffer, boolean no_root_category)

Get a breadcrumb array


admin/modules/order_forms/lib/classes/order_forms.php at line 535
public string breadcrumb_cart(integer order_form_id, integer parent_id, integer base_category_id)

Convert breadcrumb array to string for order/cart.php


admin/modules/order_forms/lib/classes/order_forms.php at line 811

cart_contents

public array cart_contents(mixed session_id)

Get the cart contents


admin/modules/order_forms/lib/classes/order_forms.php at line 1772

category_display_order

public boolean category_display_order(integer category_id, integer display_order)

Change the category display order


admin/modules/order_forms/lib/classes/order_forms.php at line 722

category_products

public array category_products(integer order_form_id, integer category_id, mixed status)

Get all product IDs for a category


admin/modules/order_forms/lib/classes/order_forms.php at line 581

category_tree_select

public array category_tree_select(integer parent_id, integer tick, string separator)

Category tree for select box


admin/modules/order_forms/lib/classes/order_forms.php at line 391

change_currency_option

public array change_currency_option(string can_change_currency, integer order_form_id)

Get a list of all price sheets


admin/modules/order_forms/lib/classes/order_forms.php at line 1659

compile_cart

public array compile_cart(array cart, string session)

Compile the cart into a usable array


admin/modules/order_forms/lib/classes/order_forms.php at line 869

currency_changer

public integer|boolean currency_changer(string session_id, integer price_sheet_id, integer order_form_id, integer customer_id)

Change the session status

Returns:
integer price sheet ID on success; boolean false on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 1146

customer_price_sheet

public array customer_price_sheet(string session, mixed customer_session)

Add the customer & user ID to the session if logged and determine assigned price sheet, if any.


admin/modules/order_forms/lib/classes/order_forms.php at line 424

delete

public boolean delete(integer id)

Delete an order form


admin/modules/order_forms/lib/classes/order_forms.php at line 661

delete_category

public boolean delete_category(integer category_id)

Delete a category and all of it's children


admin/modules/order_forms/lib/classes/order_forms.php at line 650

delete_order_form_jcategories

public boolean delete_order_form_jcategories(integer category_id)

Delete a category and all of it's children from the join table


admin/modules/order_forms/lib/classes/order_forms.php at line 440

delete_price_sheets

public boolean delete_price_sheets(integer order_form_id)

Delete the price sheets for an order form


admin/modules/order_forms/lib/classes/order_forms.php at line 65

download_conf

public string download_conf(integer order_form_id)

Download the order form configuration file


admin/modules/order_forms/lib/classes/order_forms.php at line 1815

excluded_addons

public array excluded_addons(integer sku_id)

Get all excluded addons for a price tier


admin/modules/order_forms/lib/classes/order_forms.php at line 1025

fix_qty

public boolean fix_qty(integer id, integer qty)

The qty in the cart is out of bounds with the min/max order limits


admin/modules/order_forms/lib/classes/order_forms.php at line 451

get

public array|boolean get(integer id)

Get the order form data

Returns:
array on success; boolean on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 1797

get_agreements

public array get_agreements(mixed id, integer order_form_id)

Get an agreements assigned to the order form


admin/modules/order_forms/lib/classes/order_forms.php at line 274

get_all

public array get_all()

Get a list of all order forms


admin/modules/order_forms/lib/classes/order_forms.php at line 369

get_all_pricing

public array get_all_pricing(integer order_form_id)

Get a list of all price sheets


admin/modules/order_forms/lib/classes/order_forms.php at line 349

get_all_pricing_wp

public array get_all_pricing_wp(integer order_form_id, string sort, array link_extras)

Get a list of all price sheets with pagination.


admin/modules/order_forms/lib/classes/order_forms.php at line 327

get_all_wp

public array get_all_wp(string sort, array link_extras)

Get a list of all order forms with pagination.


admin/modules/order_forms/lib/classes/order_forms.php at line 462

get_by

public array|boolean get_by(string api_key)

Get the order form data using the api key

Returns:
array on success; boolean on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 558

get_categories

public array get_categories(integer order_form_id, integer parent_id, mixed status)

Get all categories


admin/modules/order_forms/lib/classes/order_forms.php at line 473

get_category

public array|boolean get_category(integer id)

Get category details

Returns:
array on success; boolean on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 901

get_customer_price_sheet

public array|boolean get_customer_price_sheet(integer customer_id)

Get all price sheets assigned to a customer

Returns:
array on success; boolean on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 1037

get_session

public array|boolean get_session(integer session_id, integer order_id)

Get the session data

Returns:
array on success; boolean on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 1109

get_session_by_transaction_id

public array|boolean get_session_by_transaction_id(integer transaction_id)

Get the session data

Returns:
array on success; boolean on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 1091

get_session_extras

public array get_session_extras(integer session_id)

Get the sessio ndata


admin/modules/order_forms/lib/classes/order_forms.php at line 1012

get_session_order_notes

public array|boolean get_session_order_notes(integer session_id)

Get the order notes

Returns:
array on success; boolean on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 913

is_valid_customer_price_sheet

public boolean is_valid_customer_price_sheet(integer customer_id, integer price_sheet_id)

Make sure the customer is actually assigned the said price_sheet_id


admin/modules/order_forms/lib/classes/order_forms.php at line 1133

is_valid_price_sheet_for_order_form

public boolean is_valid_price_sheet_for_order_form(integer order_form_id, integer price_sheet_id)

Do we have a valid price sheet for the order form?


admin/modules/order_forms/lib/classes/order_forms.php at line 743

isset_product_in_cart_session

public boolean isset_product_in_cart_session(integer session_id, integer product_id, string sku_id, string is_addon)

Is the product already in the cart?


admin/modules/order_forms/lib/classes/order_forms.php at line 677

isset_product_in_category

public boolean isset_product_in_category(integer product_id, integer category_id, integer order_form_id)

Is the product already assigned to the category?


admin/modules/order_forms/lib/classes/order_forms.php at line 98

isset_session

public boolean isset_session(string session_id)

Does the session exist?


admin/modules/order_forms/lib/classes/order_forms.php at line 999

lock_session

public boolean lock_session(integer session_id, integer transaction_id)

Lock the session


admin/modules/order_forms/lib/classes/order_forms.php at line 262

make_default

public integer make_default()

Get the default configuration asc

Returns:
the order form id

admin/modules/order_forms/lib/classes/order_forms.php at line 130

make_pay_gateway_default

public boolean make_pay_gateway_default(integer order_form_id, integer default_pay_gateway_id)

Make a pay gateway the default for the order form


admin/modules/order_forms/lib/classes/order_forms.php at line 291

make_select

public array make_select()

Make a select box suitable for forms::select()


admin/modules/order_forms/lib/classes/order_forms.php at line 309

make_select_caa

public array make_select_caa(array order_forms)

Make a select box suitable for forms::select()


admin/modules/order_forms/lib/classes/order_forms.php at line 1488

order_complete_summary

public array order_complete_summary(string access_key)

Remove an item from the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 1786

product_display_order

public boolean product_display_order(integer product_id, integer category_id, integer order_form_id, integer display_order)

Change the product display order


admin/modules/order_forms/lib/classes/order_forms.php at line 843

remove_from_cart

public boolean remove_from_cart(integer cart_item_id, integer qty)

Remove an item from the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 801

remove_invoice_from_cart_session

public boolean remove_invoice_from_cart_session(integer session_id, integer invoice_id)

Remove the invoice from the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 218

remove_pricing

public boolean remove_pricing(integer order_form_id, integer price_sheet_id)

Add pricing to an order form


admin/modules/order_forms/lib/classes/order_forms.php at line 709

remove_product_from_category

public boolean remove_product_from_category(integer product_id, integer category_id, integer order_form_id)

Remove product from the category and order form


admin/modules/order_forms/lib/classes/order_forms.php at line 987

remove_promotion_code_to_session

public boolean remove_promotion_code_to_session(integer session_id)

Remove a promotion code from the primary session


admin/modules/order_forms/lib/classes/order_forms.php at line 963

save_order_notes_to_session

public boolean save_order_notes_to_session(integer session_id, string order_notes)

Save the order notes to the primary session


admin/modules/order_forms/lib/classes/order_forms.php at line 976

save_promotion_code_to_session

public boolean save_promotion_code_to_session(integer session_id, string promotion_code, string promotion_code_description)

Save a promotion code to the primary session


admin/modules/order_forms/lib/classes/order_forms.php at line 20

search

public array search(string terms, string sort_by, string order, array link_extras, integer id)

Search order forms


admin/modules/order_forms/lib/classes/order_forms.php at line 1066

session_add_amount_due

public boolean session_add_amount_due(integer session_id, decimal amount_due)

Add a promotional discount total


admin/modules/order_forms/lib/classes/order_forms.php at line 1054

session_add_promotion_discounts

public boolean session_add_promotion_discounts(integer session_id, decimal promotion_discounts)

Add a promotional discount total


admin/modules/order_forms/lib/classes/order_forms.php at line 113

session_extras

public boolean session_extras(string session_id, string key, string value)

Does the session exist?


admin/modules/order_forms/lib/classes/order_forms.php at line 855

session_price_sheet_id

public boolean session_price_sheet_id(integer session_id, string price_sheet_id)

Change the session status


admin/modules/order_forms/lib/classes/order_forms.php at line 926

session_status

public boolean session_status(integer session_id, string status)

Change the session status


admin/modules/order_forms/lib/classes/order_forms.php at line 141

start_session

public string|boolean start_session(string session_id)

Start a cart session

Returns:
string session ID on success; boolean false on failure

admin/modules/order_forms/lib/classes/order_forms.php at line 691

toggle_product_in_category

public boolean toggle_product_in_category(mixed product_id, integer category_id, mixed order_form_id, integer set_id)

Add product to order form and category


admin/modules/order_forms/lib/classes/order_forms.php at line 233

update

public boolean update(integer id, string status, string name, string url, string maintenance_message)

Update an order form


admin/modules/order_forms/lib/classes/order_forms.php at line 249

update_advanced

public boolean update_advanced(integer id, integer price_sheet_id, string can_change_currency, integer email_configuration_id, integer default_customer_area_id, string ion)

Update an order form


admin/modules/order_forms/lib/classes/order_forms.php at line 634

update_category

public boolean update_category(integer id, string name, string description, integer parent_id, string status, string is_default, integer order_form_id, string icon)

Add a new category

Parameters:
status - Public; Private
is_default - No; Yes

admin/modules/order_forms/lib/classes/order_forms.php at line 1080

update_gateway_logs

public boolean update_gateway_logs(integer session_id, integer order_id, integer customer_id, integer user_id)

Update the pay gateway logs


admin/modules/order_forms/lib/classes/order_forms.php at line 939

update_order_customer_id

public boolean update_order_customer_id(integer session_id, integer order_form_id, integer customer_area_id)

Save the order form ID and the customer area id to the session


admin/modules/order_forms/lib/classes/order_forms.php at line 413

update_price_sheet_label

public boolean update_price_sheet_label(string name, integer order_form_id, integer price_sheet_id)

Update the price sheet label


admin/modules/order_forms/lib/classes/order_forms.php at line 776

update_product_in_cart_session

public boolean update_product_in_cart_session(integer session_id, integer product_id, integer sku_id, integer qty, string is_addon)

Add the product to the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 830

update_qty

public boolean update_qty(integer cart_item_id, integer qty)

Update the item qty


admin/modules/order_forms/lib/classes/order_forms.php at line 951

update_session_TOS

public boolean update_session_TOS(integer session_id, string tos)

Change the Terms Of Service status for a session


admin/modules/order_forms/lib/classes/order_forms.php at line 1834

validate_addons

public array validate_addons(interger sku_id, array addons)

Validate qty of an item in the cart


admin/modules/order_forms/lib/classes/order_forms.php at line 1616

validate_qty

public array validate_qty(array cart)

Validate qty of an item in the cart


SPBAS v1.7 API Documentation