getCheapestPriceQuery example

return $product->getVariantId();
        }$products);

        /* * Query to select the data of the cheapest price */
        $mainQuery = $this->connection->createQueryBuilder();

        /* * Contains the cheapest price logic which product price should be selected. */
        $cheapestPriceQuery = $this->getCheapestPriceQuery($mainQuery$criteria);

        $mainQuery->select($this->fieldHelper->getPriceFields())
            ->addSelect($this->fieldHelper->getUnitFields())
            ->addSelect('variantCheapestPrice.ordernumber as __variant_ordernumber')
            ->addSelect('variantCheapestPrice.different_price_count as __different_price_count');

        $mainQuery->from('s_articles_prices', 'price')
            ->innerJoin('price', 's_articles_details', 'variant', 'variant.id = price.articledetailsID')
            ->innerJoin('variant', 's_articles', 'product', 'product.id = variant.articleID')
            ->leftJoin('variant', 's_core_units', 'unit', 'unit.id = variant.unitID')
            ->leftJoin('price', 's_articles_prices_attributes', 'priceAttribute', 'priceAttribute.priceID = price.id')
            
Home | Imprint | This part of the site doesn't use cookies.