Fr3DBr Posted February 16, 2014 Share Posted February 16, 2014 I made a hooks.php file in my provisioning module directory : function hook_xxx_ShoppingCartValidateProductUpdate($vars) { ob_start(); print_r($vars); ob_end_clean(); } add_hook("ShoppingCartValidateProductUpdate",1,"hook_xxx_ShoppingCartValidateProductUpdate"); But when I add a product to the cart, I don't see anything, what can be wrong ? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 16, 2014 Share Posted February 16, 2014 first you type wrong function name here: add_hook("ShoppingCartValidateProductUpdate",1,"ho ok_xxx_ShoppingCartValidateProductUpdate"); see ho ok_ also the hook action seems to work without $vars see: http://docs.whmcs.com/Hooks:Order_Process#ShoppingCartValidateProductUpdate 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted February 16, 2014 Author Share Posted February 16, 2014 This was a problem of the forum sentq, in fact it was written correct here. 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted February 17, 2014 Author Share Posted February 17, 2014 Even by adding the php file in includes/hooks it is not working at all, the function is never called 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted February 17, 2014 Author Share Posted February 17, 2014 I can confirm hooks.php is being readed, but it is not working for this hook so far. 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted February 17, 2014 Author Share Posted February 17, 2014 There are many hooks that doesn't seems to be working in 5.3.3 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 17, 2014 Share Posted February 17, 2014 There are many hooks that doesn't seems to be working in 5.3.3 how did you know that? 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted February 17, 2014 Author Share Posted February 17, 2014 how did you know that? Just make your own test. Install WHMCS 5.3.3 Make a php file in includes/hooks And test each of the hooks in the Order section. You will see none works, then if you try for example 'TicketOpen' hook, it works fine. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 17, 2014 Share Posted February 17, 2014 but i think i didn't see any of this in the change log, you can try to store information into database table instead of print it out. 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted February 17, 2014 Author Share Posted February 17, 2014 but i think i didn't see any of this in the change log,you can try to store information into database table instead of print it out. This is a bug my friend, I already did all sorts of tests, none of the 'cart.php' hooks are working at all. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted February 17, 2014 Share Posted February 17, 2014 Take a closer look at your hook and at this link http://au2.php.net/ob_start This function may also help you http://au2.php.net/manual/en/function.ob-get-contents.php Remember when the page is generated by whmcs the same format is used so you may need to exit the script immediately after your output. 0 Quote Link to comment Share on other sites More sharing options...
Fr3DBr Posted February 17, 2014 Author Share Posted February 17, 2014 Hello, Sparky. I made other types of tests, I am 100% sure they are not working. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.