Observer/Catalog/RemoveProduct.php
protected function deleteFromAccount($key)
    {
        $apiEnabled = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_API_ENABLED
        );
        $catalogEnabled = $this->helper->isCatalogSyncEnabled();
        if ($apiEnabled && $catalogEnabled) {
            $scope = $this->scopeConfig->getValue(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_CATALOG_VALUES
            );
            if ($scope == 1) {
                //register in queue with importer
                $this->importerFactory->create()
                    ->registerQueue(
                        'Catalog_Default',
                        [$key],
                        \Dotdigitalgroup\Email\Model\Importer::MODE_SINGLE_DELETE,
                        \Magento\Store\Model\Store::DEFAULT_STORE_ID
                    );
            }
            if ($scope == 2) {
                $stores = $this->storeManager->getStores();
                foreach ($stores as $store) {
                    $websiteCode = $store->getWebsite()->getCode();
                    $storeCode = $store->getCode();

                    //register in queue with importer
                    $this->importerFactory->create()
                        ->registerQueue(
                            'Catalog_' . $websiteCode . '_' . $storeCode,
                            [$key],
                            \Dotdigitalgroup\Email\Model\Importer::MODE_SINGLE_DELETE,
                            $store->getWebsite()->getId()
                        );
                }
            }
        }
    }
protected function deleteFromAccount($key)
    {
        $apiEnabled = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_API_ENABLED
        );
        $catalogEnabled = $this->helper->isCatalogSyncEnabled();
        if ($apiEnabled && $catalogEnabled) {
            $scope = $this->scopeConfig->getValue(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_CATALOG_VALUES
            );
            if ($scope == 1) {
                //register in queue with importer
                $this->importerFactory->create()
                    ->registerQueue(
                        'Catalog_Default',
                        [$key],
                        \Dotdigitalgroup\Email\Model\Importer::MODE_SINGLE_DELETE,
                        \Magento\Store\Model\Store::DEFAULT_STORE_ID
                    );
            }
            if ($scope == 2) {
                $stores = $this->storeManager->getStores();
                foreach ($stores as $store) {
                    $websiteCode = $store->getWebsite()->getCode();
                    $storeCode = $store->getCode();

                    //register in queue with importer
                    $this->importerFactory->create()
                        ->registerQueue(
                            'Catalog_' . $websiteCode . '_' . $storeCode,
                            [$key],
                            \Dotdigitalgroup\Email\Model\Importer::MODE_SINGLE_DELETE,
                            $store->getWebsite()->getId()
                        );
                }
            }
        }
    }
protected function deleteFromAccount ( $ key ) { $ apiEnabled = $ this -> scopeConfig -> getValue ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_API_ENABLED ) ; $ catalogEnabled = $ this -> helper -> isCatalogSyncEnabled ( ) ; if ( $ apiEnabled && $ catalogEnabled ) { $ scope = $ this -> scopeConfig -> getValue ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_SYNC_CATALOG_VALUES ) ; if ( $ scope == 1 ) { //register in queue with importer $ this -> importerFactory -> create ( ) -> registerQueue ( 'Catalog_Default' , [ $ key ] , \ Dotdigitalgroup \ Email \ Model \ Importer :: MODE_SINGLE_DELETE , \ Magento \ Store \ Model \ Store :: DEFAULT_STORE_ID ) ; } if ( $ scope == 2 ) { $ stores = $ this -> storeManager -> getStores ( ) ; foreach ( $ stores as $ store ) { $ websiteCode = $ store -> getWebsite ( ) -> getCode ( ) ; $ storeCode = $ store -> getCode ( ) ; //register in queue with importer $ this -> importerFactory -> create ( ) -> registerQueue ( 'Catalog_' . $ websiteCode . '_' . $ storeCode , [ $ key ] , \ Dotdigitalgroup \ Email \ Model \ Importer :: MODE_SINGLE_DELETE , $ store -> getWebsite ( ) -> getId ( ) ) ; } } } }
Delete piece of transactional data by key.

@param int $key

@return null
Delete piece of transactional data by key .