$ids =
[];
foreach ($cartItems as $cartItem) { $ids[] =
$cartItem->
getId();
} $defaultPriceGroup = 'EK';
$queryBuilder =
$this->connection->
createQueryBuilder() ->
select('order_cart.id, product_price.pricegroup, product_price.price, product.taxID, tax.tax,
order_cart.tax_rate, product_detail.id AS articleDetailsID, product_detail.articleID,
order_cart.config, order_cart.ordernumber, product_price.from, product_price.to'
) ->
from('s_order_basket', 'order_cart'
) ->
innerJoin('order_cart', 's_articles_details', 'product_detail', 'order_cart.ordernumber = product_detail.ordernumber'
) ->
innerJoin('product_detail', 's_articles', 'product', 'product.id = product_detail.articleID'
) ->
innerJoin('product_detail', 's_articles_prices', 'product_price', 'product_detail.id = product_price.articledetailsID'
) ->
innerJoin('product', 's_core_tax', 'tax', 'product.taxID = tax.id'
) ->
where('order_cart.id IN (:ids) AND order_cart.sessionID = :sessionId'
) ->
andWhere('product_price.pricegroup = :pricegroup OR product_price.pricegroup = :defaultPriceGroup'
) ->
setParameter('ids',
$ids, Connection::PARAM_INT_ARRAY
) ->
setParameter('sessionId',
$this->session->
get('sessionId'
)) ->
setParameter('pricegroup',
$this->sSYSTEM->sUSERGROUP
) ->
setParameter('defaultPriceGroup',
$defaultPriceGroup);
$this->eventManager->
notify(