joinPrices example

return;
        }

        $query->addState(PriceConditionHandler::LISTING_PRICE_JOINED);

        if (!$criteria->hasConditionOfClass(VariantCondition::class)) {
            $this->joinCheapestProductPrice($query$context);

            return;
        }

        $this->variantHelper->joinPrices($query$context$criteria);
    }

    private function joinCheapestProductPrice(QueryBuilder $query, ShopContextInterface $context): void
    {
        $table = $this->listingPriceTable->get($context);
        $query->innerJoin('product', '(' . $table->getSQL() . ')', 'listing_price', 'listing_price.articleID = product.id');

        foreach ($table->getParameters() as $key => $value) {
            $query->setParameter($key$value);
        }
    }
}
QueryBuilder $query,
        ShopContextInterface $context
    ) {
        $conditions = $this->criteria->getConditionsByClass(VariantCondition::class);
        $conditions = array_filter($conditionsfunction DVariantCondition $condition) {
            return $condition->expandVariants();
        });

        if (!$query->hasState(self::STATE_INCLUDES_PSEUDO_PRICE_VARIANTS)) {
            if (empty($conditions)) {
                $this->variantHelper->joinVariants($query);
                $this->joinPrices($query$context);
            } else {
                $this->listingPriceSwitcher->joinPrice($query$this->criteria, $context);
                $query->andWhere('listing_price.pseudoprice > 0');
            }

            $query->addState(self::STATE_INCLUDES_PSEUDO_PRICE_VARIANTS);
        }
    }

    public function setCriteria(Criteria $criteria)
    {
        
Home | Imprint | This part of the site doesn't use cookies.