-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
48 lines (39 loc) · 1.3 KB
/
controller.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
<?php
namespace Concrete\Package\CommunityStoreShippingExample;
use Concrete\Core\Package\Package;
use Whoops\Exception\ErrorException;
use Concrete\Core\Package\PackageService;
use Concrete\Core\Support\Facade\Application as ApplicationFacade;
use Concrete\Package\CommunityStore\Src\CommunityStore\Shipping\Method\ShippingMethodType;
class Controller extends Package
{
protected $pkgHandle = 'community_store_shipping_example';
protected $appVersionRequired = '8.0';
protected $pkgVersion = '2.0';
protected $packageDependencies = ['community_store'=>'2.0'];
protected $pkgAutoloaderRegistries = array(
'src/CommunityStore' => 'Concrete\Package\CommunityStoreShippingExample\Src\CommunityStore',
);
public function getPackageDescription()
{
return t("An example of how to create a Shipping Method for Community Store");
}
public function getPackageName()
{
return t("Example Shipping Method Type");
}
public function install()
{
$pkg = parent::install();
ShippingMethodType::add('example', 'Example Shipping', $pkg);
}
public function uninstall()
{
$pm = ShippingMethodType::getByHandle('example');
if ($pm) {
$pm->delete();
}
$pkg = parent::uninstall();
}
}
?>