public function isCouponCodeAvailable(): bool 	{ 		// Check if discount is active and still usable 		if (!$this->active || ($this->max_use > 0 && $this->max_use <= ($this->type == self::COUPON_CODE_DISCOUNT ? $this->checkCouponCodeMaxTimesIsUsed() : $this->checkGiftCodeMaxTimesIsUsed()))) { 			return false; 		}  		if (!getUser()) { 			return false; 		}  		if (getUser()->user->hasUsedThisDiscount($this->id)) { 			return false; 		}  		return $this->isActiveDatesWise(); 	}