Reputation: 17467
http://www.ubercart.org/docs/api/hook_add_to_cart
I am trying to hook into the add cart functionality of ubercart. I have created stock_control.module and stock_control.info files and enabled the module. In my .module file I have
The first is output but the 2nd is not.
<?php
dsm('hello1');
function stock_control_add_to_cart($nid, $qty, $data) {
dsm('hello2');
if ($qty > 1) {
$result[] = array(
' success' => FALSE,
'message' => t('Sorry, you can only add one of those at a time.'),
);
}
return $result;
}
Upvotes: 3
Views: 1625