public function processData() { if (Module::isInstalled('agilemultipleshop') && Shop::$id_shop_owner > 0) { if (!Validate::isLoadedObject($this->seller)) { $this->errors[] = Tools::displayError('Seller does not exist'); } elseif (!$this->seller->active) { self::$smarty->assign('seller', $this->seller); } else { $rewrited_url = self::$link->getAgileSellerLink((int) $this->seller->id, $this->getSellerLinkRwrite()); $this->seller_info->description = _PS_VERSION_ > '1.5' ? Tools::nl2br($this->seller_info->description) : nl2br2($this->seller_info->description); self::$smarty->assign('seller', $this->seller); self::$smarty->assign('seller_info', $this->seller_info); $sellermodule = new AgileMultipleSeller(); $conf = Configuration::getMultiple($sellermodule->getCustomFields()); $custom_labels = $sellermodule->getCustomLabels(); self::$smarty->assign('conf', $conf); self::$smarty->assign('custom_labels', $custom_labels); $nbProducts = $this->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); $this->pagination((int) $nbProducts); self::$smarty->assign('nb_products', (int) $nbProducts); $seller_products = $this->getProducts((int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay); AgileHelper::AssignProductImgs($seller_products); $si_1531_later = version_compare(_PS_VERSION_, '1.5.3.1', ">="); $HOOK_SELLER_RATINGS = ''; if (Module::isInstalled('agilesellerratings')) { require_once _PS_ROOT_DIR_ . "/modules/agilesellerratings/agilesellerratings.php"; $rmodule = new AgileSellerRatings(); $HOOK_SELLER_RATINGS = $rmodule->getAverageRating($this->id_seller, AgileSellerRatings::RATING_TYPE_SELLER); } self::$smarty->assign(array('products' => (isset($seller_products) and $seller_products) ? $seller_products : NULL, 'id_seller' => (int) $this->seller->id, 'path' => $this->seller_info->company, 'agilesellerproducts_tpl' => _PS_ROOT_DIR_ . "/modules/agilesellerproducts/", 'agilemultipleshop_tpl' => _PS_ROOT_DIR_ . "/modules/agilemultipleshop/", 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('category') : 'category'), 'mediumSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('medium') : 'medium'), 'thumbSceneSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('thumb_scene') : 'thumb_scene'), 'homeSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('home') : 'home'), 'HOOK_SELLER_RATINGS' => $HOOK_SELLER_RATINGS, 'page_name' => 'agileseller')); $ver = (int) str_replace(".", "", _PS_VERSION_); if ($ver <= 1430) { } else { if ($ver <= 1451) { if (isset(self::$cookie->id_customer)) { self::$smarty->assign('compareProducts', CompareProduct::getCustomerCompareProducts((int) self::$cookie->id_customer)); } elseif (isset(self::$cookie->id_guest)) { self::$smarty->assign('compareProducts', CompareProduct::getGuestCompareProducts((int) self::$cookie->id_guest)); } } else { if (isset(self::$cookie->id_compare)) { self::$smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) self::$cookie->id_compare)); } } } } self::$smarty->assign(array('allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers())); } }
public function processData() { if (Module::isInstalled('agilemultipleshop') && Shop::$id_shop_owner > 0) { if (!Validate::isLoadedObject($this->seller)) { $this->errors[] = Tools::displayError('Seller does not exist'); } elseif (!$this->seller->active) { self::$smarty->assign('seller', $this->seller); } else { $rewrited_url = self::$link->getAgileSellerLink((int) $this->seller->id, $this->getSellerLinkRwrite()); $this->seller_info->description = _PS_VERSION_ > '1.5' ? Tools::nl2br($this->seller_info->description) : nl2br2($this->seller_info->description); // Setting language and language level $language_level = explode(',', $this->seller_info->language_level); $language = explode(',', $this->seller_info->language); $language_array = array(); for ($x = 0; $x < count($language); $x++) { $language_array[] = $language[$x] . ' - ' . $language_level[$x]; } $this->seller_info->language = $language_array; self::$smarty->assign('seller', $this->seller); self::$smarty->assign('seller_info', $this->seller_info); $imgPath = _PS_ROOT_DIR_ . DS . 'img' . DS . 'as' . DS . $this->seller_info->id_sellerinfo; $licenseImg = _PS_ROOT_DIR_ . DS . 'img' . DS . 'as' . DS . $this->seller_info->id_sellerinfo . '_license'; $images = scandir($imgPath); unset($images[0]); unset($images[1]); $images = array_values($images); @($licenseDir = scandir($licenseImg)); $licenseExist = count($licenseDir) > 2 ? 1 : 0; $this->seller_info->seller_images = $images; $sellermodule = new AgileMultipleSeller(); $conf = Configuration::getMultiple($sellermodule->getCustomFields()); $custom_labels = $sellermodule->getCustomLabels(); self::$smarty->assign('conf', $conf); self::$smarty->assign('custom_labels', $custom_labels); $nbProducts = $this->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); $this->pagination((int) $nbProducts); self::$smarty->assign('nb_products', (int) $nbProducts); $seller_products = $this->getProducts((int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay); AgileHelper::AssignProductImgs($seller_products); $si_1531_later = version_compare(_PS_VERSION_, '1.5.3.1', ">="); $HOOK_SELLER_RATINGS = ''; if (Module::isInstalled('agilesellerratings')) { require_once _PS_ROOT_DIR_ . "/modules/agilesellerratings/agilesellerratings.php"; $rmodule = new AgileSellerRatings(); $HOOK_SELLER_RATINGS = $rmodule->getAverageRating($this->id_seller, AgileSellerRatings::RATING_TYPE_SELLER); } /*foreach($seller_products as $k => $v) { $country = $v['country']; $flagId = Country::getIdByName(1, $country); $seller_products[$k]['img_exist'] = file_exists(_PS_ROOT_DIR_ . DS . 'flag' . DS . 'mini'. DS . $flagId . '.jpg')? 1 : 0; $seller_products[$k]['img_name'] = $flagId . '.jpg'; }*/ foreach ($seller_products as $key => $value) { $seller_id = $value['id_seller']; $flagIds = self::getFlagsId($seller_id); foreach ($flagIds as $k => $flgId) { $seller_products[$key]['img_exist'][$k] = file_exists(_PS_ROOT_DIR_ . DS . 'flag' . DS . 'mini' . DS . $flgId . '.jpg') ? 1 : 0; $seller_products[$key]['img_name'][$k] = $flgId . '.jpg'; } } // die('<pre>' . print_r($seller_products, true)); self::$smarty->assign(array('products' => (isset($seller_products) and $seller_products) ? $seller_products : NULL, 'license_exist' => $licenseExist, 'id_seller' => (int) $this->seller->id, 'path' => $this->seller_info->company, 'agilesellerproducts_tpl' => _PS_ROOT_DIR_ . "/modules/agilesellerproducts/", 'agilemultipleshop_tpl' => _PS_ROOT_DIR_ . "/modules/agilemultipleshop/", 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('category') : 'category'), 'mediumSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('medium') : 'medium'), 'thumbSceneSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('thumb_scene') : 'thumb_scene'), 'homeSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('home') : 'home'), 'HOOK_SELLER_RATINGS' => $HOOK_SELLER_RATINGS, 'page_name' => 'agileseller')); $ver = (int) str_replace(".", "", _PS_VERSION_); if ($ver <= 1430) { } else { if ($ver <= 1451) { if (isset(self::$cookie->id_customer)) { self::$smarty->assign('compareProducts', CompareProduct::getCustomerCompareProducts((int) self::$cookie->id_customer)); } elseif (isset(self::$cookie->id_guest)) { self::$smarty->assign('compareProducts', CompareProduct::getGuestCompareProducts((int) self::$cookie->id_guest)); } } else { if (isset(self::$cookie->id_compare)) { self::$smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) self::$cookie->id_compare)); } } } } self::$smarty->assign(array('allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers())); } }