function commerce_coupon_remove_all_coupons_from_order in Commerce Coupon 7
Removes all coupons from a given order. references.
Parameters
$order: Order object to affect in the coupon removal.
1 call to commerce_coupon_remove_all_coupons_from_order()
- commerce_coupon_action_remove_all_coupons_from_order in ./
commerce_coupon.rules.inc - Action to remove all coupons from a given order.
File
- ./
commerce_coupon.module, line 675 - Coupon System for Drupal Commerce.
Code
function commerce_coupon_remove_all_coupons_from_order($order) {
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
$coupons = $order_wrapper->commerce_coupon_order_reference
->value();
foreach ($coupons as $coupon) {
commerce_coupon_remove_coupon_from_order($order, $coupon);
}
}