Returns true if articles shown in shop with VAT.
Checks country VAT and options (show vat only in basket and check if b2b mode is activated).

@return boolean
762208
public function isVatIncluded()
    {
        if ($this->_blIsVatIncluded !== null) {
            return $this->_blIsVatIncluded;
        }

        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        /*
         * Do not show "inclusive VAT" when:
         *
         *   B2B mode is activated
         * OR
         *   the VAT will only be calculated in the basket
         * OR
         *   the country does not bill VAT
         *
         * oxcountry__oxvatstatus: Vat status: 0 - Do not bill VAT, 1 - Do not bill VAT only if provided valid VAT ID
         * if country is not available (no session) oxvatstatus->value will return null
         */
        if ($config->getConfigParam('blShowNetPrice') || $config->getConfigParam('bl_perfCalcVatOnlyForBasketOrder')) {
            return $this->_blIsVatIncluded = false;
        }

        $user = $this->getUser();
        if ($user !== false) {
            if ($user->getFieldData('oxustid') && $user->getFieldData('oxustidstatus') == 1) {
                return $this->_blIsVatIncluded = false;
            }
        } else {
            $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        }

        $activeCountry = $user->getActiveCountry();
        if ($activeCountry !== '') {
            $country = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
            if ($country->load($activeCountry) &&
                $country->oxcountry__oxvatstatus->value !== null &&
                $country->oxcountry__oxvatstatus->value == 0
            ) {
                return $this->_blIsVatIncluded = false;
            }
        }

        return $this->_blIsVatIncluded = true;
    }
1282674
public function isVisible()
    {
        $oActivUser = \OxidEsales\Eshop\Core\Registry::getConfig()->getUser();
        $sActivUserId = null;
        if ($oActivUser) {
            $sActivUserId = $oActivUser->getId();
        }

        $blIsVisible = (bool) ($this->oxuserbaskets__oxpublic->value) ||
                       ($sActivUserId && ($this->oxuserbaskets__oxuserid->value == $sActivUserId));

        return $blIsVisible;
    }
776616
public function IsValidForCurrentUser()
    {
        $bIsValidForUser = false;
        $bIsValidShippingCountry = false;
        $bIsValidBillingCountry = false;

        $oUser = TdbDataExtranetUser::GetInstance();
        $bIsValidGroup = $this->checkUserGroup($oUser);
        if ($bIsValidGroup) {
            $bIsValidForUser = $this->checkUser($oUser);
        }
        if ($bIsValidForUser && $bIsValidGroup) {
            $bIsValidShippingCountry = $this->checkUserShippingCountry($oUser);
        }
        if ($bIsValidForUser && $bIsValidGroup && $bIsValidShippingCountry) {
            $bIsValidBillingCountry = $this->checkUserBillingCountry($oUser);
        }

        return $bIsValidForUser && $bIsValidGroup && $bIsValidShippingCountry && $bIsValidBillingCountry;
    }
207573
protected function IsAllowedToShowRegisterAfterShoppingPage()
    {
        $oStep = TdbShopOrderStep::GetStep('thankyou');
        $bUserIsValid = false;
        if (!is_null($oStep)) {
            $oUser = $oStep->GetLastUserBoughtFromSession();
            if (!is_null($oUser)) {
                $bUserIsValid = $this->ValidateGivenUserData($oUser);
                if ($bUserIsValid) {
                    $oUserOrder = &TShopBasket::GetLastCreatedOrder();
                    if ($oUser->LoginExists()) {
                        $bUserIsValid = false;
                    }
                    if (is_null($oUserOrder)) {
                        $bUserIsValid = false;
                    }
                }
            }
        }

        return $bUserIsValid;
    }
567896
public function togglePublic()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return false;
        }

        if ($oUser = $this->getUser()) {
            $blPublic = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('blpublic');
            $oBasket = $oUser->getBasket('wishlist');
            $oBasket->oxuserbaskets__oxpublic = new \OxidEsales\Eshop\Core\Field(($blPublic == 1) ? $blPublic : 0);
            $oBasket->save();
        }
    }
233261
protected function checkUserCountry()
    {
        $isValid = true;

        $payPalPayment = $this->getPayment();

        $countries = $payPalPayment->getCountries();
        if ($countries) {
            $isValid = false;
            foreach ($countries as $countryId) {
                if ($countryId === $this->getShippingCountryId()) {
                    $isValid = true;
                    break;
                }
            }
        }

        return $isValid;
    }
518510
public function getIsSelectedCurrencyAvailable()
    {
        $oConfig = $this->getConfig();
        $blEnableMultiCurrency = (bool)$oConfig->getConfigParam('blBestitAmazonPay4OxidEnableMultiCurrency');

        if ($blEnableMultiCurrency === true) {
            return true;
        }

        if ($this->_isSelectedCurrencyAvailable === null) {
            $this->_isSelectedCurrencyAvailable = true;

            $aMap = array(
                'DE' => 'EUR',
                'UK' => 'GBP',
                'US' => 'USD'
            );
            $sLocale = (string)$oConfig->getConfigParam('sAmazonLocale');
            $sCurrency = (string)$this->getSession()->getBasket()->getBasketCurrency()->name;

            //If Locale is DE and currency is not EURO don't allow Amazon checkout process
            if (isset($aMap[$sLocale]) && $aMap[$sLocale] !== $sCurrency) {
                $this->_isSelectedCurrencyAvailable = false;
            }
        }

        return $this->_isSelectedCurrencyAvailable;
    }
940142
public function getFPaymentCosts()
    {
        $oPaymentCost = $this->getCosts('oxpayment');
        if ($oPaymentCost && $oPaymentCost->getBruttoPrice()) {
            return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPaymentCost->getBruttoPrice(), $this->getBasketCurrency());
        }

        return false;
    }
1211040
public function isForeignCountry()
    {
        return !in_array($this->getId(), \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aHomeCountry'));
    }
1036993
public function hasPositionsInCart() {
    $account = \Drupal::currentUser();

    $query = $this->connection->select('site_cart', 'n');
    $query->addExpression('COUNT(n.cid)');
    $query->condition('n.oid', 0);

    if ($account->id()) {
      $query->condition('n.uid', $account->id());
    } else {
      $query->condition('n.uid_hash', kvantstudio_user_hash());
    }

    return (bool) $query->execute()->fetchField();
  }
831521
public function AllowDisplayInShop()
    {
        $bShowCat = false;

        $oShop = TdbShop::GetInstance();
        if (!is_null($oShop) && !$oShop->fieldShowEmptyCategories) {
            $bShowCat = ($this->GetNumberOfArticlesInCategory(true) > 0);
        } else {
            $bShowCat = true;
        }

        if (false == $this->fieldActive || false == $this->fieldTreeActive) {
            $bShowCat = false;
        }

        $targetPage = $this->getTargetPage();
        if (null === $targetPage || false === $targetPage) {
            return true;
        }
        // show only if the user has access to the category target page
        if (false === $targetPage->AllowAccessByCurrentUser()) {
            return false;
        }

        return $bShowCat;
    }
368091
protected function checkPriceRange()
    {
        $isValid = true;

        $payPalPayment = $this->getPayment();

        if ($payPalPayment->oxpayments__oxfromamount->value != 0 ||
            $payPalPayment->oxpayments__oxtoamount->value != 0
        ) {
            $cur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
            $price = $this->getPrice() / $cur->rate;

            $isValid = (($price >= $payPalPayment->oxpayments__oxfromamount->value) &&
                          ($price <= $payPalPayment->oxpayments__oxtoamount->value));
        }

        return $isValid;
    }
456187
public function isExpressCheckoutEnabledInMiniBasket()
    {
        $expressCheckoutEnabledInMiniBasket = false;
        if ($this->isExpressCheckoutEnabled() && $this->getPayPalConfig()->isExpressCheckoutInMiniBasketEnabled()) {
            $expressCheckoutEnabledInMiniBasket = true;
        }

        return $expressCheckoutEnabledInMiniBasket;
    }
152450
protected function checkMinOrderPrice()
    {
        $isValid = true;

        if ($minOrderPrice = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iMinOrderPrice')) {
            $isValid = $this->getPrice() > $minOrderPrice;
        }

        return $isValid;
    }
1244539
public function isEnabledPrivateSales()
    {
        if ($this->_blEnabledPrivateSales === null) {
            $this->_blEnabledPrivateSales = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsLoginEnabled');
            if ($this->_blEnabledPrivateSales && ($canPreview = \OxidEsales\Eshop\Core\Registry::getUtils()->canPreview()) !== null) {
                $this->_blEnabledPrivateSales = !$canPreview;
            }
        }

        return $this->_blEnabledPrivateSales;
    }
341587
public function getFDeliveryCosts()
    {
        $oPrice = $this->getCosts('oxdelivery');

        if ($oPrice && ($this->getBasketUser() || \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blCalculateDelCostIfNotLoggedIn'))) {
            return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getBruttoPrice(), $this->getBasketCurrency());
        }

        return false;
    }
785829
public function getPayCostVat()
    {
        $dPayVAT = $this->getCosts('oxpayment')->getVatValue();

        // blShowVATForPayCharge option will be used, only for displaying, but not calculation
        if ($dPayVAT > 0 && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForPayCharge')) {
            return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPayVAT, $this->getBasketCurrency());
        }

        return false;
    }