1 | <?php |
||
18 | class Main |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Module class instance |
||
23 | * @var \gplcart\core\Module $module |
||
24 | */ |
||
25 | protected $module; |
||
26 | |||
27 | /** |
||
28 | * @param Module $module |
||
29 | */ |
||
30 | public function __construct(Module $module) |
||
34 | |||
35 | /** |
||
36 | * Implements hook "library.list" |
||
37 | * @param array $libraries |
||
38 | */ |
||
39 | public function hookLibraryList(array &$libraries) |
||
52 | |||
53 | /** |
||
54 | * Implements hook "route.list" |
||
55 | * @param array $routes |
||
56 | */ |
||
57 | public function hookRouteList(array &$routes) |
||
76 | |||
77 | /** |
||
78 | * Implements hook "user.role.permissions" |
||
79 | * @param array $permissions |
||
80 | */ |
||
81 | public function hookUserRolePermissions(array &$permissions) |
||
85 | |||
86 | /** |
||
87 | * Implements hook "order.calculate.before" |
||
88 | * @param mixed $data |
||
89 | */ |
||
90 | public function hookOrderCalculateBefore(array &$data) |
||
96 | |||
97 | /** |
||
98 | * Implements hook "order.submit.before" |
||
99 | * @param array $order |
||
100 | * @param array $options |
||
101 | * @param array $result |
||
102 | */ |
||
103 | public function hookOrderSubmitBefore(&$order, $options, &$result) |
||
107 | |||
108 | /** |
||
109 | * Implements hook "shipping.methods" |
||
110 | * @param mixed $methods |
||
111 | */ |
||
112 | public function hookShippingMethods(array &$methods) |
||
116 | |||
117 | /** |
||
118 | * Returns an array of Shippo's shipping methods |
||
119 | * @param bool $only_enabled |
||
120 | * @return array |
||
121 | */ |
||
122 | public function getShippingMethods($only_enabled = true) |
||
141 | |||
142 | /** |
||
143 | * Calculate shipping |
||
144 | * @param $data |
||
145 | */ |
||
146 | public function calculate(&$data) |
||
150 | |||
151 | /** |
||
152 | * Returns Shippo's model instance |
||
153 | * @return \gplcart\modules\shippo\models\Shippo |
||
154 | */ |
||
155 | public function getModel() |
||
161 | |||
162 | } |
||
163 |