/** * Returns part of query for discount check. If product is variant - query contains both id check e.g. * "and (oxobjectid = '...' or oxobjectid = '...') * * @param oxarticle $oProduct product used for discount check * * @return string */ protected function _getProductCheckQuery($oProduct) { $oDb = oxDb::getDb(); // check if this article is assigned if ($sParentId = $oProduct->getParentId()) { $sArticleId = " and ( oxobjectid = " . $oDb->quote($oProduct->getProductId()) . " or oxobjectid = " . $oDb->quote($sParentId) . " )"; } else { $sArticleId = " and oxobjectid = " . $oDb->quote($oProduct->getProductId()); } return $sArticleId; }