Active
Project:
Ubercart Discount Coupons
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2012 at 07:43 UTC
Updated:
23 Feb 2012 at 13:17 UTC
I have tried to implement hook uc_coupon_validate in my module but it doesn't work. I have this code:
<?php
function mymodule_uc_coupon_validate($coupon, $order, $account) {
watchdog('mymodule', 'uc_coupon hook');
}
?>
I have tried to find all hooks in module uc_coupon with searching for string "module_invoke_all". The search didn't find such a part of code: "module_invoke_all('uc_coupon_validate', ..), so I think the function is not applied as hook.
thanks for any help
Tomas
Comments
Comment #1
wodenx commentedThe hook is invoked at line 661ff of uc_coupon.module
However, if the coupon does not exist in the system, is not active or has expired, validation will fail before the hook is invoked. If you want to do custom validation you need to create an active coupon that is not limited by date.