LLMS_Order_Generator::generate( string $user_action = self::UA_COMMIT )

Generates an order.


Description Description

Uses data submitted during class construction and performs all necessary validations. If validations pass, creates the order.


Top ↑

Parameters Parameters

$user_action

(string) (Optional) The user action, accepts LLMS_Order_Generator::UA_COMMIT or LLMS_Order_Generator::UA_VALIDATE.

Default value: self::UA_COMMIT


Top ↑

Return Return

(WP_Error|LLMS_Order)


Top ↑

Source Source

File: includes/class-llms-order-generator.php

	public function generate( $user_action = self::UA_COMMIT ) {

		$validate = $this->validate();
		if ( is_wp_error( $validate ) ) {
			return $validate;
		}

		if ( self::UA_COMMIT === $user_action ) {
			$user = $this->commit_user();
			if ( is_wp_error( $user ) ) {
				return $user;
			}
		}

		return $this->create();

	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.