$userId =
$this->session->
offsetGet('sUserId'
);
$sessionId =
$this->session->
offsetGet('sessionId'
);
if (empty($this->sSYSTEM->sUSERGROUPDATA
['tax'
]) && !
empty($this->sSYSTEM->sUSERGROUPDATA
['id'
])) { $amount = 'b.quantity*ROUND(CAST(b.price as DECIMAL(10,2))*(100+t.tax)/100,2)';
$amount_net = 'b.quantity*CAST(b.price as DECIMAL(10,2))';
} else { $amount = 'b.quantity*CAST(b.price as DECIMAL(10,2))';
$amount_net = 'b.quantity*ROUND(CAST(b.price as DECIMAL(10,2))/(100+t.tax)*100,2)';
} $queryBuilder =
$this->
getBasketQueryBuilder($amount,
$amount_net);
$queryBuilder->
setParameters([ 'userId' =>
$userId,
'sessionId' =>
empty($sessionId) ?
session_id() :
$sessionId,
'billingAddressId' =>
$this->
getBillingAddressId(),
'shippingAddressId' =>
$this->
getShippingAddressId(),
]);
foreach ($addSelect as $select) { $queryBuilder->
addSelect($select);
}