This repository has been archived by the owner on Apr 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPlugin.php
141 lines (125 loc) · 6.14 KB
/
Plugin.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php namespace BizMark\Shopahelper;
use Backend;
use System\Classes\PluginBase;
/**
* Shopahelper Plugin Information File
*/
class Plugin extends PluginBase
{
/** @var array Plugin dependencies */
public $require = ['Lovata.Shopaholic'];
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'Shopahelper',
'description' => 'The almighty helper in bulk actions for Shopaholic',
'author' => 'BizMark',
'icon' => 'icon-leaf'
];
}
/**
* Register method, called when the plugin is first registered.
*
* @return void
*/
public function register()
{
// Caching
$this->registerConsoleCommand('shopahelper:cache.all', 'BizMark\Shopahelper\Console\Cache\GenerateCache');
$this->registerConsoleCommand('shopahelper:cache.categories', 'BizMark\Shopahelper\Console\Cache\GenerateCategoriesCache');
$this->registerConsoleCommand('shopahelper:cache.products', 'BizMark\Shopahelper\Console\Cache\GenerateProductsCache');
$this->registerConsoleCommand('shopahelper:cache.offers', 'BizMark\Shopahelper\Console\Cache\GenerateOffersCache');
$this->registerConsoleCommand('shopahelper:cache.brands', 'BizMark\Shopahelper\Console\Cache\GenerateBrandsCache');
$this->registerConsoleCommand('shopahelper:cache.measure', 'BizMark\ShopaHelper\Console\Cache\GenerateMeasureCache');
$this->registerConsoleCommand('shopahelper:cache.properties', 'BizMark\ShopaHelper\Console\Cache\GeneratePropertyCache');
$this->registerConsoleCommand('shopahelper:cache.propertysets', 'BizMark\ShopaHelper\Console\Cache\GeneratePropertySetCache');
$this->registerConsoleCommand('shopahelper:cache.propertyvalues', 'BizMark\ShopaHelper\Console\Cache\GeneratePropertyValueCache');
// Linkers
//// Brands
$this->registerConsoleCommand('shopahelper:link.brand-to-products', 'BizMark\Shopahelper\Console\Linkers\BrandToProducts');
$this->registerConsoleCommand('shopahelper:link.brand-to-products-by-category', 'BizMark\Shopahelper\Console\Linkers\BrandToProductsByCategory');
//// Categories
$this->registerConsoleCommand('shopahelper:link.category-to-products', 'BizMark\Shopahelper\Console\Linkers\CategoryToProducts');
$this->registerConsoleCommand('shopahelper:link.category-to-products-by-category', 'BizMark\Shopahelper\Console\Linkers\CategoryToProductsByCategory');
//// Additional categories
$this->registerConsoleCommand('shopahelper:link.add-categories-to-products', 'BizMark\Shopahelper\Console\Linkers\AddCategoriesToProducts');
$this->registerConsoleCommand('shopahelper:link.add-category-to-products-by-add-category', 'BizMark\Shopahelper\Console\Linkers\AddCategoryToProductsByAddCategory');
$this->registerConsoleCommand('shopahelper:link.add-category-to-products-by-category', 'BizMark\Shopahelper\Console\Linkers\AddCategoryToProductsByCategory');
//// Products
$this->registerConsoleCommand('shopahelper:link.products-to-brand-by-product-name', 'BizMark\Shopahelper\Console\Linkers\ProductsToBrandByProductName');
// Detachers
//// Additional categories
$this->registerConsoleCommand('shopahelper:detach.add-category-from-products', 'BizMark\Shopahelper\Console\Detachers\AddCategoryToProducts');
// Prices
$this->registerConsoleCommand('shopahelper:price.upscale-by-percentage', 'BizMark\Shopahelper\Console\Prices\UpscalePriceByPercentage');
$this->registerConsoleCommand('shopahelper:price.downscale-by-percentage', 'BizMark\Shopahelper\Console\Prices\DownscalePriceByPercentage');
//// By Brand
$this->registerConsoleCommand('shopahelper:price.upscale-by-percentage-by-brand', 'BizMark\Shopahelper\Console\Prices\UpscalePriceByPercentageByBrand');
$this->registerConsoleCommand('shopahelper:price.downscale-by-percentage-by-brand', 'BizMark\Shopahelper\Console\Prices\DownscalePriceByPercentageByBrand');
//// By Category
$this->registerConsoleCommand('shopahelper:price.upscale-by-percentage-by-category', 'BizMark\Shopahelper\Console\Prices\UpscalePriceByPercentageByCategory');
$this->registerConsoleCommand('shopahelper:price.downscale-by-percentage-by-category', 'BizMark\Shopahelper\Console\Prices\DownscalePriceByPercentageByCategory');
//// Custom
$this->registerConsoleCommand('shopahelper:price.upscale-by-percentage-custom', 'BizMark\Shopahelper\Console\Prices\UpscalePriceByPercentageCustom');
// Setters
$this->registerConsoleCommand('shopahelper:set.attribute', 'BizMark\Shopahelper\Console\Setters\SetAttribute');
}
/**
* Boot method, called right before the request route.
*
* @return array
*/
public function boot()
{
}
/**
* Registers any front-end components implemented in this plugin.
*
* @return array
*/
public function registerComponents()
{
return []; // Remove this line to activate
return [
'BizMark\Shopahelper\Components\MyComponent' => 'myComponent',
];
}
/**
* Registers any back-end permissions used by this plugin.
*
* @return array
*/
public function registerPermissions()
{
return []; // Remove this line to activate
return [
'bizmark.shopahelper.some_permission' => [
'tab' => 'Shopahelper',
'label' => 'Some permission'
],
];
}
/**
* Registers back-end navigation items for this plugin.
*
* @return array
*/
public function registerNavigation()
{
return []; // Remove this line to activate
return [
'shopahelper' => [
'label' => 'Shopahelper',
'url' => Backend::url('bizmark/shopahelper/mycontroller'),
'icon' => 'icon-leaf',
'permissions' => ['bizmark.shopahelper.*'],
'order' => 500,
],
];
}
}