Advanced_Coupons_Tokens::trigger_acfwc_trigger_tokens_func( $tokens = array(),  $args = array() )


Source Source

File: src/integrations/advanced-coupons/tokens/advanced-coupons-tokens.php

	public function trigger_acfwc_trigger_tokens_func( $tokens = array(), $args = array() ) {
		/** @var Wc_Tokens $wc_tokens */
		$fields    = array();
		$fields[]  = array(
			'tokenId'         => 'USERTOTALCREDIT',
			'tokenName'       => __( "User's total store credit", 'uncanny-automator' ),
			'tokenType'       => 'text',
			'tokenIdentifier' => $args['meta'],
		);
		$fields[]  = array(
			'tokenId'         => 'USERLIFETIMECREDIT',
			'tokenName'       => __( "User's lifetime store credit", 'uncanny-automator' ),
			'tokenType'       => 'text',
			'tokenIdentifier' => $args['meta'],
		);
		$wc_tokens = Utilities::get_class_instance( 'Uncanny_Automator\WC_TOKENS' );
		if ( method_exists( $wc_tokens, 'wc_possible_tokens' ) ) {
			$new_tokens = $wc_tokens->wc_possible_tokens( $tokens, $args, 'order' );

			return array_merge( $fields, $new_tokens );
		}

		return array_merge( $fields, $tokens );
	}