Automattic\WooCommerce\StoreApi\Routes\V1
CartCoupons::get_route_delete_response()
Deletes all coupons in the cart.
Метод класса: CartCoupons{}
Хуков нет.
Возвращает
\WP_REST_Response
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_route_delete_response( $request );
- $request(\WP_REST_Request) (обязательный)
- Request object.
Код CartCoupons::get_route_delete_response() CartCoupons::get route delete response WC 7.7.2
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 ); }