getOrdernumbers example

$this->addCondition($condition$query);
    }

    private function addCondition(OrdernumberCondition $condition, QueryBuilder $query): void
    {
        $key = ':ordernumbers' . md5(json_encode($condition, JSON_THROW_ON_ERROR));

        $query->andWhere('variant.ordernumber IN (' . $key . ')');

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

    private function getQuery(OrdernumberCondition $criteriaPart): TermsQuery
    {
        return new TermsQuery('number.raw', $criteriaPart->getOrdernumbers());
    }
}
Home | Imprint | This part of the site doesn't use cookies.