function hook_commerce_checkout_access_alter in Commerce Core 7
Allows modules to alter checkout access resolution for an order / account.
Parameters
$access: Boolean indicating whether or not access will be granted.
$order: The order object.
$account: The account whose access is being checked.
1 invocation of hook_commerce_checkout_access_alter()
- commerce_checkout_access in modules/
checkout/ commerce_checkout.module - Checks the current user's access to the specified checkout page and order.
File
- modules/
checkout/ commerce_checkout.api.php, line 326 - Hooks provided by the Checkout module.
Code
function hook_commerce_checkout_access_alter(&$access, $order, $account) {
// Prevent access to checkout for an order that is deemed to be fraudulent.
if ($access && example_fraud_check_fails()) {
$access = FALSE;
}
}