forked from oavea/exportproducts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexportproducts.php
58 lines (50 loc) · 1.57 KB
/
exportproducts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Export Products
* @category export
*
* @author Oavea - Oavea.com
* @copyright Oavea / PrestaShop
* @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0
* @version 2.4.0
*/
class ExportProducts extends Module
{
public function __construct()
{
$this->name = 'exportproducts';
$this->tab = 'administration';
$this->version = '2.4.0';
$this->displayName = 'Export Products';
$this->author = 'Oavea - oavea.com';
$this->description = $this->l('A module to export all products to csv matching the Prestashop import template.');
parent::__construct();
}
public function install()
{
$this->installController('AdminExportProducts', 'Export Products');
return parent::install();
}
private function installController($controllerName, $name) {
$tab_admin_order_id = Tab::getIdFromClassName('AdminTools');
$tab = new Tab();
$tab->class_name = $controllerName;
$tab->id_parent = $tab_admin_order_id;
$tab->module = $this->name;
$languages = Language::getLanguages(false);
foreach($languages as $lang){
$tab->name[$lang['id_lang']] = $name;
}
$tab->save();
}
public function uninstall()
{
$this->uninstallController('AdminExportProducts');
return parent::uninstall();
}
public function uninstallController($controllerName) {
$tab_controller_main_id = TabCore::getIdFromClassName($controllerName);
$tab_controller_main = new Tab($tab_controller_main_id);
$tab_controller_main->delete();
}
}