public function loadStoreCategories() { if ($this->getConfiguration('EBAY_PROFILE_STORE_CAT') || !$this->getToken() || $this->getToken() == null) { return; } $ebay_store_categories = EbayStoreCategory::getStoreCategories($this->id); if (count($ebay_store_categories['compatible']) == 0) { $ebay = new EbayRequest(); EbayStoreCategory::updateStoreCategoryTable($ebay->getStoreCategories(), $this); } $this->setConfiguration('EBAY_PROFILE_STORE_CAT', 1); }
/** * Main Form Method * */ public function getContent() { if ($this->ebay_profile && !Configuration::get('EBAY_CATEGORY_MULTI_SKU_UPDATE')) { $ebay = new EbayRequest(); EbayCategory::updateCategoryTable($ebay->getCategoriesSkuCompliancy()); } if (Tools::getValue('refresh_store_cat')) { $ebay = new EbayRequest(); EbayStoreCategory::updateStoreCategoryTable($ebay->getStoreCategories(), $this->ebay_profile); } if ($this->ebay_profile) { $this->ebay_profile->loadStoreCategories(); } // Checking Extension if (!extension_loaded('curl') || !ini_get('allow_url_fopen')) { if (!extension_loaded('curl') && !ini_get('allow_url_fopen')) { return $this->html . $this->displayError($this->l('You must enable cURL extension and allow_url_fopen option on your server if you want to use this module.')); } elseif (!extension_loaded('curl')) { return $this->html . $this->displayError($this->l('You must enable cURL extension on your server if you want to use this module.')); } elseif (!ini_get('allow_url_fopen')) { return $this->html . $this->displayError($this->l('You must enable allow_url_fopen option on your server if you want to use this module.')); } } // If isset Post Var, post process else display form if (!empty($_POST) && (Tools::isSubmit('submitSave') || Tools::isSubmit('btnSubmitSyncAndPublish') || Tools::isSubmit('btnSubmitSync'))) { $errors = $this->_postValidation(); if (!count($errors)) { $this->_postProcess(); } else { foreach ($errors as $error) { $this->html .= '<div class="alert error"><img src="../modules/ebay/views/img/forbbiden.gif" alt="nok" /> ' . $error . '</div>'; } } if (Configuration::get('EBAY_SEND_STATS')) { $ebay_stat = new EbayStat($this->stats_version, $this->ebay_profile); $ebay_stat->save(); } } $this->html .= $this->_displayForm(); // Set old Context Shop /* RAPH if (version_compare(_PS_VERSION_, '1.5', '>') && Shop::isFeatureActive()) $this->_setContextShop($old_context_shop); */ return $this->html; }