function commerce_discount_usage_reset_order_usage in Commerce Discount 7
Reset usage statistics for an entire order.
Parameters
object $order: A fully qualified order object.
Return value
DeleteQuery Return a new DeleteQuery object.
2 calls to commerce_discount_usage_reset_order_usage()
- commerce_discount_commerce_order_delete in ./
commerce_discount.module - Implements hook_commerce_order_delete().
- commerce_discount_usage_record_order_usage in ./
commerce_discount.module - Record order usage.
File
- ./
commerce_discount.module, line 1219 - Defines the discount and discount offer entities, bundles and functionality.
Code
function commerce_discount_usage_reset_order_usage($order) {
return db_delete('commerce_discount_usage')
->condition('order_id', $order->order_id)
->execute();
}