[*] BO : Added the number of associated products in the product attachments list
This commit is contained in:
@@ -39,6 +39,9 @@ class AdminAttachmentsControllerCore extends AdminController
|
||||
$this->addRowAction('edit');
|
||||
$this->addRowAction('delete');
|
||||
|
||||
$this->_select = 'IFNULL(virtual.products, 0) as products';
|
||||
$this->_join = 'LEFT JOIN (SELECT id_attachment, COUNT(*) as products FROM '._DB_PREFIX_.'product_attachment GROUP BY id_attachment) virtual ON a.id_attachment = virtual.id_attachment';
|
||||
|
||||
$this->fields_list = array(
|
||||
'id_attachment' => array(
|
||||
'title' => $this->l('ID'),
|
||||
@@ -50,7 +53,12 @@ class AdminAttachmentsControllerCore extends AdminController
|
||||
),
|
||||
'file' => array(
|
||||
'title' => $this->l('File')
|
||||
)
|
||||
),
|
||||
'products' => array(
|
||||
'title' => $this->l('Associated to'),
|
||||
'suffix' => $this->l('product(s)'),
|
||||
'filter_key' => 'virtual!products',
|
||||
),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
|
||||
@@ -29,7 +29,7 @@ define ('TEXTAREA_SIZED', 70);
|
||||
class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
/** Name of theme by default */
|
||||
const DEFAULT_THEME_NAME = 'default';
|
||||
const DEFAULT_THEME_NAME = 'default-bootstrap';
|
||||
|
||||
/** @var string : Link which list all pack of language */
|
||||
protected $link_lang_pack = 'http://www.prestashop.com/download/lang_packs/get_each_language_pack.php';
|
||||
|
||||
@@ -47,7 +47,7 @@ if (!defined('__PS_BASE_URI__'))
|
||||
define('__PS_BASE_URI__', substr($_SERVER['REQUEST_URI'], 0, -1 * (strlen($_SERVER['REQUEST_URI']) - strrpos($_SERVER['REQUEST_URI'], '/')) - strlen(substr(dirname($_SERVER['REQUEST_URI']), strrpos(dirname($_SERVER['REQUEST_URI']), '/') + 1))));
|
||||
|
||||
if (!defined('_THEME_NAME_'))
|
||||
define('_THEME_NAME_', 'default');
|
||||
define('_THEME_NAME_', 'default-bootstrap');
|
||||
|
||||
require_once(dirname(_PS_INSTALL_PATH_).'/config/defines.inc.php');
|
||||
require_once(dirname(_PS_INSTALL_PATH_).'/config/defines_uri.inc.php');
|
||||
|
||||
Reference in New Issue
Block a user