LLMS_Controller_Registration::voucher( int $person_id, array $data, string $screen )

Attempt to redeem a voucher on user registration if a voucher was submitted during registration


Parameters Parameters

$person_id

(int) (Required) WP_User ID of the newly registered user.

$data

(array) (Required) $_POST data.

$screen

(string) (Required) Screen user registered from [checkout|registration].


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/forms/controllers/class.llms.controller.registration.php

	public function voucher( $person_id, $data, $screen ) {

		if ( 'registration' === $screen && ! empty( $data['llms_voucher'] ) ) {

			$voucher  = new LLMS_Voucher();
			$redeemed = $voucher->use_voucher( $data['llms_voucher'], $person_id );

			if ( is_wp_error( $redeemed ) ) {

				llms_add_notice( $redeemed->get_error_message(), 'error' );

			}
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.19.4 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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