You are here

function hook_uc_coupon_presave in Ubercart Discount Coupons 7.2

Same name and namespace in other branches
  1. 6 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
Implements hook_uc_coupon_presave().
1 invocation of hook_uc_coupon_presave()
uc_coupon_save in ./uc_coupon.entity.inc
Save a coupon object.

File

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

Code

function hook_uc_coupon_presave(&$coupon, $edit) {

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