hook_alloc_allocation($txn, $balance)
ecommerce-5--4/docs/developer/hooks/ec_receipt.php, line 330
tba (example is from store.module)
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
<?php
function hook_alloc_allocation($txn, $balance) {
$is_shippable = FALSE;
if (!empty($txn->items)) {
foreach ($txn->items as $item) {
if (product_is_shippable($item->vid)) {
$is_shippable = TRUE;
break;
}
}
}
if ($balance == 0) {
$txn->allocation = EC_ALLOC_COMPLETED;
if (!$is_shippable) {
$txn->workflow = EC_WORKFLOW_COMPLETED;
}
}
else {
$txn->allocation = EC_ALLOC_PART;
}
store_transaction_save($txn);
}
?>