first commit
This commit is contained in:
39
modules/pk_favorites/controllers/front/account.php
Normal file
39
modules/pk_favorites/controllers/front/account.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Promokit Menu Module
|
||||
*
|
||||
* @package alysum
|
||||
* @version 1.0
|
||||
* @author https://promokit.eu
|
||||
* @copyright Copyright Ⓒ 2018 promokit.eu <@email:support@promokit.eu>
|
||||
* @license GNU General Public License version 2
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class pk_favoritesAccountModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public $ssl = true;
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
require_once($this->module->getLocalPath().'/classes/FavoriteProduct.php');
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (!Context::getContext()->customer->isLogged())
|
||||
Tools::redirect('index.php?controller=authentication&redirect=module&module=pk_favorites&action=account');
|
||||
|
||||
if (Context::getContext()->customer->id)
|
||||
{
|
||||
$this->context->smarty->assign('favoriteProducts', FavoriteProduct::getFavProducts(Context::getContext()->customer->id));
|
||||
$this->setTemplate('module:pk_favorites/views/templates/front/pk_favorites-account.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user