Advanced_Coupons_Helpers::get_options_for_credit( $label = null,  $option_code = 'PPCONDITION',  $args = array() )

Get drop down options for the conditions.


Parameters Parameters

(Required) peepso users


Source Source

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

	public function get_options_for_credit( $label = null, $option_code = 'PPCONDITION', $args = array() ) {

		if ( ! $label ) {
			$label = esc_attr__( 'Select condition', 'uncanny-automator' );
		}

		$args = wp_parse_args(
			$args,
			array(
				'uo_include_any' => false,
				'uo_any_label'   => esc_attr__( 'Any condition', 'uncanny-automator' ),
			)
		);

		$options = array();

		if ( $args['uo_include_any'] ) {
			$options['-1'] = $args['uo_any_label'];
		}

		$options['EQ']     = __( 'equal to', 'uncanny-automator' );
		$options['NOT_EQ'] = __( 'not equal to', 'uncanny-automator' );
		$options['LT']     = __( 'less than', 'uncanny-automator' );
		$options['GT']     = __( 'greater than', 'uncanny-automator' );
		$options['GT_EQ']  = __( 'greater or equal to', 'uncanny-automator' );
		$options['LT_EQ']  = __( 'less or equal to', 'uncanny-automator' );

		$option = array(
			'option_code'     => $option_code,
			'label'           => $label,
			'input_type'      => 'select',
			'required'        => true,
			'options'         => $options,
			'relevant_tokens' => array(),
		);

		return apply_filters( 'uap_option_advanced_coupons_all_conditions', $option );
	}