Constants

ALWAYS_USE_LICENSE_KEYS_OPTION

ALWAYS_USE_LICENSE_KEYS_OPTION

BWC

BWC

BWC_REGISTRATION_SHORTCODE

BWC_REGISTRATION_SHORTCODE

DEFAULT_COURSE_TEMPLATE

DEFAULT_COURSE_TEMPLATE

DONT_ADD_MY_COURSES_PAGE_OPTION

DONT_ADD_MY_COURSES_PAGE_OPTION

FEATURE_NAME

FEATURE_NAME

LICENSE_ORDER_COMPLETED_EMAIL_TEXT_OPTION

LICENSE_ORDER_COMPLETED_EMAIL_TEXT_OPTION

LICENSE_ORDER_DETAILS_TEXT_OPTION

LICENSE_ORDER_DETAILS_TEXT_OPTION

MY_COURSES_ENDPOINT

MY_COURSES_ENDPOINT

MY_LICENSE_KEYS_ENDPOINT

MY_LICENSE_KEYS_ENDPOINT

OFFER_LICENSE_KEYS_AT_CHECKOUT_OPTION

OFFER_LICENSE_KEYS_AT_CHECKOUT_OPTION

OPTION_ALLOW_LICENSE_KEYS

OPTION_ALLOW_LICENSE_KEYS

OPTION_ALWAYS_USE_LICENSE_KEYS

OPTION_ALWAYS_USE_LICENSE_KEYS

REDEMPTIONS_AVAILABLE_FOR

REDEMPTIONS_AVAILABLE_FOR

SIMPLE_ORDER_COMPLETED_EMAIL_TEXT_OPTION

SIMPLE_ORDER_COMPLETED_EMAIL_TEXT_OPTION

SIMPLE_ORDER_DETAILS_TEXT_OPTION

SIMPLE_ORDER_DETAILS_TEXT_OPTION

SUPPRESS_DEFAULT_LICENSE_KEY_FIELD

SUPPRESS_DEFAULT_LICENSE_KEY_FIELD

Functions

__test_references()

__test_references() 

add_bright_specific_email_text()

add_bright_specific_email_text(  $order,   $sent_to_admin,   $plain_text,   $email) 

Parameters

$order
$sent_to_admin
$plain_text
$email

add_endpoints()

add_endpoints() 

add_menu_items()

add_menu_items(array  $items) : array

Insert the new endpoint into the My Account menu.

Parameters

array $items

Returns

array

add_query_vars()

add_query_vars(array  $vars) : array

Add new query var.

Parameters

array $vars

Returns

array

addTemplates()

addTemplates() 

bright_license_field()

bright_license_field(  $checkout) 

Parameters

$checkout

bright_license_field_update_order_meta()

bright_license_field_update_order_meta(  $order_id) : boolean

This is a callback from the woocommerce_checkout_update_order_meta action. It has the effect of setting the 'bright_license' field on the order.

Parameters

$order_id

Returns

boolean —

returns true if order successfully updated.

bright_set_license_field_on_checkout()

bright_set_license_field_on_checkout(  $order_id) 

This is the default function called on checkout, to determine if this is a license order.

To replace with your own function, do:

add_filter('bright_set_license_field_on_checkout', function ($function_name) { return "\SomeNamespace\bright_set_license_field_on_checkout"; }, 10, 1);

for example.

Parameters

$order_id

buildCustomForLicenseKeyWidget()

buildCustomForLicenseKeyWidget(  $coursedata,   $attr) 

Add in the templates that are part of the license key widget render, plus POST processing [ugh]

Parameters

$coursedata
$attr

bwc_get_page()

bwc_get_page(\Bright\WC\string  $page) : Array

Creates the stub pages for a vanilla Bright WooCommerce Integration

Parameters

\Bright\WC\string $page

Returns

Array —

of page ids created [or existing]

bwc_page_id()

bwc_page_id(  $page) 

Parameters

$page

bwc_page_id_option()

bwc_page_id_option(  $page) 

Parameters

$page

bwc_page_permalink()

bwc_page_permalink(  $page) 

Parameters

$page

create_default_integration_pages()

create_default_integration_pages() : Array

Creates the stub pages for a vanilla Bright WooCommerce Integration

Returns

Array —

of page ids created [or existing]

display_admin_error()

display_admin_error(  $errormsg,   $level = "notice-error") 

Parameters

$errormsg
$level

display_initialization_errors()

display_initialization_errors() 

do_license_key_page()

do_license_key_page() 

does_site_allow_license_keys()

does_site_allow_license_keys() 

enforce_quantity_rules()

enforce_quantity_rules(  $max,   $product) 

Parameters

$max
$product

filter_orders_by_status()

filter_orders_by_status(array  $orders,   $status) 

Parameters

array $orders
$status

foreach_bright_product()

foreach_bright_product(  $func) 

Parameters

$func

generate_order_details()

generate_order_details(  $order, Array  $args = array()) 

Adds order details to the Woocommerce Checkout Page.

Parameters

$order
Array $args

if 'show-registration-link' is set, a table row will be generated which links to the WP registration page with the license key encoded as a query parameter.

get_bright_products()

get_bright_products() 

get_direct_orders()

get_direct_orders(  $user = null) 

Parameters

$user

get_license_key_report_url()

get_license_key_report_url(  $license) 

Parameters

$license

get_license_key_url()

get_license_key_url(  $license) 

Parameters

$license

get_my_license_keys()

get_my_license_keys() 

get_my_license_orders()

get_my_license_orders() 

get_orders_for_license()

get_orders_for_license(  $license) 

Parameters

$license

get_simple_email_text()

get_simple_email_text(\WP_Post  $post) : Array

Default text for email and or message about how to access courseware on a simple/B2C order.

Parameters

\WP_Post $post

Returns

Array —

of page ids created [or existing]

get_wc_products_where_custom_field_is_set()

get_wc_products_where_custom_field_is_set(  $field) 

Parameters

$field

is_cart_a_probable_license_purchase()

is_cart_a_probable_license_purchase() : Boolean

Returns true if product is a bright product, and one of the following is true: 1. the item quantity is greater than 1.

  1. the bright metadata defines a quantity_multiplier.
    1. the bright metadata indicates that the product should always be in the form of a license purchase.

No arguments is taken, access to the cart is via the global $woocommerce variable.

Returns

Boolean

license_key_page()

license_key_page() 

Endpoint HTML content.

license_key_rows()

license_key_rows() 

login_page()

login_page(  $login_url,   $redirect,   $force_reauth) 

Parameters

$login_url
$redirect
$force_reauth

my_courses_page()

my_courses_page() 

processNewLicenseKeys()

processNewLicenseKeys() 

redemptions_available_for()

redemptions_available_for(  $coursedata,   $attr) 

Parameters

$coursedata
$attr

register_redirect()

register_redirect(  $redirect) 

Parameters

$redirect

require_plugin()

require_plugin(  $class,   $title = null,   $description = "") 

Parameters

$class
$title
$description

set_default_completed_order_text()

set_default_completed_order_text() 

set_license_order()

set_license_order(integer  $order_id, String  $value) : boolean

Sets the bright_license field for an order. If value is '1' [or possibly other true values], Bright will manage as a license order.

Parameters

integer $order_id

ID of the order

String $value

value to set the metadata field as.

Returns

boolean —

returns true if correctly set.

setup_simplified_checkout()

setup_simplified_checkout() 

stand_alone_license_key_page()

stand_alone_license_key_page() 

rewrite of the old template based page.

woocommerce_registration_form()

woocommerce_registration_form(  $attributes) 

Parameters

$attributes