LLMS_Controller_Orders::__construct()
Constructor
Description Description
Source Source
File: includes/controllers/class.llms.controller.orders.php
public function __construct() { // form actions add_action( 'init', array( $this, 'create_pending_order' ) ); add_action( 'init', array( $this, 'confirm_pending_order' ) ); add_action( 'init', array( $this, 'switch_payment_source' ) ); // this action adds our lifterlms specific actions when order & transaction statuses change add_action( 'transition_post_status', array( $this, 'transition_status' ), 10, 3 ); // this action adds lifterlms specific action when an order is deleted, just before the WP post postmetas are removed. add_action( 'before_delete_post', array( $this, 'on_delete_order' ) ); /** * Status Change Actions for Orders and Transactions */ // transaction status changes cascade up to the order to change the order status add_action( 'lifterlms_transaction_status_failed', array( $this, 'transaction_failed' ), 10, 1 ); add_action( 'lifterlms_transaction_status_refunded', array( $this, 'transaction_refunded' ), 10, 1 ); add_action( 'lifterlms_transaction_status_succeeded', array( $this, 'transaction_succeeded' ), 10, 1 ); // status changes for orders to enroll students and trigger completion actions add_action( 'lifterlms_order_status_completed', array( $this, 'complete_order' ), 10, 2 ); add_action( 'lifterlms_order_status_active', array( $this, 'complete_order' ), 10, 2 ); // status changes to pending cancel add_action( 'lifterlms_order_status_pending-cancel', array( $this, 'pending_cancel_order' ), 10, 1 ); // status changes for orders to unenroll students upon purchase add_action( 'lifterlms_order_status_refunded', array( $this, 'error_order' ), 10, 1 ); add_action( 'lifterlms_order_status_cancelled', array( $this, 'error_order' ), 10, 1 ); add_action( 'lifterlms_order_status_expired', array( $this, 'error_order' ), 10, 1 ); add_action( 'lifterlms_order_status_failed', array( $this, 'error_order' ), 10, 1 ); add_action( 'lifterlms_order_status_on-hold', array( $this, 'error_order' ), 10, 1 ); add_action( 'lifterlms_order_status_trash', array( $this, 'error_order' ), 10, 1 ); /** * Scheduler Actions */ // charge recurring payments add_action( 'llms_charge_recurring_payment', array( $this, 'recurring_charge' ), 10, 1 ); // expire access plans add_action( 'llms_access_plan_expiration', array( $this, 'expire_access' ), 10, 1 ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.33.0 | Added before_delete_post action to handle order deletion |
3.19.0 | Updated. |
3.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: