Computes the product of a list of numbers
@return string
481665
public function product(){
		
		Number::setScale(static::NUMERIC_FUNCTIONS_SCALE);
		
		$total = \strval($this->front());
		
		for($i = 1, $l = $this->count(); $i < $l; ++$i){
			$total = Number::multiply($total, \strval($this->_Arr[$i]));
		}
		
		return $total;
		
	}
753750
public function getOperands()
    {
        $operandValues = [];
        foreach ($this->getOperandObjects() as $operand) {
            $value = $operand->getValue();

            if ($value === null) {
                continue;
            }

            if ($operand->isMultiple()) {
                $operandValues = array_merge($operandValues, $value);
            } else {
                $operandValues[] = $value;
            }
        }

        return array_merge($operandValues, $this->additionalOperands);
    }
661216
public function GetNetProductValue()
    {
        $dProductNetValue = 0;
        $oArticles = $this->GetFieldShopOrderItemList();
        $oArticles->GoToStart();
        $aTaxValueGroups = array();
        while ($oArticle = $oArticles->Next()) {
            if (!array_key_exists($oArticle->fieldVatPercent, $aTaxValueGroups)) {
                $aTaxValueGroups[$oArticle->fieldVatPercent] = 0;
            }
            $aTaxValueGroups[$oArticle->fieldVatPercent] += $oArticle->fieldOrderPriceAfterDiscounts;
        }

        foreach ($aTaxValueGroups as $dTaxPercent => $dGrosValue) {
            $oVat = TdbShopVat::GetNewInstance();
            if ($oVat->LoadFromField('vat_percent', $dTaxPercent)) {
                $oVat->addValue($dGrosValue);
                $dProductNetValue += $oVat->getNetValue();
            } else {
                $dProductNetValue += round($dGrosValue - ($dGrosValue / (1 + $dTaxPercent / 100)), 2);
            }
        }

        return $dProductNetValue;
    }
716193
public function serie()
    {
        $computedInSerie = array();

        foreach ($this->tasks as $task) {
            $task()->then(function($result) use (&$computedInSerie) {
                $computedInSerie[] = $result;
            }, function ($emptyResult) use (&$computedInSerie) {
                $computedInSerie[] = $emptyResult;
            });
        }

        return $computedInSerie;
    }
594989
public function prices() : Float
    {
        $total = 0;

        if( ! empty(Properties::$items) ) foreach( Properties::$items as $values )
        {
            $quantity = (int)   ($values['quantity'] ?? 1);
            $price    = (float) ($values['price']    ?? 0);

            $total += $price * $quantity;
        }

        return $total;
    }
1246513
public function numPages()
    {
        if ($this->numPage) {
            $this->numPage;
        };

        $entries = $this->entries();
        $count = count($entries);

        if ($this->numPerPage()) {
            $this->numPage = ceil($count / $this->numPerPage());
        } else {
            $this->numPage = 1;
        }

        return $this->numPage;
    }
438356
public function priceCalculator()
    {
        $return_price = 0;

        $price      = \floatval($this->getRequest()->query->get('price', 0));
        $product_id = \intval($this->getRequest()->query->get('product_id', 0));
        $action     = $this->getRequest()->query->get('action', ''); // With ot without tax
        $convert    = \intval($this->getRequest()->query->get('convert_from_default_currency', 0));

        if (null !== $product = ProductQuery::create()->findPk($product_id)) {
            if ($action == 'to_tax') {
                $return_price = $this->computePrice($price, 'without_tax', $product);
            } elseif ($action == 'from_tax') {
                $return_price = $this->computePrice($price, 'with_tax', $product);
            } else {
                $return_price = $price;
            }

            if ($convert != 0) {
                $return_price = $price * Currency::getDefaultCurrency()->getRate();
            }
        }

        return new JsonResponse(array('result' => $this->formatPrice($return_price)));
    }
1063326
public function summarizeGoodsList()
    {
        $amount = 0;
        if (!is_array($this->goodsList)) {
            return $amount;
        }
        foreach ($this->goodsList as $goods) {
            $price = $goods['goods']['price'];

            // Add VAT if price is Excluding VAT
            if (($goods['goods']['flags'] & KlarnaFlags::INC_VAT) === 0) {
                $vat = $goods['goods']['vat'] / 100.0;
                $price *= (1.0 + $vat);
            }

            // Reduce discounts
            if ($goods['goods']['discount'] > 0) {
                $discount = $goods['goods']['discount'] / 100.0;
                $price *= (1.0 - $discount);
            }

            $amount += $price * (int)$goods['qty'];
        }
        return $amount;
    }
309939
public function totals()
    {
        $totals = Collection::make();

        foreach (Arr::except($this->footer(), 'all') as $level => $count) {
            $totals->put($level, [
                'label'     => $this->translate("levels.$level"),
                'value'     => $count,
                'color'     => $this->color($level),
                'highlight' => $this->color($level),
            ]);
        }

        return $totals;
    }
1085184
public function factors()
    {
        $number = $this->value;
        $limit = floor(sqrt(abs($number)));
        $ret = array();
        for ($x = 1; $x <= $limit; $x++) {
            if ($number % $x == 0) {
                $other = intval($number / $x);
                $ret[$x] = $x;
                $ret[$other] = $other;
            }
        }
        ksort($ret);
        return array_values($ret);
    }
3359
public function toArray()
    {
        $name = $this->name();

        $value = $this->computeValue();
        $delta = $this->computeDelta();

        return [
            'name' => $name,
            'key' => $this->key(),
            'granularity' => $this->granularity(),
            'prefix' => $this->prefix(),
            'suffix' => $this->suffix(),
            'hasChart' => $this->hasChart(),
            'span' => $this->span(),
            'value' => $value,
            'abbreviated_value' => (is_numeric($value)) ? U::number_abbreviate(round($value, 2), 1) : $value,
            'delta' => $delta,
            'abbreviated_delta' => (is_numeric($delta)) ? U::number_abbreviate(round($delta, 2), 1) : $delta,
        ];
    }
1230771
public function getTotalQuantity()
    {
        $iQuantityCount = 0;

        $arOfferList = $this->all();

        /** @var \Lovata\Shopaholic\Classes\Item\OfferItem $arOfferItem */
        foreach ($arOfferList as $arOfferItem) {
            $iQuantityCount += $arOfferItem->quantity;
        }

        return $iQuantityCount;
    }
1059983
private function runCalculations()
    {
        //$this->resetCalculations(); //TODO: REMOVE THIS TEMPORARY LINE
        if (!empty($this->shopCalculations)) return $this->shopCalculations;
        $cacheKey = $this->calculationsCacheKey;
        if (Config::get('shop.cache_calculations')
            && Cache::has($cacheKey)
        ) {
            $this->shopCalculations = Cache::get($cacheKey);
            return $this->shopCalculations;
        }

        $this->shopCalculations = DB::table($this->table)
            ->select([
                DB::raw('sum(' . DB::getTablePrefix() . Config::get('shop.item_table') . '.quantity) as itemCount'),
                DB::raw('sum(' . DB::getTablePrefix() . Config::get('shop.item_table') . '.price * ' . DB::getTablePrefix() . Config::get('shop.item_table') . '.quantity) as totalPrice'),
                DB::raw('sum(' . DB::getTablePrefix() . Config::get('shop.item_table') . '.tax * ' . DB::getTablePrefix() . Config::get('shop.item_table') . '.quantity) as totalTax'),
                DB::raw('sum(' . DB::getTablePrefix() . Config::get('shop.item_table') . '.shipping * ' . DB::getTablePrefix() . Config::get('shop.item_table') . '.quantity) as totalShipping'),
                DB::raw('sum(' . DB::getTablePrefix() . Config::get('shop.item_table') . '.discount * ' . DB::getTablePrefix() . Config::get('shop.item_table') . '.quantity) as totalDiscount')
            ])
            ->join(
                Config::get('shop.item_table'),
                Config::get('shop.item_table') . '.' . ($this->table == Config::get('shop.order_table') ? 'order_id' : $this->table . '_id'),
                '=',
                $this->table . '.id'
            )
            ->where($this->table . '.id', $this->attributes['id'])
            ->first();

        if(!is_null(session('coupon'))) {
            $this->setCoupon(session('coupon'));
        }
        $basePrice = $this->shopCalculations->totalPrice;

        //Apply cash discount
        if ($this->coupon['value']) {
            $this->shopCalculations->totalPrice -= $this->coupon['value'];
        }
        $this->shopCalculations->cashDiscount = $this->coupon['value'];

        //Apply % discount
        if ($this->coupon['percent']) {
            $this->shopCalculations->totalPrice -= $this->shopCalculations->totalPrice * $this->coupon['percent'] / 100;
            $this->shopCalculations->percentageDiscount = $basePrice - $this->shopCalculations->totalPrice;
        } else {
            $this->shopCalculations->percentageDiscount = 0;
        }

        $this->shopCalculations->totalDiscount = $this->shopCalculations->cashDiscount + $this->shopCalculations->percentageDiscount;

        if (Config::get('shop.cache_calculations')) {
            Cache::put(
                $cacheKey,
                $this->shopCalculations,
                Config::get('shop.cache_calculations_minutes')
            );
        }
        return $this->shopCalculations;
    }
1358844
public function eight()
    {
        $sku     = '8';
        $name    = 'Junior Jordans';
        $rate    = new UnitedKingdomValueAddedTax;
        $price   = new Money(3999, new Currency('GBP'));
        $product = new Product($sku, $name, $price, $rate);
        $product->quantity(2);
        $product->taxable(false);
        $product->delivery(new Money(599, new Currency('GBP')));

        return $product;
    }
348091
public function getTotalItemNumber()
    {
        return array_reduce(
            $this->cartLines->toArray(),
            function ($previousTotal, CartLineInterface $current) {
                return $previousTotal + $current->getQuantity();
            },
            0
        );
    }
169446
public function getCheckDigits()
    {
        $checkDigits = '';
        $iban = $this->getIban();
        if (!empty($iban)) {
            $checkDigits = substr($iban, 2, 2);
        }
        return $checkDigits;
    }
235193
function get_col_num(){
		if( ! isset($this->c) ){
			if( isset($this->children[0]) ){
				$this->c = $this->children[0]->get_col_num();
			}
			else {
				$this->c = 0;
			}
		}
		return $this->c;
	}