getMinSales example

'product',
                's_articles_top_seller_ro',
                'topSeller',
                'topSeller.article_id = product.id'
            );
            $query->addState(self::STATE_INCLUDES_TOPSELLER_TABLE);
        }

        $key = ':sales' . md5(json_encode($condition, JSON_THROW_ON_ERROR));
        $query->andWhere('topSeller.sales >= ' . $key);

        $query->setParameter($key$condition->getMinSales());
    }
}
public function handlePostFilter(
        CriteriaPartInterface $criteriaPart,
        Criteria $criteria,
        Search $search,
        ShopContextInterface $context
    ) {
        $search->addPostFilter($this->getQuery($criteriaPart));
    }

    private function getQuery(SalesCondition $criteriaPart): RangeQuery
    {
        return new RangeQuery('sales', ['gt' => $criteriaPart->getMinSales()]);
    }
}
Home | Imprint | This part of the site doesn't use cookies.