Check tax is available for product
@param \Lovata\Shopaholic\Classes\Item\ProductItem $obProductItem
@return bool
330291
public function isAvailableForProduct($obProductItem) : bool
    {
        $arProductIDList = (array) $this->product_id_list;

        $bResult = !empty($arProductIDList) && !empty($obProductItem) && in_array($obProductItem->id, $arProductIDList);

        return $bResult;
    }
1171037
protected function setAddonData(
        ItemInterface $lastProcessedProductItem,
        ItemInterface $item,
        ProductInterface $parentItemProduct = null
    ) {
        $item->setParent($lastProcessedProductItem);

        $parentProduct = $lastProcessedProductItem->getProduct();
        $addonProduct = $item->getProduct();
        /** @var Addon $addon */
        $addon = $this->addonRepository->findOneBy(['product' => $parentProduct, 'addon' => $addonProduct]);

        // Check if parent product has an addon relation.
        if (!$addon && $parentItemProduct) {
            $addon = $this->addonRepository->findOneBy(['product' => $parentProduct, 'addon' => $parentItemProduct]);
        }

        if (!$addon) {
            throw new \Exception(
                'Addon id ' . $addonProduct->getId() . ' for product id ' . $parentProduct->getId() . ' not found.'
            );
        }
        $item->setAddon($addon);

        return $addon;
    }
792863
public function resolve(CartItem $item, Request $request)
    {
        
        $productId = $request->query->get('id');
        $itemForm = $request->request->get('cart_item_simple');

        $productRepository = $this->manager->getRepository('EcommerceBundle:Product');
        if (!$productId || !$product = $productRepository->find($productId)) {
            // no product id given, or product not found
            throw new \Exception('Requested product was not found');
        }

        // assign the product and quantity to the item
        $item->setProduct($product);
        $item->setQuantity(intval($itemForm['quantity']));

        // calculate item price adding the special charge
        $price = $product->getPrice();
        if ($this->specialPercentageCharge > 0) {
            $price += $price * ($this->specialPercentageCharge / 100);
        }
        $item->setUnitPrice(intval($price));

        return $item;
    }
379483
protected function validateClassProduct()
    {
        $field = 'product_class_id';
        $value = $this->getSubmitted($field);

        if (empty($value)) {
            return null;
        }

        $label = $this->translation->text('Product class');

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        $product_class = $this->product_class->get($value);

        if (empty($product_class)) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        $fields = $this->product_class->getFields($value);
        $this->setSubmitted('product_fields', $fields);
        return true;
    }
757872
protected function isArticleParamsEqual($basketItem)
    {
        return ($basketItem->getProductId() == $this->getItemToValidate()->getArticleId() &&
                $basketItem->getPersParams() == $this->getItemToValidate()->getPersistParam() &&
                $basketItem->getSelList() == $this->getItemToValidate()->getSelectList());
    }
633699
public function getDiscountValue($dPrice)
    {
        if ($this->_isProductVoucher()) {
            return $this->_getProductDiscountValue((double) $dPrice);
        } elseif ($this->_isCategoryVoucher()) {
            return $this->_getCategoryDiscountValue((double) $dPrice);
        } else {
            return $this->_getGenericDiscountValue((double) $dPrice);
        }
    }
1140849
public function findProductPrice(PriceProduct $product)
    {
        $priceConfigurationFilter = new PriceConfigurationFilter();
        $priceConfigurationFilter->addProduct($product);

        $result = $this->findPrice($priceConfigurationFilter);
        if (isset($result[0])) {
            return $result[0];
        }

        return null;
    }
125990
public function getItemPrice($item, $currency, $useProductPrice = true)
    {
        $currency = $this->getCurrency($currency);

        if ($useProductPrice) {
            $priceValue = $this->getValidProductPriceForItem($item, $currency);
         } else {
            $priceValue = $item->getPrice();
        }

        return $priceValue;
    }
641813
public function getProductHistoricRates(RequestProduct $product) {
        return $this->get(['products', $product->getProductId(), 'candles'], ResponseProductHistoricRate::class, $product->toArray());
    }
454906
public function check(SpySalesOrderItem $orderItem)
    {
        return $this->getFacade()
            ->isPaymentUnderpaid($orderItem->getFkSalesOrder(), $orderItem->getIdSalesOrderItem());
    }
559433
public function aroundGetProductPrice(
        \Magento\Catalog\Block\Product\ListProduct $subject,
        \Closure $proceed,
        \Magento\Catalog\Model\Product $product
    ) {
        $result = $proceed($product);
        $canSeePv = $this->hlpCust->canSeePv();
        if ($canSeePv) {
            $domId = "prxgt_pv_" . $product->getId();
            $pvProd = $product->getData(AProdCollFactory::A_PV_PRODUCT);
            $pvProd = $this->hlpFormat->toNumber($pvProd);
            $html = "<div id=\"$domId\"><span>$pvProd</span> PV</div>";
            $result = $html . $result;
        }
        return $result;
    }
932772
public function hasVirtualProduct()
    {
        $virtualProductCount = OrderProductQuery::create()
            ->filterByOrderId($this->getId())
            ->filterByVirtual(1, Criteria::EQUAL)
            ->count()
        ;

        return ($virtualProductCount !== 0);
    }
1342362
protected function getProductCountAttribute()
    {
        $iProductCount = $this->getAttribute('product_count');
        if ($iProductCount !== null) {
            return $iProductCount;
        }

        //Get product count from cache
        $arCacheTag = [static::class];
        $sCacheKey = 'product_count_'.$this->id;

        $iProductCount = CCache::get($arCacheTag, $sCacheKey);
        if ($iProductCount !== null) {
            return $iProductCount;
        }

        //Calculate product count from child categories
        $iProductCount = 0;
        $obChildCategoryCollect = $this->children;
        if ($obChildCategoryCollect->isNotEmpty()) {
            /** @var CategoryItem $obChildCategoryItem */
            foreach ($obChildCategoryCollect as $obChildCategoryItem) {
                if ($obChildCategoryItem->isEmpty()) {
                    continue;
                }

                $iProductCount += $obChildCategoryItem->product_count;
            }
        }

        $iProductCount += ProductCollection::make()->active()->category($this->id)->count();

        CCache::forever($arCacheTag, $sCacheKey, $iProductCount);
        $this->setAttribute('product_count', $iProductCount);

        return $iProductCount;
    }
1007319
protected function _isProductVoucher()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $oSeries = $this->getSerie();
        $sSelect = "select 1 from oxobject2discount where oxdiscountid = " . $oDb->quote($oSeries->getId()) . " and oxtype = 'oxarticles'";
        $blOk = ( bool ) $oDb->getOne($sSelect);

        return $blOk;
    }
65085
protected function setItemByProductData($productData, ApiItemInterface $item, $locale)
    {
        $productId = $this->getProductId($productData, 'product.id');

        /** @var Product $product */
        $product = $this->productRepository->find($productId);
        if (!$product) {
            throw new ProductNotFoundException(self::$productEntityName, $productId);
        }
        $item->setProduct($product);
        $translation = $product->getTranslation($locale);

        // When the product is not available in the current language choose the first translation you find.
        if (is_null($translation)) {
            if (count($product->getTranslations()) > 0) {
                $translation = $product->getTranslations()[0];
            } else {
                throw new ProductException('Product ' . $product->getId() . ' has no translations!');
            }
        }

        $this->setItemSupplier($item, $product);

        $item->setName($translation->getName());
        $item->setDescription($translation->getLongDescription());
        $item->setNumber($product->getNumber());

        // set order unit
        if ($product->getOrderUnit()) {
            $item->setQuantityUnit($product->getOrderUnit()->getTranslation($locale)->getName());
        } else if ($product->getParent() && $product->getParent()->getOrderUnit()) {
            $item->setQuantityUnit($product->getParent()->getOrderUnit()->getTranslation($locale)->getName());
        }

        $item->setIsRecurringPrice($product->isRecurringPrice());

        $taxClass = $product->getTaxClass();

        /*
         * If the product doesn't have a taxClass but has a parent, we try to get the taxClass from the parent.
         * This is used for product variants, which get the taxClass from the original product.
         */
        if (!$taxClass && $product->getParent()) {
            $taxClass = $product->getParent()->getTaxClass();
        }

        if ($taxClass) {
            $tax = $this->retrieveTaxForClass($taxClass);
            $item->setTax($tax);
        } else {
            $item->setTax(0);
        }

        return $product;
    }
1075177
public function HasFreeShippingVoucher()
    {
        $bHasFreeShipping = false;
        $tmpCurrentPointer = $this->getItemPointer();
        $this->GoToStart();

        while (!$bHasFreeShipping && ($oItem = &$this->Next())) {
            $oVoucherSeries = &$oItem->GetFieldShopVoucherSeries();
            if ($oVoucherSeries->fieldFreeShipping) {
                $bHasFreeShipping = true;
            }
        }
        $this->setItemPointer($tmpCurrentPointer);

        return $bHasFreeShipping;
    }
450014
public function getCartTotalPrice($withItemsInPromo = true)
    {
        $total = 0;

        $cartItems = $this->getRequest()->getSession()->getSessionCart($this->getDispatcher())->getCartItems();

        foreach ($cartItems as $cartItem) {
            if ($withItemsInPromo || ! $cartItem->getPromo()) {
                $total += $cartItem->getRealPrice() * $cartItem->getQuantity();
            }
        }

        return $total;
    }