HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/lcc.kaunokolegija.lt/wp-content/plugins/countdown-builder/classes/helpers/WooManager.php
<?php
namespace ycd;

class WooManager {
	private $post;
	public function __construct($post) {
		$this->post = $post;
	}

	public function isWoo() {
		if (!$this->post) return  false;
		return $this->post->post_type === 'product';
	}

	public static function getCartInfo() {
		$args = array();
		if (function_exists('WC') && WC()->cart)  {

			$args['wooCartIsEmpty'] = (bool)WC()->cart->is_empty();
			$expirationTime = apply_filters( 'ycdWoocommerce_cart_expiring_time', time() + ( get_option( 'woocommerce_cart_expires' ) * 60 ) );
			$args['wooCartExpirationTime'] = date( 'Y-m-d H:i:s' ,$expirationTime );

		}

		return $args;
	}
}