getListingPrice example

$result = new ProductSearchResult(
            [$product->getNumber() => $product],
            1,
            [],
            $criteria,
            $this->contextService->getShopContext()
        );

        $service->updatePrices($criteria$result$this->contextService->getShopContext());

        if ($product->displayFromPrice()) {
            $data['priceStartingFrom'] = $product->getListingPrice()->getCalculatedPrice();
        }

        $data['price'] = $product->getListingPrice()->getCalculatedPrice();

        return $this->legacyEventManager->fireArticleByIdEvents($data$this);
    }

    /** * Creates different links for the product like `add to basket`, `add to note`, `view detail page`, ... * * @param int $categoryId * @param bool $addNumber * * @return array */

        return array_map([$this, 'convertListProductStruct']$products);
    }

    /** * Converts the passed ListProduct struct to a shopware 3-4 array structure. * * @return array */
    public function convertListProductStruct(ListProduct $product)
    {
        $cheapestPrice = $product->getListingPrice();

        $promotion = $this->getListProductData($product);
        $promotion = array_merge($promotion$this->convertProductPriceStruct($cheapestPrice));

        if ($product->getPriceGroup()) {
            $promotion['pricegroupActive'] = true;
            $promotion['pricegroupID'] = $product->getPriceGroup()->getId();
        }

        if ($product->displayFromPrice()) {
            $promotion['priceStartingFrom'] = $promotion['price'];
        }
Home | Imprint | This part of the site doesn't use cookies.