public function CartCouponsResource::delete in Commerce Cart API 8
File
- src/
Plugin/ rest/ resource/ CartCouponsResource.php, line 128
Class
- CartCouponsResource
- Provides a cart collection resource for current session.
Namespace
Drupal\commerce_cart_api\Plugin\rest\resourceCode
public function delete(OrderInterface $commerce_order) {
$commerce_order
->get('coupons')
->setValue(NULL);
$commerce_order
->setRefreshState(OrderInterface::REFRESH_ON_SAVE);
$commerce_order
->save();
return new ModifiedResourceResponse(NULL, 204);
}