Esempio n. 1
0
/*
* 2011-2013 LeoTheme
*
*/
// get number of category
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
include_once dirname(__FILE__) . '/leocustomajax.php';
//process category
$listCat = Tools::getValue("cat_list");
$leoProInfo = Tools::getValue("pro_info");
$leoProAdd = Tools::getValue("pro_add");
$leoProCdown = Tools::getValue("pro_cdown");
$leoProColor = Tools::getValue("pro_color");
$result = array();
$leoProductInfo = new Leocustomajax();
if ($listCat) {
    $listCat = explode(",", $listCat);
    $listCat = array_unique($listCat);
    $listCat = implode(",", $listCat);
    $sql = 'SELECT COUNT(cp.`id_product`) AS total, cp.`id_category`
					FROM `' . _DB_PREFIX_ . 'product` p
					' . Shop::addSqlAssociation('product', 'p') . '
					LEFT JOIN `' . _DB_PREFIX_ . 'category_product` cp ON p.`id_product` = cp.`id_product`
					WHERE cp.`id_category` IN (' . $listCat . ')' . ' AND product_shop.`visibility` IN ("both", "catalog")' . ' AND product_shop.`active` = 1' . ' GROUP BY cp.`id_category`';
    $cat = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
    if ($cat) {
        $result["cat"] = $cat;
    }
}
if ($leoProCdown) {
Esempio n. 2
0
 * @author    http://www.leotheme.com
 * @copyright Copyright (C) October 2013 LeoThemes.com <@emai:leotheme@gmail.com>
 *               <*****@*****.**>.All rights reserved.
 * @license   GNU General Public License version 2
 */
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
include_once dirname(__FILE__) . '/leocustomajax.php';
# process category
$listCat = Tools::getValue('cat_list');
$leoProInfo = Tools::getValue('pro_info');
$leoProAdd = Tools::getValue('pro_add');
$leoProCdown = Tools::getValue('pro_cdown');
$leoProColor = Tools::getValue('pro_color');
$result = array();
$leoProductInfo = new Leocustomajax();
if ($listCat) {
    $listCat = explode(',', $listCat);
    $listCat = array_unique($listCat);
    $listCat = implode(',', $listCat);
    $sql = 'SELECT COUNT(cp.`id_product`) AS total, cp.`id_category`
					FROM `' . _DB_PREFIX_ . 'product` p
					' . Shop::addSqlAssociation('product', 'p') . '
					LEFT JOIN `' . _DB_PREFIX_ . 'category_product` cp ON p.`id_product` = cp.`id_product`
					WHERE cp.`id_category` IN (' . $listCat . ')' . ' AND product_shop.`visibility` IN ("both", "catalog")' . ' AND product_shop.`active` = 1' . ' GROUP BY cp.`id_category`';
    $cat = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
    if ($cat) {
        $result['cat'] = $cat;
    }
}
if ($leoProCdown) {
Esempio n. 3
0
 public static function hookLeoModule()
 {
     if (file_exists(_PS_MODULE_DIR_ . 'leosliderlayer/leosliderlayer.php') && Module::isInstalled('leosliderlayer')) {
         require_once _PS_MODULE_DIR_ . 'leosliderlayer/leosliderlayer.php';
         $leo_module = new LeoSliderLayer();
         $leo_module->registerHook('header');
     }
     if (file_exists(_PS_MODULE_DIR_ . 'leoslideshow/leoslideshow.php') && Module::isInstalled('leoslideshow')) {
         require_once _PS_MODULE_DIR_ . 'leoslideshow/leoslideshow.php';
         $leo_module = new LeoSlideshow();
         $leo_module->registerHook('header');
     }
     if (file_exists(_PS_MODULE_DIR_ . 'leobootstrapmenu/leobootstrapmenu.php') && Module::isInstalled('leobootstrapmenu')) {
         require_once _PS_MODULE_DIR_ . 'leobootstrapmenu/leobootstrapmenu.php';
         $leo_module = new Leobootstrapmenu();
         $leo_module->registerHook('header');
     }
     if (file_exists(_PS_MODULE_DIR_ . 'leomenusidebar/leomenusidebar.php') && Module::isInstalled('leomenusidebar')) {
         require_once _PS_MODULE_DIR_ . 'leomenusidebar/leomenusidebar.php';
         $leo_module = new Leomenusidebar();
         $leo_module->registerHook('header');
     }
     if (file_exists(_PS_MODULE_DIR_ . 'leocustomajax/leocustomajax.php') && Module::isInstalled('leocustomajax')) {
         require_once _PS_MODULE_DIR_ . 'leocustomajax/leocustomajax.php';
         $leo_module = new Leocustomajax();
         $leo_module->registerHook('header');
     }
     if (file_exists(_PS_MODULE_DIR_ . 'leoblog/leoblog.php') && Module::isInstalled('leoblog')) {
         require_once _PS_MODULE_DIR_ . 'leoblog/leoblog.php';
         $leo_module = new Leoblog();
         $leo_module->registerHook('header');
     }
     if (file_exists(_PS_MODULE_DIR_ . 'leomanagewidgets/leomanagewidgets.php') && Module::isInstalled('leomanagewidgets')) {
         require_once _PS_MODULE_DIR_ . 'leomanagewidgets/leomanagewidgets.php';
         $leo_module = new LeoManagewidgets();
         $leo_module->registerHook('header');
     }
 }