Conditional_Logic

Conditional logic utilities.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

check_external_condition()  : bool
compare()  : mixed
is_field_hidden()  : bool
Determines if a field is hidden by conditional logic.
maybe_json_decode()  : mixed
check_condition()  : bool
Check a single condition against the current form values.
check_for_conditions()  : bool
Determines if the fields conditions are met.

Methods

check_external_condition()

public static check_external_condition(mixed $condition, mixed $product) : bool
Parameters
$condition : mixed
$product : mixed
Tags
Return values
bool

compare()

public static compare(mixed $option_values, mixed $condition) : mixed
Parameters
$option_values : mixed
$condition : mixed
Tags
Return values
mixed

is_field_hidden()

Determines if a field is hidden by conditional logic.

public static is_field_hidden(Abstract_Field $field, array<string|int, mixed> $option_data[, mixed $recursive_field = null ]) : bool
Parameters
$field : Abstract_Field
$option_data : array<string|int, mixed>
$recursive_field : mixed = null
Tags
Return values
bool

maybe_json_decode()

public static maybe_json_decode(mixed $json_value) : mixed
Parameters
$json_value : mixed
Tags
Return values
mixed

check_condition()

Check a single condition against the current form values.

private static check_condition(array<string|int, mixed> $option_data, object $condition, mixed $recursive_field, WC_Product $product) : bool
Parameters
$option_data : array<string|int, mixed>
$condition : object
$recursive_field : mixed
$product : WC_Product
Tags
Return values
bool

Whether the condition is satisfied.

check_for_conditions()

Determines if the fields conditions are met.

private static check_for_conditions(Abstract_Field $field, array<string|int, mixed> $option_data, mixed $recursive_field) : bool
Parameters
$field : Abstract_Field
$option_data : array<string|int, mixed>
$recursive_field : mixed
Tags
Return values
bool

Search results