Block/Basket.php
private function getItemsData($quoteItem, $_product, $_parentProduct)
    {
        $totalPrice = (!isset($_parentProduct) ? $quoteItem->getBaseRowTotalInclTax() : $quoteItem->getParentItem()->getBaseRowTotalInclTax());
        $inStock = ($_product->isInStock())
            ? 'In Stock'
            : 'Out of stock';
        $total = $this->priceHelper->currency(
            $totalPrice,
            true,
            false
        );

        $productUrl = (isset($_parentProduct) ? $this->urlFinder->fetchFor($_parentProduct) : $this->urlFinder->fetchFor($_product));
        $grandTotal = $this->priceHelper->currency(
            $this->getGrandTotal(),
            true,
            false
        );
        $itemsData = [
            'grandTotal' => $grandTotal,
            'total' => $total,
            'inStock' => $inStock,
            'productUrl' => $productUrl,
            'product' => (isset($_parentProduct) ? $_parentProduct : $_product),
            'qty' => isset($_parentProduct) ? $quoteItem->getParentItem()->getQty() : $quoteItem->getQty(),
            'product_details' => $_product
        ];

        return $itemsData;
    }
private function getItemsData($quoteItem, $_product, $_parentProduct)
    {
        $totalPrice = (!isset($_parentProduct) ? $quoteItem->getBaseRowTotalInclTax() : $quoteItem->getParentItem()->getBaseRowTotalInclTax());
        $inStock = ($_product->isInStock())
            ? 'In Stock'
            : 'Out of stock';
        $total = $this->priceHelper->currency(
            $totalPrice,
            true,
            false
        );

        $productUrl = (isset($_parentProduct) ? $this->urlFinder->fetchFor($_parentProduct) : $this->urlFinder->fetchFor($_product));
        $grandTotal = $this->priceHelper->currency(
            $this->getGrandTotal(),
            true,
            false
        );
        $itemsData = [
            'grandTotal' => $grandTotal,
            'total' => $total,
            'inStock' => $inStock,
            'productUrl' => $productUrl,
            'product' => (isset($_parentProduct) ? $_parentProduct : $_product),
            'qty' => isset($_parentProduct) ? $quoteItem->getParentItem()->getQty() : $quoteItem->getQty(),
            'product_details' => $_product
        ];

        return $itemsData;
    }
private function getItemsData ( $ quoteItem , $ _product , $ _parentProduct ) { $ totalPrice = ( ! isset ( $ _parentProduct ) ? $ quoteItem -> getBaseRowTotalInclTax ( ) : $ quoteItem -> getParentItem ( ) -> getBaseRowTotalInclTax ( ) ) ; $ inStock = ( $ _product -> isInStock ( ) ) ? 'In Stock' : 'Out of stock' ; $ total = $ this -> priceHelper -> currency ( $ totalPrice , true , false ) ; $ productUrl = ( isset ( $ _parentProduct ) ? $ this -> urlFinder -> fetchFor ( $ _parentProduct ) : $ this -> urlFinder -> fetchFor ( $ _product ) ) ; $ grandTotal = $ this -> priceHelper -> currency ( $ this -> getGrandTotal ( ) , true , false ) ; $ itemsData = [ 'grandTotal' => $ grandTotal , 'total' => $ total , 'inStock' => $ inStock , 'productUrl' => $ productUrl , 'product' => ( isset ( $ _parentProduct ) ? $ _parentProduct : $ _product ) , 'qty' => isset ( $ _parentProduct ) ? $ quoteItem -> getParentItem ( ) -> getQty ( ) : $ quoteItem -> getQty ( ) , 'product_details' => $ _product ] ; return $ itemsData ; }
Returns the itemsData array to be viewed;
@var \Magento\Quote\Model\Quote\Item $quoteItem
@param Product $_product
@param  Product$_parentProduct
@return array
Returns the itemsData array to be viewed ;