Model/Sync/Wishlist.php
public function sync()
    {
        $response = ['success' => true, 'message' => 'Done.'];
        $websites = $this->helper->getWebsites();
        foreach ($websites as $website) {
            $wishlistEnabled = $this->helper->getWebsiteConfig(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_WISHLIST_ENABLED,
                $website
            );
            $apiEnabled      = $this->helper->isEnabled($website);
            $storeIds        = $website->getStoreIds();

            if ($wishlistEnabled && $apiEnabled && ! empty($storeIds)) {
                //using bulk api
                $this->start = microtime(true);
                $this->exportWishlistForWebsite($website);
                //send wishlist as transactional data
                if (isset($this->wishlists[$website->getId()])) {
                    $websiteWishlists = $this->wishlists[$website->getId()];
                    //register in queue with importer
                    $this->importerFactory->create()
                                          ->registerQueue(
                                              Importer::IMPORT_TYPE_WISHLIST,
                                              $websiteWishlists,
                                              Importer::MODE_BULK,
                                              $website->getId()
                                          );
                    //mark connector wishlist as  imported
                    $this->setImported($this->wishlistIds);
                }
                if (! empty($this->wishlists)) {
                    $message = '----------- Wishlist bulk sync ----------- : ' .
                               gmdate('H:i:s', microtime(true) - $this->start) .
                               ', Total synced = ' . $this->countWishlists;

                    $this->helper->log($message);
                }

                //using single api
                $this->exportWishlistForWebsiteInSingle($website);
            }
        }
        $response['message'] = 'wishlists updated: ' . $this->countWishlists;

        return $response;
    }
public function sync()
    {
        $response = ['success' => true, 'message' => 'Done.'];
        $websites = $this->helper->getWebsites();
        foreach ($websites as $website) {
            $wishlistEnabled = $this->helper->getWebsiteConfig(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_WISHLIST_ENABLED,
                $website
            );
            $apiEnabled      = $this->helper->isEnabled($website);
            $storeIds        = $website->getStoreIds();

            if ($wishlistEnabled && $apiEnabled && ! empty($storeIds)) {
                //using bulk api
                $this->start = microtime(true);
                $this->exportWishlistForWebsite($website);
                //send wishlist as transactional data
                if (isset($this->wishlists[$website->getId()])) {
                    $websiteWishlists = $this->wishlists[$website->getId()];
                    //register in queue with importer
                    $this->importerFactory->create()
                                          ->registerQueue(
                                              Importer::IMPORT_TYPE_WISHLIST,
                                              $websiteWishlists,
                                              Importer::MODE_BULK,
                                              $website->getId()
                                          );
                    //mark connector wishlist as  imported
                    $this->setImported($this->wishlistIds);
                }
                if (! empty($this->wishlists)) {
                    $message = '----------- Wishlist bulk sync ----------- : ' .
                               gmdate('H:i:s', microtime(true) - $this->start) .
                               ', Total synced = ' . $this->countWishlists;

                    $this->helper->log($message);
                }

                //using single api
                $this->exportWishlistForWebsiteInSingle($website);
            }
        }
        $response['message'] = 'wishlists updated: ' . $this->countWishlists;

        return $response;
    }
public function sync ( ) { $ response = [ 'success' => true , 'message' => 'Done.' ] ; $ websites = $ this -> helper -> getWebsites ( ) ; foreach ( $ websites as $ website ) { $ wishlistEnabled = $ this -> helper -> getWebsiteConfig ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_SYNC_WISHLIST_ENABLED , $ website ) ; $ apiEnabled = $ this -> helper -> isEnabled ( $ website ) ; $ storeIds = $ website -> getStoreIds ( ) ; if ( $ wishlistEnabled && $ apiEnabled && ! empty ( $ storeIds ) ) { //using bulk api $ this -> start = microtime ( true ) ; $ this -> exportWishlistForWebsite ( $ website ) ; //send wishlist as transactional data if ( isset ( $ this -> wishlists [ $ website -> getId ( ) ] ) ) { $ websiteWishlists = $ this -> wishlists [ $ website -> getId ( ) ] ; //register in queue with importer $ this -> importerFactory -> create ( ) -> registerQueue ( Importer :: IMPORT_TYPE_WISHLIST , $ websiteWishlists , Importer :: MODE_BULK , $ website -> getId ( ) ) ; //mark connector wishlist as  imported $ this -> setImported ( $ this -> wishlistIds ) ; } if ( ! empty ( $ this -> wishlists ) ) { $ message = '----------- Wishlist bulk sync ----------- : ' . gmdate ( 'H:i:s' , microtime ( true ) - $ this -> start ) . ', Total synced = ' . $ this -> countWishlists ; $ this -> helper -> log ( $ message ) ; } //using single api $ this -> exportWishlistForWebsiteInSingle ( $ website ) ; } } $ response [ 'message' ] = 'wishlists updated: ' . $ this -> countWishlists ; return $ response ; }
Sync Wishlists.

@return array
Sync Wishlists .