Skip to content

Commit

Permalink
PRODUDCT-MANAGE helloworld created successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Guan committed Mar 18, 2014
1 parent 00505c4 commit da2cc0b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ps16/controllers/front/ProductsPanelController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
class ProductsPanelControllerCore extends FrontController{

}
61 changes: 59 additions & 2 deletions ps16/override/controllers/front/ProductsPanelController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,61 @@
<?php
class ProductsPanelController extends FrontController{
/*
* 2014-2014 Artxchange
* this is modifyied from AdminProductsController.php
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author Junjie Guan <[email protected]>
* @copyright Artxchange
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of Artxchange
*/

}
Class ProductsPanelControllerCore extends FrontController
{
public function init()
{
$this->page_name = 'allproducts'; // page_name and body id
// $this->display_column_left = false; // hides left column
parent::init();
}

public function setMedia()
{
parent::setMedia();
$this->addCSS(__PS_BASE_URI__.'modules/'.$this->module->name.'/css/'.$this->module->name.'.css');
}

public function initContent()
{
parent::initContent();
echo 'hey there';

$products_count = $this->module->countAllProducts();
$this->pagination($products_count);
// $products_partial = Product::getProducts($this->context->language->id, 0, 5, 'name', 'asc');
$products_partial = Product::getProducts($this->context->language->id, ((int)$this->p - 1) * (int)$this->n, $this->n, 'name', 'asc');
$products = Product::getProductsProperties($this->context->language->id, $products_partial);

$this->context->smarty->assign(array(
'products' => $products,
'homeSize' => Image::getSize('home_default')
));

$this->setTemplate('allproducts.tpl');
}
}

0 comments on commit da2cc0b

Please sign in to comment.