function getContent()
 {
     $is_one_dot_five = version_compare(_PS_VERSION_, '1.5', '>');
     // Smarty
     $template_vars = array('id_tab' => Tools::getValue('id_tab'), 'controller' => Tools::getValue('controller'), 'tab' => Tools::getValue('tab'), 'configure' => Tools::getValue('configure'), 'tab_module' => Tools::getValue('tab_module'), 'module_name' => Tools::getValue('module_name'), 'token' => Tools::getValue('token'), 'ebay_token' => Configuration::get('EBAY_SECURITY_TOKEN'), '_module_dir_' => _MODULE_DIR_, 'ebay_categories' => EbayCategoryConfiguration::getEbayCategories($this->ebay_profile->id), 'id_lang' => $this->context->cookie->id_lang, 'id_ebay_profile' => $this->ebay_profile->id, '_path' => $this->path, 'possible_attributes' => AttributeGroup::getAttributesGroups($this->context->cookie->id_lang), 'possible_features' => Feature::getFeatures($this->context->cookie->id_lang, true), 'date' => pSQL(date('Ymdhis')), 'conditions' => $this->_translatePSConditions(EbayCategoryConditionConfiguration::getPSConditions()), 'form_items_specifics' => EbaySynchronizer::getNbSynchronizableEbayCategoryCondition(), 'form_items_specifics_mixed' => EbaySynchronizer::getNbSynchronizableEbayCategoryConditionMixed(), 'isOneDotFive' => $is_one_dot_five);
     return $this->display('formItemsSpecifics.tpl', $template_vars);
 }
Example #2
0
 private function _displayFormItemsSpecifics()
 {
     // Smarty
     $template_vars = array('id_tab' => Tools::safeOutput(Tools::getValue('id_tab')), 'controller' => Tools::getValue('controller'), 'tab' => Tools::getValue('tab'), 'configure' => Tools::getValue('configure'), 'tab_module' => Tools::getValue('tab_module'), 'module_name' => Tools::getValue('module_name'), 'token' => Tools::getValue('token'), 'ebay_token' => Configuration::get('EBAY_SECURITY_TOKEN'), '_module_dir_' => _MODULE_DIR_, 'ebay_categories' => EbayCategoryConfiguration::getEbayCategories(), 'id_lang' => $this->context->cookie->id_lang, '_path' => $this->_path, 'possible_attributes' => AttributeGroup::getAttributesGroups($this->context->cookie->id_lang), 'possible_features' => Feature::getFeatures($this->context->cookie->id_lang, true), 'date' => pSQL(date('Ymdhis')), 'conditions' => $this->_translatePSConditions(EbayCategoryConditionConfiguration::getPSConditions()));
     $this->smarty->assign($template_vars);
     return $this->display(dirname(__FILE__), '/views/templates/hook/formItemsSpecifics.tpl');
 }
		FROM `' . _DB_PREFIX_ . 'ebay_product` ep2
		WHERE ep2.`id_product` = ep.`id_product`
		AND ep2.`id_ebay_profile` = ep.`id_ebay_profile`
	)' . '
	WHERE 1' . $ebay->addSqlRestrictionOnLang('pl') . $ebay->addSqlRestrictionOnLang('cl') . $ebay->addSqlRestrictionOnLang('s');
if ($search) {
    $query .= ' AND pl.`name` LIKE \'%' . $search . '%\'';
}
//$query .= ' GROUP BY s.`id_product`';
$queryCount = preg_replace('/SELECT ([a-zA-Z.,` ]+) FROM /', 'SELECT COUNT(*) FROM ', $query);
$nbProducts = Db::getInstance()->getValue($queryCount);
$res = Db::getInstance()->executeS($query . ' ORDER BY p.`id_product` ASC LIMIT ' . $offset . ', ' . $limit);
// categories
$category_list = $ebay->getChildCategories(Category::getCategories($ebay_profile->id_lang, false), version_compare(_PS_VERSION_, '1.5', '>') ? 1 : 0);
// eBay categories
$ebay_categories = EbayCategoryConfiguration::getEbayCategories($ebay_profile->id);
$content = Context::getContext();
$employee = new Employee((int) Tools::getValue('id_employee'));
$context->employee = $employee;
foreach ($res as &$row) {
    if ($row['EbayProductRef']) {
        $row['link'] = EbayProduct::getEbayUrl($row['EbayProductRef'], $ebay_request->getDev());
    }
    foreach ($category_list as $cat) {
        if ($cat['id_category'] == $row['id_category']) {
            $row['category_full_name'] = $cat['name'];
            $row['is_category_active'] = $cat['active'];
            break;
        }
    }
    if ($row['id_category_ref']) {