You are here

function ca_remove_condition_group in Ubercart 6.2

Remove a condition group from a predicate.

Parameters

$pid: The ID of the predicate to remove the condition group from.

$group_key: The key of the condition group to remove.

Return value

An array representing the full, updated predicate.

1 call to ca_remove_condition_group()
ca_conditions_form_remove_condition_group_submit in ca/ca.admin.inc
Submit handler for button to remove a condition grou.

File

ca/ca.module, line 808
This is a demonstration module for the new conditional actions API.

Code

function ca_remove_condition_group($pid, $group_key) {

  // Load the predicate as it is now.
  $predicate = ca_load_predicate($pid);

  // Update, save, and return the predicate.
  unset($predicate['#conditions']['#conditions'][$group_key]);
  ca_save_predicate($predicate);
  return $predicate;
}