HEX
Server: nginx/1.18.0
System: Linux vps-9dcdb12e 5.15.0-176-generic #186-Ubuntu SMP Fri Mar 13 11:01:42 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.24
Disabled: exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /var/www/goautomatic.pl/wp-content/plugins/latepoint/lib/controllers/carts_controller.php
<?php
/*
 * Copyright (c) 2023 LatePoint LLC. All rights reserved.
 */

if ( ! defined( 'ABSPATH' ) ) {
  exit; // Exit if accessed directly.
}


if ( ! class_exists( 'OsCartsController' ) ) :


  class OsCartsController extends OsController {

    function __construct(){
      parent::__construct();
      $this->views_folder = LATEPOINT_VIEWS_ABSPATH . 'carts/';

			$this->action_access['public'] = array_merge($this->action_access['public'], ['remove_item_from_cart']);
    }

		public function remove_item_from_cart(){
			$cart_item_id = $this->params['cart_item_id'];
			$cart_item = new OsCartItemModel($cart_item_id);
			$current_cart = OsCartsHelper::get_or_create_cart();
			if($current_cart->remove_item($cart_item)){
				$status = LATEPOINT_STATUS_SUCCESS;
				$response_html = __('Booking removed from your cart', 'latepoint');
			}else{
				$status = LATEPOINT_STATUS_ERROR;
				$response_html = __('Not Allowed', 'latepoint');
			}
      if($this->get_return_format() == 'json'){
        $this->send_json(array('status' => $status, 'message' => $response_html));
      }

		}


  }


endif;