Example #1
0
 private function _postProcessEbaySync()
 {
     // Update Sync Option
     $this->setConfiguration('EBAY_SYNC_OPTION_RESYNC', Tools::getValue('ebay_sync_option_resync') == 1 ? 1 : 0);
     // Empty error result
     $this->setConfiguration('EBAY_SYNC_LAST_PRODUCT', 0);
     if (file_exists(dirname(__FILE__) . '/log/syncError.php')) {
         @unlink(dirname(__FILE__) . '/log/syncError.php');
     }
     $this->setConfiguration('EBAY_SYNC_MODE', Tools::safeOutput(Tools::getValue('ebay_sync_mode')));
     if (Tools::getValue('ebay_sync_products_mode') == 'A') {
         $this->setConfiguration('EBAY_SYNC_PRODUCTS_MODE', 'A');
     } else {
         $this->setConfiguration('EBAY_SYNC_PRODUCTS_MODE', 'B');
         // Select the sync Categories and Retrieve product list for eBay (which have matched and sync categories)
         if (Tools::getValue('category')) {
             EbayCategoryConfiguration::updateAll(array('sync' => 0));
             foreach (Tools::getValue('category') as $id_category) {
                 EbayCategoryConfiguration::updateByIdCategory($id_category, array('sync' => 1));
             }
         }
     }
 }