-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.driver.php
More file actions
81 lines (64 loc) · 2.28 KB
/
extension.driver.php
File metadata and controls
81 lines (64 loc) · 2.28 KB
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
<?php
if(!defined('__IN_SYMPHONY__')) die('<h2>Error</h2><p>You cannot directly access this file</p>');
require_once(TOOLKIT . '/class.datasourcemanager.php');
//require_once(EXTENSIONS . '/symql/lib/class.symql.php');
Class extension_Checkout extends Extension{
public function about(){
return array('name' => 'Symphony ECommerce Checkout',
'version' => '0.1',
'release-date' => '2011-26-06',
'author' => array('name' => 'David Anderson',
'website' => 'http://veodesign.co.uk',
'email' => 'dave@veodesign.co.uk'
),
'description' => 'Basket and Checkout Extension for Symphony'
);
}
public function uninstall() {
Symphony::Engine()->Configuration->remove('checkout');
Symphony::Engine()->saveConfig();
}
public function getSubscribedDelegates() {
return array(
array(
'page' => '/system/preferences/',
'delegate' => 'AddCustomPreferenceFieldsets',
'callback' => 'preferences'
)
);
}
public function fetchNavigation() {
return array(
array(
'location' => __('System'),
'name' => __('Checkout Options'),
'link' => '/preferences/',
'limit' => 'developer'
)
);
}
// Get Config Functions -------------------------------------------------------------
public function getAllowedOptions(){
return array( 'orders-section','shipping-field','gateway-field','status-field','ipn-field','ipn-data-field',
'order-items-section','products-section','product-options-section',
'quantity-field','order-link-field','product-link-field','product-option-link-field','calc-function','calc-ds');
}
public function getConfig($name){
if(in_array($name,$this->getAllowedOptions())){
return Symphony::Configuration()->get($name, 'checkout');
}
}
// Set Config Functions -------------------------------------------------------------
public function setConfig($name,$values){
if(in_array($name,$this->getAllowedOptions())){
if (is_array($values)) {
$values = implode(',', $values);
Symphony::Configuration()->set($name, $values, 'checkout');
}
else {
Symphony::Configuration()->set($name,$values, 'checkout');
}
Symphony::Engine()->saveConfig();
}
}
}