Hi, I have a drupal site that uses Ubercart, and I need to implement some checking for products of certain type before they are placed into the shopping cart. I quickly figured the hook_order is the right place to perform these checks. Although I did develop the whole site, I am still new to deeper internals of Drupal, e.g. its modules API. So, here goes my stupid question -- where do I exactly place that code? Basically the function should check some conditions on customer record and either reject or accept the order. I think I know what should be in the hook_order, but I need to understand where it lives. The docs aren't clear on that. Can someone post a simple example of hook_order and explain where this code lives?
Thanks for helping.
Comments
You will have to create a
You will have to create a custom module (say custom_sttran is ur custom module name) and place hook_order in custom_sttran.module file as
<?php
/**
* Implementation of hook_order.
*/
function custom_sttran_order ($op, &$arg1, $arg2) {
/* Your conditional checks to come here. */
}
Hope it was helpfull...
Regards
Thanks! I'll try the custom
Thanks! I'll try the custom module approach. A good opportunity to learn the module design!