function getContent()
 {
     $configs = Configuration::getMultiple(array('EBAY_CATEGORY_LOADED_' . $this->ebay_profile->ebay_site_id, 'EBAY_SECURITY_TOKEN'));
     $ebay_request = new EbayRequest();
     $user_profile = $ebay_request->getUserProfile($this->ebay_profile->ebay_user_identifier);
     $store_categories = EbayStoreCategory::getStoreCategories($this->ebay_profile->id);
     $not_compatible_names = array();
     if ($store_categories['not_compatible']) {
         foreach ($store_categories['not_compatible'] as $cat) {
             $not_compatible_names[] = $cat['name'];
         }
     }
     $template_vars = array('configs' => $configs, '_path' => $this->path, 'controller' => Tools::getValue('controller'), 'configure' => Tools::getValue('configure'), 'token' => Tools::getValue('token'), 'tab_module' => Tools::getValue('tab_module'), 'module_name' => Tools::getValue('module_name'), 'tab' => Tools::getValue('tab'), 'nb_categorie' => count(Category::getCategories($this->context->cookie->id_lang, true, false)), 'has_store_categories' => count($store_categories['compatible']) > 1, 'not_compatible_store_categories' => implode(', ', $not_compatible_names), 'has_ebay_shop' => (bool) ($user_profile && $user_profile['StoreUrl']), 'ebay_store_url' => EbayCountrySpec::getProUrlBySiteId($this->ebay_profile->ebay_site_id));
     return $this->display('form_store_categories.tpl', $template_vars);
 }
Exemplo n.º 2
0
 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);
 }