You are here

function uc_recurring_fee_delete in Ubercart 5

Deletes a recurring fee from a product or user.

Parameters

$type: Either 'product' or 'user' to specify what type of delete needs to happen.

$id: The ID of the recurring fee to be removed from the appropriate table.

1 call to uc_recurring_fee_delete()
uc_recurring_admin_delete_form_submit in payment/uc_recurring/uc_recurring.module
1 string reference to 'uc_recurring_fee_delete'
uc_recurring_product_feature in payment/uc_recurring/uc_recurring.module
Implementation of hook_product_feature().

File

payment/uc_recurring/uc_recurring.module, line 979
Allows you to add a recurring fee to a product/SKU to handle subscription type services.

Code

function uc_recurring_fee_delete($feature, $type = 'product') {
  switch ($type) {
    case 'product':
      db_query("DELETE FROM {uc_recurring_products} WHERE pfid = %d", $feature['pfid']);
      break;
    case 'user':
      module_invoke_all('recurring_api', 'delete', $feature['fid']);
      db_query("DELETE FROM {uc_recurring_users} WHERE rfid = %d", $feature['pfid']);
      break;
  }
}