예제 #1
0
 private function listAllowed()
 {
     global $smarty;
     if (Module::isInstalled('agilemultipleseller')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         $id_owner = AgileSellerManager::getObjectOwnerID('product', Tools::getValue('id_product'));
         $smarty->assign(array('id_seller' => $id_owner));
         if ($id_owner > 0) {
             if (intval(Configuration::get('AGILE_MS_PRODUCT_APPROVAL')) == 1) {
                 $approved = AgileMultipleSeller::is_list_approved(Tools::getValue('id_product'));
                 if ($approved != 1) {
                     return false;
                 }
             }
             if (Module::isInstalled('agilesellerlistoptions')) {
                 include_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
                 $listoption = AgileSellerListOptions::get_product_list_option(Tools::getValue('id_product'), AgileSellerListOptions::ASLO_OPTION_LIST);
                 $liststatus = intval($listoption['status']);
                 $aslo_list_prod_id = intval(Configuration::get('ASLO_PROD_FOR_OPTION' . AgileSellerListOptions::ASLO_OPTION_LIST));
                 if ($liststatus != AgileSellerListOptions::ASLO_STATUS_IN_EFFECT && $aslo_list_prod_id != AgileSellerListOptions::ASLO_ALWAYS_FREE) {
                     return false;
                 }
             }
         }
     }
     return true;
 }
예제 #2
0
 public function initContent()
 {
     $this->context->smarty->assign(array('agilemultipleseller_isinstalled' => Module::isInstalled('agilemultipleseller') ? 1 : 0, 'agilesellerlistoptions_isinstalled' => Module::isInstalled('agilesellerlistoptions') ? 1 : 0, 'id_first_available_category' => AgileHelper::GetFirstAvailableCategory()));
     if (Module::isInstalled('agilemultipleseller')) {
         require_once _PS_ROOT_DIR_ . '/modules/agilemultipleseller/agilemultipleseller.php';
         require_once _PS_ROOT_DIR_ . '/modules/agilemultipleseller/SellerInfo.php';
         $this->context->smarty->assign(array('agilemultipleseller_hook' => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/views/templates/hook/", 'is_seller' => $this->is_seller, 'id_seller' => AgileSellerManager::getObjectOwnerID($this->table, Tools::getValue('id_' . $this->table)), 'sellers' => $this->is_seller ? null : AgileSellerManager::getSellersNV(true, $this->l('Public in store')), 'approveal_required' => intval(Configuration::get('AGILE_MS_PRODUCT_APPROVAL')), 'approved' => AgileMultipleSeller::is_list_approved(intval(Tools::getValue('id_product'))), 'ajx_category_url' => AgileMultipleSeller::get_agile_ajax_categories_url()));
     }
     if (Module::isInstalled('agilesellerlistoptions')) {
         require_once _PS_ROOT_DIR_ . '/modules/agilesellerlistoptions/agilesellerlistoptions.php';
         $aslo_module = new AgileSellerListOptions();
         $this->context->smarty->assign(array('agilesellerlistoptions_hook' => _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/views/templates/hook/", 'HOOK_PRODYCT_LIST_OPTIONS' => $aslo_module->hookAgileAdminProductsFormTop(array('for_front' => 0, 'id_product' => Tools::getValue('id_' . $this->table)), $this->is_seller)));
     }
     parent::initContent();
 }