forked from BantenITSolutions/oc-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
116 lines (104 loc) · 3.55 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
<?php namespace DShoreman\Shop;
use App;
use Backend;
use System\Classes\PluginBase;
use Illuminate\Foundation\AliasLoader;
/**
* Shop Plugin Information File
*/
class Plugin extends PluginBase
{
public function boot()
{
// Register service providers
App::register('\Gloudemans\Shoppingcart\ShoppingcartServiceProvider');
// Register facades
$facade = AliasLoader::getInstance();
$facade->alias('Cart', '\Gloudemans\Shoppingcart\Facades\Cart');
}
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'Shop',
'description' => 'No description provided yet...',
'author' => 'Dave Shoreman',
'icon' => 'icon-shopping-cart'
];
}
public function registerComponents()
{
return [
'DShoreman\Shop\Components\Basket' => 'shopBasket',
'DShoreman\Shop\Components\Categories' => 'shopCategories',
'DShoreman\Shop\Components\Product' => 'shopProduct',
'DShoreman\Shop\Components\Products' => 'shopProducts',
];
}
public function registerNavigation()
{
return [
'shop' => [
'label' => 'Shop',
'url' => Backend::url('dshoreman/shop/products'),
'icon' => 'icon-shopping-cart',
'permissions' => ['dshoreman.shop.*'],
'order' => 300,
'sideMenu' => [
'products' => [
'label' => 'Products',
'url' => Backend::url('dshoreman/shop/products'),
'icon' => 'icon-gift',
'permissions' => ['dshoreman.shop.access_products']
],
'categories' => [
'label' => 'Categories',
'url' => Backend::url('dshoreman/shop/categories'),
'icon' => 'icon-list-ul',
'permissions' => ['dshoreman.shop.access_categories'],
],
'orders' => [
'label' => 'Orders',
'url' => Backend::url('dshoreman/shop/orders'),
'icon' => 'icon-gbp',
'permissions' => ['dshoreman.shop.access_orders'],
],
],
],
];
}
public function registerFormWidgets()
{
return [
'Dshoreman\Shop\FormWidgets\ItemGrid' => [
'label' => 'Order Item Grid',
'alias' => 'itemgrid',
],
];
}
public function registerPermissions()
{
return [
'dshoreman.shop.access_products' => ['label' => "Manage the shop's products"],
'dshoreman.shop.access_categories' => ['label' => "Manage the shop categories"],
'dshoreman.shop.access_orders' => ['label' => "Manage the shop orders"],
];
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'Stripe Settings',
'description' => 'Manage your Stripe API keys.',
'category' => 'Shop',
'icon' => 'icon-credit-card',
'class' => 'Dshoreman\Shop\Models\Settings',
'order' => 200,
],
];
}
}