<?php
$loader = $this->registry->get('load');
$loader->controller('product/productList');

class ControllerModuleBestSeller extends ControllerProductProductList {

	public function index($setting=null) {
        $this->language->load('module/bestseller');

        if (isset($setting['hide_title'])) {
            $heading_title = false;
        } else {
            $heading_title = ($this->config->get('bestseller_title')) ? $this->config->get('bestseller_title') : $this->language->get('heading_title');
        }
        
        $this->data['productListTitle'] = array();

        $this->data['productListTitle'] = array(
            'heading_title' => $heading_title,
            'heading_subtitle' => $this->config->get('bestseller_subtitle') ? $this->config->get('bestseller_subtitle') : ''
        );

        $this->productlistitle->setProductListTitle($this->data['productListTitle']);

        $this->data['grid']             = (isset($setting['entry_type'])) ? $setting['entry_type'] : 0;
        
        $this->childrenData = array(
            'product/productList/moduleBestseller' => $setting
        );

        $this->children = array(
            'common/product_list_title',
        );

		$this->render('module/bestseller');
	}

}
