You are here

function hook_uc_coupon_presave in Ubercart Discount Coupons 6

Same name and namespace in other branches
  1. 7.2 uc_coupon.api.php \hook_uc_coupon_presave()

hook_uc_coupon_presave().

Allow modules to alter a coupon object just before it is saved.

Parameters

$coupon: The coupon object that is about to be saved.

$edit: The coupon add/edit form values that were submitted.

1 function implements hook_uc_coupon_presave()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_coupon_purchase_uc_coupon_presave in uc_coupon_purchase/uc_coupon_purchase.module
Implementation of hook_uc_coupon_presave().
1 invocation of hook_uc_coupon_presave()
uc_coupon_save in ./uc_coupon.module
Save a coupon object.

File

./uc_coupon.api.php, line 19
Ubercart Discount Coupon module api/hooks. Version 6.x-1.x

Code

function hook_uc_coupon_presave(&$coupon, $edit) {

  // Add a category to this coupon
  if (isset($edit['category'])) {
    $coupon->data['category'] = $edit['category'];
  }
}