Model/Sync/Order.php
public function searchWebsiteAccounts()
    {
        $websites = $this->helper->getWebsites();
        foreach ($websites as $website) {
            $apiEnabled = $this->helper->isEnabled($website);
            $storeIds = $website->getStoreIds();
            // api and order sync should be enabled, skip website with no store ids
            if ($apiEnabled && $this->helper->getWebsiteConfig(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_ORDER_ENABLED,
                $website
            )
                && !empty($storeIds)
            ) {
                $this->apiUsername = $this->helper->getApiUsername($website);
                $this->apiPassword = $this->helper->getApiPassword($website);
                // limit for orders included to sync
                $limit = $this->helper->getWebsiteConfig(
                    \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT,
                    $website
                );
                //set account for later use
                if (! isset($this->accounts[$this->apiUsername])) {
                    $account = $this->accountFactory->create();
                    $account->setApiUsername($this->apiUsername);
                    $account->setApiPassword($this->apiPassword);
                    $this->accounts[$this->apiUsername] = $account;
                }
                $pendingOrders = $this->getPendingConnectorOrders($website, $limit);
                if (! empty($pendingOrders)) {
                    $this->accounts[$this->apiUsername]->setOrders($pendingOrders);
                }
                $this->accounts[$this->apiUsername]->setWebsites($website->getId());
                $modifiedOrders = $this->getModifiedOrders($website, $limit);
                if (! empty($modifiedOrders)) {
                    $this->accounts[$this->apiUsername]->setOrdersForSingleSync($modifiedOrders);
                }
            }
        }
    }
public function searchWebsiteAccounts()
    {
        $websites = $this->helper->getWebsites();
        foreach ($websites as $website) {
            $apiEnabled = $this->helper->isEnabled($website);
            $storeIds = $website->getStoreIds();
            // api and order sync should be enabled, skip website with no store ids
            if ($apiEnabled && $this->helper->getWebsiteConfig(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_ORDER_ENABLED,
                $website
            )
                && !empty($storeIds)
            ) {
                $this->apiUsername = $this->helper->getApiUsername($website);
                $this->apiPassword = $this->helper->getApiPassword($website);
                // limit for orders included to sync
                $limit = $this->helper->getWebsiteConfig(
                    \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT,
                    $website
                );
                //set account for later use
                if (! isset($this->accounts[$this->apiUsername])) {
                    $account = $this->accountFactory->create();
                    $account->setApiUsername($this->apiUsername);
                    $account->setApiPassword($this->apiPassword);
                    $this->accounts[$this->apiUsername] = $account;
                }
                $pendingOrders = $this->getPendingConnectorOrders($website, $limit);
                if (! empty($pendingOrders)) {
                    $this->accounts[$this->apiUsername]->setOrders($pendingOrders);
                }
                $this->accounts[$this->apiUsername]->setWebsites($website->getId());
                $modifiedOrders = $this->getModifiedOrders($website, $limit);
                if (! empty($modifiedOrders)) {
                    $this->accounts[$this->apiUsername]->setOrdersForSingleSync($modifiedOrders);
                }
            }
        }
    }
public function searchWebsiteAccounts ( ) { $ websites = $ this -> helper -> getWebsites ( ) ; foreach ( $ websites as $ website ) { $ apiEnabled = $ this -> helper -> isEnabled ( $ website ) ; $ storeIds = $ website -> getStoreIds ( ) ; // api and order sync should be enabled, skip website with no store ids if ( $ apiEnabled && $ this -> helper -> getWebsiteConfig ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_SYNC_ORDER_ENABLED , $ website ) && ! empty ( $ storeIds ) ) { $ this -> apiUsername = $ this -> helper -> getApiUsername ( $ website ) ; $ this -> apiPassword = $ this -> helper -> getApiPassword ( $ website ) ; // limit for orders included to sync $ limit = $ this -> helper -> getWebsiteConfig ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT , $ website ) ; //set account for later use if ( ! isset ( $ this -> accounts [ $ this -> apiUsername ] ) ) { $ account = $ this -> accountFactory -> create ( ) ; $ account -> setApiUsername ( $ this -> apiUsername ) ; $ account -> setApiPassword ( $ this -> apiPassword ) ; $ this -> accounts [ $ this -> apiUsername ] = $ account ; } $ pendingOrders = $ this -> getPendingConnectorOrders ( $ website , $ limit ) ; if ( ! empty ( $ pendingOrders ) ) { $ this -> accounts [ $ this -> apiUsername ] -> setOrders ( $ pendingOrders ) ; } $ this -> accounts [ $ this -> apiUsername ] -> setWebsites ( $ website -> getId ( ) ) ; $ modifiedOrders = $ this -> getModifiedOrders ( $ website , $ limit ) ; if ( ! empty ( $ modifiedOrders ) ) { $ this -> accounts [ $ this -> apiUsername ] -> setOrdersForSingleSync ( $ modifiedOrders ) ; } } } }
Search the configuration data per website.

@throws \Magento\Framework\Exception\LocalizedException

@return null
Search the configuration data per website .