* @copyright 2007-2012 PrestaShop SA
* @version Release: $Revision: 14006 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class ProblemyKuzeControllerCore extends FrontController
{
public $php_self = 'problemy-kuze.php';
public function canonicalRedirection()
{
if (Validate::isLoadedObject($this->manufacturer) && Configuration::get('PS_CANONICAL_REDIRECT') && strtoupper($_SERVER['REQUEST_METHOD']) == 'GET')
{
$canonicalURL = self::$link->getManufacturerLink($this->manufacturer);
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
{
header('HTTP/1.0 301 Moved');
header('Cache-Control: no-cache');
if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_)
die('[Debug] This page has moved
Please use the following URL instead: '.$canonicalURL.'');
Tools::redirectLink($canonicalURL);
}
}
}
public function preProcess()
{
parent::preProcess();
}
public function process()
{
// Id jazyku
// $id_lang = (int)($params['cookie']->id_lang);
$id_lang = 6;
// Nacteni kategorii
$categories = CategoryCore::getCategories($id_lang);
$data = array();
// Pruchod kategoriemi z vetve s id 27 ( Problemy kuze ) a nacteni poctu produktu v nich
foreach($categories[27] as $id => $category) {
foreach($categories[$id] as $subid => $subcategory) {
$categoryObject = new CategoryCore($subid, $id_lang);
$data[$category['infos']['name']][$subid] = array( "category" => $subcategory['infos'], "product_count" => $categoryObject->getProducts(null, null, null, NULL, NULL, true));
unset($categoryObject);
}
}
self::$smarty->assign(array(
'letters' => $data
));
}
public function displayContent()
{
self::$smarty->display(_PS_THEME_DIR_.'problemy-kuze.tpl');
}
}