Automattic\WooCommerce\StoreApi\Routes\V1
CartCoupons::get_route_delete_response()
Deletes all coupons in the cart.
Method of the class: CartCoupons{}
No Hooks.
Return
\WP_REST_Response
.
Usage
// protected - for code of main (parent) or child class $result = $this->get_route_delete_response( $request );
- $request(\WP_REST_Request) (required)
- Request object.
CartCoupons::get_route_delete_response() CartCoupons::get route delete response code WC 9.3.1
protected function get_route_delete_response( \WP_REST_Request $request ) { $cart = $this->cart_controller->get_cart_instance(); $cart->remove_coupons(); $cart->calculate_totals(); return new \WP_REST_Response( [], 200 ); }