public function delete($sOXID = null)
    {
        if (!$sOXID) {
            $sOXID = $this->getId();
        }
        if (!$sOXID) {
            return false;
        }

        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $database->startTransaction();
        try {
            // #2339 delete first variants before deleting parent product
            $this->_deleteVariantRecords($sOXID);
            $this->load($sOXID);
            $this->_deletePics();
            $this->_onChangeResetCounts($sOXID, $this->oxarticles__oxvendorid->value, $this->oxarticles__oxmanufacturerid->value);

            // delete self
            $deleted = parent::delete($sOXID);

            $this->_deleteRecords($sOXID);

            Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderArticle::class)->onDeleteArticle($this);

            $this->onChange(ACTION_DELETE, $sOXID, $this->oxarticles__oxparentid->value);

            $database->commitTransaction();
        } catch (Exception $exception) {
            $database->rollbackTransaction();

            throw $exception;
        }

        return $deleted;
    }