示例#1
0
 public function __construct()
 {
     if (!$this->_debug_mode) {
         $this->bench = false;
     }
     $this->_addToFBLog("Start");
     $this->name = 'pm_advancedsearch4';
     if (version_compare(_PS_VERSION_, '1.4.0.0', '<')) {
         $this->tab = 'Presta Module';
     } else {
         $this->author = 'Presta-Module';
         $this->tab = 'search_filter';
         $this->need_instance = 0;
         $this->module_key = 'e0578dd1826016f7acb8045ad15372b4';
     }
     $this->version = '4.10.19';
     $this->controllers = array('advancedsearch4');
     parent::__construct();
     $this->criteriaGroupLabels = array('category' => $this->l('category'), 'feature' => $this->l('feature'), 'attribute' => $this->l('attribute'), 'supplier' => $this->l('supplier'), 'manufacturer' => $this->l('manufacturer'), 'price' => $this->l('price'), 'weight' => $this->l('product properties'), 'on_sale' => $this->l('product properties'), 'stock' => $this->l('product properties'), 'available_for_order' => $this->l('product properties'), 'online_only' => $this->l('product properties'), 'condition' => $this->l('product properties'), 'width' => $this->l('product properties'), 'height' => $this->l('product properties'), 'depth' => $this->l('product properties'), 'pack' => $this->l('product properties'));
     $this->criteria_group_type_interal_name = array(1 => 'select', 3 => 'link', 4 => 'checkbox', 5 => 'slider', 6 => 'searchbox', 2 => 'image', 7 => 'colorsquare');
     if (file_exists(dirname(__FILE__) . '/../magiczoomplus/magiczoomplus.php') && self::moduleIsInstalled('magiczoomplus')) {
         include_once _PS_ROOT_DIR_ . '/modules/magiczoomplus/magiczoomplus.php';
         if (method_exists('magiczoomplus', 'hookHeader') && method_exists('magiczoomplus', 'parseTemplateStandard')) {
             $this->MagicZoomInstance = new MagicZoomPlus();
         } else {
             $this->MagicZoomInstance = false;
         }
     } elseif (file_exists(dirname(__FILE__) . '/../magiczoom/magiczoom.php') && self::moduleIsInstalled('magiczoom')) {
         include_once _PS_ROOT_DIR_ . '/modules/magiczoom/magiczoom.php';
         if (method_exists('magiczoom', 'hookHeader') && method_exists('magiczoom', 'parseTemplateStandard')) {
             $this->MagicZoomInstance = new MagicZoom();
         } else {
             $this->MagicZoomInstance = false;
         }
     }
     if (file_exists(dirname(__FILE__) . '/../productlinksnc/productlinksnc.php') && self::moduleIsInstalled('productlinksnc')) {
         $this->productLinksNCIsInstalled = true;
     }
     if ($this->_onBackOffice()) {
         $this->displayName = $this->l('Advanced Search 4');
         $this->description = $this->l('Multi-layered search engine and search by steps');
         $this->options_remind_selection = array(0 => $this->l('Don\'t show selection'), 1 => $this->l('Show selection over product\'s results'), 2 => $this->l('Show selection on search block'), 3 => $this->l('Show selection over product\'s results and on search block'));
         $this->options_show_hide_crit_method = array(1 => $this->l('On mouse over'), 2 => $this->l('On click'), 3 => $this->l('In an overflow block'));
         $this->options_launch_search_method = array(1 => $this->l('Instant search'), 2 => $this->l('Search on submit'));
         $this->options_defaut_order_by = array(0 => $this->l('Product name'), 1 => $this->l('Product price'), 2 => $this->l('Product added date') . ' (' . $this->l('Recommended for heavy catalog') . ')', 4 => $this->l('Position inside category'), 5 => $this->l('Manufacturer'), 3 => $this->l('Product modified date') . ' (' . $this->l('Recommended for heavy catalog') . ')');
         $this->options_defaut_order_way = array(0 => $this->l('Ascending'), 1 => $this->l('Descending'));
         $this->options_criteria_group_type = array(1 => $this->l('Selectbox'), 3 => $this->l('Link'), 4 => $this->l('Checkbox'), 5 => $this->l('Slider'), 2 => $this->l('Image'));
         $this->_htFile = dirname(__FILE__) . '/../../.htaccess';
         $doc_url_tab['fr'] = 'http://www.presta-module.com/docs/fr/advancedsearch4/';
         $doc_url_tab['en'] = 'http://www.presta-module.com/docs/en/advancedsearch4/';
         $doc_url = $doc_url_tab['en'];
         if ($this->_iso_lang == 'fr') {
             $doc_url = $doc_url_tab['fr'];
         }
         $forum_url_tab['fr'] = 'http://www.prestashop.com/forums/topic/113804-module-pm-advanced-search-4-elu-meilleur-module-2012/';
         $forum_url_tab['en'] = 'http://www.prestashop.com/forums/topic/113831-module-pm-advancedsearch-4-winner-at-the-best-module-awards-2012/';
         $forum_url = $forum_url_tab['en'];
         if ($this->_iso_lang == 'fr') {
             $forum_url = $forum_url_tab['fr'];
         }
         $this->_support_link = array(array('link' => $forum_url, 'target' => '_blank', 'label' => $this->l('Forum topic')), array('link' => 'http://addons.prestashop.com/contact-community.php?id_product=2778', 'target' => '_blank', 'label' => $this->l('Support contact')));
         if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
             $this->display_horizontal_search_block = array('-1');
             foreach (array('displayHome', 'displayTop') as $hookName) {
                 if (Hook::getIdByName($hookName) !== false) {
                     $this->display_horizontal_search_block[] = Hook::getIdByName($hookName);
                 }
             }
         }
     }
 }