SendCloud_Plugin - Version 1.0.0

Version Notes

Initial version

Download this release

Release Info

Developer SendCloud
Extension SendCloud_Plugin
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (29) hide show
  1. app/code/community/SendCloud/Plugin/Block/Adminhtml/System/Config/Form/AbstractButton.php +58 -0
  2. app/code/community/SendCloud/Plugin/Block/Adminhtml/System/Config/Form/ConnectButton.php +9 -0
  3. app/code/community/SendCloud/Plugin/Block/Adminhtml/System/Config/Form/GotoButton.php +9 -0
  4. app/code/community/SendCloud/Plugin/Helper/Data.php +20 -0
  5. app/code/community/SendCloud/Plugin/Model/Carrier/Abstract.php +75 -0
  6. app/code/community/SendCloud/Plugin/Model/Carrier/ServicepointFlatrate.php +23 -0
  7. app/code/community/SendCloud/Plugin/Model/Order/ServicePoint.php +54 -0
  8. app/code/community/SendCloud/Plugin/Model/Resource/Setup.php +5 -0
  9. app/code/community/SendCloud/Plugin/Model/Servicepoint/Api.php +25 -0
  10. app/code/community/SendCloud/Plugin/Model/Servicepoint/Api/V2.php +5 -0
  11. app/code/community/SendCloud/Plugin/controllers/Adminhtml/AutoconnectController.php +101 -0
  12. app/code/community/SendCloud/Plugin/etc/adminhtml.xml +22 -0
  13. app/code/community/SendCloud/Plugin/etc/api.xml +39 -0
  14. app/code/community/SendCloud/Plugin/etc/config.xml +129 -0
  15. app/code/community/SendCloud/Plugin/etc/system.xml +194 -0
  16. app/code/community/SendCloud/Plugin/etc/wsdl.xml +56 -0
  17. app/code/community/SendCloud/Plugin/sql/SendCloud_Plugin_setup/mysql4-install-1.0.0.php +28 -0
  18. app/design/adminhtml/default/default/layout/SendCloud_Plugin.xml +8 -0
  19. app/design/adminhtml/default/default/template/SendCloud/sales_order_view_service_point.phtml +14 -0
  20. app/design/adminhtml/default/default/template/SendCloud/system/config/button.phtml +18 -0
  21. app/design/frontend/base/default/layout/SendCloud_Plugin.xml +32 -0
  22. app/design/frontend/base/default/template/SendCloud/checkout_service_point.phtml +17 -0
  23. app/design/frontend/base/default/template/SendCloud/sales_order_info_service_point.phtml +18 -0
  24. app/etc/modules/SendCloud_Plugin.xml +13 -0
  25. app/locale/de_DE/SendCloud_Plugin.csv +24 -0
  26. app/locale/en_US/SendCloud_Plugin.csv +24 -0
  27. app/locale/fr_FR/SendCloud_Plugin.csv +24 -0
  28. app/locale/nl_NL/SendCloud_Plugin.csv +24 -0
  29. package.xml +18 -0
app/code/community/SendCloud/Plugin/Block/Adminhtml/System/Config/Form/AbstractButton.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class SendCloud_Plugin_Block_Adminhtml_System_Config_Form_AbstractButton
4
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
5
+ {
6
+ protected $_buttonLabel = '';
7
+ protected $_scriptFunctionName = '';
8
+ protected $_callbackName = '';
9
+
10
+ protected function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->setTemplate('SendCloud/system/config/button.phtml');
14
+ }
15
+
16
+ /**
17
+ * Return element html
18
+ *
19
+ * @param Varien_Data_Form_Element_Abstract $element
20
+ * @return string
21
+ */
22
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
23
+ {
24
+ return $this->_toHtml();
25
+ }
26
+
27
+ /**
28
+ * Return ajax url for button
29
+ *
30
+ * @return string
31
+ */
32
+ public function getAjaxCheckUrl()
33
+ {
34
+ return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_autoconnect/'. $this->_callbackName);
35
+ }
36
+
37
+ /**
38
+ * Generate button html
39
+ *
40
+ * @return string
41
+ */
42
+ public function getButtonHtml()
43
+ {
44
+ $button = $this->getLayout()
45
+ ->createBlock('adminhtml/widget_button')
46
+ ->setData(array(
47
+ 'label' => $this->helper('adminhtml')->__($this->_buttonLabel),
48
+ 'onclick' => 'javascript:' . $this->getScriptFunctionName() . '(); return false;'
49
+ ));
50
+
51
+ return $button->toHtml();
52
+ }
53
+
54
+ public function getScriptFunctionName()
55
+ {
56
+ return $this->_scriptFunctionName;
57
+ }
58
+ }
app/code/community/SendCloud/Plugin/Block/Adminhtml/System/Config/Form/ConnectButton.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SendCloud_Plugin_Block_Adminhtml_System_Config_Form_ConnectButton
4
+ extends SendCloud_Plugin_Block_Adminhtml_System_Config_Form_AbstractButton
5
+ {
6
+ protected $_buttonLabel = 'Connect with SendCloud';
7
+ protected $_scriptFunctionName = 'connect';
8
+ protected $_callbackName = 'connect';
9
+ }
app/code/community/SendCloud/Plugin/Block/Adminhtml/System/Config/Form/GotoButton.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SendCloud_Plugin_Block_Adminhtml_System_Config_Form_GotoButton
4
+ extends SendCloud_Plugin_Block_Adminhtml_System_Config_Form_AbstractButton
5
+ {
6
+ protected $_buttonLabel = 'Go to SendCloud';
7
+ protected $_scriptFunctionName = 'goto';
8
+ protected $_callbackName = 'goto';
9
+ }
app/code/community/SendCloud/Plugin/Helper/Data.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class SendCloud_Plugin_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ public function panelUrl()
5
+ {
6
+ $panelUrl = getenv('SENDCLOUDSHIPPING_PANEL_URL');
7
+
8
+ if (empty($panelUrl)) {
9
+ $panelUrl = 'https://panel.sendcloud.sc';
10
+ }
11
+
12
+ return $panelUrl;
13
+ }
14
+
15
+ public function getBaseUrl()
16
+ {
17
+ $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
18
+ return rtrim($baseUrl, '/');
19
+ }
20
+ }
app/code/community/SendCloud/Plugin/Model/Carrier/Abstract.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class SendCloud_Plugin_Model_Carrier_Abstract
4
+ extends Mage_Shipping_Model_Carrier_Abstract
5
+ implements Mage_Shipping_Model_Carrier_Interface
6
+ {
7
+
8
+ protected $_isFixed = true;
9
+
10
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
11
+ {
12
+ if (!$this->getConfigFlag('active')) {
13
+ return false;
14
+ }
15
+
16
+ $freeBoxes = 0;
17
+ if ($request->getAllItems()) {
18
+ foreach ($request->getAllItems() as $item) {
19
+ if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
20
+ continue;
21
+ }
22
+
23
+ if ($item->getHasChildren() && $item->isShipSeparately()) {
24
+ foreach ($item->getChildren() as $child) {
25
+ if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
26
+ $freeBoxes += $item->getQty() * $child->getQty();
27
+ }
28
+ }
29
+ } elseif ($item->getFreeShipping()) {
30
+ $freeBoxes += $item->getQty();
31
+ }
32
+ }
33
+ }
34
+
35
+ $this->setFreeBoxes($freeBoxes);
36
+
37
+ $result = Mage::getModel('shipping/rate_result');
38
+ if ($this->getConfigData('type') == 'O') { // per order
39
+ $shippingPrice = $this->getConfigData('price');
40
+ } elseif ($this->getConfigData('type') == 'I') { // per item
41
+ $shippingPrice = ($request->getPackageQty() * $this->getConfigData('price')) - ($this->getFreeBoxes() * $this->getConfigData('price'));
42
+ } else {
43
+ $shippingPrice = false;
44
+ }
45
+
46
+ $shippingPrice = $this->getFinalPriceWithHandlingFee($shippingPrice);
47
+
48
+ if ($shippingPrice !== false) {
49
+ $method = Mage::getModel('shipping/rate_result_method');
50
+
51
+ $method->setCarrier($this->_code);
52
+ $method->setCarrierTitle($this->getConfigData('title'));
53
+
54
+ $method->setMethod($this->_code);
55
+ $method->setMethodTitle($this->getConfigData('name'));
56
+
57
+ if ($request->getFreeShipping() === true || $request->getPackageQty() == $this->getFreeBoxes()) {
58
+ $shippingPrice = '0.00';
59
+ }
60
+
61
+
62
+ $method->setPrice($shippingPrice);
63
+ $method->setCost($shippingPrice);
64
+
65
+ $result->append($method);
66
+ }
67
+
68
+ return $result;
69
+ }
70
+
71
+ public function getAllowedMethods()
72
+ {
73
+ return array($this->_code=>$this->getConfigData('name'));
74
+ }
75
+ }
app/code/community/SendCloud/Plugin/Model/Carrier/ServicepointFlatrate.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class SendCloud_Plugin_Model_Carrier_ServicepointFlatrate
5
+ extends SendCloud_Plugin_Model_Carrier_Abstract
6
+ {
7
+ protected $_code = 'servicepoint_flatrate';
8
+
9
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
10
+ {
11
+ if (!Mage::getStoreConfig('sendcloud/servicepoint')) {
12
+ return false;
13
+ }
14
+
15
+
16
+ if ($this->getConfigData('free_shipping_enable')
17
+ && $request->getBaseSubtotalInclTax() >= $this->getConfigData('free_shipping_subtotal')) {
18
+ $request->setFreeShipping(true);
19
+ }
20
+
21
+ return parent::collectRates($request);
22
+ }
23
+ }
app/code/community/SendCloud/Plugin/Model/Order/ServicePoint.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SendCloud_Plugin_Model_Order_ServicePoint
4
+ {
5
+ const POST_SERVICE_POINT_SELECTED = 'sendcloudshipping_service_point_selected';
6
+ const POST_SERVICE_POINT_EXTRA = 'sendcloudshipping_service_point_extra';
7
+ const SESSION_SERVICE_POINT = 'sendcloud_service_point';
8
+ const SESSION_SERVICE_POINT_EXTRA = 'sendcloud_service_point_extra';
9
+ const SHIPPING_METHOD_SERVICE_POINT = 'servicepoint_flatrate_servicepoint_flatrate';
10
+
11
+ public function before_order_save($observer)
12
+ {
13
+ $order = $observer->getOrder();
14
+
15
+ if (Mage::getStoreConfig('sendcloud/servicepoint')) {
16
+ $spp = $order->getData('sendcloud_service_point');
17
+ $post = Mage::app()->getFrontController()->getRequest()->getPost();
18
+
19
+ $shippingMethod = isset($post['shipping_method']) ? $post['shipping_method'] : $order->getShippingMethod();
20
+
21
+ if ($shippingMethod === self::SHIPPING_METHOD_SERVICE_POINT && !$spp) {
22
+
23
+ if (isset($post[self::POST_SERVICE_POINT_SELECTED])) {
24
+ $sendcloudServicePoint = $post[self::POST_SERVICE_POINT_SELECTED];
25
+ $sendcloudServicePointExtra = $post[self::POST_SERVICE_POINT_EXTRA];
26
+ } else {
27
+ $checkoutSession = Mage::getSingleton('checkout/session');
28
+ $sendcloudServicePoint = $checkoutSession->getStepData('shipping_method', self::SESSION_SERVICE_POINT);
29
+ $sendcloudServicePointExtra = $checkoutSession->getStepData('shipping_method', self::SESSION_SERVICE_POINT_EXTRA);
30
+ }
31
+
32
+ $order->setData('sendcloud_service_point', $sendcloudServicePoint);
33
+ $order->setData('sendcloud_service_point_extra', $sendcloudServicePointExtra);
34
+ }
35
+ }
36
+ }
37
+
38
+ public function after_shippingmethod_save($observer)
39
+ {
40
+ if (Mage::getStoreConfig('sendcloud/servicepoint')) {
41
+ $post = Mage::app()->getFrontController()->getRequest()->getPost();
42
+
43
+ if (isset($post['shipping_method'], $post[self::POST_SERVICE_POINT_SELECTED])
44
+ && $post['shipping_method'] === self::SHIPPING_METHOD_SERVICE_POINT) {
45
+ $checkoutSession = Mage::getSingleton('checkout/session');
46
+ $sendcloudServicePoint = $post[self::POST_SERVICE_POINT_SELECTED];
47
+ $sendcloudServicePointExtra = $post[self::POST_SERVICE_POINT_EXTRA];
48
+
49
+ $checkoutSession->setStepData('shipping_method', self::SESSION_SERVICE_POINT, $sendcloudServicePoint);
50
+ $checkoutSession->setStepData('shipping_method', self::SESSION_SERVICE_POINT_EXTRA, $sendcloudServicePointExtra);
51
+ }
52
+ }
53
+ }
54
+ }
app/code/community/SendCloud/Plugin/Model/Resource/Setup.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class SendCloud_Plugin_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
4
+ {
5
+ }
app/code/community/SendCloud/Plugin/Model/Servicepoint/Api.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SendCloud_Plugin_Model_Servicepoint_Api extends Mage_Api_Model_Resource_Abstract
4
+ {
5
+ public function activate($scriptUrl)
6
+ {
7
+ if (strpos($scriptUrl, Mage::helper('SendCloud_Plugin')->panelUrl()) === 0) {
8
+ $this->_updateServicePointUrl($scriptUrl);
9
+ return true;
10
+ }
11
+ return false;
12
+ }
13
+
14
+ public function deactivate()
15
+ {
16
+ $this->_updateServicePointUrl('');
17
+ return true;
18
+ }
19
+
20
+ private function _updateServicePointUrl($scriptUrl)
21
+ {
22
+ $config = new Mage_Core_Model_Config();
23
+ $config->saveConfig('sendcloud/servicepoint', $scriptUrl);
24
+ }
25
+ }
app/code/community/SendCloud/Plugin/Model/Servicepoint/Api/V2.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class SendCloud_Plugin_Model_Servicepoint_Api_v2 extends SendCloud_Plugin_Model_Servicepoint_Api
4
+ {
5
+ }
app/code/community/SendCloud/Plugin/controllers/Adminhtml/AutoconnectController.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SendCloud_Plugin_Adminhtml_AutoconnectController
4
+ extends Mage_Adminhtml_Controller_Action
5
+ {
6
+ const API_ROLE_NAME = 'SendCloud API';
7
+ const API_USERNAME = 'sendcloud';
8
+ private $_helper;
9
+
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_helper = Mage::helper('SendCloud_Plugin');
14
+ }
15
+
16
+ protected function _isAllowed()
17
+ {
18
+ return parent::_isAllowed();
19
+ }
20
+
21
+ public function gotoAction()
22
+ {
23
+ Mage::app()->getResponse()->setBody($this->_helper->panelUrl());
24
+ }
25
+
26
+ public function connectAction()
27
+ {
28
+ $apiKey = $this->_generateApiKey();
29
+ $apiUser = $this->_getOrCreateApiUser($apiKey);
30
+ $siteUrl = $this->_helper->getBaseUrl();
31
+ $url = sprintf(
32
+ '%s/shops/magento_v1/connect/?shop_url=%s&username=%s&password=%s',
33
+ $this->_helper->panelUrl(),
34
+ urlencode($siteUrl),
35
+ $apiUser->username,
36
+ $apiKey
37
+ );
38
+ Mage::app()->getResponse()->setBody($url);
39
+ }
40
+
41
+ private function _generateApiKey()
42
+ {
43
+ return md5(rand() . time());
44
+ }
45
+
46
+ private function _getOrCreateApiRole()
47
+ {
48
+ $apiRoleModel = Mage::getModel('api/roles');
49
+ $apiRole = $apiRoleModel->load(self::API_ROLE_NAME, 'role_name');
50
+
51
+ if (!$apiRole->getId()) {
52
+ $apiRole = $apiRoleModel
53
+ ->setName('SendCloud API')
54
+ ->setPid(false)
55
+ ->setRoleType('G')
56
+ ->save();
57
+ }
58
+
59
+ Mage::getModel('api/rules')
60
+ ->setRoleId($apiRole->getId())
61
+ ->setResources(array('all'))
62
+ ->saveRel();
63
+
64
+ return $apiRole;
65
+ }
66
+
67
+ private function _getOrCreateApiUser($apiKey)
68
+ {
69
+ $apiRole = $this->_getOrCreateApiRole();
70
+ $apiUserModel = Mage::getModel('api/user');
71
+
72
+ $apiUser = $apiUserModel->loadByUsername(self::API_USERNAME);
73
+
74
+ if (!$apiUser->getId()) {
75
+ $apiUser = $apiUserModel->setData(array(
76
+ 'username' => self::API_USERNAME,
77
+ 'firstname' => 'SendCloud',
78
+ 'lastname' => 'API',
79
+ 'email' => 'contact@sendcloud.sc',
80
+ 'api_key' => $apiKey,
81
+ 'api_key_confirmation' => $apiKey,
82
+ 'is_active' => 1,
83
+ 'user_roles' => '',
84
+ 'assigned_user_role' => '',
85
+ 'role_name' => '',
86
+ 'roles' => array($apiRole->getId()),
87
+ ));
88
+ } else {
89
+ $apiUser->setIsActive(1);
90
+ $apiUser->setApiKey($apiKey);
91
+ }
92
+
93
+ $apiUser->save();
94
+
95
+ $apiUser
96
+ ->setRoleIds(array($apiRole->getId()))
97
+ ->setRoleUserId($apiUser->getUserId())
98
+ ->saveRelations();
99
+ return $apiUser;
100
+ }
101
+ }
app/code/community/SendCloud/Plugin/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <acl>
3
+ <resources>
4
+ <admin>
5
+ <children>
6
+ <system>
7
+ <children>
8
+ <config>
9
+ <children>
10
+ <sendcloud translate="title" module="SendCloud_Plugin">
11
+ <title>SendCloud</title>
12
+ <sort_order>999</sort_order>
13
+ </sendcloud>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/community/SendCloud/Plugin/etc/api.xml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <api>
4
+ <resources>
5
+ <sendcloud_servicepoint translate="title" module="SendCloud_Plugin">
6
+ <model>SendCloud_Plugin/servicepoint_api</model>
7
+ <title>SendCloud Service Point API</title>
8
+ <acl>SendCloud_Plugin/servicepoint</acl>
9
+ <methods>
10
+ <activate translate="title" module="SendCloud_Plugin">
11
+ <title>Activate Service Point</title>
12
+ </activate>
13
+ <deactivate translate="title" module="SendCloud_Plugin">
14
+ <title>Deactivate Service Point</title>
15
+ </deactivate>
16
+ </methods>
17
+ </sendcloud_servicepoint>
18
+ </resources>
19
+ <resources_alias>
20
+ <servicepoint>sendcloud_servicepoint</servicepoint>
21
+ </resources_alias>
22
+ <v2>
23
+ <resources_function_prefix>
24
+ <servicepoint>sendcloudServicepoint</servicepoint>
25
+ </resources_function_prefix>
26
+ </v2>
27
+ <acl>
28
+ <resources>
29
+ <SendCloud_Plugin translate="title" module="SendCloud_Plugin">
30
+ <title>SendCloud</title>
31
+ <sort_order>5</sort_order>
32
+ <servicepoint translate="title" module="SendCloud_Plugin">
33
+ <title>Service Point</title>
34
+ </servicepoint>
35
+ </SendCloud_Plugin>
36
+ </resources>
37
+ </acl>
38
+ </api>
39
+ </config>
app/code/community/SendCloud/Plugin/etc/config.xml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SendCloud_Plugin>
5
+ <version>1.0.0</version>
6
+ </SendCloud_Plugin>
7
+ </modules>
8
+
9
+ <global>
10
+ <helpers>
11
+ <SendCloud_Plugin>
12
+ <class>SendCloud_Plugin_Helper</class>
13
+ </SendCloud_Plugin>
14
+ </helpers>
15
+ <models>
16
+ <SendCloud_Plugin>
17
+ <class>SendCloud_Plugin_Model</class>
18
+ </SendCloud_Plugin>
19
+ </models>
20
+ <blocks>
21
+ <SendCloud_Plugin>
22
+ <class>SendCloud_Plugin_Block</class>
23
+ </SendCloud_Plugin>
24
+ </blocks>
25
+ <events>
26
+ <sales_order_save_before>
27
+ <observers>
28
+ <SendCloud_Plugin_servicepoint>
29
+ <type>singleton</type>
30
+ <class>SendCloud_Plugin_Model_Order_ServicePoint</class>
31
+ <method>before_order_save</method>
32
+ </SendCloud_Plugin_servicepoint>
33
+ </observers>
34
+ </sales_order_save_before>
35
+ <checkout_controller_onepage_save_shipping_method>
36
+ <observers>
37
+ <checkout_controller_onepage_save_shipping_method>
38
+ <type>model</type>
39
+ <class>SendCloud_Plugin_Model_Order_ServicePoint</class>
40
+ <method>after_shippingmethod_save</method>
41
+ </checkout_controller_onepage_save_shipping_method>
42
+ </observers>
43
+ </checkout_controller_onepage_save_shipping_method>
44
+ </events>
45
+ <resources>
46
+ <SendCloud_Plugin_setup>
47
+ <setup>
48
+ <module>SendCloud_Plugin</module>
49
+ <class>SendCloud_Plugin_Model_Resource_Setup</class>
50
+ </setup>
51
+ </SendCloud_Plugin_setup>
52
+ </resources>
53
+ </global>
54
+ <admin>
55
+ <routers>
56
+ <adminhtml>
57
+ <args>
58
+ <modules>
59
+ <autoconnect after="Mage_Adminhtml">SendCloud_Plugin</autoconnect>
60
+ </modules>
61
+ </args>
62
+ </adminhtml>
63
+ </routers>
64
+ </admin>
65
+ <adminhtml>
66
+ <acl>
67
+ <resources>
68
+ <all>
69
+ <title>Allow Everything</title>
70
+ </all>
71
+ <admin>
72
+ <children>
73
+ <system>
74
+ <children>
75
+ <config>
76
+ <children>
77
+ <sendcloud>
78
+ <title>SendCloud - Settings</title>
79
+ </sendcloud>
80
+ </children>
81
+ </config>
82
+ </children>
83
+ </system>
84
+ </children>
85
+ </admin>
86
+ </resources>
87
+ </acl>
88
+ <layout>
89
+ <updates>
90
+ <SendCloud_Plugin>
91
+ <file>SendCloud_Plugin.xml</file>
92
+ </SendCloud_Plugin>
93
+ </updates>
94
+ </layout>
95
+ <translate>
96
+ <modules>
97
+ <SendCloud_Plugin>
98
+ <files>
99
+ <default>SendCloud_Plugin.csv</default>
100
+ </files>
101
+ </SendCloud_Plugin>
102
+ </modules>
103
+ </translate>
104
+ </adminhtml>
105
+ <default>
106
+ <carriers>
107
+ <servicepoint_flatrate>
108
+ <active>0</active>
109
+ <sallowspecific>0</sallowspecific>
110
+ <model>SendCloud_Plugin/carrier_servicepointFlatrate</model>
111
+ <name>Service Point Delivery</name>
112
+ <title>SendCloud</title>
113
+ <type>I</type>
114
+ <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
115
+ <handling_type>F</handling_type>
116
+ <free_shipping_enable>0</free_shipping_enable>
117
+ </servicepoint_flatrate>
118
+ </carriers>
119
+ </default>
120
+ <frontend>
121
+ <layout>
122
+ <updates>
123
+ <SendCloud_Plugin>
124
+ <file>SendCloud_Plugin.xml</file>
125
+ </SendCloud_Plugin>
126
+ </updates>
127
+ </layout>
128
+ </frontend>
129
+ </config>
app/code/community/SendCloud/Plugin/etc/system.xml ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <sendcloud translate="label" module="SendCloud_Plugin">
5
+ <label>SendCloud</label>
6
+ <sort_order>100</sort_order>
7
+ </sendcloud>
8
+ </tabs>
9
+ <sections>
10
+ <sendcloud translate="label" module="SendCloud_Plugin">
11
+ <label>Auto Connect</label>
12
+ <tab>sendcloud</tab>
13
+ <sort_order>1000</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+
18
+ <groups>
19
+ <autoconnect translate="label" module="SendCloud_Plugin">
20
+ <label>Auto Connect</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1000</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+
27
+ <fields>
28
+ <sendcloud_connect translate="label">
29
+ <frontend_type>button</frontend_type>
30
+ <frontend_model>SendCloud_Plugin/adminhtml_system_config_form_connectButton</frontend_model>
31
+ <sort_order>20</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </sendcloud_connect>
36
+ <sendcloud_panel translate="label">
37
+ <frontend_type>button</frontend_type>
38
+ <frontend_model>SendCloud_Plugin/adminhtml_system_config_form_gotoButton</frontend_model>
39
+ <sort_order>90</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ </sendcloud_panel>
44
+ </fields>
45
+ </autoconnect>
46
+ </groups>
47
+ </sendcloud>
48
+ <carriers translate="label" module="SendCloud_Plugin">
49
+ <label>Shipping Methods</label>
50
+ <tab>sales</tab>
51
+ <frontend_type>text</frontend_type>
52
+ <sort_order>320</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ <groups>
57
+ <servicepoint_flatrate translate="label">
58
+ <label>Service Point Flat Rate</label>
59
+ <frontend_type>text</frontend_type>
60
+ <sort_order>340</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ <fields>
65
+ <active translate="label">
66
+ <label>Enabled</label>
67
+ <frontend_type>select</frontend_type>
68
+ <source_model>adminhtml/system_config_source_yesno</source_model>
69
+ <sort_order>1</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ </active>
74
+ <name translate="label">
75
+ <label>Method Name</label>
76
+ <frontend_type>text</frontend_type>
77
+ <sort_order>3</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ </name>
82
+ <price translate="label">
83
+ <label>Price</label>
84
+ <frontend_type>text</frontend_type>
85
+ <validate>validate-number validate-zero-or-greater</validate>
86
+ <sort_order>4</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>0</show_in_store>
90
+ </price>
91
+ <free_shipping_enable translate="label">
92
+ <label>Free Shipping Enabled</label>
93
+ <frontend_type>select</frontend_type>
94
+ <source_model>adminhtml/system_config_source_yesno</source_model>
95
+ <sort_order>5</sort_order>
96
+ <show_in_default>1</show_in_default>
97
+ <show_in_website>1</show_in_website>
98
+ <show_in_store>0</show_in_store>
99
+ </free_shipping_enable>
100
+ <free_shipping_subtotal translate="label">
101
+ <label>Minimum Order Amount for Free Shipping</label>
102
+ <frontend_type>text</frontend_type>
103
+ <validate>validate-number validate-zero-or-greater</validate>
104
+ <sort_order>6</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>0</show_in_store>
108
+ </free_shipping_subtotal>
109
+ <handling_type translate="label">
110
+ <label>Calculate Handling Fee</label>
111
+ <frontend_type>select</frontend_type>
112
+ <source_model>shipping/source_handlingType</source_model>
113
+ <sort_order>7</sort_order>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>0</show_in_store>
117
+ </handling_type>
118
+ <handling_fee translate="label">
119
+ <label>Handling Fee</label>
120
+ <frontend_type>text</frontend_type>
121
+ <validate>validate-number validate-zero-or-greater</validate>
122
+ <sort_order>8</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>0</show_in_store>
126
+ </handling_fee>
127
+ <sort_order translate="label">
128
+ <label>Sort Order</label>
129
+ <frontend_type>text</frontend_type>
130
+ <sort_order>100</sort_order>
131
+ <show_in_default>1</show_in_default>
132
+ <show_in_website>1</show_in_website>
133
+ <show_in_store>0</show_in_store>
134
+ </sort_order>
135
+ <title translate="label">
136
+ <label>Title</label>
137
+ <frontend_type>text</frontend_type>
138
+ <sort_order>2</sort_order>
139
+ <show_in_default>1</show_in_default>
140
+ <show_in_website>1</show_in_website>
141
+ <show_in_store>1</show_in_store>
142
+ </title>
143
+ <type translate="label">
144
+ <label>Type</label>
145
+ <frontend_type>select</frontend_type>
146
+ <source_model>adminhtml/system_config_source_shipping_flatrate</source_model>
147
+ <sort_order>4</sort_order>
148
+ <show_in_default>1</show_in_default>
149
+ <show_in_website>1</show_in_website>
150
+ <show_in_store>0</show_in_store>
151
+ </type>
152
+ <sallowspecific translate="label">
153
+ <label>Ship to Applicable Countries</label>
154
+ <frontend_type>select</frontend_type>
155
+ <sort_order>90</sort_order>
156
+ <frontend_class>shipping-applicable-country</frontend_class>
157
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>0</show_in_store>
161
+ </sallowspecific>
162
+ <specificcountry translate="label">
163
+ <label>Ship to Specific Countries</label>
164
+ <frontend_type>multiselect</frontend_type>
165
+ <sort_order>91</sort_order>
166
+ <source_model>adminhtml/system_config_source_country</source_model>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>0</show_in_store>
170
+ <can_be_empty>1</can_be_empty>
171
+ </specificcountry>
172
+ <showmethod translate="label">
173
+ <label>Show Method if Not Applicable</label>
174
+ <frontend_type>select</frontend_type>
175
+ <sort_order>92</sort_order>
176
+ <source_model>adminhtml/system_config_source_yesno</source_model>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>1</show_in_website>
179
+ <show_in_store>0</show_in_store>
180
+ </showmethod>
181
+ <specificerrmsg translate="label">
182
+ <label>Displayed Error Message</label>
183
+ <frontend_type>textarea</frontend_type>
184
+ <sort_order>80</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>1</show_in_store>
188
+ </specificerrmsg>
189
+ </fields>
190
+ </servicepoint_flatrate>
191
+ </groups>
192
+ </carriers>
193
+ </sections>
194
+ </config>
app/code/community/SendCloud/Plugin/etc/wsdl.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
3
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
4
+ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
5
+ <message name="sendcloudActivateServicePointRequest">
6
+ <part name="sessionId" type="xsd:string" />
7
+ <part name="scriptUrl" type="xsd:string" />
8
+ </message>
9
+ <message name="sendcloudActivateServicePointResponse">
10
+ <part name="result" type="xsd:boolean" />
11
+ </message>
12
+ <message name="sendcloudDeactivateServicePointRequest">
13
+ <part name="sessionId" type="xsd:string" />
14
+ </message>
15
+ <message name="sendcloudDeactivateServicePointResponse">
16
+ <part name="result" type="xsd:boolean" />
17
+ </message>
18
+ <portType name="{{var wsdl.handler}}PortType">
19
+ <operation name="sendcloudServicepointActivate">
20
+ <documentation>Activate service point</documentation>
21
+ <input message="typens:sendcloudActivateServicePointRequest" />
22
+ <output message="typens:sendcloudActivateServicePointResponse" />
23
+ </operation>
24
+ <operation name="sendcloudServicepointDeactivate">
25
+ <documentation>Activate service point</documentation>
26
+ <input message="typens:sendcloudDeactivateServicePointRequest" />
27
+ <output message="typens:sendcloudDeactivateServicePointResponse" />
28
+ </operation>
29
+ </portType>
30
+ <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
31
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
32
+ <operation name="sendcloudServicepointActivate">
33
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
34
+ <input>
35
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
36
+ </input>
37
+ <output>
38
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
39
+ </output>
40
+ </operation>
41
+ <operation name="sendcloudServicepointDeactivate">
42
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
43
+ <input>
44
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
45
+ </input>
46
+ <output>
47
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
48
+ </output>
49
+ </operation>
50
+ </binding>
51
+ <service name="{{var wsdl.name}}Service">
52
+ <port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
53
+ <soap:address location="{{var wsdl.url}}" />
54
+ </port>
55
+ </service>
56
+ </definitions>
app/code/community/SendCloud/Plugin/sql/SendCloud_Plugin_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $connection = $installer->getConnection();
5
+
6
+ $salesFlatOrderTable = $installer->getTable('sales_flat_order');
7
+ $salesFlatOrderGridTable = $installer->getTable('sales_flat_order_grid');
8
+
9
+ $salesFlatOrderTableProps = $connection->describeTable($salesFlatOrderTable);
10
+ $salesFlatOrderGridTableProps = $connection->describeTable($salesFlatOrderGridTable);
11
+
12
+ if (!isset($salesFlatOrderTableProps['sendcloud_service_point'])) {
13
+ $connection->addColumn($salesFlatOrderTable, 'sendcloud_service_point', 'INT(11)');
14
+ }
15
+
16
+ if (!isset($salesFlatOrderTableProps['sendcloud_service_point'])) {
17
+ $connection->addColumn($salesFlatOrderGridTable, 'sendcloud_service_point', 'INT(11)');
18
+ }
19
+
20
+ if (!isset($salesFlatOrderGridTableProps['sendcloud_service_point_extra'])) {
21
+ $connection->addColumn($salesFlatOrderTable, 'sendcloud_service_point_extra', 'TEXT');
22
+ }
23
+
24
+ if (!isset($salesFlatOrderGridTableProps['sendcloud_service_point_extra'])) {
25
+ $connection->addColumn($salesFlatOrderGridTable, 'sendcloud_service_point_extra', 'TEXT');
26
+ }
27
+
28
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/SendCloud_Plugin.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <adminhtml_sales_order_view>
4
+ <reference name="content">
5
+ <block type="adminhtml/sales_order_view" template="SendCloud/sales_order_view_service_point.phtml" after="sales_order_edit"/>
6
+ </reference>
7
+ </adminhtml_sales_order_view>
8
+ </layout>
app/design/adminhtml/default/default/template/SendCloud/sales_order_view_service_point.phtml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_servicePointExtra = $this->getOrder()->getData('sendcloud_service_point_extra');
3
+ if ($_servicePointExtra): ?>
4
+ <div class="box-left">
5
+ <div class="entry-edit">
6
+ <div class="entry-edit-head">
7
+ <h4 class="icon-head"><?php echo Mage::helper('SendCloud_Plugin')->__('Service Point') ?></h4>
8
+ </div>
9
+ <fieldset>
10
+ <?php echo join('<br>', explode('|', $_servicePointExtra)) ?>
11
+ </fieldset>
12
+ </div>
13
+ </div>
14
+ <?php endif; ?>
app/design/adminhtml/default/default/template/SendCloud/system/config/button.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ function <?php echo $this->getScriptFunctionName()?>() {
3
+ var newTab = window.open('about:blank', 'blank');
4
+ new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
5
+ method: 'get',
6
+ onSuccess: function(transport) {
7
+ if (transport.responseText) {
8
+ newTab.location = transport.responseText;
9
+ } else {
10
+ newTab.close();
11
+ }
12
+ },
13
+ onFailure: newTab.close
14
+ });
15
+ }
16
+ </script>
17
+
18
+ <?php echo $this->getButtonHtml() ?>
app/design/frontend/base/default/layout/SendCloud_Plugin.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <checkout_onepage_index>
4
+ <reference name="content">
5
+ <block type="core/template" name="sendcloud_js" template="SendCloud/checkout_service_point.phtml"></block>
6
+ </reference>
7
+ </checkout_onepage_index>
8
+
9
+ <onestepcheckout_index_index>
10
+ <reference name="content">
11
+ <block type="core/template" name="sendcloud_js" template="SendCloud/checkout_service_point.phtml"></block>
12
+ </reference>
13
+ </onestepcheckout_index_index>
14
+
15
+ <opc_index_index>
16
+ <reference name="content">
17
+ <block type="core/template" name="sendcloud_js" template="SendCloud/checkout_service_point.phtml"></block>
18
+ </reference>
19
+ </opc_index_index>
20
+
21
+ <firecheckout_index_index>
22
+ <reference name="content">
23
+ <block type="core/template" name="sendcloud_js" template="SendCloud/checkout_service_point.phtml"></block>
24
+ </reference>
25
+ </firecheckout_index_index>
26
+
27
+ <sales_order_view>
28
+ <reference name="my.account.wrapper">
29
+ <block type="sales/order_info" name="service_point_info" template="SendCloud/sales_order_info_service_point.phtml" after="sales.order.info"></block>
30
+ </reference>
31
+ </sales_order_view>
32
+ </layout>
app/design/frontend/base/default/template/SendCloud/checkout_service_point.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $servicePointUrl = Mage::getStoreConfig('sendcloud/servicepoint');
3
+ if ($servicePointUrl) {
4
+ $locale = Mage::app()->getLocale()->getLocaleCode();
5
+ $parts = explode('_', $locale);
6
+ $language = isset($parts[0]) ? $parts[0] : 'en';
7
+
8
+ $session = Mage::getSingleton('checkout/session');
9
+ $quoteId = $session->getQuoteId();
10
+ ?>
11
+ <script type="text/javascript">
12
+ var SENDCLOUDSHIPPING_LANGUAGE = "<?php echo $language ?>";
13
+ var SENDCLOUDSHIPPING_QUOTE_ID = "<?php echo $quoteId ?>";
14
+ </script>
15
+ <script type="text/javascript" src="<?php echo $servicePointUrl ?>"></script>
16
+ <?php
17
+ }
app/design/frontend/base/default/template/SendCloud/sales_order_info_service_point.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_service_point_extra = $this->getOrder()->getData('sendcloud_service_point_extra');
3
+ if ($_service_point_extra): ?>
4
+ <div class="col2-set order-info-box">
5
+ <div class="col-1">
6
+ <div class="box">
7
+ <div class="box-title">
8
+ <h2><?php echo Mage::helper('SendCloud_Plugin')->__('Service Point') ?></h2>
9
+ </div>
10
+ <div class="box-content">
11
+ <address>
12
+ <?php echo join('<br>', explode('|', $_service_point_extra)) ?>
13
+ </address>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <?php endif; ?>
app/etc/modules/SendCloud_Plugin.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SendCloud_Plugin>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Admin />
9
+ <Mage_Sales />
10
+ </depends>
11
+ </SendCloud_Plugin>
12
+ </modules>
13
+ </config>
app/locale/de_DE/SendCloud_Plugin.csv ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Service Point","Service Point"
2
+ "Connect with SendCloud","Mit SendCloud Verbinden"
3
+ "Go to SendCloud","Gehe zu SendCloud"
4
+ "SendCloud","SendCloud"
5
+ "SendCloud Service Point API","SendCloud Service Point API"
6
+ "Activate Service Point","Service Point Aktivieren"
7
+ "Deactivate Service Point","Service Point Deaktivieren"
8
+ "Auto Connect","Automatisch Verbinden"
9
+ "Service Point Flat Rate","Service Point Pauschaltarif"
10
+ "Free Shipping Enabled","Kostenloses Versenden Wurde Hinzugefügt"
11
+ "Minimum Order Amount for Free Shipping","Minimale Bestellmenge für kostenloses Versenden"
12
+ "Shipping Methods","Shipping Methods"
13
+ "Enabled","Aktiviert"
14
+ "Method Name","Methodenname"
15
+ "Price","Preis"
16
+ "Calculate Handling Fee","Bearbeitungsgebühr berechnen"
17
+ "Handling Fee","Bearbeitungsgebühren"
18
+ "Sort Order","Sortierreihenfolge"
19
+ "Title","Titel"
20
+ "Type","Typ"
21
+ "Ship to Applicable Countries","Versand in zutreffende Länder"
22
+ "Ship to Specific Countries","Versand in angegebene Länder"
23
+ "Show Method if Not Applicable","Wenn nicht anwendbar, Verfahren anzeigen"
24
+ "Displayed Error Message","Angezeigte Fehlermeldung"
app/locale/en_US/SendCloud_Plugin.csv ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Service Point","Service Point"
2
+ "Connect with SendCloud","Connect with SendCloud"
3
+ "Go to SendCloud","Go to SendCloud"
4
+ "SendCloud","SendCloud"
5
+ "SendCloud Service Point API","SendCloud Service Point API"
6
+ "Activate Service Point","Activate Service Point"
7
+ "Deactivate Service Point","Deactivate Service Point"
8
+ "Auto Connect","Auto Connect"
9
+ "Service Point Flat Rate","Service Point Flat Rate"
10
+ "Free Shipping Enabled","Free Shipping Enabled"
11
+ "Minimum Order Amount for Free Shipping","Minimum Order Amount for Free Shipping"
12
+ "Shipping Methods","Shipping Methods"
13
+ "Enabled","Enabled"
14
+ "Method Name","Method Name"
15
+ "Price","Price"
16
+ "Calculate Handling Fee","Calculate Handling Fee"
17
+ "Handling Fee","Handling Fee"
18
+ "Sort Order","Sort Order"
19
+ "Title","Title"
20
+ "Type","Type"
21
+ "Ship to Applicable Countries","Ship to Applicable Countries"
22
+ "Ship to Specific Countries","Ship to Specific Countries"
23
+ "Show Method if Not Applicable","Show Method if Not Applicable"
24
+ "Displayed Error Message","Displayed Error Message"
app/locale/fr_FR/SendCloud_Plugin.csv ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Service Point","Point Service"
2
+ "Connect with SendCloud","Se connecter avec SendCloud"
3
+ "Go to SendCloud","Aller sur SendCloud"
4
+ "SendCloud","SendCloud"
5
+ "SendCloud Service Point API","API SendCloud Point Service"
6
+ "Activate Service Point","Activer Point Service"
7
+ "Deactivate Service Point","Désactiver Point Service"
8
+ "Auto Connect","Connexion Automatique"
9
+ "Service Point Flat Rate","Tarif unique Point Service"
10
+ "Free Shipping Enabled","Envoi Gratuit Activé"
11
+ "Minimum Order Amount for Free Shipping","Montant Mimimum de la Commande pour un Envoi Gratuit"
12
+ "Shipping Methods","Shipping Methods"
13
+ "Enabled","Activé"
14
+ "Method Name","Nom de méthode"
15
+ "Price","Prix"
16
+ "Calculate Handling Fee","Calculer les frais de dossier"
17
+ "Handling Fee","Frais de traitement"
18
+ "Sort Order","Ordre de tri"
19
+ "Title","Titre"
20
+ "Type","Type"
21
+ "Ship to Applicable Countries","Livrer vers les pays applicables"
22
+ "Ship to Specific Countries","Livrer vers les pays spécifiques"
23
+ "Show Method if Not Applicable","Afficher le mode s'il n'est pas applicable"
24
+ "Displayed Error Message","Message d'erreur affiché"
app/locale/nl_NL/SendCloud_Plugin.csv ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Service Point","Servicepunt"
2
+ "Connect with SendCloud","Koppel met SendCloud"
3
+ "Go to SendCloud","Ga naar SendCloud"
4
+ "SendCloud","SendCloud"
5
+ "SendCloud Service Point API","SendCloud Servicepunt API"
6
+ "Activate Service Point","Activeren Servicepunt"
7
+ "Deactivate Service Point","Deactiveren Servicepunt"
8
+ "Auto Connect","Auto Connect"
9
+ "Service Point Flat Rate","Servicepunt Vast Tarief"
10
+ "Free Shipping Enabled","Gratis Verzenden Toevoegen"
11
+ "Minimum Order Amount for Free Shipping","Minimale Orderwaarde voor Gratis Verzenden"
12
+ "Shipping Methods","Shipping Methods"
13
+ "Enabled","Ingeschakeld"
14
+ "Method Name","Naam van methode"
15
+ "Price","Prijs"
16
+ "Calculate Handling Fee","Bestelkosten berekenen"
17
+ "Handling Fee","Bestelkosten"
18
+ "Sort Order","Sorteer volgorde"
19
+ "Title","Titel"
20
+ "Type","Type"
21
+ "Ship to Applicable Countries","Verzenden naar landen die van toepassing zijn"
22
+ "Ship to Specific Countries","Verzenden naar bepaalde landen"
23
+ "Show Method if Not Applicable","Laat verzendwijze zien indien niet van toepassing"
24
+ "Displayed Error Message","Weergeven foutbericht"
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>SendCloud_Plugin</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GPLv2</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>SendCloud is the smart shipping solution for ecommerce. With SendCloud you can easily ship packages with multiple carriers.</summary>
10
+ <description>Shipping packages has never been this easy! [SendCloud](https://sendcloud.sc) allows you to automatically create and print shipping labels for multiple carriers like DHL, DPD, UPS and more. Installing this plugin also adds the option to ship to selected service points directly from your shops checkout.</description>
11
+ <notes>Initial version</notes>
12
+ <authors><author><name>SendCloud</name><user>SendCloud</user><email>info@sendcloud.sc</email></author></authors>
13
+ <date>2016-11-18</date>
14
+ <time>14:16:14</time>
15
+ <contents><target name="magecommunity"><dir name="SendCloud"><dir name="Plugin"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="AbstractButton.php" hash="d6f1113fdac2334eca971128b54698cf"/><file name="ConnectButton.php" hash="233e27b35b6d3bc524003c0cb1d0af48"/><file name="GotoButton.php" hash="2839e63b5aff25d3a2f0b1cc73c70e55"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="596906b8df6b7064831de38dc62268f6"/></dir><dir name="Model"><dir name="Carrier"><file name="Abstract.php" hash="8d7adf1bfdb2b662de580e2012aed677"/><file name="ServicepointFlatrate.php" hash="fd5a491bfc6e7bfcabbbc73316d54246"/></dir><dir name="Order"><file name="ServicePoint.php" hash="3e2d747b0f3861eca265dcdb3a3cf465"/></dir><dir name="Resource"><file name="Setup.php" hash="48439d1dfcd408ef8ed430a0e9a0b1e2"/></dir><dir name="Servicepoint"><dir name="Api"><file name="V2.php" hash="5b75e090f2eec270c5e7c31c858f5b39"/></dir><file name="Api.php" hash="20234c78eb9fa6fce26249738f4d314e"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AutoconnectController.php" hash="c57984eeb760fe79eabba5e4979053e8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="4ff28e0a2124dec315903f78a1e83bd8"/><file name="api.xml" hash="eac2a3e876057842924b4b83cce053d4"/><file name="config.xml" hash="9eff8194a7bf1ac0c57b982a217f7899"/><file name="system.xml" hash="eb0259cd999210a99bd0c18a3da8ad5f"/><file name="wsdl.xml" hash="66007e79590f626f099678e07a0aeb26"/></dir><dir name="sql"><dir name="SendCloud_Plugin_setup"><file name="mysql4-install-1.0.0.php" hash="558d7faf99fbe264cebf293ae714946f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="SendCloud_Plugin.xml" hash="fc34a36183d01362f225ee10be3fb2ab"/></dir><dir name="template"><dir name="SendCloud"><file name="sales_order_view_service_point.phtml" hash="f7f8522eb62b7d5e2a6c50395e84c510"/><dir name="system"><dir name="config"><file name="button.phtml" hash="f5a8a872ae95b804ed5ac48e3c0cea07"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="SendCloud_Plugin.xml" hash="4c07395cf4b8cf12aea5cf5771245bea"/></dir><dir name="template"><dir name="SendCloud"><file name="checkout_service_point.phtml" hash="e29b8cfb14a818bc220e407d546a8b79"/><file name="sales_order_info_service_point.phtml" hash="8576b415b2da4030855ce7e0d22d090f"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SendCloud_Plugin.xml" hash="b60ec9f5d1b78054cce7115165d2b0ea"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="SendCloud_Plugin.csv" hash="0ebdedfb3b5bc75685714dd2a5efb786"/></dir><dir name="en_US"><file name="SendCloud_Plugin.csv" hash="b80cf0125a6ddbd651bf32a320ee8b5e"/></dir><dir name="fr_FR"><file name="SendCloud_Plugin.csv" hash="ea036e72ac642f151d676a316212d6c7"/></dir><dir name="nl_NL"><file name="SendCloud_Plugin.csv" hash="26a9470e152c7a831fcaf21f8fcf0eb5"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>7.1.0</max></php></required></dependencies>
18
+ </package>