Version Notes
Download this release
Release Info
Developer | Fontis |
Extension | Fontis_Australia |
Version | 2.5.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.5 to 2.5.0
- app/code/community/Fontis/Australia/Block/Autocomplete.php +5 -22
- app/code/community/Fontis/Australia/Block/Bpay/Form.php +1 -4
- app/code/community/Fontis/Australia/Block/Bpay/Info.php +2 -5
- app/code/community/Fontis/Australia/Block/Directdeposit/Form.php +1 -4
- app/code/community/Fontis/Australia/Block/Directdeposit/Info.php +4 -7
- app/code/community/Fontis/Australia/Block/Eparcel/Rate/Export.php +35 -0
- app/code/community/Fontis/Australia/Block/Getprice.php +3 -6
- app/code/community/Fontis/Australia/Block/Googleproducts.php +8 -11
- app/code/community/Fontis/Australia/Block/Myshopping.php +3 -6
- app/code/community/Fontis/Australia/Block/Shopbot.php +4 -7
- app/code/community/Fontis/Australia/Block/Shoppingdotcom.php +6 -9
- app/code/community/Fontis/Australia/Helper/Bpay.php +8 -11
- app/code/community/Fontis/Australia/Helper/Data.php +71 -22
- app/code/community/Fontis/Australia/Helper/Eparcel.php +117 -0
- app/code/community/Fontis/Australia/Model/Config/Condition.php +19 -3
- app/code/community/Fontis/Australia/Model/Config/CustomerGroupAccess.php +9 -12
- app/code/community/Fontis/Australia/Model/Config/CustomerGroups.php +17 -18
- app/code/community/Fontis/Australia/Model/Config/EmailNotificationLevel.php +29 -0
- app/code/community/Fontis/Australia/Model/Config/ProductAttributes.php +45 -50
- app/code/community/Fontis/Australia/Model/Mysql4/Shipping/Carrier/Eparcel.php +90 -79
- app/code/community/Fontis/Australia/Model/Mysql4/Shipping/Carrier/Eparcel/Collection.php +1 -4
- app/code/community/Fontis/Australia/Model/Observer.php +42 -0
- app/code/community/Fontis/Australia/Model/Payment/Bpay.php +33 -36
- app/code/community/Fontis/Australia/Model/Payment/Directdeposit.php +9 -12
- app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php +57 -61
- app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel.php +161 -314
- app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Abstract.php +147 -147
- app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Csv.php +97 -146
- app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Exception.php +18 -4
- app/code/community/Fontis/Australia/Model/Shipping/Config/Eparcel.php +5 -8
- app/code/community/Fontis/Australia/Model/Shipping/Config/Eparcelcondition.php +1 -4
- app/code/community/Fontis/Australia/Model/Shipping/Config/Shippingmethods.php +2 -5
- app/code/community/Fontis/Australia/Model/Shipping/Config/Weightunits.php +1 -4
- app/code/community/Fontis/Australia/controllers/AjaxController.php +1 -4
- app/code/community/Fontis/Australia/controllers/EparcelController.php +75 -22
- app/code/community/Fontis/Australia/etc/adminhtml.xml +46 -0
- app/code/community/Fontis/Australia/etc/config.xml +19 -47
- app/code/community/Fontis/Australia/etc/system.xml +262 -180
- app/code/community/Fontis/Australia/sql/australia_setup/mysql4-install-0.7.0.php +16 -19
- app/code/community/Fontis/Australia/sql/australia_setup/mysql4-install-2.2.0.php +1 -4
- app/code/community/Fontis/Australia/sql/australia_setup/mysql4-install-2.2.2.php +4 -7
- app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-1.2.1-1.2.2.php +1 -4
- app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.1.0-2.2.0.php +1 -4
- app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.2.1-2.2.2.php +1 -4
- app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.3.0-2.4.0.php +43 -0
- app/design/adminhtml/default/default/template/fontis/australia/payment/bpay/form.phtml +4 -4
- app/design/adminhtml/default/default/template/fontis/australia/payment/bpay/info.phtml +1 -1
- app/design/adminhtml/default/default/template/fontis/australia/payment/directdeposit/form.phtml +1 -1
- app/design/adminhtml/default/default/template/fontis/australia/payment/directdeposit/info.phtml +1 -1
- app/design/adminhtml/default/default/template/fontis/australia/system/config/form/field/array_dropdown.phtml +2 -2
- app/design/frontend/base/default/layout/{fontis_australia.xml → fontis/australia.xml} +13 -7
- app/design/frontend/base/default/template/fontis/australia/payment/bpay/form.phtml +1 -4
- app/design/frontend/base/default/template/fontis/australia/payment/bpay/info.phtml +1 -1
- app/design/frontend/base/default/template/fontis/australia/payment/bpay/success.phtml +2 -13
- app/design/frontend/base/default/template/fontis/australia/payment/directdeposit/form.phtml +19 -21
- app/design/frontend/base/default/template/fontis/australia/payment/directdeposit/info.phtml +3 -8
- app/design/frontend/base/default/template/fontis/australia/payment/directdeposit/success.phtml +4 -11
- app/design/frontend/base/default/template/fontis/australia/postcode-checkout.phtml +50 -63
- app/design/frontend/base/default/template/fontis/australia/postcode.phtml +24 -34
- app/etc/modules/Fontis_Australia.xml +2 -5
- lib/Doghouse/Australia/Eparcel.php +48 -0
- lib/Doghouse/Australia/Eparcel/Parcel.php +76 -0
- lib/Doghouse/Australia/Eparcel/Parcel/Carton.php +25 -0
- lib/Doghouse/Australia/Eparcel/Record.php +37 -0
- lib/Doghouse/Australia/Eparcel/Record/Article.php +35 -0
- lib/Doghouse/Australia/Eparcel/Record/Article/CubicWeight.php +25 -0
- lib/Doghouse/Australia/Eparcel/Record/Consignment.php +66 -0
- lib/Doghouse/Australia/Eparcel/Record/Good.php +16 -0
- package.xml +7 -7
- skin/frontend/base/default/fontis/australia/css/postcode-autocomplete.css +23 -0
- skin/frontend/{default/default/images/fontis → base/default/fontis/australia/images}/bpay.png +0 -0
app/code/community/Fontis/Australia/Block/Autocomplete.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* Fontis Australia Extension
|
5 |
*
|
@@ -9,14 +8,11 @@
|
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
@@ -25,7 +21,6 @@
|
|
25 |
*/
|
26 |
class Fontis_Australia_Block_Autocomplete extends Mage_Core_Block_Abstract
|
27 |
{
|
28 |
-
|
29 |
protected function _toHtml()
|
30 |
{
|
31 |
$html = '';
|
@@ -35,32 +30,20 @@ class Fontis_Australia_Block_Autocomplete extends Mage_Core_Block_Abstract
|
|
35 |
}
|
36 |
|
37 |
// Get the text that the customer has entered as a query.
|
38 |
-
$
|
39 |
-
|
40 |
-
if ($country != "AU") {
|
41 |
return $html;
|
42 |
}
|
43 |
|
44 |
-
/* @var $conn Varien_Db_Adapter_Pdo_Mysql */
|
45 |
-
$conn = Mage::getSingleton('core/resource')->getConnection('australia_read');
|
46 |
-
$resultArray = $conn->fetchAll(
|
47 |
-
'SELECT au.*, dcr.region_id FROM ' . Mage::getSingleton('core/resource')->getTableName('australia_postcode') . ' AS au
|
48 |
-
INNER JOIN ' . Mage::getSingleton('core/resource')->getTableName('directory_country_region') . ' AS dcr ON au.region_code = dcr.code
|
49 |
-
WHERE city LIKE :city ORDER BY city, region_code',
|
50 |
-
array('city' => $query)
|
51 |
-
);
|
52 |
-
|
53 |
$html = '<ul>';
|
54 |
$counter = 0;
|
55 |
-
foreach ($
|
56 |
$html .= '<li class="' . ((++$counter) % 2 ? 'odd' : 'even') . '" id="region-' . $item['region_id'] . '-postcode-' . $item['postcode'] . '">';
|
57 |
$html .= $item['city'] . '<span class="informal"> ' . $item['region_code'] . ', ' . $item['postcode'] . '</span>';
|
58 |
$html .= '</li>';
|
59 |
}
|
60 |
-
|
61 |
-
$html.= '</ul>';
|
62 |
|
63 |
return $html;
|
64 |
}
|
65 |
-
|
66 |
}
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Fontis Australia Extension
|
4 |
*
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
21 |
*/
|
22 |
class Fontis_Australia_Block_Autocomplete extends Mage_Core_Block_Abstract
|
23 |
{
|
|
|
24 |
protected function _toHtml()
|
25 |
{
|
26 |
$html = '';
|
30 |
}
|
31 |
|
32 |
// Get the text that the customer has entered as a query.
|
33 |
+
$results = $this->helper('australia')->getPostcodeAutocompleteResults();
|
34 |
+
if (empty($results)) {
|
|
|
35 |
return $html;
|
36 |
}
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
$html = '<ul>';
|
39 |
$counter = 0;
|
40 |
+
foreach ($results as $item) {
|
41 |
$html .= '<li class="' . ((++$counter) % 2 ? 'odd' : 'even') . '" id="region-' . $item['region_id'] . '-postcode-' . $item['postcode'] . '">';
|
42 |
$html .= $item['city'] . '<span class="informal"> ' . $item['region_code'] . ', ' . $item['postcode'] . '</span>';
|
43 |
$html .= '</li>';
|
44 |
}
|
45 |
+
$html .= '</ul>';
|
|
|
46 |
|
47 |
return $html;
|
48 |
}
|
|
|
49 |
}
|
app/code/community/Fontis/Australia/Block/Bpay/Form.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/Block/Bpay/Info.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -56,7 +53,7 @@ class Fontis_Australia_Block_Bpay_Info extends Mage_Payment_Block_Info
|
|
56 |
$this->_convertAdditionalData();
|
57 |
}
|
58 |
return $this->_ref;
|
59 |
-
}
|
60 |
|
61 |
/**
|
62 |
* Gets any additional data saved by the BPAY payment module.
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
53 |
$this->_convertAdditionalData();
|
54 |
}
|
55 |
return $this->_ref;
|
56 |
+
}
|
57 |
|
58 |
/**
|
59 |
* Gets any additional data saved by the BPAY payment module.
|
app/code/community/Fontis/Australia/Block/Directdeposit/Form.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/Block/Directdeposit/Info.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -58,7 +55,7 @@ class Fontis_Australia_Block_Directdeposit_Info extends Mage_Payment_Block_Info
|
|
58 |
}
|
59 |
return $this->_accountBSB;
|
60 |
}
|
61 |
-
|
62 |
/**
|
63 |
* Gets the bank account number as set by the admin.
|
64 |
*
|
@@ -71,7 +68,7 @@ class Fontis_Australia_Block_Directdeposit_Info extends Mage_Payment_Block_Info
|
|
71 |
}
|
72 |
return $this->_accountNumber;
|
73 |
}
|
74 |
-
|
75 |
/**
|
76 |
* Gets the bank account number as set by the admin.
|
77 |
*
|
@@ -83,7 +80,7 @@ class Fontis_Australia_Block_Directdeposit_Info extends Mage_Payment_Block_Info
|
|
83 |
$this->_convertAdditionalData();
|
84 |
}
|
85 |
return $this->_message;
|
86 |
-
}
|
87 |
|
88 |
/**
|
89 |
* Converts serialised additional data into a more usable form.
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
55 |
}
|
56 |
return $this->_accountBSB;
|
57 |
}
|
58 |
+
|
59 |
/**
|
60 |
* Gets the bank account number as set by the admin.
|
61 |
*
|
68 |
}
|
69 |
return $this->_accountNumber;
|
70 |
}
|
71 |
+
|
72 |
/**
|
73 |
* Gets the bank account number as set by the admin.
|
74 |
*
|
80 |
$this->_convertAdditionalData();
|
81 |
}
|
82 |
return $this->_message;
|
83 |
+
}
|
84 |
|
85 |
/**
|
86 |
* Converts serialised additional data into a more usable form.
|
app/code/community/Fontis/Australia/Block/Eparcel/Rate/Export.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_Australia
|
14 |
+
* @author Thai Phan
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Fontis_Australia_Block_Eparcel_Rate_Export extends Mage_Adminhtml_Block_System_Config_Form_Field
|
20 |
+
{
|
21 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
22 |
+
{
|
23 |
+
$this->setElement($element);
|
24 |
+
$url = $this->getUrl('australia/eparcel/exportTablerates');
|
25 |
+
|
26 |
+
$html = $this->getLayout()->createBlock('adminhtml/widget_button')
|
27 |
+
->setType('button')
|
28 |
+
->setClass('')
|
29 |
+
->setLabel('Export CSV')
|
30 |
+
->setOnClick("setLocation('$url')")
|
31 |
+
->toHtml();
|
32 |
+
|
33 |
+
return $html;
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Fontis/Australia/Block/Getprice.php
CHANGED
@@ -8,16 +8,13 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com and you will be sent a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Tom Greenaway
|
18 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
-
*/
|
21 |
class Fontis_Australia_Block_Getprice extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
22 |
{
|
23 |
protected $magentoOptions = array('final_price' => 'final_price', 'product_num' => 'product_num', "link" => "link", "category" => "category", "image_url" => "image_url", "currency" => "currency");
|
@@ -34,10 +31,10 @@ class Fontis_Australia_Block_Getprice extends Mage_Adminhtml_Block_System_Config
|
|
34 |
));
|
35 |
$this->_addAfter = false;
|
36 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
37 |
-
|
38 |
parent::__construct();
|
39 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
40 |
-
|
41 |
// product options
|
42 |
$eav_config_model = Mage::getModel('eav/config');
|
43 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Tom Greenaway
|
15 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
class Fontis_Australia_Block_Getprice extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
19 |
{
|
20 |
protected $magentoOptions = array('final_price' => 'final_price', 'product_num' => 'product_num', "link" => "link", "category" => "category", "image_url" => "image_url", "currency" => "currency");
|
31 |
));
|
32 |
$this->_addAfter = false;
|
33 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
34 |
+
|
35 |
parent::__construct();
|
36 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
37 |
+
|
38 |
// product options
|
39 |
$eav_config_model = Mage::getModel('eav/config');
|
40 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
app/code/community/Fontis/Australia/Block/Googleproducts.php
CHANGED
@@ -8,21 +8,18 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com and you will be sent a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Peter Spiller
|
18 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
-
*/
|
21 |
class Fontis_Australia_Block_Googleproducts extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
22 |
{
|
23 |
// Map in some of the values not normally visible
|
24 |
protected $magentoOptions = array('is_salable' => 'is_saleable', 'manufacturer_name' => 'manufacturer_name', 'final_price' => 'final_price');
|
25 |
-
|
26 |
public function __construct()
|
27 |
{
|
28 |
$this->addColumn('magento', array(
|
@@ -35,10 +32,10 @@ class Fontis_Australia_Block_Googleproducts extends Mage_Adminhtml_Block_System_
|
|
35 |
));
|
36 |
$this->_addAfter = false;
|
37 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
38 |
-
|
39 |
parent::__construct();
|
40 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
41 |
-
|
42 |
// product options
|
43 |
$eav_config_model = Mage::getModel('eav/config');
|
44 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
@@ -77,12 +74,12 @@ class Fontis_Australia_Block_Googleproducts extends Mage_Adminhtml_Block_System_
|
|
77 |
$model = Mage::getModel('australia/googleproducts');
|
78 |
foreach ($model->available_fields as $field) {
|
79 |
$rendered .= '<option value="'.$field.'">'.str_replace("_", " ", $field)."</option>";
|
80 |
-
}
|
81 |
$rendered .= '</select>';
|
82 |
}
|
83 |
-
|
84 |
return $rendered;
|
85 |
}
|
86 |
-
|
87 |
-
|
88 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Peter Spiller
|
15 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
class Fontis_Australia_Block_Googleproducts extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
19 |
{
|
20 |
// Map in some of the values not normally visible
|
21 |
protected $magentoOptions = array('is_salable' => 'is_saleable', 'manufacturer_name' => 'manufacturer_name', 'final_price' => 'final_price');
|
22 |
+
|
23 |
public function __construct()
|
24 |
{
|
25 |
$this->addColumn('magento', array(
|
32 |
));
|
33 |
$this->_addAfter = false;
|
34 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
35 |
+
|
36 |
parent::__construct();
|
37 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
38 |
+
|
39 |
// product options
|
40 |
$eav_config_model = Mage::getModel('eav/config');
|
41 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
74 |
$model = Mage::getModel('australia/googleproducts');
|
75 |
foreach ($model->available_fields as $field) {
|
76 |
$rendered .= '<option value="'.$field.'">'.str_replace("_", " ", $field)."</option>";
|
77 |
+
}
|
78 |
$rendered .= '</select>';
|
79 |
}
|
80 |
+
|
81 |
return $rendered;
|
82 |
}
|
83 |
+
|
84 |
+
|
85 |
}
|
app/code/community/Fontis/Australia/Block/Myshopping.php
CHANGED
@@ -8,16 +8,13 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com and you will be sent a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Tom Greenaway
|
18 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
-
*/
|
21 |
class Fontis_Australia_Block_Myshopping extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
22 |
{
|
23 |
protected $magentoOptions = array('instock' => 'instock', 'brand' => 'brand', 'final_price' => 'final_price', 'product_id' => 'product_id', "category" => "category", "link" => "link", "image_url" => "image_url");
|
@@ -34,10 +31,10 @@ class Fontis_Australia_Block_Myshopping extends Mage_Adminhtml_Block_System_Conf
|
|
34 |
));
|
35 |
$this->_addAfter = false;
|
36 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
37 |
-
|
38 |
parent::__construct();
|
39 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
40 |
-
|
41 |
// product options
|
42 |
$eav_config_model = Mage::getModel('eav/config');
|
43 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Tom Greenaway
|
15 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
class Fontis_Australia_Block_Myshopping extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
19 |
{
|
20 |
protected $magentoOptions = array('instock' => 'instock', 'brand' => 'brand', 'final_price' => 'final_price', 'product_id' => 'product_id', "category" => "category", "link" => "link", "image_url" => "image_url");
|
31 |
));
|
32 |
$this->_addAfter = false;
|
33 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
34 |
+
|
35 |
parent::__construct();
|
36 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
37 |
+
|
38 |
// product options
|
39 |
$eav_config_model = Mage::getModel('eav/config');
|
40 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
app/code/community/Fontis/Australia/Block/Shopbot.php
CHANGED
@@ -8,16 +8,13 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com and you will be sent a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Tom Greenaway
|
18 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
-
*/
|
21 |
class Fontis_Australia_Block_Shopbot extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
22 |
{
|
23 |
protected $magentoOptions = array("final_price" => "final_price", "link" => "link", "availability" => "availability", "price" => "price");
|
@@ -34,10 +31,10 @@ class Fontis_Australia_Block_Shopbot extends Mage_Adminhtml_Block_System_Config_
|
|
34 |
));
|
35 |
$this->_addAfter = false;
|
36 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
37 |
-
|
38 |
parent::__construct();
|
39 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
40 |
-
|
41 |
// extra options
|
42 |
$this->magentoOptions['FONTIS-product-id'] = 'Product ID';
|
43 |
$this->magentoOptions['FONTIS-category'] = 'Product Category';
|
@@ -86,7 +83,7 @@ class Fontis_Australia_Block_Shopbot extends Mage_Adminhtml_Block_System_Config_
|
|
86 |
}
|
87 |
$rendered .= '</select>';
|
88 |
}
|
89 |
-
|
90 |
return $rendered;
|
91 |
}
|
92 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Tom Greenaway
|
15 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
class Fontis_Australia_Block_Shopbot extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
19 |
{
|
20 |
protected $magentoOptions = array("final_price" => "final_price", "link" => "link", "availability" => "availability", "price" => "price");
|
31 |
));
|
32 |
$this->_addAfter = false;
|
33 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
34 |
+
|
35 |
parent::__construct();
|
36 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
37 |
+
|
38 |
// extra options
|
39 |
$this->magentoOptions['FONTIS-product-id'] = 'Product ID';
|
40 |
$this->magentoOptions['FONTIS-category'] = 'Product Category';
|
83 |
}
|
84 |
$rendered .= '</select>';
|
85 |
}
|
86 |
+
|
87 |
return $rendered;
|
88 |
}
|
89 |
}
|
app/code/community/Fontis/Australia/Block/Shoppingdotcom.php
CHANGED
@@ -8,21 +8,18 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com and you will be sent a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Peter Spiller
|
18 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
-
*/
|
21 |
class Fontis_Australia_Block_Shoppingdotcom extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
22 |
{
|
23 |
// Map in some of the values not normally visible
|
24 |
protected $magentoOptions = array('is_salable' => 'is_saleable', 'manufacturer_name' => 'manufacturer_name', 'final_price' => 'final_price');
|
25 |
-
|
26 |
public function __construct()
|
27 |
{
|
28 |
$this->addColumn('magento', array(
|
@@ -35,10 +32,10 @@ class Fontis_Australia_Block_Shoppingdotcom extends Mage_Adminhtml_Block_System_
|
|
35 |
));
|
36 |
$this->_addAfter = false;
|
37 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
38 |
-
|
39 |
parent::__construct();
|
40 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
41 |
-
|
42 |
// product options
|
43 |
$eav_config_model = Mage::getModel('eav/config');
|
44 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
@@ -77,10 +74,10 @@ class Fontis_Australia_Block_Shoppingdotcom extends Mage_Adminhtml_Block_System_
|
|
77 |
$model = Mage::getModel('australia/shoppingdotcom');
|
78 |
foreach ($model->available_fields as $field) {
|
79 |
$rendered .= '<option value="'.$field.'">'.str_replace("_", " ", $field)."</option>";
|
80 |
-
}
|
81 |
$rendered .= '</select>';
|
82 |
}
|
83 |
-
|
84 |
return $rendered;
|
85 |
}
|
86 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Peter Spiller
|
15 |
* @copyright Copyright (c) 2008 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
class Fontis_Australia_Block_Shoppingdotcom extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
19 |
{
|
20 |
// Map in some of the values not normally visible
|
21 |
protected $magentoOptions = array('is_salable' => 'is_saleable', 'manufacturer_name' => 'manufacturer_name', 'final_price' => 'final_price');
|
22 |
+
|
23 |
public function __construct()
|
24 |
{
|
25 |
$this->addColumn('magento', array(
|
32 |
));
|
33 |
$this->_addAfter = false;
|
34 |
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add linked attribute');
|
35 |
+
|
36 |
parent::__construct();
|
37 |
$this->setTemplate('fontis/australia/system/config/form/field/array_dropdown.phtml');
|
38 |
+
|
39 |
// product options
|
40 |
$eav_config_model = Mage::getModel('eav/config');
|
41 |
$attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
|
74 |
$model = Mage::getModel('australia/shoppingdotcom');
|
75 |
foreach ($model->available_fields as $field) {
|
76 |
$rendered .= '<option value="'.$field.'">'.str_replace("_", " ", $field)."</option>";
|
77 |
+
}
|
78 |
$rendered .= '</select>';
|
79 |
}
|
80 |
+
|
81 |
return $rendered;
|
82 |
}
|
83 |
}
|
app/code/community/Fontis/Australia/Helper/Bpay.php
CHANGED
@@ -8,17 +8,14 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
-
|
22 |
/**
|
23 |
* BPAY-specific helper
|
24 |
*/
|
@@ -28,10 +25,10 @@ class Fontis_Australia_Helper_Bpay extends Mage_Core_Helper_Abstract
|
|
28 |
{
|
29 |
$acceptCreditCards = Mage::getStoreConfig('payment/bpay/accept_credit_cards');
|
30 |
|
31 |
-
$output = '
|
32 |
<div id="bpay" style="border: 2px solid rgb(16, 32, 75); margin: 0px; padding: 6px; width: 238px; font-family: Arial,Helvetica,sans-serif; background-color: rgb(255, 255, 255);">
|
33 |
<div class="bpayLogo" style="border: 2px solid rgb(20, 44, 97); width: 51px; height: 87px; float: left;">
|
34 |
-
<img src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'frontend/
|
35 |
</div>
|
36 |
<div class="customerReferenceBox" style="border: 2px solid rgb(20, 44, 97); padding: 0px 8px; height: 87px; width: 158px; margin-left: 60px; margin-bottom: 4px;">
|
37 |
<p class="customerReferenceBoxText" style="font-size: 13px; text-transform: capitalize; color: rgb(20, 44, 97); white-space: nowrap; line-height: 22px; font-weight: normal;">
|
@@ -39,7 +36,7 @@ class Fontis_Australia_Helper_Bpay extends Mage_Core_Helper_Abstract
|
|
39 |
<b>Ref</b>: ' . $customerReferenceNumber . '<br>
|
40 |
</p>
|
41 |
</div>';
|
42 |
-
|
43 |
if($acceptCreditCards) {
|
44 |
$output .= '<div>
|
45 |
<p class="billerTextHeading" style="font-size: 11px; text-transform: capitalize; color: rgb(20, 44, 97); white-space: nowrap; line-height: 20px; font-weight: bold;">Telephone & Internet Banking — BPAY®</p>
|
@@ -51,8 +48,8 @@ class Fontis_Australia_Helper_Bpay extends Mage_Core_Helper_Abstract
|
|
51 |
<p class="billerText" style="font-size: 11px; color: rgb(20, 44, 97);">Contact your bank or financial institution to make this payment from your cheque, savings, debit or transaction account. More info: www.bpay.com.au</p>
|
52 |
</div>';
|
53 |
}
|
54 |
-
|
55 |
-
$output .= '</div>';
|
56 |
-
return $output;
|
57 |
}
|
58 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
+
|
19 |
/**
|
20 |
* BPAY-specific helper
|
21 |
*/
|
25 |
{
|
26 |
$acceptCreditCards = Mage::getStoreConfig('payment/bpay/accept_credit_cards');
|
27 |
|
28 |
+
$output = '
|
29 |
<div id="bpay" style="border: 2px solid rgb(16, 32, 75); margin: 0px; padding: 6px; width: 238px; font-family: Arial,Helvetica,sans-serif; background-color: rgb(255, 255, 255);">
|
30 |
<div class="bpayLogo" style="border: 2px solid rgb(20, 44, 97); width: 51px; height: 87px; float: left;">
|
31 |
+
<img alt="BPAY" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'frontend/base/default/images/fontis/australia/bpay.png' . '" height="82" width="51">
|
32 |
</div>
|
33 |
<div class="customerReferenceBox" style="border: 2px solid rgb(20, 44, 97); padding: 0px 8px; height: 87px; width: 158px; margin-left: 60px; margin-bottom: 4px;">
|
34 |
<p class="customerReferenceBoxText" style="font-size: 13px; text-transform: capitalize; color: rgb(20, 44, 97); white-space: nowrap; line-height: 22px; font-weight: normal;">
|
36 |
<b>Ref</b>: ' . $customerReferenceNumber . '<br>
|
37 |
</p>
|
38 |
</div>';
|
39 |
+
|
40 |
if($acceptCreditCards) {
|
41 |
$output .= '<div>
|
42 |
<p class="billerTextHeading" style="font-size: 11px; text-transform: capitalize; color: rgb(20, 44, 97); white-space: nowrap; line-height: 20px; font-weight: bold;">Telephone & Internet Banking — BPAY®</p>
|
48 |
<p class="billerText" style="font-size: 11px; color: rgb(20, 44, 97);">Contact your bank or financial institution to make this payment from your cheque, savings, debit or transaction account. More info: www.bpay.com.au</p>
|
49 |
</div>';
|
50 |
}
|
51 |
+
|
52 |
+
$output .= '</div>';
|
53 |
+
return $output;
|
54 |
}
|
55 |
}
|
app/code/community/Fontis/Australia/Helper/Data.php
CHANGED
@@ -8,40 +8,41 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
-
|
22 |
/**
|
23 |
* Data helper
|
24 |
*/
|
25 |
class Fontis_Australia_Helper_Data extends Mage_Core_Helper_Abstract
|
26 |
{
|
|
|
|
|
27 |
const MAX_QUERY_LEN = 100;
|
28 |
|
|
|
|
|
29 |
protected $_queryText;
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
public function getQueryText()
|
35 |
{
|
36 |
if (is_null($this->_queryText)) {
|
37 |
-
if($this->_getRequest()->getParam('billing')) {
|
38 |
-
|
39 |
-
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
} else {
|
44 |
-
|
45 |
}
|
46 |
$this->_queryText = trim($this->_queryText);
|
47 |
if (Mage::helper('core/string')->strlen($this->_queryText) > self::MAX_QUERY_LEN) {
|
@@ -50,15 +51,63 @@ class Fontis_Australia_Helper_Data extends Mage_Core_Helper_Abstract
|
|
50 |
}
|
51 |
return $this->_queryText;
|
52 |
}
|
53 |
-
|
54 |
public function getQueryCountry()
|
55 |
{
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
+
|
19 |
/**
|
20 |
* Data helper
|
21 |
*/
|
22 |
class Fontis_Australia_Helper_Data extends Mage_Core_Helper_Abstract
|
23 |
{
|
24 |
+
const XML_PATH_POSTCODE_AUTOCOMPLETE_ENABLED = 'fontis_australia/postcode_autocomplete/enabled';
|
25 |
+
|
26 |
const MAX_QUERY_LEN = 100;
|
27 |
|
28 |
+
const MAX_AUTOCOMPLETE_RESULTS_DEFAULT = 20;
|
29 |
+
|
30 |
protected $_queryText;
|
31 |
|
32 |
+
/**
|
33 |
+
* Gets the query text for city lookups in the postcode database.
|
34 |
+
*/
|
35 |
public function getQueryText()
|
36 |
{
|
37 |
if (is_null($this->_queryText)) {
|
38 |
+
if ($this->_getRequest()->getParam('billing')) {
|
39 |
+
$tmp = $this->_getRequest()->getParam('billing');
|
40 |
+
$this->_queryText = $tmp['city'];
|
41 |
+
} elseif ($this->_getRequest()->getParam('shipping')) {
|
42 |
+
$tmp = $this->_getRequest()->getParam('shipping');
|
43 |
+
$this->_queryText = $tmp['city'];
|
44 |
} else {
|
45 |
+
$this->_queryText = $this->_getRequest()->getParam('city');
|
46 |
}
|
47 |
$this->_queryText = trim($this->_queryText);
|
48 |
if (Mage::helper('core/string')->strlen($this->_queryText) > self::MAX_QUERY_LEN) {
|
51 |
}
|
52 |
return $this->_queryText;
|
53 |
}
|
54 |
+
|
55 |
public function getQueryCountry()
|
56 |
{
|
57 |
+
return $this->_getRequest()->getParam('country');
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getCitySuggestUrl()
|
61 |
+
{
|
62 |
+
return $this->_getUrl('australia/ajax/suggest', array('_secure'=>true));
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Checks whether postcode autocomplete is enabled.
|
67 |
+
*
|
68 |
+
* @return bool
|
69 |
+
*/
|
70 |
+
public function isPostcodeAutocompleteEnabled()
|
71 |
+
{
|
72 |
+
return Mage::getStoreConfigFlag(self::XML_PATH_POSTCODE_AUTOCOMPLETE_ENABLED);
|
73 |
}
|
74 |
|
75 |
+
/**
|
76 |
+
* @return int
|
77 |
+
*/
|
78 |
+
public function getPostcodeAutocompleteMaxResults()
|
79 |
+
{
|
80 |
+
$max = Mage::getStoreConfig("fontis_australia/postcode_autocomplete/max_results");
|
81 |
+
if (!is_numeric($max)) {
|
82 |
+
return self::MAX_AUTOCOMPLETE_RESULTS_DEFAULT;
|
83 |
+
}
|
84 |
+
$max = (int) $max;
|
85 |
+
if ($max > 0) {
|
86 |
+
return $max;
|
87 |
+
} else {
|
88 |
+
return self::MAX_AUTOCOMPLETE_RESULTS_DEFAULT;
|
89 |
+
}
|
90 |
+
}
|
91 |
|
92 |
+
/**
|
93 |
+
* @return array
|
94 |
+
*/
|
95 |
+
public function getPostcodeAutocompleteResults()
|
96 |
+
{
|
97 |
+
$country = $this->getQueryCountry();
|
98 |
+
if ($country != "AU") {
|
99 |
+
return array();
|
100 |
+
}
|
101 |
+
|
102 |
+
$res = Mage::getSingleton('core/resource');
|
103 |
+
/* @var $conn Varien_Db_Adapter_Pdo_Mysql */
|
104 |
+
$conn = $res->getConnection('australia_read');
|
105 |
+
return $conn->fetchAll(
|
106 |
+
'SELECT au.*, dcr.region_id FROM ' . $res->getTableName('australia_postcode') . ' AS au
|
107 |
+
INNER JOIN ' . $res->getTableName('directory_country_region') . ' AS dcr ON au.region_code = dcr.code
|
108 |
+
WHERE city LIKE :city ORDER BY city, region_code, postcode
|
109 |
+
LIMIT ' . $this->getPostcodeAutocompleteMaxResults(),
|
110 |
+
array('city' => '%' . $this->getQueryText() . '%')
|
111 |
+
);
|
112 |
+
}
|
113 |
+
}
|
app/code/community/Fontis/Australia/Helper/Eparcel.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_Australia
|
14 |
+
* @author Thai Phan
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Fontis_Australia_Helper_Eparcel extends Mage_Core_Helper_Abstract
|
20 |
+
{
|
21 |
+
const XML_PATH_EMAIL_NOTIFICATION_ENABLED = 'doghouse_eparcelexport/email_notification/enabled';
|
22 |
+
const XML_PATH_EMAIL_NOTIFICATION_LEVEL = 'doghouse_eparcelexport/email_notification/level';
|
23 |
+
|
24 |
+
/* AUSTRALIA POST CHARGE CODES */
|
25 |
+
private $chargeCodes = array(
|
26 |
+
|
27 |
+
/* Domestic / Standard / Individual */
|
28 |
+
'S1', // EPARCEL 1 Domestic
|
29 |
+
'S2', // EPARCEL 2 Domestic
|
30 |
+
'S3', // EPARCEL 3 Domestic
|
31 |
+
'S4', // EPARCEL 4 Domestic
|
32 |
+
'S5', // EPARCEL 5 Domestic
|
33 |
+
'S6', // EPARCEL 6 Domestic
|
34 |
+
'S7', // EPARCEL 7 Domestic
|
35 |
+
'S8', // EPARCEL 8 Domestic
|
36 |
+
|
37 |
+
/* Domestic / Standard / Business */
|
38 |
+
'B1', // B TO B EPARCEL 1 Domestic
|
39 |
+
'B2', // B TO B EPARCEL 2 Domestic
|
40 |
+
'B5', // B TO B EPARCEL 5 Domestic
|
41 |
+
|
42 |
+
/* Domestic / Express / Individual */
|
43 |
+
'X1', // EXPRESS POST EPARCEL Domestic
|
44 |
+
'X2', // EXPRESS POST EPARCEL 2 Domestic
|
45 |
+
|
46 |
+
/* Domestic / Express / Business */
|
47 |
+
'XB1', // EXPRESS POST EPARCEL B2B Domestic
|
48 |
+
'XB2', // EXPRESS POST EPARCEL B2B 2 Domestic
|
49 |
+
|
50 |
+
/* International / Standard */
|
51 |
+
'AIR1', // INTERNATIONAL Airmail 1 International
|
52 |
+
'AIR2', // INTERNATIONAL Airmail 2 International
|
53 |
+
'AIR3', // INTERNATIONAL Airmail - 8 Zones International
|
54 |
+
|
55 |
+
/* International / Express */
|
56 |
+
'EPI1', // Express Post International International
|
57 |
+
'EPI2', // Express Post International International
|
58 |
+
'EPI3', // Express Post International – 8 zones International
|
59 |
+
|
60 |
+
'ECM1', // Express Courier Int'l Merchandise 1 International
|
61 |
+
'ECM2', // Express Courier Int'l Merchandise 2 International
|
62 |
+
'ECM3', // Express Courier Int'l Merch 8Zone International
|
63 |
+
|
64 |
+
'ECD1', // EXPRESS COURIER INT'L DOC 1 International
|
65 |
+
'ECD2', // EXPRESS COURIER INT'L DOC 2 International
|
66 |
+
'ECD3', // Express Courier Int'l Doc – 8 zones International
|
67 |
+
|
68 |
+
/* Other */
|
69 |
+
|
70 |
+
'CFR', // eParcel Call For Return Domestic
|
71 |
+
'PR', // eParcel Post Returns Service Domestic
|
72 |
+
|
73 |
+
'CS1', // CTC EPARCEL Domestic
|
74 |
+
'CS4', // CTC EPARCEL Domestic
|
75 |
+
'CS5', // CTC EPARCEL 5 Domestic
|
76 |
+
'CS6', // CTC EPARCEL 6 Domestic
|
77 |
+
'CS7', // CTC EPARCEL 7 Domestic
|
78 |
+
'CS8', // CTC EPARCEL 8 Domestic
|
79 |
+
|
80 |
+
'CX1', // CTC EXPRESS POST 500G BRK Domestic
|
81 |
+
'CX2', // CTC EXPRESS POST MULTI BRK Domestic
|
82 |
+
|
83 |
+
'RPI1', // Registered Post International International
|
84 |
+
);
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Returns whether email notifications are enabled.
|
88 |
+
*
|
89 |
+
* @return bool
|
90 |
+
*/
|
91 |
+
public function isEmailNotificationEnabled()
|
92 |
+
{
|
93 |
+
return Mage::getStoreConfigFlag(self::XML_PATH_EMAIL_NOTIFICATION_ENABLED);
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Returns the email notification level, i.e. none, notify when despatched,
|
98 |
+
* or complete tracking.
|
99 |
+
*
|
100 |
+
* @return string
|
101 |
+
*/
|
102 |
+
public function getEmailNotificationLevel()
|
103 |
+
{
|
104 |
+
return Mage::getStoreConfig(self::XML_PATH_EMAIL_NOTIFICATION_LEVEL);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Determines whether a given string is a valid eParcel charge code.
|
109 |
+
*
|
110 |
+
* @param string $chargeCode
|
111 |
+
* @return bool
|
112 |
+
*/
|
113 |
+
public function isValidChargeCode($chargeCode)
|
114 |
+
{
|
115 |
+
return in_array($chargeCode, $this->chargeCodes);
|
116 |
+
}
|
117 |
+
}
|
app/code/community/Fontis/Australia/Model/Config/Condition.php
CHANGED
@@ -1,13 +1,29 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
class Fontis_Australia_Model_Config_Condition
|
4 |
{
|
5 |
public function toOptionArray()
|
6 |
{
|
7 |
return array(
|
8 |
-
array('value' => 'new',
|
9 |
-
array('value' => 'used',
|
10 |
array('value' => 'refurbished', 'label' => 'Refurbished'),
|
11 |
);
|
12 |
}
|
13 |
-
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_Australia
|
14 |
+
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
|
19 |
class Fontis_Australia_Model_Config_Condition
|
20 |
{
|
21 |
public function toOptionArray()
|
22 |
{
|
23 |
return array(
|
24 |
+
array('value' => 'new', 'label' => 'New'),
|
25 |
+
array('value' => 'used', 'label' => 'Used'),
|
26 |
array('value' => 'refurbished', 'label' => 'Refurbished'),
|
27 |
);
|
28 |
}
|
29 |
+
}
|
app/code/community/Fontis/Australia/Model/Config/CustomerGroupAccess.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -27,12 +24,12 @@
|
|
27 |
*/
|
28 |
class Fontis_Australia_Model_Config_CustomerGroupAccess
|
29 |
{
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
24 |
*/
|
25 |
class Fontis_Australia_Model_Config_CustomerGroupAccess
|
26 |
{
|
27 |
+
public function toOptionArray()
|
28 |
+
{
|
29 |
+
return array(
|
30 |
+
array('value' => 0, 'label' => Mage::helper('adminhtml')->__('No restrictions')),
|
31 |
+
array('value' => 1, 'label' => Mage::helper('adminhtml')->__('Only allow group ...')),
|
32 |
+
array('value' => 2, 'label' => Mage::helper('adminhtml')->__('Allow all groups except ...'))
|
33 |
+
);
|
34 |
+
}
|
35 |
}
|
app/code/community/Fontis/Australia/Model/Config/CustomerGroups.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -27,18 +24,20 @@
|
|
27 |
*/
|
28 |
class Fontis_Australia_Model_Config_CustomerGroups
|
29 |
{
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
44 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
24 |
*/
|
25 |
class Fontis_Australia_Model_Config_CustomerGroups
|
26 |
{
|
27 |
+
public function toOptionArray()
|
28 |
+
{
|
29 |
+
$storeId = Mage::app()->getStore()->getId();
|
30 |
+
$collection = Mage::getModel('customer/group')->setStoreId($storeId)->getCollection();
|
31 |
+
|
32 |
+
$options = array();
|
33 |
+
|
34 |
+
foreach ($collection as $group) {
|
35 |
+
$options[] = array(
|
36 |
+
'value' => $group->getCustomerGroupId(),
|
37 |
+
'label' => $group->getCustomerGroupCode()
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
return $options;
|
42 |
+
}
|
43 |
}
|
app/code/community/Fontis/Australia/Model/Config/EmailNotificationLevel.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_Australia
|
14 |
+
* @author Thai Phan
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Fontis_Australia_Model_Config_EmailNotificationLevel
|
20 |
+
{
|
21 |
+
public function toOptionArray()
|
22 |
+
{
|
23 |
+
return array(
|
24 |
+
array('value' => 'NONE', 'label' => Mage::helper('australia')->__('None')),
|
25 |
+
array('value' => 'DESPATCH', 'label' => Mage::helper('australia')->__('Despatch')),
|
26 |
+
array('value' => 'TRACKADV', 'label' => Mage::helper('australia')->__('Track Advice')),
|
27 |
+
);
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Fontis/Australia/Model/Config/ProductAttributes.php
CHANGED
@@ -1,50 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Fontis Australia Extension
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
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 |
-
return $options;
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_Australia
|
14 |
+
* @author Tom Greenaway
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* List all available product attributes
|
21 |
+
*
|
22 |
+
* @category Fontis
|
23 |
+
* @package Fontis_Australia
|
24 |
+
*/
|
25 |
+
class Fontis_Australia_Model_Config_ProductAttributes
|
26 |
+
{
|
27 |
+
public function toOptionArray() {
|
28 |
+
$eav_config = Mage::getModel('eav/config');
|
29 |
+
$attributes = $eav_config->getEntityAttributeCodes('catalog_product');
|
30 |
+
|
31 |
+
$options = array();
|
32 |
+
$options[0] = "No Attribute";
|
33 |
+
|
34 |
+
foreach ($attributes as $att_code) {
|
35 |
+
$attribute = $eav_config->getAttribute('catalog_product', $att_code);
|
36 |
+
Mage::log($attribute);
|
37 |
+
|
38 |
+
if ($att_code != '') {
|
39 |
+
$options[$att_code] = $att_code;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
return $options;
|
44 |
+
}
|
45 |
+
}
|
|
|
|
|
|
|
|
|
|
app/code/community/Fontis/Australia/Model/Mysql4/Shipping/Carrier/Eparcel.php
CHANGED
@@ -8,9 +8,6 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* Originally based on Magento Tablerate Shipping code and Auctionmaid Matrixrate.
|
16 |
* @copyright Copyright (c) 2008 Auction Maid (http://www.auctionmaid.com)
|
@@ -19,12 +16,14 @@
|
|
19 |
* @category Fontis
|
20 |
* @package Fontis_Australia
|
21 |
* @author Chris Norton
|
22 |
-
* @copyright Copyright (c)
|
23 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
24 |
*/
|
25 |
|
26 |
class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_Model_Mysql4_Abstract
|
27 |
{
|
|
|
|
|
28 |
protected function _construct()
|
29 |
{
|
30 |
$this->_init('australia/eparcel', 'pk');
|
@@ -33,31 +32,34 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
33 |
public function getRate(Mage_Shipping_Model_Rate_Request $request)
|
34 |
{
|
35 |
$read = $this->_getReadAdapter();
|
36 |
-
$write = $this->_getWriteAdapter();
|
37 |
|
38 |
-
|
39 |
$table = $this->getMainTable();
|
|
|
40 |
|
41 |
-
$insuranceStep = (float)Mage::
|
42 |
-
$insuranceCostPerStep = (float)Mage::
|
43 |
-
$signatureRequired = Mage::
|
44 |
if($signatureRequired) {
|
45 |
-
$signatureCost = (float)Mage::
|
46 |
} else {
|
47 |
$signatureCost = 0;
|
48 |
}
|
49 |
-
|
50 |
Mage::log($request->getDestCountryId());
|
51 |
Mage::log($request->getDestRegionId());
|
52 |
Mage::log($postcode);
|
53 |
Mage::log(var_export($request->getConditionName(), true));
|
54 |
-
|
55 |
-
for ($j=0;$j<5;$j++)
|
56 |
-
{
|
57 |
|
58 |
-
|
59 |
|
|
|
60 |
|
|
|
|
|
|
|
|
|
|
|
61 |
switch($j) {
|
62 |
case 0:
|
63 |
$select->where(
|
@@ -69,13 +71,13 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
69 |
case 1:
|
70 |
$select->where(
|
71 |
$read->quoteInto(" (dest_country_id=? ", $request->getDestCountryId()).
|
72 |
-
$read->quoteInto(" AND dest_region_id=? AND dest_zip='') ", $request->getDestRegionId())
|
73 |
);
|
74 |
break;
|
75 |
|
76 |
case 2:
|
77 |
$select->where(
|
78 |
-
$read->quoteInto(" (dest_country_id=? AND dest_region_id='0' AND dest_zip='') ", $request->getDestCountryId())
|
79 |
);
|
80 |
break;
|
81 |
case 3:
|
@@ -86,7 +88,7 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
86 |
break;
|
87 |
case 4:
|
88 |
$select->where(
|
89 |
-
" (dest_country_id='0' AND dest_region_id='0' AND dest_zip='')"
|
90 |
);
|
91 |
break;
|
92 |
}
|
@@ -126,48 +128,48 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
126 |
{
|
127 |
// have found a result or found nothing and at end of list!
|
128 |
foreach ($row as $data) {
|
129 |
-
|
130 |
$price = (float)($data['price']);
|
131 |
-
|
132 |
// add per-Kg cost
|
133 |
$conditionValue = (float)($request->getData($request->getConditionName()));
|
134 |
$price += (float)($data['price_per_kg']) * $conditionValue;
|
135 |
-
|
136 |
// add signature cost
|
137 |
$price += $signatureCost;
|
138 |
-
|
139 |
-
// add version without insurance
|
140 |
-
$data['price'] = (string)$price;
|
141 |
-
$newdata[]=$data;
|
142 |
|
143 |
-
// add version
|
144 |
-
// work out how many insurance 'steps' we have
|
145 |
-
$steps = ceil($request->getPackageValue() / $insuranceStep);
|
146 |
-
Mage::log("Insurance steps: $steps");
|
147 |
-
// add on number of 'steps' multiplied by the
|
148 |
-
// insurance cost per step
|
149 |
-
$insuranceCost = $insuranceCostPerStep * $steps;
|
150 |
-
Mage::log("Insurance cost: $insuranceCost");
|
151 |
-
$price += $insuranceCost;
|
152 |
-
|
153 |
$data['price'] = (string)$price;
|
154 |
-
$data['delivery_type'] .= " with TransitCover";
|
155 |
$newdata[]=$data;
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
} catch(Exception $e) {
|
158 |
Mage::log($e->getMessage());
|
159 |
}
|
160 |
}
|
161 |
break;
|
162 |
}
|
163 |
-
|
164 |
Mage::log(var_export($newdata, true));
|
165 |
return $newdata;
|
166 |
}
|
167 |
|
168 |
public function uploadAndImport(Varien_Object $object)
|
169 |
{
|
170 |
-
Mage::log('Eparcel uploadAndImport');
|
171 |
$csvFile = $_FILES["groups"]["tmp_name"]["eparcel"]["fields"]["import"]["value"];
|
172 |
|
173 |
if (!empty($csvFile)) {
|
@@ -177,7 +179,6 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
177 |
$table = Mage::getSingleton('core/resource')->getTableName('australia/eparcel');
|
178 |
|
179 |
$websiteId = $object->getScopeId();
|
180 |
-
$websiteModel = Mage::app()->getWebsite($websiteId);
|
181 |
|
182 |
if (isset($_POST['groups']['eparcel']['fields']['condition_name']['inherit'])) {
|
183 |
$conditionName = (string)Mage::getConfig()->getNode('default/carriers/eparcel/condition_name');
|
@@ -186,22 +187,23 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
186 |
}
|
187 |
|
188 |
$conditionFullName = Mage::getModel('australia/shipping_carrier_eparcel')->getCode('condition_name_short', $conditionName);
|
189 |
-
|
190 |
if (!empty($csv)) {
|
191 |
$exceptions = array();
|
192 |
$csvLines = explode("\n", $csv);
|
193 |
$csvLine = array_shift($csvLines);
|
194 |
$csvLine = $this->_getCsvValues($csvLine);
|
195 |
-
if (count($csvLine) <
|
196 |
-
$exceptions[0] = Mage::helper('shipping')->__('
|
197 |
}
|
198 |
|
199 |
$countryCodes = array();
|
200 |
$regionCodes = array();
|
201 |
-
foreach ($csvLines as $k
|
202 |
$csvLine = $this->_getCsvValues($csvLine);
|
203 |
-
|
204 |
-
|
|
|
205 |
} else {
|
206 |
$countryCodes[] = $csvLine[0];
|
207 |
$regionCodes[] = $csvLine[1];
|
@@ -236,7 +238,7 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
236 |
if (empty($countryCodesToIds) || !array_key_exists($csvLine[0], $countryCodesToIds)) {
|
237 |
$countryId = '0';
|
238 |
if ($csvLine[0] != '*' && $csvLine[0] != '') {
|
239 |
-
$exceptions[] = Mage::helper('shipping')->__('Invalid
|
240 |
}
|
241 |
} else {
|
242 |
$countryId = $countryCodesToIds[$csvLine[0]];
|
@@ -245,7 +247,7 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
245 |
if (empty($regionCodesToIds) || !array_key_exists($csvLine[1], $regionCodesToIds)) {
|
246 |
$regionId = '0';
|
247 |
if ($csvLine[1] != '*' && $csvLine[1] != '') {
|
248 |
-
$exceptions[] = Mage::helper('shipping')->__('Invalid
|
249 |
}
|
250 |
} else {
|
251 |
$regionId = $regionCodesToIds[$csvLine[1]];
|
@@ -258,56 +260,67 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
258 |
}
|
259 |
|
260 |
if (!$this->_isPositiveDecimalNumber($csvLine[3]) || $csvLine[3] == '*' || $csvLine[3] == '') {
|
261 |
-
$exceptions[] = Mage::helper('shipping')->__('Invalid %s "%s"
|
262 |
} else {
|
263 |
$csvLine[3] = (float)$csvLine[3];
|
264 |
}
|
265 |
|
266 |
if (!$this->_isPositiveDecimalNumber($csvLine[4]) || $csvLine[4] == '*' || $csvLine[4] == '') {
|
267 |
-
$exceptions[] = Mage::helper('shipping')->__('Invalid %s "%s"
|
268 |
} else {
|
269 |
$csvLine[4] = (float)$csvLine[4];
|
270 |
}
|
271 |
|
272 |
if (!$this->_isPositiveDecimalNumber($csvLine[5])) {
|
273 |
-
$exceptions[] = Mage::helper('shipping')->__('Invalid
|
274 |
} else {
|
275 |
$csvLine[5] = (float)$csvLine[5];
|
276 |
}
|
277 |
|
278 |
if (!$this->_isPositiveDecimalNumber($csvLine[6])) {
|
279 |
-
$exceptions[] = Mage::helper('shipping')->__('Invalid
|
280 |
} else {
|
281 |
$csvLine[6] = (float)$csvLine[6];
|
282 |
}
|
283 |
-
|
284 |
-
|
285 |
-
|
|
|
|
|
|
|
286 |
} else {
|
287 |
$csvLine[8] = isset($csvLine[8]) ? (string)$csvLine[8] : null;
|
288 |
}
|
289 |
-
|
290 |
-
if (isset($csvLine[9])
|
291 |
-
$exceptions[] = Mage::helper('shipping')->__('Invalid
|
292 |
} else {
|
293 |
$csvLine[9] = isset($csvLine[9]) ? (string)$csvLine[9] : null;
|
294 |
}
|
295 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
$data[] = array(
|
297 |
-
'website_id'
|
298 |
-
'dest_country_id'
|
299 |
-
'dest_region_id'
|
300 |
-
'dest_zip'
|
301 |
-
'condition_name'
|
302 |
-
'condition_from_value'
|
303 |
-
'condition_to_value'
|
304 |
-
'price'
|
305 |
-
'price_per_kg'
|
306 |
-
'delivery_type'
|
307 |
-
'
|
308 |
-
'
|
|
|
309 |
);
|
310 |
-
|
311 |
$dataDetails[] = array(
|
312 |
'country' => $csvLine[0],
|
313 |
'region' => $csvLine[1]
|
@@ -343,20 +356,19 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
343 |
$pcode1 = (int)$postcodeEntry[0];
|
344 |
$pcode2 = (int)$postcodeEntry[1];
|
345 |
Mage::log("Line $k, postcode range: $pcode1-$pcode2");
|
346 |
-
|
347 |
$postcodes = array_merge($postcodes, range(min($pcode1, $pcode2), max($pcode1, $pcode2)));
|
348 |
}
|
349 |
}
|
350 |
-
|
351 |
Mage::log(var_export($postcodes, true));
|
352 |
foreach($postcodes as $postcode) {
|
353 |
$dataLine['dest_zip'] = str_pad($postcode, 4, "0", STR_PAD_LEFT);
|
354 |
$connection->insert($table, $dataLine);
|
355 |
}
|
356 |
} catch (Exception $e) {
|
357 |
-
//$exceptions[] = Mage::helper('shipping')->__('ERROR Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s")', ($k+1), $dataDetails[$k]['country'], $dataDetails[$k]['region'], $dataLine['dest_zip'], $dataLine['condition_value']);
|
358 |
Mage::log($e->getMessage());
|
359 |
-
$
|
360 |
}
|
361 |
}
|
362 |
}
|
@@ -371,20 +383,20 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
371 |
/**
|
372 |
* Due to bugs in fgetcsv(), this extension is using tips from php.net.
|
373 |
* We could potentially swap this out for Zend's CSV parsers after testing for bugs in that.
|
374 |
-
*
|
375 |
* Note: I've updated this code the latest version in the comments on php.net (Jonathan Melnick)
|
376 |
-
*
|
377 |
* @author Jonathan Melnick
|
378 |
* @author Chris Norton
|
379 |
* @author Dave Walter
|
380 |
* @author justin at cam dot org
|
381 |
* @author Theodule
|
382 |
* @author dan dot jones at lunarfish dot co dot uk
|
383 |
-
*
|
384 |
* @see http://www.php.net/manual/en/function.split.php#81490
|
385 |
* @see https://bugs.php.net/bug.php?id=45356
|
386 |
* @see http://stackoverflow.com/questions/12390851/fgetcsv-is-eating-the-first-letter-of-a-string-if-its-an-umlaut
|
387 |
-
*
|
388 |
* @param string $string
|
389 |
* @param string $separator
|
390 |
*/
|
@@ -418,5 +430,4 @@ class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_M
|
|
418 |
{
|
419 |
return preg_match ("/^[0-9]+(\.[0-9]*)?$/", $n);
|
420 |
}
|
421 |
-
|
422 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* Originally based on Magento Tablerate Shipping code and Auctionmaid Matrixrate.
|
13 |
* @copyright Copyright (c) 2008 Auction Maid (http://www.auctionmaid.com)
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Fontis_Australia_Model_Mysql4_Shipping_Carrier_Eparcel extends Mage_Core_Model_Mysql4_Abstract
|
24 |
{
|
25 |
+
const MIN_CSV_COLUMN_COUNT = 8;
|
26 |
+
|
27 |
protected function _construct()
|
28 |
{
|
29 |
$this->_init('australia/eparcel', 'pk');
|
32 |
public function getRate(Mage_Shipping_Model_Rate_Request $request)
|
33 |
{
|
34 |
$read = $this->_getReadAdapter();
|
|
|
35 |
|
36 |
+
$postcode = $request->getDestPostcode();
|
37 |
$table = $this->getMainTable();
|
38 |
+
$storeId = $request->getStoreId();
|
39 |
|
40 |
+
$insuranceStep = (float)Mage::getStoreConfig('default/carriers/eparcel/insurance_step', $storeId);
|
41 |
+
$insuranceCostPerStep = (float)Mage::getStoreConfig('default/carriers/eparcel/insurance_cost_per_step', $storeId);
|
42 |
+
$signatureRequired = Mage::getStoreConfigFlag('default/carriers/eparcel/signature_required', $storeId);
|
43 |
if($signatureRequired) {
|
44 |
+
$signatureCost = (float)Mage::getStoreConfig('default/carriers/eparcel/signature_cost', $storeId);
|
45 |
} else {
|
46 |
$signatureCost = 0;
|
47 |
}
|
48 |
+
|
49 |
Mage::log($request->getDestCountryId());
|
50 |
Mage::log($request->getDestRegionId());
|
51 |
Mage::log($postcode);
|
52 |
Mage::log(var_export($request->getConditionName(), true));
|
|
|
|
|
|
|
53 |
|
54 |
+
for ($j = 0; $j < 5; $j++) {
|
55 |
|
56 |
+
$select = $read->select()->from($table);
|
57 |
|
58 |
+
// Support for Multi Warehouse Extension.
|
59 |
+
if ($request->getWarehouseId() > 0) {
|
60 |
+
$select->where('stock_id = ?', $request->getWarehouseId());
|
61 |
+
}
|
62 |
+
|
63 |
switch($j) {
|
64 |
case 0:
|
65 |
$select->where(
|
71 |
case 1:
|
72 |
$select->where(
|
73 |
$read->quoteInto(" (dest_country_id=? ", $request->getDestCountryId()).
|
74 |
+
$read->quoteInto(" AND dest_region_id=? AND dest_zip='0000') ", $request->getDestRegionId())
|
75 |
);
|
76 |
break;
|
77 |
|
78 |
case 2:
|
79 |
$select->where(
|
80 |
+
$read->quoteInto(" (dest_country_id=? AND dest_region_id='0' AND dest_zip='0000') ", $request->getDestCountryId())
|
81 |
);
|
82 |
break;
|
83 |
case 3:
|
88 |
break;
|
89 |
case 4:
|
90 |
$select->where(
|
91 |
+
" (dest_country_id='0' AND dest_region_id='0' AND dest_zip='0000')"
|
92 |
);
|
93 |
break;
|
94 |
}
|
128 |
{
|
129 |
// have found a result or found nothing and at end of list!
|
130 |
foreach ($row as $data) {
|
131 |
+
try {
|
132 |
$price = (float)($data['price']);
|
133 |
+
|
134 |
// add per-Kg cost
|
135 |
$conditionValue = (float)($request->getData($request->getConditionName()));
|
136 |
$price += (float)($data['price_per_kg']) * $conditionValue;
|
137 |
+
|
138 |
// add signature cost
|
139 |
$price += $signatureCost;
|
|
|
|
|
|
|
|
|
140 |
|
141 |
+
// add version without insurance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
$data['price'] = (string)$price;
|
|
|
143 |
$newdata[]=$data;
|
144 |
|
145 |
+
if (Mage::getStoreConfig('carriers/eparcel/insurance_enable', $storeId)) {
|
146 |
+
// add version with insurance
|
147 |
+
// work out how many insurance 'steps' we have
|
148 |
+
$steps = ceil($request->getPackageValue() / $insuranceStep);
|
149 |
+
Mage::log("Insurance steps: $steps");
|
150 |
+
// add on number of 'steps' multiplied by the
|
151 |
+
// insurance cost per step
|
152 |
+
$insuranceCost = $insuranceCostPerStep * $steps;
|
153 |
+
Mage::log("Insurance cost: $insuranceCost");
|
154 |
+
$price += $insuranceCost;
|
155 |
+
|
156 |
+
$data['price'] = (string)$price;
|
157 |
+
$data['delivery_type'] .= " with TransitCover";
|
158 |
+
$newdata[]=$data;
|
159 |
+
}
|
160 |
} catch(Exception $e) {
|
161 |
Mage::log($e->getMessage());
|
162 |
}
|
163 |
}
|
164 |
break;
|
165 |
}
|
166 |
+
}
|
167 |
Mage::log(var_export($newdata, true));
|
168 |
return $newdata;
|
169 |
}
|
170 |
|
171 |
public function uploadAndImport(Varien_Object $object)
|
172 |
{
|
|
|
173 |
$csvFile = $_FILES["groups"]["tmp_name"]["eparcel"]["fields"]["import"]["value"];
|
174 |
|
175 |
if (!empty($csvFile)) {
|
179 |
$table = Mage::getSingleton('core/resource')->getTableName('australia/eparcel');
|
180 |
|
181 |
$websiteId = $object->getScopeId();
|
|
|
182 |
|
183 |
if (isset($_POST['groups']['eparcel']['fields']['condition_name']['inherit'])) {
|
184 |
$conditionName = (string)Mage::getConfig()->getNode('default/carriers/eparcel/condition_name');
|
187 |
}
|
188 |
|
189 |
$conditionFullName = Mage::getModel('australia/shipping_carrier_eparcel')->getCode('condition_name_short', $conditionName);
|
190 |
+
|
191 |
if (!empty($csv)) {
|
192 |
$exceptions = array();
|
193 |
$csvLines = explode("\n", $csv);
|
194 |
$csvLine = array_shift($csvLines);
|
195 |
$csvLine = $this->_getCsvValues($csvLine);
|
196 |
+
if (count($csvLine) < self::MIN_CSV_COLUMN_COUNT) {
|
197 |
+
$exceptions[0] = Mage::helper('shipping')->__('Less than ' . self::MIN_CSV_COLUMN_COUNT . ' columns in the CSV header.');
|
198 |
}
|
199 |
|
200 |
$countryCodes = array();
|
201 |
$regionCodes = array();
|
202 |
+
foreach ($csvLines as $k => $csvLine) {
|
203 |
$csvLine = $this->_getCsvValues($csvLine);
|
204 |
+
$count = count($csvLine);
|
205 |
+
if ($count > 0 && $count < self::MIN_CSV_COLUMN_COUNT) {
|
206 |
+
$exceptions[0] = Mage::helper('shipping')->__('Less than ' . self::MIN_CSV_COLUMN_COUNT . ' columns in row ' . ($k + 1) . '.');
|
207 |
} else {
|
208 |
$countryCodes[] = $csvLine[0];
|
209 |
$regionCodes[] = $csvLine[1];
|
238 |
if (empty($countryCodesToIds) || !array_key_exists($csvLine[0], $countryCodesToIds)) {
|
239 |
$countryId = '0';
|
240 |
if ($csvLine[0] != '*' && $csvLine[0] != '') {
|
241 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid country "%s" on row #%s', $csvLine[0], ($k+1));
|
242 |
}
|
243 |
} else {
|
244 |
$countryId = $countryCodesToIds[$csvLine[0]];
|
247 |
if (empty($regionCodesToIds) || !array_key_exists($csvLine[1], $regionCodesToIds)) {
|
248 |
$regionId = '0';
|
249 |
if ($csvLine[1] != '*' && $csvLine[1] != '') {
|
250 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid region/state "%s" on row #%s', $csvLine[1], ($k+1));
|
251 |
}
|
252 |
} else {
|
253 |
$regionId = $regionCodesToIds[$csvLine[1]];
|
260 |
}
|
261 |
|
262 |
if (!$this->_isPositiveDecimalNumber($csvLine[3]) || $csvLine[3] == '*' || $csvLine[3] == '') {
|
263 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid %s "%s" on row #%s', $conditionFullName, $csvLine[3], ($k+1));
|
264 |
} else {
|
265 |
$csvLine[3] = (float)$csvLine[3];
|
266 |
}
|
267 |
|
268 |
if (!$this->_isPositiveDecimalNumber($csvLine[4]) || $csvLine[4] == '*' || $csvLine[4] == '') {
|
269 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid %s "%s" on row #%s', $conditionFullName, $csvLine[4], ($k+1));
|
270 |
} else {
|
271 |
$csvLine[4] = (float)$csvLine[4];
|
272 |
}
|
273 |
|
274 |
if (!$this->_isPositiveDecimalNumber($csvLine[5])) {
|
275 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid shipping price "%s" on row #%s', $csvLine[5], ($k+1));
|
276 |
} else {
|
277 |
$csvLine[5] = (float)$csvLine[5];
|
278 |
}
|
279 |
|
280 |
if (!$this->_isPositiveDecimalNumber($csvLine[6])) {
|
281 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid shipping price per kg "%s" on row #%s', $csvLine[6], ($k+1));
|
282 |
} else {
|
283 |
$csvLine[6] = (float)$csvLine[6];
|
284 |
}
|
285 |
+
|
286 |
+
/** @var Fontis_Australia_Helper_Eparcel $helper */
|
287 |
+
$helper = Mage::helper('australia/eparcel');
|
288 |
+
|
289 |
+
if (isset($csvLine[8]) && $csvLine[8] != '' && !$helper->isValidChargeCode($csvLine[8])) {
|
290 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid charge code "%s" on row #%s', $csvLine[8], ($k+1));
|
291 |
} else {
|
292 |
$csvLine[8] = isset($csvLine[8]) ? (string)$csvLine[8] : null;
|
293 |
}
|
294 |
+
|
295 |
+
if (isset($csvLine[9]) && $csvLine[9] != '' && !$helper->isValidChargeCode($csvLine[9])) {
|
296 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid charge code "%s" on row #%s', $csvLine[9], ($k+1));
|
297 |
} else {
|
298 |
$csvLine[9] = isset($csvLine[9]) ? (string)$csvLine[9] : null;
|
299 |
}
|
300 |
|
301 |
+
// If Multi Warehouse Ext is not used the value is 0 (as for no warehouse) otherwise is positive integer from table "warehouse"
|
302 |
+
if (isset($csvLine[10]) && intval($csvLine[10]) < 0) {
|
303 |
+
$exceptions[] = Mage::helper('shipping')->__('Invalid Warehouse ID "%s" in the Row #%s', $csvLine[10], ($k+1));
|
304 |
+
} else {
|
305 |
+
$csvLine[10] = isset($csvLine[10]) ? (int)$csvLine[10] : null;
|
306 |
+
}
|
307 |
+
|
308 |
$data[] = array(
|
309 |
+
'website_id' => $websiteId,
|
310 |
+
'dest_country_id' => $countryId,
|
311 |
+
'dest_region_id' => $regionId,
|
312 |
+
'dest_zip' => $zip,
|
313 |
+
'condition_name' => $conditionName,
|
314 |
+
'condition_from_value' => $csvLine[3],
|
315 |
+
'condition_to_value' => $csvLine[4],
|
316 |
+
'price' => $csvLine[5],
|
317 |
+
'price_per_kg' => $csvLine[6],
|
318 |
+
'delivery_type' => $csvLine[7],
|
319 |
+
'charge_code_individual' => $csvLine[8],
|
320 |
+
'charge_code_business' => $csvLine[9],
|
321 |
+
'stock_id' => $csvLine[10],
|
322 |
);
|
323 |
+
|
324 |
$dataDetails[] = array(
|
325 |
'country' => $csvLine[0],
|
326 |
'region' => $csvLine[1]
|
356 |
$pcode1 = (int)$postcodeEntry[0];
|
357 |
$pcode2 = (int)$postcodeEntry[1];
|
358 |
Mage::log("Line $k, postcode range: $pcode1-$pcode2");
|
359 |
+
|
360 |
$postcodes = array_merge($postcodes, range(min($pcode1, $pcode2), max($pcode1, $pcode2)));
|
361 |
}
|
362 |
}
|
363 |
+
|
364 |
Mage::log(var_export($postcodes, true));
|
365 |
foreach($postcodes as $postcode) {
|
366 |
$dataLine['dest_zip'] = str_pad($postcode, 4, "0", STR_PAD_LEFT);
|
367 |
$connection->insert($table, $dataLine);
|
368 |
}
|
369 |
} catch (Exception $e) {
|
|
|
370 |
Mage::log($e->getMessage());
|
371 |
+
$exceptions[] = $e->getMessage();
|
372 |
}
|
373 |
}
|
374 |
}
|
383 |
/**
|
384 |
* Due to bugs in fgetcsv(), this extension is using tips from php.net.
|
385 |
* We could potentially swap this out for Zend's CSV parsers after testing for bugs in that.
|
386 |
+
*
|
387 |
* Note: I've updated this code the latest version in the comments on php.net (Jonathan Melnick)
|
388 |
+
*
|
389 |
* @author Jonathan Melnick
|
390 |
* @author Chris Norton
|
391 |
* @author Dave Walter
|
392 |
* @author justin at cam dot org
|
393 |
* @author Theodule
|
394 |
* @author dan dot jones at lunarfish dot co dot uk
|
395 |
+
*
|
396 |
* @see http://www.php.net/manual/en/function.split.php#81490
|
397 |
* @see https://bugs.php.net/bug.php?id=45356
|
398 |
* @see http://stackoverflow.com/questions/12390851/fgetcsv-is-eating-the-first-letter-of-a-string-if-its-an-umlaut
|
399 |
+
*
|
400 |
* @param string $string
|
401 |
* @param string $separator
|
402 |
*/
|
430 |
{
|
431 |
return preg_match ("/^[0-9]+(\.[0-9]*)?$/", $n);
|
432 |
}
|
|
|
433 |
}
|
app/code/community/Fontis/Australia/Model/Mysql4/Shipping/Carrier/Eparcel/Collection.php
CHANGED
@@ -8,16 +8,13 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* Originally based on Magento Tablerate Shipping code.
|
16 |
*
|
17 |
* @category Fontis
|
18 |
* @package Fontis_Australia
|
19 |
* @author Chris Norton
|
20 |
-
* @copyright Copyright (c)
|
21 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
*/
|
23 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* Originally based on Magento Tablerate Shipping code.
|
13 |
*
|
14 |
* @category Fontis
|
15 |
* @package Fontis_Australia
|
16 |
* @author Chris Norton
|
17 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
|
app/code/community/Fontis/Australia/Model/Observer.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_Australia
|
14 |
+
* @author Thai Phan
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Fontis_Australia_Model_Observer
|
20 |
+
{
|
21 |
+
public function autoload()
|
22 |
+
{
|
23 |
+
require_once(__DIR__ . '/../lib/vendor/autoload.php');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Adds a history entry to orders placed using AU direct deposit or BPay.
|
28 |
+
*/
|
29 |
+
public function addHistory($event)
|
30 |
+
{
|
31 |
+
$order = $event->getOrder();
|
32 |
+
if($order && $order->getPayment()) {
|
33 |
+
if($order->getPayment()->getMethod() == 'directdeposit_au') {
|
34 |
+
$order->addStatusHistoryComment('Order placed with Direct Deposit')
|
35 |
+
->setIsCustomerNotified(false);
|
36 |
+
} else if($order->getPayment()->getMethod() == 'bpay') {
|
37 |
+
$order->addStatusHistoryComment('Order placed with BPay')
|
38 |
+
->setIsCustomerNotified(false);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
app/code/community/Fontis/Australia/Model/Payment/Bpay.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -30,7 +27,7 @@ class Fontis_Australia_Model_Payment_Bpay extends Mage_Payment_Model_Method_Abst
|
|
30 |
protected $_code = 'bpay';
|
31 |
protected $_formBlockType = 'fontis_australia_block_bpay_form';
|
32 |
protected $_infoBlockType = 'fontis_australia_block_bpay_info';
|
33 |
-
|
34 |
protected $_ref = null;
|
35 |
|
36 |
public function isAvailable($quote = null)
|
@@ -39,10 +36,10 @@ class Fontis_Australia_Model_Payment_Bpay extends Mage_Payment_Model_Method_Abst
|
|
39 |
{
|
40 |
return false;
|
41 |
}
|
42 |
-
|
43 |
$groupAccess = $this->getConfigData('customer_group_access');
|
44 |
$group = $this->getConfigData('customer_group');
|
45 |
-
|
46 |
if($groupAccess == 0)
|
47 |
{
|
48 |
// No restrictions on access
|
@@ -66,7 +63,7 @@ class Fontis_Australia_Model_Payment_Bpay extends Mage_Payment_Model_Method_Abst
|
|
66 |
return true;
|
67 |
}
|
68 |
}
|
69 |
-
|
70 |
// Default, restrict access
|
71 |
return false;
|
72 |
}
|
@@ -82,29 +79,29 @@ class Fontis_Australia_Model_Payment_Bpay extends Mage_Payment_Model_Method_Abst
|
|
82 |
$info = $this->getInfoInstance();
|
83 |
$info->setBillerCode($this->getBillerCode());
|
84 |
$info->setRef($this->getRef());
|
85 |
-
|
86 |
$details = array();
|
87 |
if ($this->getBillerCode())
|
88 |
{
|
89 |
$details['biller_code'] = $this->getBillerCode();
|
90 |
-
|
91 |
if($this->getRef())
|
92 |
{
|
93 |
$details['ref'] = $this->getRef();
|
94 |
}
|
95 |
}
|
96 |
-
if (!empty($details))
|
97 |
{
|
98 |
$this->getInfoInstance()->setAdditionalData(serialize($details));
|
99 |
}
|
100 |
return $this;
|
101 |
}
|
102 |
-
|
103 |
public function getBillerCode()
|
104 |
{
|
105 |
return $this->getConfigData('biller_code');
|
106 |
}
|
107 |
-
|
108 |
public function getRef()
|
109 |
{
|
110 |
if($this->_ref) {
|
@@ -129,38 +126,38 @@ class Fontis_Australia_Model_Payment_Bpay extends Mage_Payment_Model_Method_Abst
|
|
129 |
} else {
|
130 |
$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
131 |
$this->_ref = $this->_calculateRef($order_id);
|
132 |
-
}
|
133 |
//$this->assignData();
|
134 |
-
}
|
135 |
return $this->_ref;
|
136 |
}
|
137 |
-
|
138 |
public function getMessage()
|
139 |
{
|
140 |
return $this->getConfigData('message');
|
141 |
}
|
142 |
-
|
143 |
protected function _calculateRef($ref, $seperator = '', $crn_length = 6)
|
144 |
{
|
145 |
-
$revstr = strrev(intval($ref));
|
146 |
-
$total = 0;
|
147 |
-
for ($i = 0;$i < strlen($revstr); $i++) {
|
148 |
-
|
149 |
-
if ($i%2 == 0) {
|
150 |
-
$multiplier = 2;
|
151 |
-
}
|
152 |
-
else $multiplier = 1;
|
153 |
-
|
154 |
-
$sub_total = intval($revstr[$i]) * $multiplier;
|
155 |
-
if ($sub_total >= 10) {
|
156 |
-
$temp = (string) $sub_total;
|
157 |
-
$sub_total = intval($temp[0]) + intval($temp[1]);
|
158 |
-
}
|
159 |
-
$total += $sub_total;
|
160 |
-
}
|
161 |
-
|
162 |
-
$check_digit = (10 - ($total % 10))%10;
|
163 |
-
$crn = str_pad(ltrim($ref, "0"),$crn_length-1,0,STR_PAD_LEFT) .$seperator. $check_digit;
|
164 |
return $crn;
|
165 |
}
|
166 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
27 |
protected $_code = 'bpay';
|
28 |
protected $_formBlockType = 'fontis_australia_block_bpay_form';
|
29 |
protected $_infoBlockType = 'fontis_australia_block_bpay_info';
|
30 |
+
|
31 |
protected $_ref = null;
|
32 |
|
33 |
public function isAvailable($quote = null)
|
36 |
{
|
37 |
return false;
|
38 |
}
|
39 |
+
|
40 |
$groupAccess = $this->getConfigData('customer_group_access');
|
41 |
$group = $this->getConfigData('customer_group');
|
42 |
+
|
43 |
if($groupAccess == 0)
|
44 |
{
|
45 |
// No restrictions on access
|
63 |
return true;
|
64 |
}
|
65 |
}
|
66 |
+
|
67 |
// Default, restrict access
|
68 |
return false;
|
69 |
}
|
79 |
$info = $this->getInfoInstance();
|
80 |
$info->setBillerCode($this->getBillerCode());
|
81 |
$info->setRef($this->getRef());
|
82 |
+
|
83 |
$details = array();
|
84 |
if ($this->getBillerCode())
|
85 |
{
|
86 |
$details['biller_code'] = $this->getBillerCode();
|
87 |
+
|
88 |
if($this->getRef())
|
89 |
{
|
90 |
$details['ref'] = $this->getRef();
|
91 |
}
|
92 |
}
|
93 |
+
if (!empty($details))
|
94 |
{
|
95 |
$this->getInfoInstance()->setAdditionalData(serialize($details));
|
96 |
}
|
97 |
return $this;
|
98 |
}
|
99 |
+
|
100 |
public function getBillerCode()
|
101 |
{
|
102 |
return $this->getConfigData('biller_code');
|
103 |
}
|
104 |
+
|
105 |
public function getRef()
|
106 |
{
|
107 |
if($this->_ref) {
|
126 |
} else {
|
127 |
$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
128 |
$this->_ref = $this->_calculateRef($order_id);
|
129 |
+
}
|
130 |
//$this->assignData();
|
131 |
+
}
|
132 |
return $this->_ref;
|
133 |
}
|
134 |
+
|
135 |
public function getMessage()
|
136 |
{
|
137 |
return $this->getConfigData('message');
|
138 |
}
|
139 |
+
|
140 |
protected function _calculateRef($ref, $seperator = '', $crn_length = 6)
|
141 |
{
|
142 |
+
$revstr = strrev(intval($ref));
|
143 |
+
$total = 0;
|
144 |
+
for ($i = 0;$i < strlen($revstr); $i++) {
|
145 |
+
|
146 |
+
if ($i%2 == 0) {
|
147 |
+
$multiplier = 2;
|
148 |
+
}
|
149 |
+
else $multiplier = 1;
|
150 |
+
|
151 |
+
$sub_total = intval($revstr[$i]) * $multiplier;
|
152 |
+
if ($sub_total >= 10) {
|
153 |
+
$temp = (string) $sub_total;
|
154 |
+
$sub_total = intval($temp[0]) + intval($temp[1]);
|
155 |
+
}
|
156 |
+
$total += $sub_total;
|
157 |
+
}
|
158 |
+
|
159 |
+
$check_digit = (10 - ($total % 10))%10;
|
160 |
+
$crn = str_pad(ltrim($ref, "0"),$crn_length-1,0,STR_PAD_LEFT) .$seperator. $check_digit;
|
161 |
return $crn;
|
162 |
}
|
163 |
}
|
app/code/community/Fontis/Australia/Model/Payment/Directdeposit.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -43,10 +40,10 @@ class Fontis_Australia_Model_Payment_Directdeposit extends Mage_Payment_Model_Me
|
|
43 |
{
|
44 |
return false;
|
45 |
}
|
46 |
-
|
47 |
$groupAccess = $this->getConfigData('customer_group_access');
|
48 |
$group = $this->getConfigData('customer_group');
|
49 |
-
|
50 |
if($groupAccess == 0)
|
51 |
{
|
52 |
// No restrictions on access
|
@@ -70,7 +67,7 @@ class Fontis_Australia_Model_Payment_Directdeposit extends Mage_Payment_Model_Me
|
|
70 |
return true;
|
71 |
}
|
72 |
}
|
73 |
-
|
74 |
// Default, restrict access
|
75 |
return false;
|
76 |
}
|
@@ -88,11 +85,11 @@ class Fontis_Australia_Model_Payment_Directdeposit extends Mage_Payment_Model_Me
|
|
88 |
{
|
89 |
$details['account_name'] = $this->getAccountName();
|
90 |
}
|
91 |
-
if ($this->getAccountBSB())
|
92 |
{
|
93 |
$details['account_bsb'] = $this->getAccountBSB();
|
94 |
}
|
95 |
-
if ($this->getAccountNumber())
|
96 |
{
|
97 |
$details['account_number'] = $this->getAccountNumber();
|
98 |
}
|
@@ -100,13 +97,13 @@ class Fontis_Australia_Model_Payment_Directdeposit extends Mage_Payment_Model_Me
|
|
100 |
{
|
101 |
$details['message'] = $this->getMessage();
|
102 |
}
|
103 |
-
if (!empty($details))
|
104 |
{
|
105 |
$this->getInfoInstance()->setAdditionalData(serialize($details));
|
106 |
}
|
107 |
return $this;
|
108 |
}
|
109 |
-
|
110 |
public function getAccountName()
|
111 |
{
|
112 |
return Mage::getStoreConfig('payment/directdeposit_au/account_name', $this->getInfoInstance()->getQuote()->getStoreId());
|
@@ -121,7 +118,7 @@ class Fontis_Australia_Model_Payment_Directdeposit extends Mage_Payment_Model_Me
|
|
121 |
{
|
122 |
return Mage::getStoreConfig('payment/directdeposit_au/account_number', $this->getInfoInstance()->getQuote()->getStoreId());
|
123 |
}
|
124 |
-
|
125 |
public function getMessage()
|
126 |
{
|
127 |
return Mage::getStoreConfig('payment/directdeposit_au/message', $this->getInfoInstance()->getQuote()->getStoreId());
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
40 |
{
|
41 |
return false;
|
42 |
}
|
43 |
+
|
44 |
$groupAccess = $this->getConfigData('customer_group_access');
|
45 |
$group = $this->getConfigData('customer_group');
|
46 |
+
|
47 |
if($groupAccess == 0)
|
48 |
{
|
49 |
// No restrictions on access
|
67 |
return true;
|
68 |
}
|
69 |
}
|
70 |
+
|
71 |
// Default, restrict access
|
72 |
return false;
|
73 |
}
|
85 |
{
|
86 |
$details['account_name'] = $this->getAccountName();
|
87 |
}
|
88 |
+
if ($this->getAccountBSB())
|
89 |
{
|
90 |
$details['account_bsb'] = $this->getAccountBSB();
|
91 |
}
|
92 |
+
if ($this->getAccountNumber())
|
93 |
{
|
94 |
$details['account_number'] = $this->getAccountNumber();
|
95 |
}
|
97 |
{
|
98 |
$details['message'] = $this->getMessage();
|
99 |
}
|
100 |
+
if (!empty($details))
|
101 |
{
|
102 |
$this->getInfoInstance()->setAdditionalData(serialize($details));
|
103 |
}
|
104 |
return $this;
|
105 |
}
|
106 |
+
|
107 |
public function getAccountName()
|
108 |
{
|
109 |
return Mage::getStoreConfig('payment/directdeposit_au/account_name', $this->getInfoInstance()->getQuote()->getStoreId());
|
118 |
{
|
119 |
return Mage::getStoreConfig('payment/directdeposit_au/account_number', $this->getInfoInstance()->getQuote()->getStoreId());
|
120 |
}
|
121 |
+
|
122 |
public function getMessage()
|
123 |
{
|
124 |
return Mage::getStoreConfig('payment/directdeposit_au/message', $this->getInfoInstance()->getQuote()->getStoreId());
|
app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php
CHANGED
@@ -9,14 +9,11 @@
|
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
@@ -82,43 +79,42 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost extends Mage_Shippin
|
|
82 |
|
83 |
if ($drc['err_msg'] == 'OK') {
|
84 |
// Check for registered post activation. If so, add extra options
|
85 |
-
if ($this->getConfigData('registered_post'))
|
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 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
}
|
122 |
}
|
123 |
}
|
124 |
} else {
|
@@ -267,23 +263,23 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost extends Mage_Shippin
|
|
267 |
{
|
268 |
// Construct the appropriate URL and send all the information
|
269 |
// to the Australia Post DRC.
|
270 |
-
|
271 |
// don't make a call if the postcodes are not populated.
|
272 |
if(is_null($fromPostCode) || is_null($toPostCode)) {
|
273 |
return array('err_msg' => 'One of To or From Postcodes are missing');
|
274 |
}
|
275 |
-
|
276 |
/**
|
277 |
* Lucas van Staden @ doghouse media (lucas@dhmedia.com.au)
|
278 |
* Add a drc call cache to session. (valid for 1 hour)
|
279 |
* The call to drc is made at least 3-4 times, using the same data (ugh)
|
280 |
* - Add to cart (sometimes * 2)
|
281 |
* - Checkout * 2
|
282 |
-
*
|
283 |
* Create a lookup cache based on FromPostcode->ToPostcode combination, and re-use cached data
|
284 |
* The end result will kill lookups in checkout process, as it was actually done at cart, which will speed checkout up.
|
285 |
*/
|
286 |
-
|
287 |
$drcCache = Mage::getSingleton('checkout/session')->getDrcCache();
|
288 |
if(!$drcCache) {
|
289 |
$drcCache = array();
|
@@ -292,8 +288,8 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost extends Mage_Shippin
|
|
292 |
// prevents any mistake from stopping checkout as a new lookup will be done.
|
293 |
try {
|
294 |
$time = time();
|
295 |
-
if($this->getConfigFlag('cache')
|
296 |
-
&& array_key_exists($fromPostCode, $drcCache)
|
297 |
&& array_key_exists($toPostCode, $drcCache[$fromPostCode])
|
298 |
&& $time - $drcCache[$fromPostCode][$toPostCode]['timestamp'] < 3600) {
|
299 |
if ($this->getConfigFlag('debug')) {
|
@@ -303,23 +299,23 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost extends Mage_Shippin
|
|
303 |
}
|
304 |
} catch (Exception $e) {
|
305 |
mage::logException($e);
|
306 |
-
}
|
307 |
}
|
308 |
-
|
309 |
-
$url = "http://drc.edeliver.com.au/ratecalc.asp?" .
|
310 |
"Pickup_Postcode=" . rawurlencode($fromPostCode) .
|
311 |
"&Destination_Postcode=" . rawurlencode($toPostCode) .
|
312 |
"&Country=" . rawurlencode($destCountry) .
|
313 |
"&Weight=" . rawurlencode($weight) .
|
314 |
-
"&Service_Type=" . rawurlencode($service) .
|
315 |
-
"&Height=" . rawurlencode($height) .
|
316 |
-
"&Width=" . rawurlencode($width) .
|
317 |
"&Length=" . rawurlencode($length) .
|
318 |
"&Quantity=" . rawurlencode($num_boxes);
|
319 |
-
|
320 |
if(extension_loaded('curl'))
|
321 |
{
|
322 |
-
|
323 |
if ($this->getConfigFlag('debug')) {
|
324 |
Mage::log('Using curl', null, 'fontis_australia.log');
|
325 |
}
|
@@ -346,15 +342,15 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost extends Mage_Shippin
|
|
346 |
$drc_result = explode("\n",$drc_result);
|
347 |
//clean up array
|
348 |
$drc_result = array_map('trim', $drc_result);
|
349 |
-
$drc_result = array_filter($drc_result);
|
350 |
-
|
351 |
}
|
352 |
else if(ini_get('allow_url_fopen'))
|
353 |
{
|
354 |
if ($this->getConfigFlag('debug')) {
|
355 |
Mage::log('Using fopen URL wrappers', null, 'fontis_australia.log');
|
356 |
}
|
357 |
-
|
358 |
$drc_result = file($url);
|
359 |
}
|
360 |
else
|
@@ -376,12 +372,12 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost extends Mage_Shippin
|
|
376 |
return array('err_msg' => 'Parsing error on Australia Post results');
|
377 |
}
|
378 |
}
|
379 |
-
|
380 |
// save the drc data to lookup cache, with a timestamp.
|
381 |
if(is_array($drcCache)){
|
382 |
-
$drcCache[$fromPostCode][$toPostCode] = array('result'=>$result,'timestamp'=>time());
|
383 |
Mage::getSingleton('checkout/session')->setDrcCache($drcCache);
|
384 |
-
}
|
385 |
return $result;
|
386 |
}
|
387 |
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
12 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_Australia
|
15 |
* @author Chris Norton
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
79 |
|
80 |
if ($drc['err_msg'] == 'OK') {
|
81 |
// Check for registered post activation. If so, add extra options
|
82 |
+
if ($this->getConfigData('registered_post')) {
|
83 |
+
$title = $this->getConfigData('name') . " " . ucfirst(strtolower($shipping_method));
|
84 |
+
|
85 |
+
$charge = $drc['charge'];
|
86 |
+
$charge += $this->getConfigData('registered_post_charge');
|
87 |
+
|
88 |
+
if ($this->getConfigData('person_to_person')) {
|
89 |
+
$charge += 5.50;
|
90 |
+
} elseif ($this->getConfigData('delivery_confirmation')) {
|
91 |
+
$charge += 1.85;
|
92 |
+
}
|
93 |
+
|
94 |
+
$method = $this->_createMethod($request, $shipping_method, $title, $charge, $charge);
|
95 |
+
$result->append($method);
|
96 |
+
|
97 |
+
// Insurance only covers up to $5000 worth of goods.
|
98 |
+
$packageValue = ($request->getPackageValue() > 5000) ? 5000 : $request->getPackageValue();
|
99 |
+
|
100 |
+
// Insurance cost is $1.25 per $100 or part thereof. First $100 is
|
101 |
+
// included in normal registered post costs.
|
102 |
+
$insurance = (ceil($packageValue / 100) - 1) * 1.25;
|
103 |
+
|
104 |
+
// Only add a new method if the insurance is different
|
105 |
+
if ($insurance > 0) {
|
106 |
+
$charge += $insurance;
|
107 |
+
|
108 |
+
$title = $this->getConfigData('name') . " " . ucfirst(strtolower($shipping_method)) . ' with Extra Cover';
|
109 |
+
$method = $this->_createMethod($request, $shipping_method . '_EC', $title, $charge, $charge);
|
110 |
+
$result->append($method);
|
111 |
+
}
|
112 |
+
} else {
|
113 |
+
$title = $this->getConfigData('name') . " " . ucfirst(strtolower($shipping_method));
|
114 |
+
|
115 |
+
$method = $this->_createMethod($request, $shipping_method, $title, $drc['charge'], $drc['charge']);
|
116 |
+
$result->append($method);
|
117 |
+
}
|
|
|
118 |
}
|
119 |
}
|
120 |
} else {
|
263 |
{
|
264 |
// Construct the appropriate URL and send all the information
|
265 |
// to the Australia Post DRC.
|
266 |
+
|
267 |
// don't make a call if the postcodes are not populated.
|
268 |
if(is_null($fromPostCode) || is_null($toPostCode)) {
|
269 |
return array('err_msg' => 'One of To or From Postcodes are missing');
|
270 |
}
|
271 |
+
|
272 |
/**
|
273 |
* Lucas van Staden @ doghouse media (lucas@dhmedia.com.au)
|
274 |
* Add a drc call cache to session. (valid for 1 hour)
|
275 |
* The call to drc is made at least 3-4 times, using the same data (ugh)
|
276 |
* - Add to cart (sometimes * 2)
|
277 |
* - Checkout * 2
|
278 |
+
*
|
279 |
* Create a lookup cache based on FromPostcode->ToPostcode combination, and re-use cached data
|
280 |
* The end result will kill lookups in checkout process, as it was actually done at cart, which will speed checkout up.
|
281 |
*/
|
282 |
+
|
283 |
$drcCache = Mage::getSingleton('checkout/session')->getDrcCache();
|
284 |
if(!$drcCache) {
|
285 |
$drcCache = array();
|
288 |
// prevents any mistake from stopping checkout as a new lookup will be done.
|
289 |
try {
|
290 |
$time = time();
|
291 |
+
if($this->getConfigFlag('cache')
|
292 |
+
&& array_key_exists($fromPostCode, $drcCache)
|
293 |
&& array_key_exists($toPostCode, $drcCache[$fromPostCode])
|
294 |
&& $time - $drcCache[$fromPostCode][$toPostCode]['timestamp'] < 3600) {
|
295 |
if ($this->getConfigFlag('debug')) {
|
299 |
}
|
300 |
} catch (Exception $e) {
|
301 |
mage::logException($e);
|
302 |
+
}
|
303 |
}
|
304 |
+
|
305 |
+
$url = "http://drc.edeliver.com.au/ratecalc.asp?" .
|
306 |
"Pickup_Postcode=" . rawurlencode($fromPostCode) .
|
307 |
"&Destination_Postcode=" . rawurlencode($toPostCode) .
|
308 |
"&Country=" . rawurlencode($destCountry) .
|
309 |
"&Weight=" . rawurlencode($weight) .
|
310 |
+
"&Service_Type=" . rawurlencode($service) .
|
311 |
+
"&Height=" . rawurlencode($height) .
|
312 |
+
"&Width=" . rawurlencode($width) .
|
313 |
"&Length=" . rawurlencode($length) .
|
314 |
"&Quantity=" . rawurlencode($num_boxes);
|
315 |
+
|
316 |
if(extension_loaded('curl'))
|
317 |
{
|
318 |
+
|
319 |
if ($this->getConfigFlag('debug')) {
|
320 |
Mage::log('Using curl', null, 'fontis_australia.log');
|
321 |
}
|
342 |
$drc_result = explode("\n",$drc_result);
|
343 |
//clean up array
|
344 |
$drc_result = array_map('trim', $drc_result);
|
345 |
+
$drc_result = array_filter($drc_result);
|
346 |
+
|
347 |
}
|
348 |
else if(ini_get('allow_url_fopen'))
|
349 |
{
|
350 |
if ($this->getConfigFlag('debug')) {
|
351 |
Mage::log('Using fopen URL wrappers', null, 'fontis_australia.log');
|
352 |
}
|
353 |
+
|
354 |
$drc_result = file($url);
|
355 |
}
|
356 |
else
|
372 |
return array('err_msg' => 'Parsing error on Australia Post results');
|
373 |
}
|
374 |
}
|
375 |
+
|
376 |
// save the drc data to lookup cache, with a timestamp.
|
377 |
if(is_array($drcCache)){
|
378 |
+
$drcCache[$fromPostCode][$toPostCode] = array('result'=>$result,'timestamp'=>time());
|
379 |
Mage::getSingleton('checkout/session')->setDrcCache($drcCache);
|
380 |
+
}
|
381 |
return $result;
|
382 |
}
|
383 |
|
app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel.php
CHANGED
@@ -8,9 +8,6 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* Originally based on Magento Tablerate Shipping code and Auctionmaid Matrixrate.
|
16 |
* @copyright Copyright (c) 2008 Auction Maid (http://www.auctionmaid.com)
|
@@ -19,7 +16,7 @@
|
|
19 |
* @category Fontis
|
20 |
* @package Fontis_Australia
|
21 |
* @author Chris Norton
|
22 |
-
* @copyright Copyright (c)
|
23 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
24 |
*/
|
25 |
|
@@ -31,48 +28,55 @@
|
|
31 |
*/
|
32 |
|
33 |
class Fontis_Australia_Model_Shipping_Carrier_Eparcel
|
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 |
-
if(is_array($rates))
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
$method = Mage::getModel('shipping/rate_result_method');
|
69 |
|
70 |
$method->setCarrier('eparcel');
|
71 |
$method->setCarrierTitle($this->getConfigData('title'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
-
$method->setMethod($this->_getChargeCode($rate));
|
74 |
-
$method->setMethodTitle($rate['delivery_type']);
|
75 |
-
|
76 |
$method->setMethodChargeCodeIndividual($rate['charge_code_individual']);
|
77 |
$method->setMethodChargeCodeBusiness($rate['charge_code_business']);
|
78 |
|
@@ -85,9 +89,7 @@ class Fontis_Australia_Model_Shipping_Carrier_Eparcel
|
|
85 |
$result->append($method);
|
86 |
}
|
87 |
}
|
88 |
-
}
|
89 |
-
else
|
90 |
-
{
|
91 |
if (!empty($rates) && $rates['price'] >= 0) {
|
92 |
$method = Mage::getModel('shipping/rate_result_method');
|
93 |
|
@@ -99,7 +101,7 @@ class Fontis_Australia_Model_Shipping_Carrier_Eparcel
|
|
99 |
|
100 |
$method->setMethodChargeCodeIndividual($rates['charge_code_individual']);
|
101 |
$method->setMethodChargeCodeBusiness($rates['charge_code_business']);
|
102 |
-
|
103 |
$shippingPrice = $this->getFinalPriceWithHandlingFee($rates['price']);
|
104 |
|
105 |
$method->setPrice($shippingPrice);
|
@@ -110,8 +112,8 @@ class Fontis_Australia_Model_Shipping_Carrier_Eparcel
|
|
110 |
}
|
111 |
}
|
112 |
|
113 |
-
|
114 |
-
|
115 |
|
116 |
protected function _getChargeCode($rate)
|
117 |
{
|
@@ -142,273 +144,118 @@ class Fontis_Australia_Model_Shipping_Carrier_Eparcel
|
|
142 |
return Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/default_charge_code_individual');
|
143 |
}
|
144 |
}
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
'label' => $observer->block->__('Eparcel CSV export'),
|
257 |
'url' => $observer->block->getUrl('australia/eparcel/export')
|
258 |
));
|
259 |
-
|
260 |
-
|
261 |
-
/**
|
262 |
-
* Event Observer. Triggered when a shipment is created.
|
263 |
-
*/
|
264 |
-
public function sendManifest($observer)
|
265 |
-
{
|
266 |
-
/**
|
267 |
-
* As far as I can tell, this has never worked.
|
268 |
-
* I'll refactor to work is possible and integrate with new charge code management.
|
269 |
-
* @author Jonathan Melnick
|
270 |
-
*/
|
271 |
-
return;
|
272 |
-
|
273 |
-
|
274 |
-
//Mage::log('=========================================================================');
|
275 |
-
|
276 |
-
$order = $observer->getEvent()->getShipment()->getOrder();
|
277 |
-
|
278 |
-
if(!($order->getShippingCarrier() instanceof $this)) {
|
279 |
-
return $this;
|
280 |
-
}
|
281 |
-
|
282 |
-
// The current timestamp is used several times
|
283 |
-
$timestamp = date('c');
|
284 |
-
|
285 |
-
// Save the consignment number as it will be used more than once
|
286 |
-
$consignmentNumber = $order->getIncrementId();
|
287 |
-
|
288 |
-
$doc = new SimpleXMLElement('<PCMS xmlns="http://www.auspost.com.au/xml/pcms"></PCMS>');
|
289 |
-
|
290 |
-
$pcms = $doc->addChild('SendPCMSManifest');
|
291 |
-
|
292 |
-
$head = $pcms->addChild('header');
|
293 |
-
$body = $pcms->addChild('body');
|
294 |
-
|
295 |
-
$head->addChild('TransactionDateTime', $timestamp);
|
296 |
-
$head->addChild('TransactionId', $consignmentNumber);
|
297 |
-
$head->addChild('TransactionSequence', '0'); // Used to identify a sequence of transactions, N/A
|
298 |
-
$head->addChild('ApplicationId', 'MERCHANT');
|
299 |
-
|
300 |
-
$manifest = $body->addChild('PCMSManifest');
|
301 |
-
|
302 |
-
$manifest->addChild('MerchantLocationId', $this->getConfigData('merchant_location_id')); // Testing = AWV
|
303 |
-
$manifest->addChild('ManifestNumber', $consignmentNumber);
|
304 |
-
$manifest->addChild('DateSubmitted', $timestamp);
|
305 |
-
$manifest->addChild('DateLodged', $timestamp);
|
306 |
-
|
307 |
-
// There may be multiple consignments per manifest.
|
308 |
-
$consignment = $manifest->addChild('PCMSConsignment');
|
309 |
-
|
310 |
-
// Get shipping address info
|
311 |
-
$shippingAddress = $order->getShippingAddress();
|
312 |
-
$name = $shippingAddress->getFirstname().' '.$shippingAddress->getLastname();
|
313 |
-
$street = $shippingAddress->getStreet();
|
314 |
-
|
315 |
-
// TODO: Revert back to using the Magento directory lookup, once they have
|
316 |
-
// fixed the code that does loadByName.
|
317 |
-
$stateCodes = array(
|
318 |
-
'Victoria' => 'VIC',
|
319 |
-
'New South Wales' => 'NSW',
|
320 |
-
'Australian Capital Territory' => 'ACT',
|
321 |
-
'Northern Territory' => 'NT',
|
322 |
-
'Queensland' => 'QLD',
|
323 |
-
'South Australia' => 'SA',
|
324 |
-
'Tasmania' => 'TAS',
|
325 |
-
'Western Australia' => 'WA'
|
326 |
-
);
|
327 |
-
|
328 |
-
|
329 |
-
$consignment->addChild('ConsignmentNumber', $consignmentNumber);
|
330 |
-
$consignment->addChild('ChargeCode', $this->getConfigData('charge_code')); // Testing = S2
|
331 |
-
$consignment->addChild('DeliveryName', $name);
|
332 |
-
if($shippingAddress->getCompany()) { $consignment->addChild('DeliveryCompanyName', $shippingAddress->getCompany()); } // Optional
|
333 |
-
if(is_array($street)) {
|
334 |
-
$consignment->addChild('DeliveryAddressLine1', $street[0]);
|
335 |
-
if(count($street) >= 2) { $consignment->addChild('DeliveryAddressLine2', $street[1]); } // Optional
|
336 |
-
if(count($street) >= 3) { $consignment->addChild('DeliveryAddressLine3', $street[2]); } // Optional
|
337 |
-
if(count($street) >= 4) { $consignment->addChild('DeliveryAddressLine4', $street[3]); } // Optional
|
338 |
-
}
|
339 |
-
else {
|
340 |
-
$consignment->addChild('DeliveryAddressLine1', $street);
|
341 |
-
}
|
342 |
-
$consignment->addChild('DeliveryPhoneNumber', $shippingAddress->getTelephone());
|
343 |
-
$consignment->addChild('DeliveryEmailAddress', $order->getCustomerEmail());
|
344 |
-
$consignment->addChild('DeliverySuburb', $shippingAddress->getCity());
|
345 |
-
//$consignment->addChild('DeliveryStateCode', Mage::getModel('directory/region')->loadByName($shippingAddress->getRegion(), 'AU')->getCode());
|
346 |
-
$consignment->addChild('DeliveryStateCode', $stateCodes[$shippingAddress->getRegion()]);
|
347 |
-
$consignment->addChild('DeliveryPostcode', $shippingAddress->getPostcode());
|
348 |
-
$consignment->addChild('DeliveryCountryCode', 'AU'); // International deliveries not currently accepted
|
349 |
-
$consignment->addChild('IsInternationalDelivery', 'false'); // International deliveries not currently accepted
|
350 |
-
$consignment->addChild('ReturnName', $this->getConfigData('return_name')); // Optional
|
351 |
-
$consignment->addChild('ReturnAddressLine1', $this->getConfigData('return_address_1'));
|
352 |
-
$consignment->addChild('ReturnAddressLine2', $this->getConfigData('return_address_2')); // Optional
|
353 |
-
$consignment->addChild('ReturnAddressLine3', $this->getConfigData('return_address_3')); // Optional
|
354 |
-
$consignment->addChild('ReturnAddressLine4', $this->getConfigData('return_address_4')); // Optional
|
355 |
-
$consignment->addChild('ReturnSuburb', $this->getConfigData('return_suburb'));
|
356 |
-
$consignment->addChild('ReturnStateCode', $this->getConfigData('return_state'));
|
357 |
-
$consignment->addChild('ReturnPostcode', $this->getConfigData('return_postcode'));
|
358 |
-
$consignment->addChild('ReturnCountryCode', 'AU');
|
359 |
-
$consignment->addChild('CreatedDateTime', $timestamp);
|
360 |
-
$consignment->addChild('PostChargeToAccount', $this->getConfigData('post_charge_account')); // For Testing = 8830728
|
361 |
-
$consignment->addChild('IsSignatureRequired', $this->getConfigData('signature_required') ? 'Y' : 'N'); // Y/N
|
362 |
-
$consignment->addChild('DeliverPartConsignment', 'N'); // Y/N
|
363 |
-
$consignment->addChild('ContainsDangerousGoods', 'false'); // true/false
|
364 |
-
|
365 |
-
foreach($order->getAllVisibleItems() as $item) {
|
366 |
-
Mage::log('Item: ' . print_r($item->getData(), true));
|
367 |
-
// Consignments have one article per product
|
368 |
-
$article = $consignment->addChild('PCMSDomesticArticle'); // International deliveries not currently accepted
|
369 |
-
|
370 |
-
$article->addChild('ArticleNumber', $item->getSku());
|
371 |
-
$article->addChild('BarcodeArticleNumber', '');
|
372 |
-
//$article->addChild('Length', ''); // Optional
|
373 |
-
//$article->addChild('Width', ''); // Optional
|
374 |
-
//$article->addChild('Height', ''); // Optional
|
375 |
-
$article->addChild('ActualWeight', $item->getRowWeight());
|
376 |
-
//$article->addChild('CubicWeight', ''); // Optional
|
377 |
-
$article->addChild('ArticleDescription', $item->getShortDescription());
|
378 |
-
$article->addChild('IsTransitCoverRequired', 'N');
|
379 |
-
//$article->addChild('TransitCoverAmount', '');
|
380 |
-
|
381 |
-
// All contents are optional
|
382 |
-
$contents = $article->addChild('ContentsItem');
|
383 |
-
|
384 |
-
//$contents->addChild('ProductType', '');
|
385 |
-
//$contents->addChild('GoodsDescription', '');
|
386 |
-
//$contents->addChild('CountryOriginCode', '');
|
387 |
-
//$contents->addChild('Weight', $item->getWeight());
|
388 |
-
$contents->addChild('Quantity', $item->getQtyShipped());
|
389 |
-
$contents->addChild('UnitValue', $item->getPrice());
|
390 |
-
$contents->addChild('Value', $item->getRowTotal());
|
391 |
-
//$contents->addChild('HSTariff', '');
|
392 |
-
//$contents->addChild('ProductClassification', '');
|
393 |
-
//*/
|
394 |
-
}
|
395 |
-
|
396 |
-
$data = $doc->asXML();
|
397 |
-
|
398 |
-
//Mage::log($data);
|
399 |
-
|
400 |
-
$soap = new SoapClient('https://test603a.auspost.com.au/despatchManifest/DespatchManifestWS?WSDL', array('login' => 'soaptest', 'password' => 'password'));
|
401 |
-
$soap->submitManifestForDespatch($data);
|
402 |
-
|
403 |
-
// Automatically add tracking information
|
404 |
-
$track = Mage::getModel('sales/order_shipment_track');
|
405 |
-
$track->setCarrierCode('eparcel');
|
406 |
-
$track->setNumber($consignmentNumber);
|
407 |
-
$track->setTitle($this->getConfigData('title'));
|
408 |
-
$observer->getEvent()->getShipment()->addTrack($track);
|
409 |
-
|
410 |
-
//Mage::log(print_r($track->getData(), true));
|
411 |
-
|
412 |
-
return $this;
|
413 |
-
}
|
414 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* Originally based on Magento Tablerate Shipping code and Auctionmaid Matrixrate.
|
13 |
* @copyright Copyright (c) 2008 Auction Maid (http://www.auctionmaid.com)
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
28 |
*/
|
29 |
|
30 |
class Fontis_Australia_Model_Shipping_Carrier_Eparcel
|
31 |
+
extends Mage_Shipping_Model_Carrier_Abstract
|
32 |
+
implements Mage_Shipping_Model_Carrier_Interface
|
33 |
{
|
34 |
+
protected $_code = 'eparcel';
|
35 |
+
protected $_default_condition_name = 'package_weight';
|
36 |
+
|
37 |
+
protected $_conditionNames = array();
|
38 |
+
|
39 |
+
public function __construct()
|
40 |
+
{
|
41 |
+
parent::__construct();
|
42 |
+
foreach ($this->getCode('condition_name') as $k=>$v) {
|
43 |
+
$this->_conditionNames[] = $k;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
|
48 |
+
{
|
49 |
+
if (!$this->getConfigFlag('active')) {
|
50 |
+
return false;
|
51 |
+
}
|
52 |
+
|
53 |
+
if (!$request->getConditionName()) {
|
54 |
+
$request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
|
55 |
+
}
|
56 |
+
|
57 |
+
$result = Mage::getModel('shipping/rate_result');
|
58 |
+
$rates = $this->getRate($request);
|
59 |
+
|
60 |
+
if (is_array($rates)) {
|
61 |
+
foreach ($rates as $rate) {
|
62 |
+
if (!empty($rate) && $rate['price'] >= 0) {
|
63 |
+
/** @var Mage_Shipping_Model_Rate_Result_Method $method */
|
64 |
+
$method = Mage::getModel('shipping/rate_result_method');
|
|
|
65 |
|
66 |
$method->setCarrier('eparcel');
|
67 |
$method->setCarrierTitle($this->getConfigData('title'));
|
68 |
+
if ($this->_getChargeCode($rate)) {
|
69 |
+
$_method = strtolower(str_replace(' ', '_', $this->_getChargeCode($rate)));
|
70 |
+
} else {
|
71 |
+
$_method = strtolower(str_replace(' ', '_', $rate['delivery_type']));
|
72 |
+
}
|
73 |
+
$method->setMethod($_method);
|
74 |
+
if ($this->getConfigData('carriers/eparcel/name')) {
|
75 |
+
$method->setMethodTitle($this->getConfigData('carriers/eparcel/name'));
|
76 |
+
} else {
|
77 |
+
$method->setMethodTitle($rate['delivery_type']);
|
78 |
+
}
|
79 |
|
|
|
|
|
|
|
80 |
$method->setMethodChargeCodeIndividual($rate['charge_code_individual']);
|
81 |
$method->setMethodChargeCodeBusiness($rate['charge_code_business']);
|
82 |
|
89 |
$result->append($method);
|
90 |
}
|
91 |
}
|
92 |
+
} else {
|
|
|
|
|
93 |
if (!empty($rates) && $rates['price'] >= 0) {
|
94 |
$method = Mage::getModel('shipping/rate_result_method');
|
95 |
|
101 |
|
102 |
$method->setMethodChargeCodeIndividual($rates['charge_code_individual']);
|
103 |
$method->setMethodChargeCodeBusiness($rates['charge_code_business']);
|
104 |
+
|
105 |
$shippingPrice = $this->getFinalPriceWithHandlingFee($rates['price']);
|
106 |
|
107 |
$method->setPrice($shippingPrice);
|
112 |
}
|
113 |
}
|
114 |
|
115 |
+
return $result;
|
116 |
+
}
|
117 |
|
118 |
protected function _getChargeCode($rate)
|
119 |
{
|
144 |
return Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/default_charge_code_individual');
|
145 |
}
|
146 |
}
|
147 |
+
|
148 |
+
public function getRate(Mage_Shipping_Model_Rate_Request $request)
|
149 |
+
{
|
150 |
+
return Mage::getResourceModel('australia/shipping_carrier_eparcel')->getRate($request);
|
151 |
+
}
|
152 |
+
|
153 |
+
public function getCode($type, $code='')
|
154 |
+
{
|
155 |
+
$codes = array(
|
156 |
+
|
157 |
+
'condition_name'=>array(
|
158 |
+
'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
|
159 |
+
'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
|
160 |
+
'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
|
161 |
+
),
|
162 |
+
|
163 |
+
'condition_name_short'=>array(
|
164 |
+
'package_weight' => Mage::helper('shipping')->__('Weight (and above)'),
|
165 |
+
'package_value' => Mage::helper('shipping')->__('Order Subtotal (and above)'),
|
166 |
+
'package_qty' => Mage::helper('shipping')->__('# of Items (and above)'),
|
167 |
+
),
|
168 |
+
|
169 |
+
);
|
170 |
+
|
171 |
+
if (!isset($codes[$type])) {
|
172 |
+
throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Table Rate code type: %s', $type));
|
173 |
+
}
|
174 |
+
|
175 |
+
if (''===$code) {
|
176 |
+
return $codes[$type];
|
177 |
+
}
|
178 |
+
|
179 |
+
if (!isset($codes[$type][$code])) {
|
180 |
+
throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Table Rate code for type %s: %s', $type, $code));
|
181 |
+
}
|
182 |
+
|
183 |
+
return $codes[$type][$code];
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Get allowed shipping methods
|
188 |
+
*
|
189 |
+
* @return array
|
190 |
+
*/
|
191 |
+
public function getAllowedMethods()
|
192 |
+
{
|
193 |
+
return array('bestway'=>$this->getConfigData('name'));
|
194 |
+
}
|
195 |
+
|
196 |
+
/*
|
197 |
+
* Tracking code
|
198 |
+
*
|
199 |
+
* @return bool
|
200 |
+
*/
|
201 |
+
public function isTrackingAvailable()
|
202 |
+
{
|
203 |
+
return true;
|
204 |
+
}
|
205 |
+
|
206 |
+
public function getTrackingInfo($tracking)
|
207 |
+
{
|
208 |
+
$result = $this->getTracking($tracking);
|
209 |
+
|
210 |
+
if ($result instanceof Mage_Shipping_Model_Tracking_Result) {
|
211 |
+
if ($trackings = $result->getAllTrackings()) {
|
212 |
+
return $trackings[0];
|
213 |
+
}
|
214 |
+
} elseif (is_string($result) && !empty($result)) {
|
215 |
+
return $result;
|
216 |
+
}
|
217 |
+
|
218 |
+
return false;
|
219 |
+
}
|
220 |
+
|
221 |
+
public function getTracking($trackings)
|
222 |
+
{
|
223 |
+
if (!is_array($trackings)) {
|
224 |
+
$trackings = array($trackings);
|
225 |
+
}
|
226 |
+
|
227 |
+
return $this->_getTracking($trackings);
|
228 |
+
}
|
229 |
+
|
230 |
+
protected function _getTracking($trackings)
|
231 |
+
{
|
232 |
+
$result = Mage::getModel('shipping/tracking_result');
|
233 |
+
|
234 |
+
foreach($trackings as $t) {
|
235 |
+
$tracking = Mage::getModel('shipping/tracking_result_status');
|
236 |
+
$tracking->setCarrier($this->_code);
|
237 |
+
$tracking->setCarrierTitle($this->getConfigData('title'));
|
238 |
+
$tracking->setTracking($t);
|
239 |
+
$tracking->setUrl('http://www.eparcel.com.au/');
|
240 |
+
$result->append($tracking);
|
241 |
+
}
|
242 |
+
|
243 |
+
return $result;
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Event Observer. Triggered before an adminhtml widget template is rendered.
|
248 |
+
* We use this to add our action to bulk actions in the sales order grid instead of overridding the class.
|
249 |
+
*/
|
250 |
+
public function addExportToBulkAction($observer)
|
251 |
+
{
|
252 |
+
if (! $observer->block instanceof Mage_Adminhtml_Block_Sales_Order_Grid) {
|
253 |
+
return;
|
254 |
+
}
|
255 |
+
|
256 |
+
$observer->block->getMassactionBlock()->addItem('eparcelexport', array(
|
257 |
+
'label' => $observer->block->__('Export to CSV (eParcel)'),
|
|
|
258 |
'url' => $observer->block->getUrl('australia/eparcel/export')
|
259 |
));
|
260 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Abstract.php
CHANGED
@@ -14,151 +14,151 @@
|
|
14 |
abstract class Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
15 |
extends Mage_Core_Model_Abstract
|
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 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
}
|
14 |
abstract class Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
15 |
extends Mage_Core_Model_Abstract
|
16 |
{
|
17 |
+
/**
|
18 |
+
* Returns the name of the website, store and store view the order was placed in.
|
19 |
+
*
|
20 |
+
* @param Mage_Sales_Model_Order $order The order to return info from
|
21 |
+
* @return String The name of the website, store and store view the order was placed in
|
22 |
+
*/
|
23 |
+
protected function getStoreName($order)
|
24 |
+
{
|
25 |
+
$storeId = $order->getStoreId();
|
26 |
+
if (is_null($storeId)) {
|
27 |
+
return $this->getOrder()->getStoreName();
|
28 |
+
}
|
29 |
+
$store = Mage::app()->getStore($storeId);
|
30 |
+
$name = array(
|
31 |
+
$store->getWebsite()->getName(),
|
32 |
+
$store->getGroup()->getName(),
|
33 |
+
$store->getName()
|
34 |
+
);
|
35 |
+
return implode(', ', $name);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Returns the payment method of the given order.
|
40 |
+
*
|
41 |
+
* @param Mage_Sales_Model_Order $order The order to return info from
|
42 |
+
* @return String The name of the payment method
|
43 |
+
*/
|
44 |
+
protected function getPaymentMethod($order)
|
45 |
+
{
|
46 |
+
return $order->getPayment()->getMethod();
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Returns the shipping method of the given order.
|
51 |
+
*
|
52 |
+
* @param Mage_Sales_Model_Order $order The order to return info from
|
53 |
+
* @return String The name of the shipping method
|
54 |
+
*/
|
55 |
+
protected function getShippingMethod($order)
|
56 |
+
{
|
57 |
+
if (!$order->getIsVirtual() && $order->getShippingMethod()) {
|
58 |
+
return $order->getShippingMethod();
|
59 |
+
}
|
60 |
+
return '';
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Returns the total quantity of ordered items of the given order.
|
65 |
+
*
|
66 |
+
* @param Mage_Sales_Model_Order $order The order to return info from
|
67 |
+
* @return int The total quantity of ordered items
|
68 |
+
*/
|
69 |
+
protected function getTotalQtyItemsOrdered($order) {
|
70 |
+
$qty = 0;
|
71 |
+
$orderedItems = $order->getItemsCollection();
|
72 |
+
foreach ($orderedItems as $item)
|
73 |
+
{
|
74 |
+
if (!$item->isDummy()) {
|
75 |
+
$qty += (int)$item->getQtyOrdered();
|
76 |
+
}
|
77 |
+
}
|
78 |
+
return $qty;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Returns the sku of the given item dependant on the product type.
|
83 |
+
*
|
84 |
+
* @param Mage_Sales_Model_Order_Item $item The item to return info from
|
85 |
+
* @return String The sku
|
86 |
+
*/
|
87 |
+
protected function getItemSku($item)
|
88 |
+
{
|
89 |
+
if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
|
90 |
+
return $item->getProductOptionByCode('simple_sku');
|
91 |
+
}
|
92 |
+
return $item->getSku();
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Returns the options of the given item separated by comma(s) like this:
|
97 |
+
* option1: value1, option2: value2
|
98 |
+
*
|
99 |
+
* @param Mage_Sales_Model_Order_Item $item The item to return info from
|
100 |
+
* @return String The item options
|
101 |
+
*/
|
102 |
+
protected function getItemOptions($item)
|
103 |
+
{
|
104 |
+
$options = '';
|
105 |
+
if ($orderOptions = $this->getItemOrderOptions($item)) {
|
106 |
+
foreach ($orderOptions as $_option) {
|
107 |
+
if (strlen($options) > 0) {
|
108 |
+
$options .= ', ';
|
109 |
+
}
|
110 |
+
$options .= $_option['label'].': '.$_option['value'];
|
111 |
+
}
|
112 |
+
}
|
113 |
+
return $options;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Returns all the product options of the given item including additional_options and
|
118 |
+
* attributes_info.
|
119 |
+
*
|
120 |
+
* @param Mage_Sales_Model_Order_Item $item The item to return info from
|
121 |
+
* @return Array The item options
|
122 |
+
*/
|
123 |
+
protected function getItemOrderOptions($item)
|
124 |
+
{
|
125 |
+
$result = array();
|
126 |
+
if ($options = $item->getProductOptions()) {
|
127 |
+
if (isset($options['options'])) {
|
128 |
+
$result = array_merge($result, $options['options']);
|
129 |
+
}
|
130 |
+
if (isset($options['additional_options'])) {
|
131 |
+
$result = array_merge($result, $options['additional_options']);
|
132 |
+
}
|
133 |
+
if (!empty($options['attributes_info'])) {
|
134 |
+
$result = array_merge($options['attributes_info'], $result);
|
135 |
+
}
|
136 |
+
}
|
137 |
+
return $result;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Calculates and returns the grand total of an item including tax and excluding
|
142 |
+
* discount.
|
143 |
+
*
|
144 |
+
* @param Mage_Sales_Model_Order_Item $item The item to return info from
|
145 |
+
* @return Float The grand total
|
146 |
+
*/
|
147 |
+
protected function getItemTotal($item)
|
148 |
+
{
|
149 |
+
return $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount();
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Formats a price by adding the currency symbol and formatting the number
|
154 |
+
* depending on the current locale.
|
155 |
+
*
|
156 |
+
* @param Float $price The price to format
|
157 |
+
* @param Mage_Sales_Model_Order $formatter The order to format the price by implementing the method formatPriceTxt($price)
|
158 |
+
* @return String The formatted price
|
159 |
+
*/
|
160 |
+
protected function formatPrice($price, $formatter)
|
161 |
+
{
|
162 |
+
return $formatter->formatPriceTxt($price);
|
163 |
+
}
|
164 |
}
|
app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Csv.php
CHANGED
@@ -10,82 +10,18 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
|
10 |
{
|
11 |
const ENCLOSURE = '"';
|
12 |
const DELIMITER = ',';
|
13 |
-
|
14 |
const DEBUG = false;
|
15 |
|
16 |
protected $_defaults = null;
|
17 |
-
|
18 |
-
/* AUSTRALIA POST CHARGE CODES */
|
19 |
-
protected $_chargeCodes = array(
|
20 |
-
|
21 |
-
/* Domestic / Standard / Individual */
|
22 |
-
|
23 |
-
'S1', // EPARCEL 1 Domestic
|
24 |
-
'S2', // EPARCEL 2 Domestic
|
25 |
-
'S3', // EPARCEL 3 Domestic
|
26 |
-
'S4', // EPARCEL 4 Domestic
|
27 |
-
'S5', // EPARCEL 5 Domestic
|
28 |
-
'S6', // EPARCEL 6 Domestic
|
29 |
-
'S7', // EPARCEL 7 Domestic
|
30 |
-
'S8', // EPARCEL 8 Domestic
|
31 |
-
|
32 |
-
/* Domestic / Standard / Business */
|
33 |
-
|
34 |
-
'B1', // B TO B EPARCEL 1 Domestic
|
35 |
-
'B2', // B TO B EPARCEL 2 Domestic
|
36 |
-
'B5', // B TO B EPARCEL 5 Domestic
|
37 |
-
|
38 |
-
/* Domestic / Express / Individual */
|
39 |
-
'X1', // EXPRESS POST EPARCEL Domestic
|
40 |
-
'X2', // EXPRESS POST EPARCEL 2 Domestic
|
41 |
-
|
42 |
-
/* Domestic / Express / Business */
|
43 |
-
'XB1', // EXPRESS POST EPARCEL B2B Domestic
|
44 |
-
'XB2', // EXPRESS POST EPARCEL B2B 2 Domestic
|
45 |
-
|
46 |
-
/* International / Standard */
|
47 |
-
'AIR1', // INTERNATIONAL Airmail 1 International
|
48 |
-
'AIR2', // INTERNATIONAL Airmail 2 International
|
49 |
-
'AIR3', // INTERNATIONAL Airmail - 8 Zones International
|
50 |
-
|
51 |
-
/* International / Express */
|
52 |
-
'EPI1', // Express Post International International
|
53 |
-
'EPI2', // Express Post International International
|
54 |
-
'EPI3', // Express Post International – 8 zones International
|
55 |
-
|
56 |
-
'ECM1', // Express Courier Int’l Merchandise 1 International
|
57 |
-
'ECM2', // Express Courier Int’l Merchandise 2 International
|
58 |
-
'ECM3', // Express Courier Int’l Merch 8Zone International
|
59 |
-
|
60 |
-
'ECD1', // EXPRESS COURIER INT'L DOC 1 International
|
61 |
-
'ECD2', // EXPRESS COURIER INT'L DOC 2 International
|
62 |
-
'ECD3', // Express Courier Int’l Doc – 8 zones International
|
63 |
-
|
64 |
-
/* Other */
|
65 |
-
|
66 |
-
'CFR', // eParcel Call For Return Domestic
|
67 |
-
'PR', // eParcel Post Returns Service Domestic
|
68 |
-
|
69 |
-
'CS1', // CTC EPARCEL Domestic
|
70 |
-
'CS4', // CTC EPARCEL Domestic
|
71 |
-
'CS5', // CTC EPARCEL 5 Domestic
|
72 |
-
'CS6', // CTC EPARCEL 6 Domestic
|
73 |
-
'CS7', // CTC EPARCEL 7 Domestic
|
74 |
-
'CS8', // CTC EPARCEL 8 Domestic
|
75 |
-
|
76 |
-
'CX1', // CTC EXPRESS POST 500G BRK Domestic
|
77 |
-
'CX2', // CTC EXPRESS POST MULTI BRK Domestic
|
78 |
-
|
79 |
-
'RPI1', // Registered Post International International
|
80 |
-
);
|
81 |
-
|
82 |
/**
|
83 |
* Implementation of abstract method to export given orders to csv file in var/export.
|
84 |
*
|
85 |
* @param $orders List of orders of type Mage_Sales_Model_Order or order ids to export.
|
86 |
* @return String The name of the written csv file in var/export
|
87 |
*/
|
88 |
-
public function exportOrders($orders)
|
89 |
{
|
90 |
$eparcel = new Doghouse_Australia_Eparcel();
|
91 |
|
@@ -94,30 +30,30 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
|
94 |
|
95 |
if ( ! $order->getShippingCarrier() instanceof Fontis_Australia_Model_Shipping_Carrier_Eparcel ) {
|
96 |
throw new Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Exception(
|
97 |
-
"Order #" . $order->getIncrementId() . " doesn't use Australia Post
|
98 |
-
);
|
99 |
}
|
100 |
-
|
101 |
$orderItems = $order->getItemsCollection();
|
102 |
-
$currentParcel = $this->getNewParcel();
|
103 |
-
$
|
104 |
-
|
105 |
foreach ($orderItems as $item) {
|
106 |
/* Check item is valid */
|
107 |
if ( $item->isDummy() ) continue;
|
108 |
|
109 |
/* Calculate item quantity */
|
110 |
$itemQuantity = $item->getData('qty_ordered') - $item->getData('qty_canceled') - $item->getData('qty_shipped');
|
111 |
-
|
112 |
/* Check item quantity */
|
113 |
if ( $itemQuantity == 0 ) continue;
|
114 |
-
|
115 |
/*
|
116 |
* Populate Good Record
|
117 |
-
*
|
118 |
-
* UPDATE 2010.06.16 : Auspost support has said that we should only have ONE good record
|
119 |
* per consignment (though their documentation says otherwise)
|
120 |
-
*
|
121 |
* @var Doghouse_Australia_Eparcel_Record_Good
|
122 |
*/
|
123 |
$goodRecord = new Doghouse_Australia_Eparcel_Record_Good();
|
@@ -130,22 +66,22 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
|
130 |
$goodRecord->weight = max($item['weight'], 0);
|
131 |
$goodRecord->unitValue = max($item->getData('price') + $item->getData('tax_amount'), 0);
|
132 |
$goodRecord->totalValue = max($goodRecord->unitValue * $goodRecord->quantity, 0);
|
133 |
-
|
134 |
-
/* We have at least one Good,
|
135 |
-
if (! $
|
136 |
-
$eparcel->addRecord($
|
137 |
}
|
138 |
-
|
139 |
/* If current parcel can't fit extra item, close it, and open new parcel */
|
140 |
if (! $currentParcel->canAddGood($goodRecord)) {
|
141 |
-
$this->closeParcel($eparcel
|
142 |
-
$currentParcel = $this->getNewParcel();
|
143 |
}
|
144 |
-
|
145 |
/* Add item to Parcel */
|
146 |
$currentParcel->addGood($goodRecord);
|
147 |
}
|
148 |
-
|
149 |
$this->closeParcel($eparcel, $currentParcel);
|
150 |
}
|
151 |
|
@@ -154,11 +90,11 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
|
154 |
nl2br($this->log())
|
155 |
);
|
156 |
}
|
157 |
-
|
158 |
/* Save file */
|
159 |
$fileName = 'order_export_'.date("Ymd_His").'_eparcel.csv';
|
160 |
$filePath = Mage::getBaseDir('export').'/'.$fileName;
|
161 |
-
|
162 |
if ($eparcel->makeCsv($filePath)) {
|
163 |
return $filePath;
|
164 |
}
|
@@ -167,39 +103,45 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
|
167 |
"Unable to build .CSV file!"
|
168 |
);
|
169 |
}
|
170 |
-
|
171 |
-
|
|
|
|
|
|
|
|
|
172 |
{
|
173 |
$parcel = new Doghouse_Australia_Eparcel_Parcel_Carton();
|
174 |
-
|
175 |
-
$parcel->isInsuranceRequired(
|
176 |
-
|
|
|
|
|
177 |
$parcel->weightMax = $this->getDefault('parcel/weightmax');
|
178 |
$parcel->width = (int) $this->getDefault('parcel/width');
|
179 |
$parcel->height = (int) $this->getDefault('parcel/height');
|
180 |
$parcel->length = (int) $this->getDefault('parcel/length');
|
181 |
-
|
182 |
return $parcel;
|
183 |
}
|
184 |
-
|
185 |
protected function closeParcel(Doghouse_Australia_Eparcel $eparcel, Doghouse_Australia_Eparcel_Parcel $parcel)
|
186 |
{
|
187 |
$articleRecordClass = (bool) $this->getDefault('parcel/use_cubicweight') ?
|
188 |
'Doghouse_Australia_Eparcel_Record_Article_CubicWeight' :
|
189 |
'Doghouse_Australia_Eparcel_Record_Article';
|
190 |
-
|
191 |
$goodRecords = $parcel->getGoodRecords();
|
192 |
|
193 |
if (count($goodRecords) == 0) {
|
194 |
return false;
|
195 |
}
|
196 |
-
|
197 |
$eparcel->addRecord(
|
198 |
$parcel->processArticleRecord(
|
199 |
new $articleRecordClass()
|
200 |
)
|
201 |
);
|
202 |
-
|
203 |
if ((bool) $this->getDefault('good/use_multiplegoodrecords')) {
|
204 |
foreach ($parcel->getGoodRecords() as $_goodRecord) {
|
205 |
$eparcel->addRecord($_goodRecord);
|
@@ -211,63 +153,77 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
|
211 |
$goodRecord->hsTariffCode = '';
|
212 |
$goodRecord->productClassification = null;
|
213 |
$goodRecord->quantity = 1;
|
214 |
-
|
215 |
foreach ($parcel->getGoodRecords() as $_goodRecord) {
|
216 |
/* Set product type and description */
|
217 |
$goodRecord->productType = $_goodRecord->productType;
|
218 |
-
$goodRecord->description = str_replace(',', '', $_goodRecord->
|
219 |
-
|
220 |
/* Add weight * quantity */
|
221 |
$goodRecord->weight += $_goodRecord->weight * $_goodRecord->quantity;
|
222 |
$goodRecord->unitValue += $_goodRecord->unitValue * $_goodRecord->quantity;
|
223 |
$goodRecord->totalValue += $_goodRecord->totalValue;
|
224 |
}
|
225 |
-
|
226 |
$eparcel->addRecord($goodRecord);
|
227 |
}
|
228 |
-
|
229 |
return true;
|
230 |
}
|
231 |
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
234 |
{
|
235 |
-
|
236 |
-
|
237 |
-
$
|
238 |
-
|
239 |
-
$
|
240 |
-
|
241 |
-
$
|
242 |
-
$
|
243 |
-
|
|
|
|
|
244 |
/* AusPost said this was useless/pointless */
|
245 |
-
//$
|
246 |
-
|
247 |
-
$
|
248 |
-
$
|
249 |
-
$
|
250 |
-
$
|
251 |
-
$
|
252 |
-
$
|
253 |
-
$
|
254 |
-
$
|
255 |
-
$
|
256 |
-
$
|
257 |
-
$
|
258 |
-
$
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
-
|
263 |
protected function _getChargeCode(Mage_Sales_Model_Order $order)
|
264 |
{
|
265 |
list ($carrierCode, $chargeCode) = explode('_', $order->getData('shipping_method'));
|
266 |
-
|
267 |
-
|
|
|
|
|
|
|
268 |
return $chargeCode;
|
269 |
}
|
270 |
-
|
271 |
/* Is this customer is in a ~business~ group ? */
|
272 |
$isBusinessCustomer = in_array(
|
273 |
$order->getData('customer_group_id'),
|
@@ -275,29 +231,24 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
|
|
275 |
Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/business_groups')
|
276 |
)
|
277 |
);
|
278 |
-
|
279 |
return $isBusinessCustomer ?
|
280 |
Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/default_charge_code_business') :
|
281 |
Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/default_charge_code_individual');
|
282 |
}
|
283 |
-
|
284 |
-
protected function _isValidChargeCode($chargeCode)
|
285 |
-
{
|
286 |
-
return in_array($chargeCode, $this->_chargeCodes);
|
287 |
-
}
|
288 |
-
|
289 |
protected function getDefault($key)
|
290 |
{
|
291 |
if (! is_array($this->_defaults)) {
|
292 |
$this->_defaults = Mage::getStoreConfig('doghouse_eparcelexport');
|
293 |
}
|
294 |
-
|
295 |
$_defaults = $this->_defaults;
|
296 |
-
|
297 |
-
|
298 |
$_defaults = $_defaults[$keyPart];
|
299 |
}
|
300 |
|
301 |
return $_defaults;
|
302 |
}
|
303 |
-
}
|
10 |
{
|
11 |
const ENCLOSURE = '"';
|
12 |
const DELIMITER = ',';
|
13 |
+
|
14 |
const DEBUG = false;
|
15 |
|
16 |
protected $_defaults = null;
|
17 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Implementation of abstract method to export given orders to csv file in var/export.
|
20 |
*
|
21 |
* @param $orders List of orders of type Mage_Sales_Model_Order or order ids to export.
|
22 |
* @return String The name of the written csv file in var/export
|
23 |
*/
|
24 |
+
public function exportOrders($orders)
|
25 |
{
|
26 |
$eparcel = new Doghouse_Australia_Eparcel();
|
27 |
|
30 |
|
31 |
if ( ! $order->getShippingCarrier() instanceof Fontis_Australia_Model_Shipping_Carrier_Eparcel ) {
|
32 |
throw new Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Exception(
|
33 |
+
"Order #" . $order->getIncrementId() . " doesn't use Australia Post eParcel as its carrier!"
|
34 |
+
);
|
35 |
}
|
36 |
+
|
37 |
$orderItems = $order->getItemsCollection();
|
38 |
+
$currentParcel = $this->getNewParcel($order);
|
39 |
+
$consignmentRecord = $this->getConsignmentRecord($order,$currentParcel);
|
40 |
+
|
41 |
foreach ($orderItems as $item) {
|
42 |
/* Check item is valid */
|
43 |
if ( $item->isDummy() ) continue;
|
44 |
|
45 |
/* Calculate item quantity */
|
46 |
$itemQuantity = $item->getData('qty_ordered') - $item->getData('qty_canceled') - $item->getData('qty_shipped');
|
47 |
+
|
48 |
/* Check item quantity */
|
49 |
if ( $itemQuantity == 0 ) continue;
|
50 |
+
|
51 |
/*
|
52 |
* Populate Good Record
|
53 |
+
*
|
54 |
+
* UPDATE 2010.06.16 : Auspost support has said that we should only have ONE good record
|
55 |
* per consignment (though their documentation says otherwise)
|
56 |
+
*
|
57 |
* @var Doghouse_Australia_Eparcel_Record_Good
|
58 |
*/
|
59 |
$goodRecord = new Doghouse_Australia_Eparcel_Record_Good();
|
66 |
$goodRecord->weight = max($item['weight'], 0);
|
67 |
$goodRecord->unitValue = max($item->getData('price') + $item->getData('tax_amount'), 0);
|
68 |
$goodRecord->totalValue = max($goodRecord->unitValue * $goodRecord->quantity, 0);
|
69 |
+
|
70 |
+
/* We have at least one Good, time to add the consignmentRecord if not done yet */
|
71 |
+
if (! $consignmentRecord->isAddedToEparcel()) {
|
72 |
+
$eparcel->addRecord($consignmentRecord);
|
73 |
}
|
74 |
+
|
75 |
/* If current parcel can't fit extra item, close it, and open new parcel */
|
76 |
if (! $currentParcel->canAddGood($goodRecord)) {
|
77 |
+
$this->closeParcel($eparcel, $currentParcel);
|
78 |
+
$currentParcel = $this->getNewParcel($order);
|
79 |
}
|
80 |
+
|
81 |
/* Add item to Parcel */
|
82 |
$currentParcel->addGood($goodRecord);
|
83 |
}
|
84 |
+
|
85 |
$this->closeParcel($eparcel, $currentParcel);
|
86 |
}
|
87 |
|
90 |
nl2br($this->log())
|
91 |
);
|
92 |
}
|
93 |
+
|
94 |
/* Save file */
|
95 |
$fileName = 'order_export_'.date("Ymd_His").'_eparcel.csv';
|
96 |
$filePath = Mage::getBaseDir('export').'/'.$fileName;
|
97 |
+
|
98 |
if ($eparcel->makeCsv($filePath)) {
|
99 |
return $filePath;
|
100 |
}
|
103 |
"Unable to build .CSV file!"
|
104 |
);
|
105 |
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* @param Mage_Sales_Model_Order $order
|
109 |
+
* @return Doghouse_Australia_Eparcel_Parcel_Carton
|
110 |
+
*/
|
111 |
+
protected function getNewParcel(Mage_Sales_Model_Order $order)
|
112 |
{
|
113 |
$parcel = new Doghouse_Australia_Eparcel_Parcel_Carton();
|
114 |
+
|
115 |
+
$parcel->isInsuranceRequired(
|
116 |
+
Mage::getStoreConfigFlag('carriers/eparcel/insurance_enable', $order->getStoreId())
|
117 |
+
);
|
118 |
+
|
119 |
$parcel->weightMax = $this->getDefault('parcel/weightmax');
|
120 |
$parcel->width = (int) $this->getDefault('parcel/width');
|
121 |
$parcel->height = (int) $this->getDefault('parcel/height');
|
122 |
$parcel->length = (int) $this->getDefault('parcel/length');
|
123 |
+
|
124 |
return $parcel;
|
125 |
}
|
126 |
+
|
127 |
protected function closeParcel(Doghouse_Australia_Eparcel $eparcel, Doghouse_Australia_Eparcel_Parcel $parcel)
|
128 |
{
|
129 |
$articleRecordClass = (bool) $this->getDefault('parcel/use_cubicweight') ?
|
130 |
'Doghouse_Australia_Eparcel_Record_Article_CubicWeight' :
|
131 |
'Doghouse_Australia_Eparcel_Record_Article';
|
132 |
+
|
133 |
$goodRecords = $parcel->getGoodRecords();
|
134 |
|
135 |
if (count($goodRecords) == 0) {
|
136 |
return false;
|
137 |
}
|
138 |
+
|
139 |
$eparcel->addRecord(
|
140 |
$parcel->processArticleRecord(
|
141 |
new $articleRecordClass()
|
142 |
)
|
143 |
);
|
144 |
+
|
145 |
if ((bool) $this->getDefault('good/use_multiplegoodrecords')) {
|
146 |
foreach ($parcel->getGoodRecords() as $_goodRecord) {
|
147 |
$eparcel->addRecord($_goodRecord);
|
153 |
$goodRecord->hsTariffCode = '';
|
154 |
$goodRecord->productClassification = null;
|
155 |
$goodRecord->quantity = 1;
|
156 |
+
|
157 |
foreach ($parcel->getGoodRecords() as $_goodRecord) {
|
158 |
/* Set product type and description */
|
159 |
$goodRecord->productType = $_goodRecord->productType;
|
160 |
+
$goodRecord->description = str_replace(',', '', $_goodRecord->description); // remove commas
|
161 |
+
|
162 |
/* Add weight * quantity */
|
163 |
$goodRecord->weight += $_goodRecord->weight * $_goodRecord->quantity;
|
164 |
$goodRecord->unitValue += $_goodRecord->unitValue * $_goodRecord->quantity;
|
165 |
$goodRecord->totalValue += $_goodRecord->totalValue;
|
166 |
}
|
167 |
+
|
168 |
$eparcel->addRecord($goodRecord);
|
169 |
}
|
170 |
+
|
171 |
return true;
|
172 |
}
|
173 |
|
174 |
+
/**
|
175 |
+
* @param Mage_Sales_Model_Order $order
|
176 |
+
* @param Doghouse_Australia_Eparcel_Parcel $parcel
|
177 |
+
* @return Doghouse_Australia_Eparcel_Record_Consignment
|
178 |
+
*/
|
179 |
+
protected function getConsignmentRecord(Mage_Sales_Model_Order $order, Doghouse_Australia_Eparcel_Parcel $parcel)
|
180 |
{
|
181 |
+
/** @var Fontis_Australia_Helper_Eparcel $helper */
|
182 |
+
$helper = Mage::helper('australia/eparcel');
|
183 |
+
$consignmentRecord = new Doghouse_Australia_Eparcel_Record_Consignment();
|
184 |
+
|
185 |
+
$consignmentRecord->chargeCode = $this->_getChargeCode($order);
|
186 |
+
|
187 |
+
$consignmentRecord->isSignatureRequired = (bool) $this->getDefault('consignement/is_signature_required');
|
188 |
+
$consignmentRecord->addToAddressBook = (bool) $this->getDefault('consignement/add_to_address_book');
|
189 |
+
$consignmentRecord->isRefPrintRequired = (bool) $this->getDefault('consignement/print_ref1');
|
190 |
+
$consignmentRecord->isRef2PrintRequired = (bool) $this->getDefault('consignement/print_ref2');
|
191 |
+
|
192 |
/* AusPost said this was useless/pointless */
|
193 |
+
//$consignmentRecord->merchantConsigneeCode = $order->getCustomerId(); // only returns if customer not anonymous
|
194 |
+
|
195 |
+
$shippingAddress = $order->getShippingAddress();
|
196 |
+
$consignmentRecord->consigneeName = $shippingAddress->getName();
|
197 |
+
$consignmentRecord->consigneeAddressLine1 = $shippingAddress->getStreet1();
|
198 |
+
$consignmentRecord->consigneeAddressLine2 = $shippingAddress->getStreet2();
|
199 |
+
$consignmentRecord->consigneeAddressLine3 = $shippingAddress->getStreet3();
|
200 |
+
$consignmentRecord->consigneeAddressLine4 = $shippingAddress->getStreet4();
|
201 |
+
$consignmentRecord->consigneeSuburb = $shippingAddress->getCity();
|
202 |
+
$consignmentRecord->consigneeStateCode = $shippingAddress->getRegionCode();
|
203 |
+
$consignmentRecord->consigneePostcode = $shippingAddress->getPostcode();
|
204 |
+
$consignmentRecord->consigneeCountryCode = $shippingAddress->getCountry();
|
205 |
+
$consignmentRecord->consigneePhoneNumber = $shippingAddress->getData('telephone');
|
206 |
+
$consignmentRecord->ref = $order->hasInvoices() ? $order->getInvoiceCollection()->getLastItem()->getData('increment_id') : "";
|
207 |
+
$consignmentRecord->ref2 = $order->getRealOrderId();
|
208 |
+
if ($helper->isEmailNotificationEnabled()) {
|
209 |
+
$consignmentRecord->consigneeEmailAddress = $order->getCustomerEmail();
|
210 |
+
$consignmentRecord->emailNotification = $helper->getEmailNotificationLevel();
|
211 |
+
}
|
212 |
+
|
213 |
+
return $consignmentRecord;
|
214 |
}
|
215 |
+
|
216 |
protected function _getChargeCode(Mage_Sales_Model_Order $order)
|
217 |
{
|
218 |
list ($carrierCode, $chargeCode) = explode('_', $order->getData('shipping_method'));
|
219 |
+
|
220 |
+
/** @var Fontis_Australia_Helper_Eparcel $helper */
|
221 |
+
$helper = Mage::helper('australia/eparcel');
|
222 |
+
$chargeCode = strtoupper($chargeCode);
|
223 |
+
if ($helper->isValidChargeCode($chargeCode)) {
|
224 |
return $chargeCode;
|
225 |
}
|
226 |
+
|
227 |
/* Is this customer is in a ~business~ group ? */
|
228 |
$isBusinessCustomer = in_array(
|
229 |
$order->getData('customer_group_id'),
|
231 |
Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/business_groups')
|
232 |
)
|
233 |
);
|
234 |
+
|
235 |
return $isBusinessCustomer ?
|
236 |
Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/default_charge_code_business') :
|
237 |
Mage::getStoreConfig('doghouse_eparcelexport/charge_codes/default_charge_code_individual');
|
238 |
}
|
239 |
+
|
|
|
|
|
|
|
|
|
|
|
240 |
protected function getDefault($key)
|
241 |
{
|
242 |
if (! is_array($this->_defaults)) {
|
243 |
$this->_defaults = Mage::getStoreConfig('doghouse_eparcelexport');
|
244 |
}
|
245 |
+
|
246 |
$_defaults = $this->_defaults;
|
247 |
+
|
248 |
+
foreach (explode('/',$key) as $keyPart) {
|
249 |
$_defaults = $_defaults[$keyPart];
|
250 |
}
|
251 |
|
252 |
return $_defaults;
|
253 |
}
|
254 |
+
}
|
app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Exception.php
CHANGED
@@ -1,7 +1,21 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
class Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Exception
|
4 |
-
extends Mage_Core_Exception
|
5 |
{
|
6 |
-
|
7 |
-
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
+
* @package Fontis_Australia
|
14 |
+
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
|
19 |
+
class Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Exception extends Mage_Core_Exception
|
|
|
20 |
{
|
21 |
+
}
|
|
app/code/community/Fontis/Australia/Model/Shipping/Config/Eparcel.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -28,8 +25,8 @@
|
|
28 |
|
29 |
class Fontis_Australia_Model_Shipping_Config_Eparcel extends Mage_Core_Model_Config_Data
|
30 |
{
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
25 |
|
26 |
class Fontis_Australia_Model_Shipping_Config_Eparcel extends Mage_Core_Model_Config_Data
|
27 |
{
|
28 |
+
public function _afterSave()
|
29 |
+
{
|
30 |
+
Mage::getResourceModel('australia/shipping_carrier_eparcel')->uploadAndImport($this);
|
31 |
+
}
|
32 |
}
|
app/code/community/Fontis/Australia/Model/Shipping/Config/Eparcelcondition.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/Model/Shipping/Config/Shippingmethods.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -34,7 +31,7 @@ class Fontis_Australia_Model_Shipping_Config_Shippingmethods
|
|
34 |
{
|
35 |
$shippingMethods[] = array('value' => $key, 'label' => $value);
|
36 |
}
|
37 |
-
|
38 |
return $shippingMethods;
|
39 |
}
|
40 |
}
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
31 |
{
|
32 |
$shippingMethods[] = array('value' => $key, 'label' => $value);
|
33 |
}
|
34 |
+
|
35 |
return $shippingMethods;
|
36 |
}
|
37 |
}
|
app/code/community/Fontis/Australia/Model/Shipping/Config/Weightunits.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/controllers/AjaxController.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com and you will be sent a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/controllers/EparcelController.php
CHANGED
@@ -1,6 +1,19 @@
|
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @package Fontis_Australia
|
|
|
|
|
|
|
4 |
*/
|
5 |
|
6 |
/**
|
@@ -8,35 +21,75 @@
|
|
8 |
*/
|
9 |
class Fontis_Australia_EparcelController extends Mage_Adminhtml_Controller_Action
|
10 |
{
|
|
|
|
|
11 |
/**
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* This action exports orders to a CSV file and downloads the file.
|
15 |
-
* The orders to be exported depend on the HTTP POST param "order_ids".
|
16 |
*/
|
17 |
public function exportAction()
|
18 |
{
|
19 |
-
$
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
-
|
30 |
-
{
|
31 |
-
Mage::getSingleton('core/session')->addError($e->getMessage());
|
32 |
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
}
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Fontis Australia Extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
+
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
19 |
/**
|
21 |
*/
|
22 |
class Fontis_Australia_EparcelController extends Mage_Adminhtml_Controller_Action
|
23 |
{
|
24 |
+
const ADMINHTML_SALES_ORDER_INDEX = 'adminhtml/sales_order/index';
|
25 |
+
|
26 |
/**
|
27 |
+
* Generate and export a CSV file for the given orders.
|
|
|
|
|
|
|
28 |
*/
|
29 |
public function exportAction()
|
30 |
{
|
31 |
+
$request = $this->getRequest();
|
32 |
+
if ($request->isPost()) {
|
33 |
+
$orders = $this->getRequest()->getPost('order_ids', array());
|
34 |
+
|
35 |
+
try {
|
36 |
+
// Build the CSV and retrieve its path
|
37 |
+
$filePath = Mage::getModel('australia/shipping_carrier_eparcel_export_csv')->exportOrders($orders);
|
38 |
+
|
39 |
+
// Download the file
|
40 |
+
$this->_prepareDownloadResponse( basename($filePath), file_get_contents($filePath) );
|
41 |
+
} catch (Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Exception $e) {
|
42 |
+
Mage::getSingleton('core/session')->addError($e->getMessage());
|
43 |
+
|
44 |
+
$this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
|
45 |
+
}
|
46 |
+
catch(Exception $e)
|
47 |
+
{
|
48 |
+
Mage::getSingleton('core/session')->addError('An error occurred. ' . $e->getMessage());
|
49 |
+
|
50 |
+
$this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
|
51 |
+
}
|
52 |
+
} else {
|
53 |
+
$this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
|
54 |
}
|
55 |
+
}
|
|
|
|
|
56 |
|
57 |
+
/**
|
58 |
+
* Export the eParcel table rates as a CSV file.
|
59 |
+
*/
|
60 |
+
public function exportTableratesAction()
|
61 |
+
{
|
62 |
+
$rates = Mage::getResourceModel('australia/shipping_carrier_eparcel_collection');
|
63 |
+
$response = array(
|
64 |
+
array('Country', 'Region/State', 'Postcodes', 'Weight from', 'Weight to', 'Parcel Cost', 'Cost Per Kg', 'Delivery Type', 'Charge Code Individual', 'Charge Code Business')
|
65 |
+
);
|
66 |
+
foreach ($rates as $rate) {
|
67 |
+
$countryId = $rate->getData('dest_country_id');
|
68 |
+
$countryCode = Mage::getModel('directory/country')->load($countryId)->getIso3Code();
|
69 |
+
$regionId = $rate->getData('dest_region_id');
|
70 |
+
$regionCode = Mage::getModel('directory/region')->load($regionId)->getCode();
|
71 |
+
$response[] = array(
|
72 |
+
$countryCode,
|
73 |
+
$regionCode,
|
74 |
+
$rate->getData('dest_zip'),
|
75 |
+
$rate->getData('condition_from_value'),
|
76 |
+
$rate->getData('condition_to_value'),
|
77 |
+
$rate->getData('price'),
|
78 |
+
$rate->getData('price_per_kg'),
|
79 |
+
$rate->getData('delivery_type'),
|
80 |
+
$rate->getData('charge_code_individual'),
|
81 |
+
$rate->getData('charge_code_business')
|
82 |
+
);
|
83 |
}
|
84 |
+
|
85 |
+
$csv = new Varien_File_Csv();
|
86 |
+
$temp = tmpfile();
|
87 |
+
foreach ($response as $responseRow) {
|
88 |
+
$csv->fputcsv($temp, $responseRow);
|
89 |
}
|
90 |
+
rewind($temp);
|
91 |
+
$contents = stream_get_contents($temp);
|
92 |
+
$this->_prepareDownloadResponse('tablerates.csv', $contents);
|
93 |
+
fclose($temp);
|
94 |
}
|
95 |
}
|
app/code/community/Fontis/Australia/etc/adminhtml.xml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Fontis Australia Extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category Fontis
|
14 |
+
* @package Fontis_Australia
|
15 |
+
* @author Chris Norton
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
+
*/
|
19 |
+
-->
|
20 |
+
<config>
|
21 |
+
<acl>
|
22 |
+
<resources>
|
23 |
+
<admin>
|
24 |
+
<children>
|
25 |
+
<system>
|
26 |
+
<children>
|
27 |
+
<config>
|
28 |
+
<children>
|
29 |
+
<fontis_australia>
|
30 |
+
<title>Australia Section</title>
|
31 |
+
</fontis_australia>
|
32 |
+
<fontis_feeds>
|
33 |
+
<title>Feeds Section</title>
|
34 |
+
</fontis_feeds>
|
35 |
+
<doghouse_eparcelexport>
|
36 |
+
<title>eParcel Export Section</title>
|
37 |
+
</doghouse_eparcelexport>
|
38 |
+
</children>
|
39 |
+
</config>
|
40 |
+
</children>
|
41 |
+
</system>
|
42 |
+
</children>
|
43 |
+
</admin>
|
44 |
+
</resources>
|
45 |
+
</acl>
|
46 |
+
</config>
|
app/code/community/Fontis/Australia/etc/config.xml
CHANGED
@@ -9,21 +9,18 @@
|
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
-->
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Fontis_Australia>
|
26 |
-
<version>2.
|
27 |
<depends>
|
28 |
<Mage_Shipping />
|
29 |
<Mage_Payment />
|
@@ -154,15 +151,6 @@
|
|
154 |
</order>
|
155 |
</sales>
|
156 |
<events>
|
157 |
-
<sales_order_shipment_save_after>
|
158 |
-
<observers>
|
159 |
-
<fontis_australia_shipment_save>
|
160 |
-
<type>singleton</type>
|
161 |
-
<class>australia/shipping_carrier_eparcel</class>
|
162 |
-
<method>sendManifest</method>
|
163 |
-
</fontis_australia_shipment_save>
|
164 |
-
</observers>
|
165 |
-
</sales_order_shipment_save_after>
|
166 |
<adminhtml_block_html_before>
|
167 |
<observers>
|
168 |
<fontis_australia_shipment_eparcel_export_bulkaction>
|
@@ -172,6 +160,14 @@
|
|
172 |
</fontis_australia_shipment_eparcel_export_bulkaction>
|
173 |
</observers>
|
174 |
</adminhtml_block_html_before>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
</events>
|
176 |
</global>
|
177 |
<frontend>
|
@@ -187,7 +183,7 @@
|
|
187 |
<layout>
|
188 |
<updates>
|
189 |
<australia module="Fontis_Australia">
|
190 |
-
<file>
|
191 |
</australia>
|
192 |
</updates>
|
193 |
</layout>
|
@@ -230,7 +226,7 @@
|
|
230 |
<bpay>
|
231 |
<active>0</active>
|
232 |
<model>australia/payment_bpay</model>
|
233 |
-
<order_status>
|
234 |
<customer_group_access>0</customer_group_access>
|
235 |
<customer_group>0</customer_group>
|
236 |
<title>BPAY</title>
|
@@ -242,7 +238,7 @@
|
|
242 |
<directdeposit_au>
|
243 |
<active>0</active>
|
244 |
<model>australia/payment_directdeposit</model>
|
245 |
-
<order_status>
|
246 |
<customer_group_access>0</customer_group_access>
|
247 |
<customer_group>0</customer_group>
|
248 |
<title>Direct Deposit</title>
|
@@ -254,6 +250,12 @@
|
|
254 |
</directdeposit_au>
|
255 |
</payment>
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
<fontis_feeds>
|
258 |
<shoppingdotcomfeed>
|
259 |
<output>shoppingdotcom-feeds/</output>
|
@@ -282,34 +284,4 @@
|
|
282 |
</googleproductsfeed>
|
283 |
</fontis_feeds>
|
284 |
</default>
|
285 |
-
<adminhtml>
|
286 |
-
<acl>
|
287 |
-
<resources>
|
288 |
-
<all>
|
289 |
-
<title>Allow Everything</title>
|
290 |
-
</all>
|
291 |
-
<admin>
|
292 |
-
<children>
|
293 |
-
<system>
|
294 |
-
<children>
|
295 |
-
<config>
|
296 |
-
<children>
|
297 |
-
<fontis_australia>
|
298 |
-
<title>Australia</title>
|
299 |
-
</fontis_australia>
|
300 |
-
<fontis_feeds>
|
301 |
-
<title>Feeds</title>
|
302 |
-
</fontis_feeds>
|
303 |
-
<doghouse_eparcelexport>
|
304 |
-
<title>Eparcel Export</title>
|
305 |
-
</doghouse_eparcelexport>
|
306 |
-
</children>
|
307 |
-
</config>
|
308 |
-
</children>
|
309 |
-
</system>
|
310 |
-
</children>
|
311 |
-
</admin>
|
312 |
-
</resources>
|
313 |
-
</acl>
|
314 |
-
</adminhtml>
|
315 |
</config>
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
12 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_Australia
|
15 |
* @author Chris Norton
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
-->
|
20 |
<config>
|
21 |
<modules>
|
22 |
<Fontis_Australia>
|
23 |
+
<version>2.5.0</version>
|
24 |
<depends>
|
25 |
<Mage_Shipping />
|
26 |
<Mage_Payment />
|
151 |
</order>
|
152 |
</sales>
|
153 |
<events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
<adminhtml_block_html_before>
|
155 |
<observers>
|
156 |
<fontis_australia_shipment_eparcel_export_bulkaction>
|
160 |
</fontis_australia_shipment_eparcel_export_bulkaction>
|
161 |
</observers>
|
162 |
</adminhtml_block_html_before>
|
163 |
+
<checkout_type_onepage_save_order>
|
164 |
+
<observers>
|
165 |
+
<fontis_australia_payment_place>
|
166 |
+
<class>australia/observer</class>
|
167 |
+
<method>addHistory</method>
|
168 |
+
</fontis_australia_payment_place>
|
169 |
+
</observers>
|
170 |
+
</checkout_type_onepage_save_order>
|
171 |
</events>
|
172 |
</global>
|
173 |
<frontend>
|
183 |
<layout>
|
184 |
<updates>
|
185 |
<australia module="Fontis_Australia">
|
186 |
+
<file>fontis/australia.xml</file>
|
187 |
</australia>
|
188 |
</updates>
|
189 |
</layout>
|
226 |
<bpay>
|
227 |
<active>0</active>
|
228 |
<model>australia/payment_bpay</model>
|
229 |
+
<order_status>pending_bpay</order_status>
|
230 |
<customer_group_access>0</customer_group_access>
|
231 |
<customer_group>0</customer_group>
|
232 |
<title>BPAY</title>
|
238 |
<directdeposit_au>
|
239 |
<active>0</active>
|
240 |
<model>australia/payment_directdeposit</model>
|
241 |
+
<order_status>pending_deposit</order_status>
|
242 |
<customer_group_access>0</customer_group_access>
|
243 |
<customer_group>0</customer_group>
|
244 |
<title>Direct Deposit</title>
|
250 |
</directdeposit_au>
|
251 |
</payment>
|
252 |
|
253 |
+
<fontis_australia>
|
254 |
+
<postcode_autocomplete>
|
255 |
+
<max_results>20</max_results>
|
256 |
+
</postcode_autocomplete>
|
257 |
+
</fontis_australia>
|
258 |
+
|
259 |
<fontis_feeds>
|
260 |
<shoppingdotcomfeed>
|
261 |
<output>shoppingdotcom-feeds/</output>
|
284 |
</googleproductsfeed>
|
285 |
</fontis_feeds>
|
286 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
</config>
|
app/code/community/Fontis/Australia/etc/system.xml
CHANGED
@@ -9,14 +9,11 @@
|
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
-->
|
@@ -88,7 +85,7 @@
|
|
88 |
<label>Products Use Units</label>
|
89 |
<frontend_type>select</frontend_type>
|
90 |
<source_model>australia/shipping_config_weightunits</source_model>
|
91 |
-
<sort_order>20</sort_order>
|
92 |
<show_in_default>1</show_in_default>
|
93 |
<show_in_website>1</show_in_website>
|
94 |
<show_in_store>1</show_in_store>
|
@@ -213,7 +210,7 @@
|
|
213 |
<show_in_website>1</show_in_website>
|
214 |
<show_in_store>1</show_in_store>
|
215 |
<fields>
|
216 |
-
|
217 |
<label>Calculate Handling Fee</label>
|
218 |
<frontend_type>select</frontend_type>
|
219 |
<source_model>shipping/source_handlingType</source_model>
|
@@ -231,8 +228,8 @@
|
|
231 |
<show_in_store>1</show_in_store>
|
232 |
</handling_fee>
|
233 |
<merchant_location_id translate="label">
|
234 |
-
|
235 |
-
|
236 |
<sort_order>9</sort_order>
|
237 |
<show_in_default>1</show_in_default>
|
238 |
<show_in_website>1</show_in_website>
|
@@ -240,35 +237,43 @@
|
|
240 |
<comment>Provided by Australia Post. The unique ID specifying a specific merchant location.</comment>
|
241 |
</merchant_location_id>
|
242 |
<post_charge_account translate="label">
|
243 |
-
|
244 |
-
|
245 |
<sort_order>11</sort_order>
|
246 |
<show_in_default>1</show_in_default>
|
247 |
<show_in_website>1</show_in_website>
|
248 |
<show_in_store>1</show_in_store>
|
249 |
-
<comment>Merchant account to which Australia Post
|
250 |
</post_charge_account>
|
251 |
-
|
252 |
<signature_required translate="label">
|
253 |
-
|
254 |
-
|
255 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
256 |
<sort_order>12</sort_order>
|
257 |
<show_in_default>1</show_in_default>
|
258 |
<show_in_website>1</show_in_website>
|
259 |
<show_in_store>1</show_in_store>
|
260 |
-
<comment>If Yes Australia Post will attempt to capture a signature and if no-one is in attendance the consignment will be
|
261 |
</signature_required>
|
262 |
<signature_cost translate="label">
|
263 |
-
|
264 |
<frontend_type>text</frontend_type>
|
265 |
<sort_order>13</sort_order>
|
266 |
<show_in_default>1</show_in_default>
|
267 |
<show_in_website>1</show_in_website>
|
268 |
<show_in_store>1</show_in_store>
|
269 |
-
<comment>
|
270 |
</signature_cost>
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
<insurance_step translate="label">
|
273 |
<label>Insurance Step</label>
|
274 |
<frontend_type>text</frontend_type>
|
@@ -309,7 +314,8 @@
|
|
309 |
</condition_name>
|
310 |
<export translate="label">
|
311 |
<label>Export</label>
|
312 |
-
<frontend_type>
|
|
|
313 |
<sort_order>5</sort_order>
|
314 |
<show_in_default>0</show_in_default>
|
315 |
<show_in_website>1</show_in_website>
|
@@ -357,47 +363,47 @@
|
|
357 |
<show_in_website>1</show_in_website>
|
358 |
<show_in_store>1</show_in_store>
|
359 |
</return_name>
|
360 |
-
<return_addressline_1>
|
361 |
<label>Return Address Line 1</label>
|
362 |
<frontend_type>text</frontend_type>
|
363 |
<sort_order>61</sort_order>
|
364 |
<show_in_default>1</show_in_default>
|
365 |
<show_in_website>1</show_in_website>
|
366 |
<show_in_store>1</show_in_store>
|
367 |
-
</return_addressline_1>
|
368 |
-
<return_addressline_2>
|
369 |
<label>Return Address Line 2</label>
|
370 |
<frontend_type>text</frontend_type>
|
371 |
<sort_order>62</sort_order>
|
372 |
<show_in_default>1</show_in_default>
|
373 |
<show_in_website>1</show_in_website>
|
374 |
<show_in_store>1</show_in_store>
|
375 |
-
</return_addressline_2>
|
376 |
-
<return_addressline_3>
|
377 |
<label>Return Address Line 3</label>
|
378 |
<frontend_type>text</frontend_type>
|
379 |
<sort_order>63</sort_order>
|
380 |
<show_in_default>1</show_in_default>
|
381 |
<show_in_website>1</show_in_website>
|
382 |
<show_in_store>1</show_in_store>
|
383 |
-
</return_addressline_3>
|
384 |
-
<return_addressline_4>
|
385 |
<label>Return Address Line 4</label>
|
386 |
<frontend_type>text</frontend_type>
|
387 |
<sort_order>64</sort_order>
|
388 |
<show_in_default>1</show_in_default>
|
389 |
<show_in_website>1</show_in_website>
|
390 |
<show_in_store>1</show_in_store>
|
391 |
-
</return_addressline_4>
|
392 |
-
<return_suburb>
|
393 |
<label>Return Suburb</label>
|
394 |
<frontend_type>text</frontend_type>
|
395 |
<sort_order>65</sort_order>
|
396 |
<show_in_default>1</show_in_default>
|
397 |
<show_in_website>1</show_in_website>
|
398 |
<show_in_store>1</show_in_store>
|
399 |
-
</return_suburb>
|
400 |
-
<return_state>
|
401 |
<label>Return State Code</label>
|
402 |
<frontend_type>text</frontend_type>
|
403 |
<sort_order>66</sort_order>
|
@@ -405,15 +411,15 @@
|
|
405 |
<show_in_website>1</show_in_website>
|
406 |
<show_in_store>1</show_in_store>
|
407 |
<comment>Must be a two- or three-letter state code</comment>
|
408 |
-
</return_state>
|
409 |
-
<return_postcode>
|
410 |
<label>Return Postcode</label>
|
411 |
<frontend_type>text</frontend_type>
|
412 |
<sort_order>67</sort_order>
|
413 |
<show_in_default>1</show_in_default>
|
414 |
<show_in_website>1</show_in_website>
|
415 |
<show_in_store>1</show_in_store>
|
416 |
-
</return_postcode>
|
417 |
|
418 |
<sallowspecific translate="label">
|
419 |
<label>Ship to applicable countries</label>
|
@@ -456,7 +462,7 @@
|
|
456 |
</groups>
|
457 |
</carriers>
|
458 |
<payment translate="label" module="payment">
|
459 |
-
|
460 |
<bpay translate="label">
|
461 |
<label>BPAY</label>
|
462 |
<frontend_type>text</frontend_type>
|
@@ -474,24 +480,33 @@
|
|
474 |
<show_in_website>1</show_in_website>
|
475 |
<show_in_store>0</show_in_store>
|
476 |
</active>
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
<sort_order translate="label">
|
496 |
<label>Sort order</label>
|
497 |
<frontend_type>text</frontend_type>
|
@@ -508,40 +523,40 @@
|
|
508 |
<show_in_website>1</show_in_website>
|
509 |
<show_in_store>0</show_in_store>
|
510 |
</title>
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
</accept_credit_cards>
|
538 |
<message translate="label">
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
</message>
|
546 |
<allowspecific translate="label">
|
547 |
<label>Payment from applicable countries</label>
|
@@ -581,7 +596,7 @@
|
|
581 |
</model>
|
582 |
</fields>
|
583 |
</bpay>
|
584 |
-
|
585 |
<label>Direct Deposit (AU)</label>
|
586 |
<frontend_type>text</frontend_type>
|
587 |
<sort_order>1</sort_order>
|
@@ -598,24 +613,33 @@
|
|
598 |
<show_in_website>1</show_in_website>
|
599 |
<show_in_store>0</show_in_store>
|
600 |
</active>
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
<sort_order translate="label">
|
620 |
<label>Sort order</label>
|
621 |
<frontend_type>text</frontend_type>
|
@@ -632,34 +656,34 @@
|
|
632 |
<show_in_website>1</show_in_website>
|
633 |
<show_in_store>0</show_in_store>
|
634 |
</title>
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
<allowspecific translate="label">
|
664 |
<label>Payment from applicable countries</label>
|
665 |
<frontend_type>allowspecific</frontend_type>
|
@@ -697,10 +721,10 @@
|
|
697 |
<model>
|
698 |
</model>
|
699 |
</fields>
|
700 |
-
</directdeposit_au>
|
701 |
-
|
702 |
</payment>
|
703 |
-
|
704 |
<fontis_australia>
|
705 |
<label>Australia</label>
|
706 |
<tab>fontis_extensions</tab>
|
@@ -709,35 +733,63 @@
|
|
709 |
<show_in_default>1</show_in_default>
|
710 |
<show_in_website>1</show_in_website>
|
711 |
<show_in_store>1</show_in_store>
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
741 |
</fontis_australia>
|
742 |
|
743 |
<fontis_feeds>
|
@@ -1111,10 +1163,10 @@
|
|
1111 |
</googleproductsfeed>
|
1112 |
</groups>
|
1113 |
</fontis_feeds>
|
1114 |
-
|
1115 |
<doghouse_eparcelexport translate="label comment">
|
1116 |
<tab>sales</tab>
|
1117 |
-
<label>
|
1118 |
<frontend_type>text</frontend_type>
|
1119 |
<sort_order>600</sort_order>
|
1120 |
<show_in_default>1</show_in_default>
|
@@ -1129,7 +1181,7 @@
|
|
1129 |
<show_in_website>1</show_in_website>
|
1130 |
<show_in_store>1</show_in_store>
|
1131 |
<fields>
|
1132 |
-
|
1133 |
<label>Use Cubic Weight ?</label>
|
1134 |
<frontend_type>select</frontend_type>
|
1135 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
@@ -1164,7 +1216,7 @@
|
|
1164 |
<show_in_default>1</show_in_default>
|
1165 |
<show_in_website>1</show_in_website>
|
1166 |
<show_in_store>1</show_in_store>
|
1167 |
-
<comment>
|
1168 |
</height>
|
1169 |
<length translate="label">
|
1170 |
<label>Parcel Length</label>
|
@@ -1178,7 +1230,7 @@
|
|
1178 |
</fields>
|
1179 |
</parcel>
|
1180 |
<consignement translate="label comment">
|
1181 |
-
<label>
|
1182 |
<frontend_type>text</frontend_type>
|
1183 |
<sort_order>20</sort_order>
|
1184 |
<show_in_default>1</show_in_default>
|
@@ -1193,7 +1245,7 @@
|
|
1193 |
<show_in_default>1</show_in_default>
|
1194 |
<show_in_website>1</show_in_website>
|
1195 |
<show_in_store>1</show_in_store>
|
1196 |
-
<comment>Should signature be required by default ?
|
1197 |
</is_signature_required>
|
1198 |
<add_to_address_book translate="label">
|
1199 |
<label>Add to Address Book ?</label>
|
@@ -1235,7 +1287,7 @@
|
|
1235 |
<show_in_website>1</show_in_website>
|
1236 |
<show_in_store>1</show_in_store>
|
1237 |
<fields>
|
1238 |
-
|
1239 |
<label>Product type</label>
|
1240 |
<frontend_type>text</frontend_type>
|
1241 |
<sort_order>10</sort_order>
|
@@ -1252,12 +1304,12 @@
|
|
1252 |
<show_in_default>1</show_in_default>
|
1253 |
<show_in_website>1</show_in_website>
|
1254 |
<show_in_store>1</show_in_store>
|
1255 |
-
<comment>Australia Post's documentation says to use multiple good lines but their tech support says no.
|
1256 |
</use_multiplegoodrecords>
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
<label>Charge codes</label>
|
1262 |
<frontend_type>text</frontend_type>
|
1263 |
<sort_order>20</sort_order>
|
@@ -1266,8 +1318,8 @@
|
|
1266 |
<show_in_store>1</show_in_store>
|
1267 |
<fields>
|
1268 |
<default_charge_code_individual translate="label">
|
1269 |
-
|
1270 |
-
|
1271 |
<sort_order>10</sort_order>
|
1272 |
<show_in_default>1</show_in_default>
|
1273 |
<show_in_website>1</show_in_website>
|
@@ -1275,8 +1327,8 @@
|
|
1275 |
<comment>The default charge code for individuals. Will be overridden by values in your table rates.</comment>
|
1276 |
</default_charge_code_individual>
|
1277 |
<default_charge_code_business translate="label">
|
1278 |
-
|
1279 |
-
|
1280 |
<sort_order>10</sort_order>
|
1281 |
<show_in_default>1</show_in_default>
|
1282 |
<show_in_website>1</show_in_website>
|
@@ -1291,10 +1343,40 @@
|
|
1291 |
<show_in_default>1</show_in_default>
|
1292 |
<show_in_website>1</show_in_website>
|
1293 |
<show_in_store>1</show_in_store>
|
1294 |
-
<comment>The selected customer groups will use the "Business" version of the "Standard" and "Express" charge codes.
|
1295 |
</business_groups>
|
1296 |
-
|
1297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1298 |
</groups>
|
1299 |
</doghouse_eparcelexport>
|
1300 |
</sections>
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
12 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_Australia
|
15 |
* @author Chris Norton
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
-->
|
85 |
<label>Products Use Units</label>
|
86 |
<frontend_type>select</frontend_type>
|
87 |
<source_model>australia/shipping_config_weightunits</source_model>
|
88 |
+
<sort_order>20</sort_order>
|
89 |
<show_in_default>1</show_in_default>
|
90 |
<show_in_website>1</show_in_website>
|
91 |
<show_in_store>1</show_in_store>
|
210 |
<show_in_website>1</show_in_website>
|
211 |
<show_in_store>1</show_in_store>
|
212 |
<fields>
|
213 |
+
<handling_type translate="label">
|
214 |
<label>Calculate Handling Fee</label>
|
215 |
<frontend_type>select</frontend_type>
|
216 |
<source_model>shipping/source_handlingType</source_model>
|
228 |
<show_in_store>1</show_in_store>
|
229 |
</handling_fee>
|
230 |
<merchant_location_id translate="label">
|
231 |
+
<label>Merchant Location ID</label>
|
232 |
+
<frontend_type>text</frontend_type>
|
233 |
<sort_order>9</sort_order>
|
234 |
<show_in_default>1</show_in_default>
|
235 |
<show_in_website>1</show_in_website>
|
237 |
<comment>Provided by Australia Post. The unique ID specifying a specific merchant location.</comment>
|
238 |
</merchant_location_id>
|
239 |
<post_charge_account translate="label">
|
240 |
+
<label>Post Charge To Account</label>
|
241 |
+
<frontend_type>text</frontend_type>
|
242 |
<sort_order>11</sort_order>
|
243 |
<show_in_default>1</show_in_default>
|
244 |
<show_in_website>1</show_in_website>
|
245 |
<show_in_store>1</show_in_store>
|
246 |
+
<comment>Merchant account to which Australia Post "post" the charges against for invoicing purposes.</comment>
|
247 |
</post_charge_account>
|
248 |
+
|
249 |
<signature_required translate="label">
|
250 |
+
<label>Signature Required</label>
|
251 |
+
<frontend_type>select</frontend_type>
|
252 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
253 |
<sort_order>12</sort_order>
|
254 |
<show_in_default>1</show_in_default>
|
255 |
<show_in_website>1</show_in_website>
|
256 |
<show_in_store>1</show_in_store>
|
257 |
+
<comment>If Yes, Australia Post will attempt to capture a signature and if no-one is in attendance the consignment will be "carded".</comment>
|
258 |
</signature_required>
|
259 |
<signature_cost translate="label">
|
260 |
+
<label>Signature Cost</label>
|
261 |
<frontend_type>text</frontend_type>
|
262 |
<sort_order>13</sort_order>
|
263 |
<show_in_default>1</show_in_default>
|
264 |
<show_in_website>1</show_in_website>
|
265 |
<show_in_store>1</show_in_store>
|
266 |
+
<comment>Additional amount to charge for requiring a signature.</comment>
|
267 |
</signature_cost>
|
268 |
+
<insurance_enable translate="label">
|
269 |
+
<label>Enable Insurance</label>
|
270 |
+
<frontend_type>select</frontend_type>
|
271 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
272 |
+
<sort_order>19</sort_order>
|
273 |
+
<show_in_default>1</show_in_default>
|
274 |
+
<show_in_website>1</show_in_website>
|
275 |
+
<show_in_store>1</show_in_store>
|
276 |
+
</insurance_enable>
|
277 |
<insurance_step translate="label">
|
278 |
<label>Insurance Step</label>
|
279 |
<frontend_type>text</frontend_type>
|
314 |
</condition_name>
|
315 |
<export translate="label">
|
316 |
<label>Export</label>
|
317 |
+
<frontend_type>button</frontend_type>
|
318 |
+
<frontend_model>australia/eparcel_rate_export</frontend_model>
|
319 |
<sort_order>5</sort_order>
|
320 |
<show_in_default>0</show_in_default>
|
321 |
<show_in_website>1</show_in_website>
|
363 |
<show_in_website>1</show_in_website>
|
364 |
<show_in_store>1</show_in_store>
|
365 |
</return_name>
|
366 |
+
<return_addressline_1>
|
367 |
<label>Return Address Line 1</label>
|
368 |
<frontend_type>text</frontend_type>
|
369 |
<sort_order>61</sort_order>
|
370 |
<show_in_default>1</show_in_default>
|
371 |
<show_in_website>1</show_in_website>
|
372 |
<show_in_store>1</show_in_store>
|
373 |
+
</return_addressline_1>
|
374 |
+
<return_addressline_2>
|
375 |
<label>Return Address Line 2</label>
|
376 |
<frontend_type>text</frontend_type>
|
377 |
<sort_order>62</sort_order>
|
378 |
<show_in_default>1</show_in_default>
|
379 |
<show_in_website>1</show_in_website>
|
380 |
<show_in_store>1</show_in_store>
|
381 |
+
</return_addressline_2>
|
382 |
+
<return_addressline_3>
|
383 |
<label>Return Address Line 3</label>
|
384 |
<frontend_type>text</frontend_type>
|
385 |
<sort_order>63</sort_order>
|
386 |
<show_in_default>1</show_in_default>
|
387 |
<show_in_website>1</show_in_website>
|
388 |
<show_in_store>1</show_in_store>
|
389 |
+
</return_addressline_3>
|
390 |
+
<return_addressline_4>
|
391 |
<label>Return Address Line 4</label>
|
392 |
<frontend_type>text</frontend_type>
|
393 |
<sort_order>64</sort_order>
|
394 |
<show_in_default>1</show_in_default>
|
395 |
<show_in_website>1</show_in_website>
|
396 |
<show_in_store>1</show_in_store>
|
397 |
+
</return_addressline_4>
|
398 |
+
<return_suburb>
|
399 |
<label>Return Suburb</label>
|
400 |
<frontend_type>text</frontend_type>
|
401 |
<sort_order>65</sort_order>
|
402 |
<show_in_default>1</show_in_default>
|
403 |
<show_in_website>1</show_in_website>
|
404 |
<show_in_store>1</show_in_store>
|
405 |
+
</return_suburb>
|
406 |
+
<return_state>
|
407 |
<label>Return State Code</label>
|
408 |
<frontend_type>text</frontend_type>
|
409 |
<sort_order>66</sort_order>
|
411 |
<show_in_website>1</show_in_website>
|
412 |
<show_in_store>1</show_in_store>
|
413 |
<comment>Must be a two- or three-letter state code</comment>
|
414 |
+
</return_state>
|
415 |
+
<return_postcode>
|
416 |
<label>Return Postcode</label>
|
417 |
<frontend_type>text</frontend_type>
|
418 |
<sort_order>67</sort_order>
|
419 |
<show_in_default>1</show_in_default>
|
420 |
<show_in_website>1</show_in_website>
|
421 |
<show_in_store>1</show_in_store>
|
422 |
+
</return_postcode>
|
423 |
|
424 |
<sallowspecific translate="label">
|
425 |
<label>Ship to applicable countries</label>
|
462 |
</groups>
|
463 |
</carriers>
|
464 |
<payment translate="label" module="payment">
|
465 |
+
<groups>
|
466 |
<bpay translate="label">
|
467 |
<label>BPAY</label>
|
468 |
<frontend_type>text</frontend_type>
|
480 |
<show_in_website>1</show_in_website>
|
481 |
<show_in_store>0</show_in_store>
|
482 |
</active>
|
483 |
+
<order_status>
|
484 |
+
<label>New Order Status</label>
|
485 |
+
<frontend_type>select</frontend_type>
|
486 |
+
<source_model>adminhtml/system_config_source_order_status_new</source_model>
|
487 |
+
<sort_order>2</sort_order>
|
488 |
+
<show_in_default>1</show_in_default>
|
489 |
+
<show_in_website>1</show_in_website>
|
490 |
+
<show_in_store>0</show_in_store>
|
491 |
+
</order_status>
|
492 |
+
<customer_group_access translate="label">
|
493 |
+
<label>Customer Group Access</label>
|
494 |
+
<frontend_type>select</frontend_type>
|
495 |
+
<source_model>australia/config_customerGroupAccess</source_model>
|
496 |
+
<sort_order>3</sort_order>
|
497 |
+
<show_in_default>1</show_in_default>
|
498 |
+
<show_in_website>1</show_in_website>
|
499 |
+
<show_in_store>0</show_in_store>
|
500 |
+
</customer_group_access>
|
501 |
+
<customer_group translate="label">
|
502 |
+
<label>Customer Group</label>
|
503 |
+
<frontend_type>select</frontend_type>
|
504 |
+
<source_model>australia/config_customerGroups</source_model>
|
505 |
+
<sort_order>4</sort_order>
|
506 |
+
<show_in_default>1</show_in_default>
|
507 |
+
<show_in_website>1</show_in_website>
|
508 |
+
<show_in_store>0</show_in_store>
|
509 |
+
</customer_group>
|
510 |
<sort_order translate="label">
|
511 |
<label>Sort order</label>
|
512 |
<frontend_type>text</frontend_type>
|
523 |
<show_in_website>1</show_in_website>
|
524 |
<show_in_store>0</show_in_store>
|
525 |
</title>
|
526 |
+
<biller_code translate="label">
|
527 |
+
<label>Biller Code</label>
|
528 |
+
<sort_order>61</sort_order>
|
529 |
+
<show_in_default>1</show_in_default>
|
530 |
+
<show_in_website>1</show_in_website>
|
531 |
+
<show_in_store>1</show_in_store>
|
532 |
+
</biller_code>
|
533 |
+
<calculate_using_customerid translate="label">
|
534 |
+
<label>Use Customer ID for Ref</label>
|
535 |
+
<frontend_type>select</frontend_type>
|
536 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
537 |
+
<sort_order>62</sort_order>
|
538 |
+
<show_in_default>1</show_in_default>
|
539 |
+
<show_in_website>1</show_in_website>
|
540 |
+
<show_in_store>1</show_in_store>
|
541 |
+
<comment>Normally set to NO unless you use BPAY for recurring payments. Guest checkouts are NOT supported if this is set to YES.</comment>
|
542 |
+
</calculate_using_customerid>
|
543 |
+
<accept_credit_cards translate="label">
|
544 |
+
<label>Accepts Credit Cards</label>
|
545 |
+
<frontend_type>select</frontend_type>
|
546 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
547 |
+
<sort_order>63</sort_order>
|
548 |
+
<show_in_default>1</show_in_default>
|
549 |
+
<show_in_website>1</show_in_website>
|
550 |
+
<show_in_store>1</show_in_store>
|
551 |
+
<comment>Set to NO if you do not accept credit card payments through BPAY. This simply changes the text presented to the customer.</comment>
|
552 |
</accept_credit_cards>
|
553 |
<message translate="label">
|
554 |
+
<label>Message</label>
|
555 |
+
<sort_order>64</sort_order>
|
556 |
+
<show_in_default>1</show_in_default>
|
557 |
+
<show_in_website>1</show_in_website>
|
558 |
+
<show_in_store>1</show_in_store>
|
559 |
+
<comment>Displayed during checkout. Customise this to notify your customers that they will be presented with BPAY information after checkout.</comment>
|
560 |
</message>
|
561 |
<allowspecific translate="label">
|
562 |
<label>Payment from applicable countries</label>
|
596 |
</model>
|
597 |
</fields>
|
598 |
</bpay>
|
599 |
+
<directdeposit_au translate="label">
|
600 |
<label>Direct Deposit (AU)</label>
|
601 |
<frontend_type>text</frontend_type>
|
602 |
<sort_order>1</sort_order>
|
613 |
<show_in_website>1</show_in_website>
|
614 |
<show_in_store>0</show_in_store>
|
615 |
</active>
|
616 |
+
<order_status>
|
617 |
+
<label>New Order Status</label>
|
618 |
+
<frontend_type>select</frontend_type>
|
619 |
+
<source_model>adminhtml/system_config_source_order_status_new</source_model>
|
620 |
+
<sort_order>2</sort_order>
|
621 |
+
<show_in_default>1</show_in_default>
|
622 |
+
<show_in_website>1</show_in_website>
|
623 |
+
<show_in_store>0</show_in_store>
|
624 |
+
</order_status>
|
625 |
+
<customer_group_access translate="label">
|
626 |
+
<label>Customer Group Access</label>
|
627 |
+
<frontend_type>select</frontend_type>
|
628 |
+
<source_model>australia/config_customerGroupAccess</source_model>
|
629 |
+
<sort_order>3</sort_order>
|
630 |
+
<show_in_default>1</show_in_default>
|
631 |
+
<show_in_website>1</show_in_website>
|
632 |
+
<show_in_store>0</show_in_store>
|
633 |
+
</customer_group_access>
|
634 |
+
<customer_group translate="label">
|
635 |
+
<label>Customer Group</label>
|
636 |
+
<frontend_type>select</frontend_type>
|
637 |
+
<source_model>australia/config_customerGroups</source_model>
|
638 |
+
<sort_order>4</sort_order>
|
639 |
+
<show_in_default>1</show_in_default>
|
640 |
+
<show_in_website>1</show_in_website>
|
641 |
+
<show_in_store>0</show_in_store>
|
642 |
+
</customer_group>
|
643 |
<sort_order translate="label">
|
644 |
<label>Sort order</label>
|
645 |
<frontend_type>text</frontend_type>
|
656 |
<show_in_website>1</show_in_website>
|
657 |
<show_in_store>0</show_in_store>
|
658 |
</title>
|
659 |
+
<account_name translate="label">
|
660 |
+
<label>Account Name</label>
|
661 |
+
<sort_order>61</sort_order>
|
662 |
+
<show_in_default>1</show_in_default>
|
663 |
+
<show_in_website>1</show_in_website>
|
664 |
+
<show_in_store>1</show_in_store>
|
665 |
+
</account_name>
|
666 |
+
<account_bsb translate="label">
|
667 |
+
<label>Account BSB</label>
|
668 |
+
<sort_order>62</sort_order>
|
669 |
+
<show_in_default>1</show_in_default>
|
670 |
+
<show_in_website>1</show_in_website>
|
671 |
+
<show_in_store>1</show_in_store>
|
672 |
+
</account_bsb>
|
673 |
+
<account_number translate="label">
|
674 |
+
<label>Account Number</label>
|
675 |
+
<sort_order>63</sort_order>
|
676 |
+
<show_in_default>1</show_in_default>
|
677 |
+
<show_in_website>1</show_in_website>
|
678 |
+
<show_in_store>1</show_in_store>
|
679 |
+
</account_number>
|
680 |
+
<message translate="label">
|
681 |
+
<label>Message</label>
|
682 |
+
<sort_order>64</sort_order>
|
683 |
+
<show_in_default>1</show_in_default>
|
684 |
+
<show_in_website>1</show_in_website>
|
685 |
+
<show_in_store>1</show_in_store>
|
686 |
+
</message>
|
687 |
<allowspecific translate="label">
|
688 |
<label>Payment from applicable countries</label>
|
689 |
<frontend_type>allowspecific</frontend_type>
|
721 |
<model>
|
722 |
</model>
|
723 |
</fields>
|
724 |
+
</directdeposit_au>
|
725 |
+
</groups>
|
726 |
</payment>
|
727 |
+
|
728 |
<fontis_australia>
|
729 |
<label>Australia</label>
|
730 |
<tab>fontis_extensions</tab>
|
733 |
<show_in_default>1</show_in_default>
|
734 |
<show_in_website>1</show_in_website>
|
735 |
<show_in_store>1</show_in_store>
|
736 |
+
<groups>
|
737 |
+
<business translate="label">
|
738 |
+
<label>Business Details</label>
|
739 |
+
<frontend_type>text</frontend_type>
|
740 |
+
<sort_order>0</sort_order>
|
741 |
+
<show_in_default>1</show_in_default>
|
742 |
+
<show_in_website>1</show_in_website>
|
743 |
+
<show_in_store>1</show_in_store>
|
744 |
+
<fields>
|
745 |
+
<abn translate="label">
|
746 |
+
<label>ABN</label>
|
747 |
+
<frontend_type>text</frontend_type>
|
748 |
+
<sort_order>1</sort_order>
|
749 |
+
<show_in_default>1</show_in_default>
|
750 |
+
<show_in_website>1</show_in_website>
|
751 |
+
<show_in_store>1</show_in_store>
|
752 |
+
<comment>(Australian Business Number)</comment>
|
753 |
+
</abn>
|
754 |
+
<phone translate="label">
|
755 |
+
<label>Phone Number</label>
|
756 |
+
<frontend_type>text</frontend_type>
|
757 |
+
<sort_order>2</sort_order>
|
758 |
+
<show_in_default>1</show_in_default>
|
759 |
+
<show_in_website>1</show_in_website>
|
760 |
+
<show_in_store>1</show_in_store>
|
761 |
+
</phone>
|
762 |
+
</fields>
|
763 |
+
</business>
|
764 |
+
<postcode_autocomplete translate="label">
|
765 |
+
<label>Postcode Autocomplete</label>
|
766 |
+
<frontend_type>text</frontend_type>
|
767 |
+
<sort_order>30</sort_order>
|
768 |
+
<show_in_default>1</show_in_default>
|
769 |
+
<show_in_website>1</show_in_website>
|
770 |
+
<show_in_store>1</show_in_store>
|
771 |
+
<fields>
|
772 |
+
<enabled translate="label">
|
773 |
+
<label>Enabled</label>
|
774 |
+
<frontend_type>select</frontend_type>
|
775 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
776 |
+
<sort_order>10</sort_order>
|
777 |
+
<show_in_default>1</show_in_default>
|
778 |
+
<show_in_website>1</show_in_website>
|
779 |
+
<show_in_store>1</show_in_store>
|
780 |
+
</enabled>
|
781 |
+
<max_results translate="label">
|
782 |
+
<label>Maximum Number of Results</label>
|
783 |
+
<frontend_type>text</frontend_type>
|
784 |
+
<validate>validate-number</validate>
|
785 |
+
<sort_order>20</sort_order>
|
786 |
+
<show_in_default>1</show_in_default>
|
787 |
+
<show_in_website>1</show_in_website>
|
788 |
+
<show_in_store>1</show_in_store>
|
789 |
+
</max_results>
|
790 |
+
</fields>
|
791 |
+
</postcode_autocomplete>
|
792 |
+
</groups>
|
793 |
</fontis_australia>
|
794 |
|
795 |
<fontis_feeds>
|
1163 |
</googleproductsfeed>
|
1164 |
</groups>
|
1165 |
</fontis_feeds>
|
1166 |
+
|
1167 |
<doghouse_eparcelexport translate="label comment">
|
1168 |
<tab>sales</tab>
|
1169 |
+
<label>eParcel Export</label>
|
1170 |
<frontend_type>text</frontend_type>
|
1171 |
<sort_order>600</sort_order>
|
1172 |
<show_in_default>1</show_in_default>
|
1181 |
<show_in_website>1</show_in_website>
|
1182 |
<show_in_store>1</show_in_store>
|
1183 |
<fields>
|
1184 |
+
<use_cubicweight translate="label">
|
1185 |
<label>Use Cubic Weight ?</label>
|
1186 |
<frontend_type>select</frontend_type>
|
1187 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
1216 |
<show_in_default>1</show_in_default>
|
1217 |
<show_in_website>1</show_in_website>
|
1218 |
<show_in_store>1</show_in_store>
|
1219 |
+
<comment>Centimetres - no decimals</comment>
|
1220 |
</height>
|
1221 |
<length translate="label">
|
1222 |
<label>Parcel Length</label>
|
1230 |
</fields>
|
1231 |
</parcel>
|
1232 |
<consignement translate="label comment">
|
1233 |
+
<label>Consignment Defaults</label>
|
1234 |
<frontend_type>text</frontend_type>
|
1235 |
<sort_order>20</sort_order>
|
1236 |
<show_in_default>1</show_in_default>
|
1245 |
<show_in_default>1</show_in_default>
|
1246 |
<show_in_website>1</show_in_website>
|
1247 |
<show_in_store>1</show_in_store>
|
1248 |
+
<comment>Should signature be required by default ? Specific shipping methods will override this setting. Check cost of service on your Australia Post contract.</comment>
|
1249 |
</is_signature_required>
|
1250 |
<add_to_address_book translate="label">
|
1251 |
<label>Add to Address Book ?</label>
|
1287 |
<show_in_website>1</show_in_website>
|
1288 |
<show_in_store>1</show_in_store>
|
1289 |
<fields>
|
1290 |
+
<product_type translate="label">
|
1291 |
<label>Product type</label>
|
1292 |
<frontend_type>text</frontend_type>
|
1293 |
<sort_order>10</sort_order>
|
1304 |
<show_in_default>1</show_in_default>
|
1305 |
<show_in_website>1</show_in_website>
|
1306 |
<show_in_store>1</show_in_store>
|
1307 |
+
<comment>Australia Post's documentation says to use multiple good lines but their tech support says no. Also, it only seems to work when set to 'No'.</comment>
|
1308 |
</use_multiplegoodrecords>
|
1309 |
+
|
1310 |
+
</fields>
|
1311 |
+
</good>
|
1312 |
+
<charge_codes translate="label comment">
|
1313 |
<label>Charge codes</label>
|
1314 |
<frontend_type>text</frontend_type>
|
1315 |
<sort_order>20</sort_order>
|
1318 |
<show_in_store>1</show_in_store>
|
1319 |
<fields>
|
1320 |
<default_charge_code_individual translate="label">
|
1321 |
+
<label>Default charge Code (individual)</label>
|
1322 |
+
<frontend_type>text</frontend_type>
|
1323 |
<sort_order>10</sort_order>
|
1324 |
<show_in_default>1</show_in_default>
|
1325 |
<show_in_website>1</show_in_website>
|
1327 |
<comment>The default charge code for individuals. Will be overridden by values in your table rates.</comment>
|
1328 |
</default_charge_code_individual>
|
1329 |
<default_charge_code_business translate="label">
|
1330 |
+
<label>Default charge Code (business)</label>
|
1331 |
+
<frontend_type>text</frontend_type>
|
1332 |
<sort_order>10</sort_order>
|
1333 |
<show_in_default>1</show_in_default>
|
1334 |
<show_in_website>1</show_in_website>
|
1343 |
<show_in_default>1</show_in_default>
|
1344 |
<show_in_website>1</show_in_website>
|
1345 |
<show_in_store>1</show_in_store>
|
1346 |
+
<comment>The selected customer groups will use the "Business" version of the "Standard" and "Express" charge codes. Make sure your contract supports business (B2B) charge codes.</comment>
|
1347 |
</business_groups>
|
1348 |
+
</fields>
|
1349 |
+
</charge_codes>
|
1350 |
+
<email_notification translate="label comment">
|
1351 |
+
<label>Email Notification</label>
|
1352 |
+
<frontend_type>text</frontend_type>
|
1353 |
+
<sort_order>40</sort_order>
|
1354 |
+
<show_in_default>1</show_in_default>
|
1355 |
+
<show_in_website>1</show_in_website>
|
1356 |
+
<show_in_store>1</show_in_store>
|
1357 |
+
<fields>
|
1358 |
+
<enabled>
|
1359 |
+
<label>Enabled</label>
|
1360 |
+
<frontend_type>select</frontend_type>
|
1361 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
1362 |
+
<sort_order>10</sort_order>
|
1363 |
+
<show_in_default>1</show_in_default>
|
1364 |
+
<show_in_website>1</show_in_website>
|
1365 |
+
<show_in_store>1</show_in_store>
|
1366 |
+
<comment>Add the customer's email address to the CSV file.</comment>
|
1367 |
+
</enabled>
|
1368 |
+
<level>
|
1369 |
+
<label>Notification Level</label>
|
1370 |
+
<frontend_type>select</frontend_type>
|
1371 |
+
<source_model>australia/config_emailNotificationLevel</source_model>
|
1372 |
+
<sort_order>20</sort_order>
|
1373 |
+
<show_in_default>1</show_in_default>
|
1374 |
+
<show_in_website>1</show_in_website>
|
1375 |
+
<show_in_store>1</show_in_store>
|
1376 |
+
<comment>Set what kind of email notification the customer will receive.</comment>
|
1377 |
+
</level>
|
1378 |
+
</fields>
|
1379 |
+
</email_notification>
|
1380 |
</groups>
|
1381 |
</doghouse_eparcelexport>
|
1382 |
</sections>
|
app/code/community/Fontis/Australia/sql/australia_setup/mysql4-install-0.7.0.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
@@ -50,42 +47,42 @@ CREATE TABLE {$this->getTable('australia_eparcel')} (
|
|
50 |
$installer->run("
|
51 |
DELETE FROM `{$this->getTable('directory_country_region')}` WHERE country_id = 'AU';
|
52 |
|
53 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
54 |
('AU', 'ACT', 'Australian Capital Territory');
|
55 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
56 |
('en_US', LAST_INSERT_ID(), 'Australian Capital Territory'), ('en_AU', LAST_INSERT_ID(), 'Australian Capital Territory');
|
57 |
-
|
58 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
59 |
('AU', 'NSW', 'New South Wales');
|
60 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
61 |
('en_US', LAST_INSERT_ID(), 'New South Wales'), ('en_AU', LAST_INSERT_ID(), 'New South Wales');
|
62 |
-
|
63 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
64 |
('AU', 'NT', 'Northern Territory');
|
65 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
66 |
('en_US', LAST_INSERT_ID(), 'Northern Territory'), ('en_AU', LAST_INSERT_ID(), 'Northern Territory');
|
67 |
-
|
68 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
69 |
('AU', 'QLD', 'Queensland');
|
70 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
71 |
('en_US', LAST_INSERT_ID(), 'Queensland'), ('en_AU', LAST_INSERT_ID(), 'Queensland');
|
72 |
-
|
73 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
74 |
('AU', 'SA', 'South Australia');
|
75 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
76 |
('en_US', LAST_INSERT_ID(), 'South Australia'), ('en_AU', LAST_INSERT_ID(), 'South Australia');
|
77 |
-
|
78 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
79 |
('AU', 'TAS', 'Tasmania');
|
80 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
81 |
('en_US', LAST_INSERT_ID(), 'Tasmania'), ('en_AU', LAST_INSERT_ID(), 'Tasmania');
|
82 |
-
|
83 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
84 |
('AU', 'VIC', 'Victoria');
|
85 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
86 |
('en_US', LAST_INSERT_ID(), 'Victoria'), ('en_AU', LAST_INSERT_ID(), 'Victoria');
|
87 |
-
|
88 |
-
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
89 |
('AU', 'WA', 'Western Australia');
|
90 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
91 |
('en_US', LAST_INSERT_ID(), 'Western Australia'), ('en_AU', LAST_INSERT_ID(), 'Western Australia');");
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
47 |
$installer->run("
|
48 |
DELETE FROM `{$this->getTable('directory_country_region')}` WHERE country_id = 'AU';
|
49 |
|
50 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
51 |
('AU', 'ACT', 'Australian Capital Territory');
|
52 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
53 |
('en_US', LAST_INSERT_ID(), 'Australian Capital Territory'), ('en_AU', LAST_INSERT_ID(), 'Australian Capital Territory');
|
54 |
+
|
55 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
56 |
('AU', 'NSW', 'New South Wales');
|
57 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
58 |
('en_US', LAST_INSERT_ID(), 'New South Wales'), ('en_AU', LAST_INSERT_ID(), 'New South Wales');
|
59 |
+
|
60 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
61 |
('AU', 'NT', 'Northern Territory');
|
62 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
63 |
('en_US', LAST_INSERT_ID(), 'Northern Territory'), ('en_AU', LAST_INSERT_ID(), 'Northern Territory');
|
64 |
+
|
65 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
66 |
('AU', 'QLD', 'Queensland');
|
67 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
68 |
('en_US', LAST_INSERT_ID(), 'Queensland'), ('en_AU', LAST_INSERT_ID(), 'Queensland');
|
69 |
+
|
70 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
71 |
('AU', 'SA', 'South Australia');
|
72 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
73 |
('en_US', LAST_INSERT_ID(), 'South Australia'), ('en_AU', LAST_INSERT_ID(), 'South Australia');
|
74 |
+
|
75 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
76 |
('AU', 'TAS', 'Tasmania');
|
77 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
78 |
('en_US', LAST_INSERT_ID(), 'Tasmania'), ('en_AU', LAST_INSERT_ID(), 'Tasmania');
|
79 |
+
|
80 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
81 |
('AU', 'VIC', 'Victoria');
|
82 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
83 |
('en_US', LAST_INSERT_ID(), 'Victoria'), ('en_AU', LAST_INSERT_ID(), 'Victoria');
|
84 |
+
|
85 |
+
INSERT INTO `{$this->getTable('directory_country_region')}` (`country_id`, `code`, `default_name`) VALUES
|
86 |
('AU', 'WA', 'Western Australia');
|
87 |
INSERT INTO `{$this->getTable('directory_country_region_name')}` (`locale`, `region_id`, `name`) VALUES
|
88 |
('en_US', LAST_INSERT_ID(), 'Western Australia'), ('en_AU', LAST_INSERT_ID(), 'Western Australia');");
|
app/code/community/Fontis/Australia/sql/australia_setup/mysql4-install-2.2.0.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/sql/australia_setup/mysql4-install-2.2.2.php
CHANGED
@@ -8,15 +8,12 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
* @author Jonathan Melnick
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
@@ -117,10 +114,10 @@ if(!$success) {
|
|
117 |
|
118 |
$_values = array();
|
119 |
$i = 0;
|
120 |
-
|
121 |
while ($row = fgets($fp)) {
|
122 |
$_values[] = '(' . trim($row) . ')';
|
123 |
-
|
124 |
// Process the file in batches
|
125 |
if($i++ % 1000 == 0) {
|
126 |
$insertValues = implode(',', $_values);
|
@@ -128,7 +125,7 @@ if(!$success) {
|
|
128 |
$_values = array();
|
129 |
}
|
130 |
}
|
131 |
-
|
132 |
// Insert any remaining values
|
133 |
if(count($_values)) {
|
134 |
$insertValues = implode(',', $_values);
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
* @author Jonathan Melnick
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
|
114 |
|
115 |
$_values = array();
|
116 |
$i = 0;
|
117 |
+
|
118 |
while ($row = fgets($fp)) {
|
119 |
$_values[] = '(' . trim($row) . ')';
|
120 |
+
|
121 |
// Process the file in batches
|
122 |
if($i++ % 1000 == 0) {
|
123 |
$insertValues = implode(',', $_values);
|
125 |
$_values = array();
|
126 |
}
|
127 |
}
|
128 |
+
|
129 |
// Insert any remaining values
|
130 |
if(count($_values)) {
|
131 |
$insertValues = implode(',', $_values);
|
app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-1.2.1-1.2.2.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.1.0-2.2.0.php
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
|
app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.2.1-2.2.2.php
CHANGED
@@ -8,9 +8,6 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
@@ -23,7 +20,7 @@ $installer = $this;
|
|
23 |
$installer->startSetup();
|
24 |
|
25 |
$installer->run(
|
26 |
-
"ALTER TABLE `australia_eparcel`"
|
27 |
. " ADD `charge_code_individual` VARCHAR( 50 ) NULL DEFAULT NULL,"
|
28 |
. " ADD `charge_code_business` VARCHAR( 50 ) NULL DEFAULT NULL"
|
29 |
);
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
20 |
$installer->startSetup();
|
21 |
|
22 |
$installer->run(
|
23 |
+
"ALTER TABLE `australia_eparcel`"
|
24 |
. " ADD `charge_code_individual` VARCHAR( 50 ) NULL DEFAULT NULL,"
|
25 |
. " ADD `charge_code_business` VARCHAR( 50 ) NULL DEFAULT NULL"
|
26 |
);
|
app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.3.0-2.4.0.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Natural Candle Supply
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category Fontis
|
16 |
+
* @package Fontis_Australia
|
17 |
+
* @author Tomas Dermisek
|
18 |
+
* @copyright Copyright (c) 2014 Natural Candle Supply
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
|
22 |
+
$installer = $this;
|
23 |
+
$installer->startSetup();
|
24 |
+
|
25 |
+
/**
|
26 |
+
*
|
27 |
+
* Added stock_id for storing of Warehouse ID
|
28 |
+
* See: Multi Warehouse Extension: http://innoexts.com/promotion/multi-warehouse/
|
29 |
+
* Version: 1.2.0.11
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
$installer->run(
|
33 |
+
"ALTER TABLE {$this->getTable('australia_eparcel')}
|
34 |
+
ADD stock_id INT NOT NULL DEFAULT '0' COMMENT 'Warehouse ID for Multi Warehouse extension';"
|
35 |
+
);
|
36 |
+
|
37 |
+
$installer->run("
|
38 |
+
ALTER TABLE {$this->getTable('australia_eparcel')}
|
39 |
+
DROP INDEX `dest_country`,
|
40 |
+
ADD UNIQUE `dest_country` ( `website_id` , `dest_country_id` , `dest_region_id` , `dest_zip` , `condition_name` , `condition_to_value` , `delivery_type`, `stock_id`)
|
41 |
+
");
|
42 |
+
|
43 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/template/fontis/australia/payment/bpay/form.phtml
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
@@ -62,7 +62,7 @@
|
|
62 |
color: #142C61;
|
63 |
white-space: nowrap;
|
64 |
line-height: 20px;
|
65 |
-
font-weight: bold;
|
66 |
}
|
67 |
.billerText{
|
68 |
font-size: 11px;
|
@@ -72,9 +72,9 @@
|
|
72 |
</style>
|
73 |
<div align="left">
|
74 |
<table border="0" cellpadding="0" cellspacing="0" class="bpay">
|
75 |
-
<tr>
|
76 |
<td width="1%" class="bpayLogo"><img src="http://www.bpay.com.au/images/bpay.jpg" width="51" height="82" /></td>
|
77 |
-
<td class="customerReferenceBox">
|
78 |
<p class="customerReferenceBoxText">
|
79 |
<?php if ($this->getMethod()->getBillerCode()): ?>
|
80 |
<?php echo $this->__('<b>Biller Code</b>: %s', $this->getMethod()->getBillerCode()); ?><br />
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
62 |
color: #142C61;
|
63 |
white-space: nowrap;
|
64 |
line-height: 20px;
|
65 |
+
font-weight: bold;
|
66 |
}
|
67 |
.billerText{
|
68 |
font-size: 11px;
|
72 |
</style>
|
73 |
<div align="left">
|
74 |
<table border="0" cellpadding="0" cellspacing="0" class="bpay">
|
75 |
+
<tr>
|
76 |
<td width="1%" class="bpayLogo"><img src="http://www.bpay.com.au/images/bpay.jpg" width="51" height="82" /></td>
|
77 |
+
<td class="customerReferenceBox">
|
78 |
<p class="customerReferenceBoxText">
|
79 |
<?php if ($this->getMethod()->getBillerCode()): ?>
|
80 |
<?php echo $this->__('<b>Biller Code</b>: %s', $this->getMethod()->getBillerCode()); ?><br />
|
app/design/adminhtml/default/default/template/fontis/australia/payment/bpay/info.phtml
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
app/design/adminhtml/default/default/template/fontis/australia/payment/directdeposit/form.phtml
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
app/design/adminhtml/default/default/template/fontis/australia/payment/directdeposit/info.phtml
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
app/design/adminhtml/default/default/template/fontis/australia/system/config/form/field/array_dropdown.phtml
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* @package Fontis_CampaignMonitor
|
17 |
* @author Peter Spiller
|
18 |
* @author Chris Norton
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
?>
|
@@ -121,7 +121,7 @@ var arrayRow<?php echo $_htmlId ?> = {
|
|
121 |
}
|
122 |
}
|
123 |
<?php endforeach;?>
|
124 |
-
|
125 |
<?php if ($this->_addAfter):?>
|
126 |
Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
|
127 |
<?php endif;?>
|
16 |
* @package Fontis_CampaignMonitor
|
17 |
* @author Peter Spiller
|
18 |
* @author Chris Norton
|
19 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
?>
|
121 |
}
|
122 |
}
|
123 |
<?php endforeach;?>
|
124 |
+
|
125 |
<?php if ($this->_addAfter):?>
|
126 |
Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
|
127 |
<?php endif;?>
|
app/design/frontend/base/default/layout/{fontis_australia.xml → fontis/australia.xml}
RENAMED
@@ -9,32 +9,38 @@
|
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
-->
|
23 |
<layout version="0.1.0">
|
24 |
<customer_address_form>
|
25 |
-
<reference name="
|
|
|
|
|
|
|
26 |
<block type="core/template" name="fontis_australia_autocomplete" template="fontis/australia/postcode.phtml"/>
|
27 |
</reference>
|
28 |
</customer_address_form>
|
29 |
<customer_account_create>
|
|
|
|
|
|
|
30 |
<reference name="footer">
|
31 |
<block type="core/template" name="fontis_australia_autocomplete" template="fontis/australia/postcode.phtml"/>
|
32 |
</reference>
|
33 |
</customer_account_create>
|
34 |
<checkout_onepage_index>
|
35 |
-
<reference name="
|
|
|
|
|
|
|
36 |
<block type="core/template" name="fontis_australia_autocomplete" template="fontis/australia/postcode-checkout.phtml"/>
|
37 |
-
</reference>
|
38 |
</checkout_onepage_index>
|
39 |
<checkout_onepage_success>
|
40 |
<reference name="checkout.success">
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
12 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_Australia
|
15 |
* @author Chris Norton
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
-->
|
20 |
<layout version="0.1.0">
|
21 |
<customer_address_form>
|
22 |
+
<reference name="head">
|
23 |
+
<action method="addCss" ifconfig="fontis_australia/postcode_autocomplete/enabled"><stylesheet>fontis/australia/css/postcode-autocomplete.css</stylesheet></action>
|
24 |
+
</reference>
|
25 |
+
<reference name="my.account.wrapper">
|
26 |
<block type="core/template" name="fontis_australia_autocomplete" template="fontis/australia/postcode.phtml"/>
|
27 |
</reference>
|
28 |
</customer_address_form>
|
29 |
<customer_account_create>
|
30 |
+
<reference name="head">
|
31 |
+
<action method="addCss" ifconfig="fontis_australia/postcode_autocomplete/enabled"><stylesheet>fontis/australia/css/postcode-autocomplete.css</stylesheet></action>
|
32 |
+
</reference>
|
33 |
<reference name="footer">
|
34 |
<block type="core/template" name="fontis_australia_autocomplete" template="fontis/australia/postcode.phtml"/>
|
35 |
</reference>
|
36 |
</customer_account_create>
|
37 |
<checkout_onepage_index>
|
38 |
+
<reference name="head">
|
39 |
+
<action method="addCss" ifconfig="fontis_australia/postcode_autocomplete/enabled"><stylesheet>fontis/australia/css/postcode-autocomplete.css</stylesheet></action>
|
40 |
+
</reference>
|
41 |
+
<reference name="content">
|
42 |
<block type="core/template" name="fontis_australia_autocomplete" template="fontis/australia/postcode-checkout.phtml"/>
|
43 |
+
</reference>
|
44 |
</checkout_onepage_index>
|
45 |
<checkout_onepage_success>
|
46 |
<reference name="checkout.success">
|
app/design/frontend/base/default/template/fontis/australia/payment/bpay/form.phtml
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
?>
|
app/design/frontend/base/default/template/fontis/australia/payment/bpay/info.phtml
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
app/design/frontend/base/default/template/fontis/australia/payment/bpay/success.phtml
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
@@ -24,17 +24,6 @@ $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
|
24 |
$payment = $order->getPayment();
|
25 |
?>
|
26 |
<?php if($payment->getMethod() == 'bpay'): ?>
|
27 |
-
<?php
|
28 |
-
$bpay = Mage::getModel('australia/payment_bpay');
|
29 |
-
$data = array(
|
30 |
-
'biller_code' => $bpay->getBillerCode(),
|
31 |
-
'ref' => $bpay->getRef()
|
32 |
-
);
|
33 |
-
$payment->setAdditionalData(serialize($data));
|
34 |
-
$payment->save();
|
35 |
-
|
36 |
-
$order->addStatusToHistory('pending_bpay', 'Order placed with BPAY', false);
|
37 |
-
$order->save();
|
38 |
-
?>
|
39 |
<?php echo Mage::helper('australia/bpay')->bpayInfoBlock($data['biller_code'], $data['ref']); ?>
|
40 |
<?php endif; ?>
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
24 |
$payment = $order->getPayment();
|
25 |
?>
|
26 |
<?php if($payment->getMethod() == 'bpay'): ?>
|
27 |
+
<?php $data = @unserialize($payment->getAdditionalData()); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
<?php echo Mage::helper('australia/bpay')->bpayInfoBlock($data['biller_code'], $data['ref']); ?>
|
29 |
<?php endif; ?>
|
app/design/frontend/base/default/template/fontis/australia/payment/directdeposit/form.phtml
CHANGED
@@ -15,27 +15,25 @@
|
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
</ul>
|
41 |
-
</fieldset>
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
22 |
+
<?php $method = $this->getMethod(); ?>
|
23 |
+
<dl id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none" class="form-list">
|
24 |
+
<?php if ($method->getAccountName()): ?>
|
25 |
+
<dt><?php echo $this->__('Account Name'); ?></dt>
|
26 |
+
<dd><?php echo $method->getAccountName(); ?></dd>
|
27 |
+
<?php endif;?>
|
28 |
+
<?php if ($method->getAccountBSB()): ?>
|
29 |
+
<dt><?php echo $this->__('Account BSB'); ?></dt>
|
30 |
+
<dd><?php echo $method->getAccountBSB(); ?></dd>
|
31 |
+
<?php endif;?>
|
32 |
+
<?php if ($method->getAccountNumber()): ?>
|
33 |
+
<dt><?php echo $this->__('Account Number'); ?></dt>
|
34 |
+
<dd><?php echo $method->getAccountNumber(); ?></dd>
|
35 |
+
<?php endif;?>
|
36 |
+
<?php if ($method->getMessage()): ?>
|
37 |
+
<dd><?php echo $method->getMessage(); ?></dd>
|
38 |
+
<?php endif;?>
|
39 |
+
</dl>
|
|
|
|
app/design/frontend/base/default/template/fontis/australia/payment/directdeposit/info.phtml
CHANGED
@@ -8,21 +8,16 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
22 |
<p><?php echo $this->getMethod()->getTitle() ?>
|
23 |
-
<?php //if($this->getInfo()->getAdditionalData()): ?>
|
24 |
<?php if($this->getAccountName()): ?><br /><?php echo $this->__('Account Name: %s', $this->getAccountName()); ?><?php endif; ?>
|
25 |
-
|
26 |
-
|
27 |
-
<?php //endif;?>
|
28 |
</p>
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
?>
|
19 |
<p><?php echo $this->getMethod()->getTitle() ?>
|
|
|
20 |
<?php if($this->getAccountName()): ?><br /><?php echo $this->__('Account Name: %s', $this->getAccountName()); ?><?php endif; ?>
|
21 |
+
<?php if($this->getAccountBSB()): ?><br /><?php echo $this->__('Account BSB: %s', $this->getAccountBSB()); ?><?php endif; ?>
|
22 |
+
<?php if($this->getAccountNumber()): ?><br /><?php echo $this->__('Account Number: %s', $this->getAccountNumber()); ?><?php endif; ?>
|
|
|
23 |
</p>
|
app/design/frontend/base/default/template/fontis/australia/payment/directdeposit/success.phtml
CHANGED
@@ -8,14 +8,11 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
@@ -24,15 +21,11 @@ $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
|
24 |
$payment = $order->getPayment();
|
25 |
?>
|
26 |
<?php if($payment->getMethod() == 'directdeposit_au'): ?>
|
27 |
-
<?php
|
28 |
-
$order->addStatusToHistory('pending_deposit', 'Order placed with Direct Deposit', false);
|
29 |
-
$order->save();
|
30 |
-
$data = @unserialize($payment->getAdditionalData());
|
31 |
-
?>
|
32 |
<div id="directdeposit_au_success">
|
33 |
<p class="message"><?php echo $this->__('Please use the following details to make payment:'); ?></p>
|
34 |
<?php if($data['account_name']): ?><br /><b><?php echo $this->__('Account Name: '); ?></b> <?php echo $data['account_name']; ?><?php endif; ?>
|
35 |
-
|
36 |
-
|
37 |
</div>
|
38 |
<?php endif; ?>
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
?>
|
21 |
$payment = $order->getPayment();
|
22 |
?>
|
23 |
<?php if($payment->getMethod() == 'directdeposit_au'): ?>
|
24 |
+
<?php $data = @unserialize($payment->getAdditionalData()); ?>
|
|
|
|
|
|
|
|
|
25 |
<div id="directdeposit_au_success">
|
26 |
<p class="message"><?php echo $this->__('Please use the following details to make payment:'); ?></p>
|
27 |
<?php if($data['account_name']): ?><br /><b><?php echo $this->__('Account Name: '); ?></b> <?php echo $data['account_name']; ?><?php endif; ?>
|
28 |
+
<?php if($data['account_bsb']): ?><br /><b><?php echo $this->__('Account BSB: '); ?></b> <?php echo $data['account_bsb']; ?><?php endif; ?>
|
29 |
+
<?php if($data['account_number']): ?><br /><b><?php echo $this->__('Account Number: '); ?></b> <?php echo $data['account_number']; ?><?php endif; ?>
|
30 |
</div>
|
31 |
<?php endif; ?>
|
app/design/frontend/base/default/template/fontis/australia/postcode-checkout.phtml
CHANGED
@@ -8,77 +8,64 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
22 |
-
|
|
|
|
|
23 |
|
24 |
-
//============ Billing ============//
|
25 |
-
var autocomplete_city_billing = new Element('div', { id: 'autocomplete_city_billing', 'class': '
|
26 |
-
$('billing:city').parentNode.appendChild(autocomplete_city_billing);
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
|
39 |
-
var
|
40 |
-
afterUpdateElement: updateAddressBilling,
|
41 |
-
minChars: 2,
|
42 |
-
parameters: 'country=' + $F('billing:country_id')
|
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 |
-
// Create the autocompleter and assign it to a variable for future use.
|
69 |
-
var completer = new Ajax.Autocompleter("shipping:city", "autocomplete_city_shipping", "<?php echo $this->helper('australia')->getCitySuggestUrl();?>", {
|
70 |
-
afterUpdateElement: updateAddressShipping,
|
71 |
-
minChars: 2,
|
72 |
-
parameters: 'country=' + $F('shipping:country_id')
|
73 |
-
});
|
74 |
-
|
75 |
-
// Detect when the country has changed and update the parameters sent by the autocompleter.
|
76 |
-
$('shipping:country_id').observe('change', function() {
|
77 |
-
completer = new Ajax.Autocompleter("shipping:city", "autocomplete_city_shipping", "<?php echo $this->helper('australia')->getCitySuggestUrl();?>", {
|
78 |
-
afterUpdateElement: updateAddressShipping,
|
79 |
-
minChars: 2,
|
80 |
-
parameters: 'country=' + $F('shipping:country_id')
|
81 |
-
});
|
82 |
-
});
|
83 |
-
|
84 |
-
</script>
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
?>
|
19 |
+
<?php if (Mage::helper('australia')->isPostcodeAutocompleteEnabled()): ?>
|
20 |
+
<script type="text/javascript">
|
21 |
+
var citySuggestUrl = '<?php echo $this->helper('australia')->getCitySuggestUrl(); ?>';
|
22 |
|
23 |
+
//============ Billing ============//
|
24 |
+
var autocomplete_city_billing = new Element('div', { id: 'autocomplete_city_billing', 'class': 'fontis-postcode-autocomplete' });
|
|
|
25 |
|
26 |
+
if ($('billing:city')) {
|
27 |
+
$('billing:city').parentNode.appendChild(autocomplete_city_billing);
|
28 |
+
|
29 |
+
function updateAddressBilling(text, item) {
|
30 |
+
// Update state and postcode fields
|
31 |
+
var id = item.id;
|
32 |
+
var tokens = id.split('-');
|
33 |
+
|
34 |
+
// Assume item at index 1 is region_id, item at index 3 is postcode
|
35 |
+
$('billing:region_id').value = tokens[1];
|
36 |
+
$('billing:postcode').value = tokens[3];
|
37 |
+
}
|
38 |
+
|
39 |
+
// Create the autocompleter and assign it to a variable for future use.
|
40 |
+
var completer = new Ajax.Autocompleter("billing:city", "autocomplete_city_billing", citySuggestUrl, {
|
41 |
+
afterUpdateElement: updateAddressBilling,
|
42 |
+
minChars: 2,
|
43 |
+
parameters: 'country=' + $F('billing:country_id')
|
44 |
+
});
|
45 |
+
}
|
46 |
|
47 |
+
//============ Shipping ============//
|
48 |
+
var autocomplete_city_shipping = new Element('div', { id: 'autocomplete_city_shipping', 'class': 'fontis-postcode-autocomplete' });
|
|
|
|
|
|
|
|
|
49 |
|
50 |
+
if ($('shipping:city')) {
|
51 |
+
$('shipping:city').parentNode.appendChild(autocomplete_city_shipping);
|
52 |
+
|
53 |
+
function updateAddressShipping(text, item) {
|
54 |
+
// Update state and postcode fields
|
55 |
+
var id = item.id;
|
56 |
+
var tokens = id.split('-');
|
57 |
+
|
58 |
+
// Assume item at index 1 is region_id, item at index 3 is postcode
|
59 |
+
$('shipping:region_id').value = tokens[1];
|
60 |
+
$('shipping:postcode').value = tokens[3];
|
61 |
+
}
|
62 |
+
|
63 |
+
// Create the autocompleter and assign it to a variable for future use.
|
64 |
+
var completer = new Ajax.Autocompleter("shipping:city", "autocomplete_city_shipping", citySuggestUrl, {
|
65 |
+
afterUpdateElement: updateAddressShipping,
|
66 |
+
minChars: 2,
|
67 |
+
parameters: 'country=' + $F('shipping:country_id')
|
68 |
+
});
|
69 |
+
}
|
70 |
+
</script>
|
71 |
+
<?php endif ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/fontis/australia/postcode.phtml
CHANGED
@@ -8,48 +8,38 @@
|
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
* @category Fontis
|
16 |
* @package Fontis_Australia
|
17 |
* @author Chris Norton
|
18 |
-
* @copyright Copyright (c)
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
?>
|
22 |
-
|
|
|
|
|
23 |
|
24 |
-
// Create and insert the div that will hold the list of autocomplete items. This
|
25 |
-
// is added to the DOM immediately following the #city field.
|
26 |
-
var autocomplete_city = new Element('div', { id: 'autocomplete_city', 'class': '
|
27 |
-
$('city').parentNode.appendChild(autocomplete_city);
|
28 |
|
29 |
-
function updateAddress(text, item) {
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
// Assume item at index 1 is region_id, item at index 3 is postcode
|
35 |
-
$('region_id').value = tokens[1];
|
36 |
-
$('zip').value = tokens[3];
|
37 |
-
}
|
38 |
|
39 |
-
//
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
parameters: 'country=' + $F('country')
|
44 |
-
});
|
45 |
|
46 |
-
//
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
</script>
|
8 |
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
11 |
*
|
12 |
* @category Fontis
|
13 |
* @package Fontis_Australia
|
14 |
* @author Chris Norton
|
15 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
16 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
*/
|
18 |
?>
|
19 |
+
<?php if (Mage::helper('australia')->isPostcodeAutocompleteEnabled()): ?>
|
20 |
+
<script type="text/javascript">
|
21 |
+
var citySuggestUrl = '<?php echo $this->helper('australia')->getCitySuggestUrl(); ?>';
|
22 |
|
23 |
+
// Create and insert the div that will hold the list of autocomplete items. This
|
24 |
+
// is added to the DOM immediately following the #city field.
|
25 |
+
var autocomplete_city = new Element('div', { id: 'autocomplete_city', 'class': 'fontis-postcode-autocomplete' });
|
26 |
+
$('city').parentNode.appendChild(autocomplete_city);
|
27 |
|
28 |
+
function updateAddress(text, item) {
|
29 |
+
// Update state and postcode fields
|
30 |
+
var id = item.id;
|
31 |
+
var tokens = id.split('-');
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
// Assume item at index 1 is region_id, item at index 3 is postcode
|
34 |
+
$('region_id').value = tokens[1];
|
35 |
+
$('zip').value = tokens[3];
|
36 |
+
}
|
|
|
|
|
37 |
|
38 |
+
// Create the autocompleter and assign it to a variable for future use.
|
39 |
+
var completer = new Ajax.Autocompleter("city", "autocomplete_city", citySuggestUrl, {
|
40 |
+
afterUpdateElement: updateAddress,
|
41 |
+
minChars: 2,
|
42 |
+
parameters: 'country=' + $F('country')
|
43 |
+
});
|
44 |
+
</script>
|
45 |
+
<?php endif ?>
|
|
|
|
app/etc/modules/Fontis_Australia.xml
CHANGED
@@ -9,14 +9,11 @@
|
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
* @category Fontis
|
17 |
* @package Fontis_Australia
|
18 |
* @author Chris Norton
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
-->
|
@@ -27,4 +24,4 @@
|
|
27 |
<codePool>community</codePool>
|
28 |
</Fontis_Australia>
|
29 |
</modules>
|
30 |
-
</config>
|
9 |
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
* http://opensource.org/licenses/osl-3.0.php
|
|
|
|
|
|
|
12 |
*
|
13 |
* @category Fontis
|
14 |
* @package Fontis_Australia
|
15 |
* @author Chris Norton
|
16 |
+
* @copyright Copyright (c) 2014 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
17 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
18 |
*/
|
19 |
-->
|
24 |
<codePool>community</codePool>
|
25 |
</Fontis_Australia>
|
26 |
</modules>
|
27 |
+
</config>
|
lib/Doghouse/Australia/Eparcel.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Doghouse_Australia_Eparcel
|
4 |
+
{
|
5 |
+
const ENCLOSURE = '"';
|
6 |
+
const DELIMITER = ',';
|
7 |
+
|
8 |
+
protected $records = array();
|
9 |
+
|
10 |
+
public function addRecord(Doghouse_Australia_Eparcel_Record $record)
|
11 |
+
{
|
12 |
+
$record->isAddedToEparcel(true);
|
13 |
+
|
14 |
+
return array_push($this->records,$record);
|
15 |
+
}
|
16 |
+
|
17 |
+
public function makeCsv($filePath)
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* File pointer handle
|
21 |
+
* @var resource
|
22 |
+
*/
|
23 |
+
$_fp = fopen($filePath, 'w');
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Check FP handle is ok
|
27 |
+
*/
|
28 |
+
if ( $_fp == false ) return false;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Cycle through records
|
32 |
+
*/
|
33 |
+
foreach( $this->records as $record )
|
34 |
+
{
|
35 |
+
fputcsv($_fp,$record->getValues(),self::DELIMITER,self::ENCLOSURE);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Close File pointer
|
40 |
+
*/
|
41 |
+
fclose( $_fp );
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Return :)
|
45 |
+
*/
|
46 |
+
return true;
|
47 |
+
}
|
48 |
+
}
|
lib/Doghouse/Australia/Eparcel/Parcel.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class Doghouse_Australia_Eparcel_Parcel
|
4 |
+
{
|
5 |
+
public $weight = 0; // [Kg]
|
6 |
+
public $weightMax = 0; // [Kg]
|
7 |
+
|
8 |
+
public $width = 0; // [cm]
|
9 |
+
public $height = 0; // [cm]
|
10 |
+
public $length = 0; // [cm]
|
11 |
+
|
12 |
+
protected $_goodRecords = array();
|
13 |
+
|
14 |
+
protected $isInsuranceRequired = false;
|
15 |
+
|
16 |
+
public function isInsuranceRequired($isInsuranceRequired=null)
|
17 |
+
{
|
18 |
+
if (!is_null($isInsuranceRequired))
|
19 |
+
{
|
20 |
+
$this->isInsuranceRequired = (bool) $isInsuranceRequired;
|
21 |
+
}
|
22 |
+
|
23 |
+
return (bool) $this->isInsuranceRequired;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function processArticleRecord(Doghouse_Australia_Eparcel_Record_Article $record)
|
27 |
+
{
|
28 |
+
$totalValue = $this->getTotalValue();
|
29 |
+
|
30 |
+
$record->length = $this->length;
|
31 |
+
$record->width = $this->width;
|
32 |
+
$record->height = $this->height;
|
33 |
+
|
34 |
+
$record->weight = $this->weight;
|
35 |
+
|
36 |
+
$record->numberIdenticalItems = 1;
|
37 |
+
$record->description = "";
|
38 |
+
$record->valueForCustoms = $totalValue;
|
39 |
+
|
40 |
+
$record->calculateWeight();
|
41 |
+
|
42 |
+
if( $this->isInsuranceRequired() )
|
43 |
+
{
|
44 |
+
$record->isInsuranceRequired = true;
|
45 |
+
$record->insuranceAmount = $totalValue;
|
46 |
+
}
|
47 |
+
|
48 |
+
return $record;
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function getTotalValue()
|
52 |
+
{
|
53 |
+
$totalValue = 0;
|
54 |
+
|
55 |
+
foreach( $this->getGoodRecords() as $_goodRecord )
|
56 |
+
{
|
57 |
+
$totalValue += $_goodRecord->totalValue;
|
58 |
+
}
|
59 |
+
|
60 |
+
return $totalValue;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function addGood(Doghouse_Australia_Eparcel_Record_Good $goodRecord)
|
64 |
+
{
|
65 |
+
$this->_goodRecords[] = $goodRecord;
|
66 |
+
|
67 |
+
return true;
|
68 |
+
}
|
69 |
+
|
70 |
+
public function getGoodRecords()
|
71 |
+
{
|
72 |
+
return $this->_goodRecords;
|
73 |
+
}
|
74 |
+
|
75 |
+
abstract public function canAddGood(Doghouse_Australia_Eparcel_Record_Good $goodRecord);
|
76 |
+
}
|
lib/Doghouse/Australia/Eparcel/Parcel/Carton.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Doghouse_Australia_Eparcel_Parcel_Carton extends Doghouse_Australia_Eparcel_Parcel
|
4 |
+
{
|
5 |
+
public function canAddGood(Doghouse_Australia_Eparcel_Record_Good $goodRecord)
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Check that adding this good to parcel will not make
|
9 |
+
* total parcel weight go over parcel's maxWeight
|
10 |
+
*/
|
11 |
+
if ( ($goodRecord->weight * $goodRecord->quantity) + $this->weight >= $this->weightMax )
|
12 |
+
{
|
13 |
+
return false;
|
14 |
+
}
|
15 |
+
|
16 |
+
return true;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function addGood(Doghouse_Australia_Eparcel_Record_Good $goodRecord)
|
20 |
+
{
|
21 |
+
$this->weight += ( $goodRecord->weight * $goodRecord->quantity );
|
22 |
+
|
23 |
+
return parent::addGood($goodRecord);
|
24 |
+
}
|
25 |
+
}
|
lib/Doghouse/Australia/Eparcel/Record.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class Doghouse_Australia_Eparcel_Record
|
4 |
+
{
|
5 |
+
public $type;
|
6 |
+
|
7 |
+
protected $isAddedToEparcel = false;
|
8 |
+
|
9 |
+
public function isAddedToEparcel($isAddedToEparcel=null)
|
10 |
+
{
|
11 |
+
if ( !is_null($isAddedToEparcel) )
|
12 |
+
{
|
13 |
+
$this->isAddedToEparcel = (bool) $isAddedToEparcel;
|
14 |
+
}
|
15 |
+
|
16 |
+
return (bool) $this->isAddedToEparcel;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getValues()
|
20 |
+
{
|
21 |
+
$values = array_values(
|
22 |
+
get_object_vars($this)
|
23 |
+
);
|
24 |
+
|
25 |
+
// Removes $isAddedToEparcel from array
|
26 |
+
// TODO: Use a better data structure to generate eParcel records
|
27 |
+
array_pop($values);
|
28 |
+
|
29 |
+
foreach( $values as &$value )
|
30 |
+
{
|
31 |
+
if ( $value === true ) $value = 'Y';
|
32 |
+
if ( $value === false ) $value = 'N';
|
33 |
+
}
|
34 |
+
|
35 |
+
return $values;
|
36 |
+
}
|
37 |
+
}
|
lib/Doghouse/Australia/Eparcel/Record/Article.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Doghouse_Australia_Eparcel_Record_Article extends Doghouse_Australia_Eparcel_Record
|
4 |
+
{
|
5 |
+
public $type = 'A';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The cubic weight is the parcel's volume in cubic metres multiplied by 250.
|
9 |
+
* @see http://auspost.com.au/personal/parcel-dimensions.html
|
10 |
+
* @var float
|
11 |
+
*/
|
12 |
+
public $weight;
|
13 |
+
|
14 |
+
public $length;
|
15 |
+
public $width;
|
16 |
+
public $height;
|
17 |
+
public $numberIdenticalItems = 1;
|
18 |
+
public $description;
|
19 |
+
public $isDangerousGoods = false;
|
20 |
+
public $isInsuranceRequired = false;
|
21 |
+
public $insuranceAmount;
|
22 |
+
public $valueForCustoms;
|
23 |
+
public $exportReason;
|
24 |
+
public $exportClearanceNumber;
|
25 |
+
|
26 |
+
public function calculateWeight()
|
27 |
+
{
|
28 |
+
/*
|
29 |
+
* Everything is already calculated.
|
30 |
+
* This method only exists for consistency with
|
31 |
+
* Doghouse_Australia_Eparcel_Record_Article_CubicWeight
|
32 |
+
*/
|
33 |
+
return true;
|
34 |
+
}
|
35 |
+
}
|
lib/Doghouse/Australia/Eparcel/Record/Article/CubicWeight.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Doghouse_Australia_Eparcel_Record_Article_CubicWeight extends Doghouse_Australia_Eparcel_Record_Article
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* The cubic weight is the parcel's volume in cubic metres multiplied by 250.
|
7 |
+
* @see http://auspost.com.au/personal/parcel-dimensions.html
|
8 |
+
* @var float
|
9 |
+
*/
|
10 |
+
public $weight;
|
11 |
+
|
12 |
+
public function calculateWeight()
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Convert [cm] to [m]
|
16 |
+
*/
|
17 |
+
$l = (float) $this->length / 100;
|
18 |
+
$w = (float) $this->width / 100;
|
19 |
+
$h = (float) $this->height / 100;
|
20 |
+
|
21 |
+
$this->weight = round( ($l * $w * $h) * 250, 2);
|
22 |
+
|
23 |
+
return true;
|
24 |
+
}
|
25 |
+
}
|
lib/Doghouse/Australia/Eparcel/Record/Consignment.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Doghouse_Australia_Eparcel_Record_Consignment extends Doghouse_Australia_Eparcel_Record
|
4 |
+
{
|
5 |
+
public $type = 'C';
|
6 |
+
public $consignmentId = '';
|
7 |
+
|
8 |
+
public $postChargeToAccount;
|
9 |
+
public $chargeCode;
|
10 |
+
public $merchantConsigneeCode;
|
11 |
+
public $consigneeName;
|
12 |
+
public $consigneeBusinessName;
|
13 |
+
public $consigneeAddressLine1;
|
14 |
+
public $consigneeAddressLine2;
|
15 |
+
public $consigneeAddressLine3;
|
16 |
+
public $consigneeAddressLine4;
|
17 |
+
public $consigneeSuburb;
|
18 |
+
public $consigneeStateCode;
|
19 |
+
public $consigneePostcode;
|
20 |
+
public $consigneeCountryCode;
|
21 |
+
public $consigneePhoneNumber;
|
22 |
+
public $isPhonePrintRequired = false;
|
23 |
+
public $consigneeFaxNumber;
|
24 |
+
public $deliveryInstructions;
|
25 |
+
public $isSignatureRequired;
|
26 |
+
public $isPartDelivery = false;
|
27 |
+
public $comments;
|
28 |
+
public $addToAddressBook = false;
|
29 |
+
public $cashToCollectAmount;
|
30 |
+
public $ref;
|
31 |
+
public $isRefPrintRequired = false;
|
32 |
+
public $ref2;
|
33 |
+
public $isRef2PrintRequired = false;
|
34 |
+
public $chargebackAccount;
|
35 |
+
public $isRecurringConsignment = false;
|
36 |
+
public $returnName;
|
37 |
+
public $returnAddress1;
|
38 |
+
public $returnAddress2;
|
39 |
+
public $returnAddress3;
|
40 |
+
public $returnAddress4;
|
41 |
+
public $returnSuburb;
|
42 |
+
public $returnState;
|
43 |
+
public $returnPostcode;
|
44 |
+
public $returnCountryCode;
|
45 |
+
public $redirectionCompanyName;
|
46 |
+
public $redirectionName;
|
47 |
+
public $redirectionAddress1;
|
48 |
+
public $redirectionAddress2;
|
49 |
+
public $redirectionAddress3;
|
50 |
+
public $redirectionAddress4;
|
51 |
+
public $redirectSuburb;
|
52 |
+
public $redirectState;
|
53 |
+
public $redirectionPostcode;
|
54 |
+
public $redirectionCountryCode;
|
55 |
+
public $manifestIdentifier;
|
56 |
+
public $consigneeEmailAddress;
|
57 |
+
public $emailNotification;
|
58 |
+
public $businessPartnerNumber;
|
59 |
+
public $surveyId;
|
60 |
+
public $deliverySubscription;
|
61 |
+
public $embargoDate;
|
62 |
+
public $specifiedDeliveryDate;
|
63 |
+
public $specifiedDeliveryDay;
|
64 |
+
public $specifiedNoDeliveryDay;
|
65 |
+
public $customerCollectLocation;
|
66 |
+
}
|
lib/Doghouse/Australia/Eparcel/Record/Good.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Doghouse_Australia_Eparcel_Record_Good extends Doghouse_Australia_Eparcel_Record
|
4 |
+
{
|
5 |
+
public $type = 'G';
|
6 |
+
|
7 |
+
public $originCountryCode;
|
8 |
+
public $hsTariffCode;
|
9 |
+
public $description;
|
10 |
+
public $productType;
|
11 |
+
public $productClassification;
|
12 |
+
public $quantity;
|
13 |
+
public $weight = 0;
|
14 |
+
public $unitValue;
|
15 |
+
public $totalValue;
|
16 |
+
}
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fontis_Australia</name>
|
4 |
-
<version>2.
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="http://opensource.org/licenses/osl-3.0.php">
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>This extension
|
11 |
<notes></notes>
|
12 |
<authors><author><name>Fontis</name><user>magento</user><email>magento@fontis.com.au</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Fontis"><dir name="Australia"><dir name="Block"><file name="Autocomplete.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fontis_Australia</name>
|
4 |
+
<version>2.5.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Adds Australian states and territories, support for Australia Post and eParcel shipping, direct deposit and BPAY payment methods, and postcode autocomplete for Australian stores.</summary>
|
10 |
+
<description>This extension provides commonly required features for Australian Magento stores. For more information, including screenshots, changelogs and instructions on configuration and usage, please see the Fontis Australia Magento extension page. To stay up-to-date with the latest releases, follow us on Twitter and subscribe to our blog. If you'd like to link to this extension, please link to our extension page which is updated more frequently than this Connect listing. A complete list of our other extensions can be found on our Magento extensions page.</description>
|
11 |
<notes></notes>
|
12 |
<authors><author><name>Fontis</name><user>magento</user><email>magento@fontis.com.au</email></author></authors>
|
13 |
+
<date>2014-07-18</date>
|
14 |
+
<time>07:25:52</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Fontis"><dir name="Australia"><dir name="Block"><file name="Autocomplete.php" hash="609d334b1494233f5d20de1aaafc0d4c"/><dir name="Bpay"><file name="Form.php" hash="034514d25a9c4e8de64150d912aa8130"/><file name="Info.php" hash="47eed1f5b91c3f456c7154c335f7262b"/></dir><dir name="Directdeposit"><file name="Form.php" hash="439c16e96a418014cfdb92a740ef7130"/><file name="Info.php" hash="56ec86fa11cfe8694a9dcc793a61d1a3"/></dir><dir name="Eparcel"><dir name="Rate"><file name="Export.php" hash="13aa83083535622d67734411016d97b1"/></dir></dir><file name="Getprice.php" hash="a1811483699a257fd79fe6c56be901ef"/><file name="Googleproducts.php" hash="28b376a67c85ba12c65fdbece4056ab3"/><file name="Myshopping.php" hash="313a4a8024adb67e99108e14d52038b9"/><file name="Shopbot.php" hash="dc1dcc21eb1594f44f70ba7209832f87"/><file name="Shoppingdotcom.php" hash="62605d4bacd72cc81d33e49bfd646972"/></dir><dir name="controllers"><file name="AjaxController.php" hash="e7b05fc7526d866d5d1f64a9eda3fb8b"/><file name="EparcelController.php" hash="123b4aaa79b325f8556587b36f4752f7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7a3034da139962630f7bba6354c95c09"/><file name="config.xml" hash="27e1ed2e574c9737956debaa229bbde4"/><file name="system.xml" hash="db72467990392d7d7c05be1708708dd7"/></dir><dir name="Helper"><file name="Bpay.php" hash="c920b9fbc3403dd6ca6a7ac8a49874d4"/><file name="Data.php" hash="f844c3724bdef23bc594907b04c1989b"/><file name="Eparcel.php" hash="189023699fe22f5064f07cd71308b782"/></dir><dir name="Model"><file name="Child.php" hash="475f761e6d50ce007fc264c492175181"/><dir name="Config"><file name="Condition.php" hash="40e7f4e7dd219907ef85e8a54665041f"/><file name="CustomerGroupAccess.php" hash="a91deffb20d991626a9c7fbbcf25f44c"/><file name="CustomerGroups.php" hash="d7d3b1439647f9d64040a0c972908a48"/><file name="EmailNotificationLevel.php" hash="682c12494834b98fdf8c4271722d6f6f"/><file name="ProductAttributes.php" hash="7036f5b60ab3d4ceac5528767d1ae88f"/></dir><file name="FeedCronBase.php" hash="ddb265d96c3c6c8dbdeb16bc1c81c73d"/><dir name="Getprice"><file name="Child.php" hash="dfabad93d15f2429737557edf129e5b6"/><file name="Cron.php" hash="71a66c848b92673249c48490bef9f8d3"/></dir><file name="Getprice.php" hash="13b0ced9bb96501f63f4f18b53abc648"/><dir name="Googleproducts"><file name="Cron.php" hash="d32cca98a88e419351317685bf4e572f"/></dir><file name="Googleproducts.php" hash="ed6e75324fbaba5bc2ce1a5df9725d85"/><dir name="Myshopping"><file name="Child.php" hash="eed4b19b9461d31fa398804a6dd83b5b"/><file name="Cron.php" hash="1c57f4946c70cc15afdae9f72fb78f19"/></dir><file name="Myshopping.php" hash="0142fee7f03a38ae793054f35f4694d2"/><dir name="Mysql4"><dir name="Shipping"><dir name="Carrier"><dir name="Eparcel"><file name="Collection.php" hash="1552f81ee8c5074892fed908003b1106"/></dir><file name="Eparcel.php" hash="d853ad36c1cbb0ecf0f9df7ade4d1212"/></dir></dir></dir><file name="Observer.php" hash="c6b6b15867c371e7b69aa17e2a4ead83"/><dir name="Payment"><file name="Bpay.php" hash="334d96f59d61eae2ecb0dfd115959e34"/><file name="Directdeposit.php" hash="38cc15ce5f89dcf08434ec3aa7d4ffe7"/></dir><dir name="Shipping"><dir name="Carrier"><file name="Australiapost.php" hash="c88d6ff883df03d91c3692543c62f6a3"/><dir name="Eparcel"><dir name="Export"><file name="Abstract.php" hash="cb84eeee5ff4eccb1eaae36939f739b0"/><file name="Csv.php" hash="f45fabc954ecd26246d78a31a5ccab69"/><file name="Exception.php" hash="ac6fd3d124a17436f98c44d78e4a1cd2"/></dir></dir><file name="Eparcel.php" hash="dc79f4ed15df49e009a7f3fa1b063d5d"/></dir><dir name="Config"><file name="Eparcelcondition.php" hash="b1fe6753b806fb8dcd6b768edb12e9ac"/><file name="Eparcel.php" hash="927557f285cd2facc0ca5477d02a1677"/><file name="Shippingmethods.php" hash="8cdff62758eeff136126daf8f6e6e537"/><file name="Weightunits.php" hash="0eee652e6e6e87db289457754e56f2e4"/></dir></dir><dir name="Shopbot"><file name="Child.php" hash="121df42f2ea7cc7945a88227412438ca"/><file name="Cron.php" hash="19ee9f6b965846be570ca18fd78cfb15"/></dir><file name="Shopbot.php" hash="0d3dfa8fa56098eb74dbea22c2ca3b41"/><dir name="Shoppingdotcom"><file name="Cron.php" hash="353db362d54aaeef11d0cddcf4a6a8a1"/></dir><file name="Shoppingdotcom.php" hash="26a3837c76ff71e6eeab80f527561dd6"/></dir><dir name="sql"><dir name="australia_setup"><file name="mysql4-install-0.7.0.php" hash="fbf6045327c2b6f406876accc7140a82"/><file name="mysql4-install-2.2.0.php" hash="400152c0be1e17b95d24d00414be6284"/><file name="mysql4-install-2.2.2.php" hash="cbf95b6ac637149f3e660f2909f8014c"/><file name="mysql4-upgrade-1.2.1-1.2.2.php" hash="50637f83f3efeef6f67da9e23c8b499a"/><file name="mysql4-upgrade-2.1.0-2.2.0.php" hash="473a3efd1d6f52633d2cec6c51f2b7c9"/><file name="mysql4-upgrade-2.2.1-2.2.2.php" hash="e5ce9e8d49f590d0ac9b8efdab26ba18"/><file name="mysql4-upgrade-2.3.0-2.4.0.php" hash="b74ce148a2245b65a481cb978beff3bb"/><file name="postcodes.csv" hash="e6e407c3fcf49625e62ee89f9404e667"/><file name="postcodes.txt" hash="21083a0f94e200259c9b4540666b251e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="fontis"><dir name="australia"><dir name="payment"><dir name="bpay"><file name="form.phtml" hash="3d5804d766b238aa45d9c37224215ba7"/><file name="info.phtml" hash="915770cc66f2d07b240b0acdee1e5947"/></dir><dir name="directdeposit"><file name="form.phtml" hash="5a607a3098e3cf7523cba93f74d22ccb"/><file name="info.phtml" hash="af582ae19c575ff41d83cedf830728cb"/></dir></dir><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array_dropdown.phtml" hash="dbeee20f09fcb3a09488788db4208ee1"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="fontis"><file name="australia.xml" hash="01ea2d52169ec97df309789f874c0a56"/></dir></dir><dir name="template"><dir name="fontis"><dir name="australia"><dir name="payment"><dir name="bpay"><file name="form.phtml" hash="95fc335f5ce746620969590243e4eeff"/><file name="info.phtml" hash="5031750f5bb5e5a2d6dc881caa9bfa16"/><file name="success.phtml" hash="ea3431c3539b901b3015e2b0c3cc5d89"/></dir><dir name="directdeposit"><file name="form.phtml" hash="db0e673add121406a65fe8051eaf4766"/><file name="info.phtml" hash="18af88d08fbf563b540d95012988aa04"/><file name="success.phtml" hash="531b2f65df1b7515d9e3731503102595"/></dir></dir><file name="postcode-checkout.phtml" hash="7def41a2bcd07309b2c8c4b4d83e3ad8"/><file name="postcode.phtml" hash="c7672d4792762b456bab3f6ea23adb49"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fontis_Australia.xml" hash="8da197b82d59caa47d51ce42c636a1d6"/></dir></target><target name="magelib"><dir name="Doghouse"><dir name="Australia"><dir name="Eparcel"><dir name="Parcel"><file name="Carton.php" hash="7ad715c0833e4deb43e16b3b3c4a2e82"/></dir><file name="Parcel.php" hash="de466fcd5db65c712b34eb8f2d7c9fd6"/><dir name="Record"><dir name="Article"><file name="CubicWeight.php" hash="6f640a55dcf100a18d2ed2d26403881a"/></dir><file name="Article.php" hash="908fc0bab8d53ea79c77f3004c0adb56"/><file name="Consignment.php" hash="39a510e8f02c1be08ca06c10e67cad01"/><file name="Good.php" hash="12b0f6cdb2ddd05c2337ebb5cd1bc00d"/></dir><file name="Record.php" hash="c6556fa6b6081695dfc2d13103421d5f"/></dir><file name="Eparcel.php" hash="c95976309f54461cf9ddf923cdcaa825"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="fontis"><dir name="australia"><dir name="css"><file name="postcode-autocomplete.css" hash="0022ba1e83d3ba1fedb960afb4ea6547"/></dir><dir name="images"><file name="bpay.png" hash="481c9ee07049203aca13d6d2c2948cf7"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/frontend/base/default/fontis/australia/css/postcode-autocomplete.css
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.fontis-postcode-autocomplete {
|
2 |
+
z-index: 999;
|
3 |
+
}
|
4 |
+
.fontis-postcode-autocomplete ul {
|
5 |
+
border: 1px solid #5c7989;
|
6 |
+
background-color: #f9f5f0;
|
7 |
+
}
|
8 |
+
.fontis-postcode-autocomplete li {
|
9 |
+
border-bottom: 1px solid #f4eee7;
|
10 |
+
margin-bottom: 5px;
|
11 |
+
padding: 2px 8px 1px 8px;
|
12 |
+
cursor: pointer;
|
13 |
+
}
|
14 |
+
.fontis-postcode-autocomplete li .amount {
|
15 |
+
float: right;
|
16 |
+
font-weight: bold;
|
17 |
+
}
|
18 |
+
.fontis-postcode-autocomplete li.odd {
|
19 |
+
background-color: #fffefb;
|
20 |
+
}
|
21 |
+
.fontis-postcode-autocomplete li.selected {
|
22 |
+
background-color:#f7e8dd;
|
23 |
+
}
|
skin/frontend/{default/default/images/fontis → base/default/fontis/australia/images}/bpay.png
RENAMED
File without changes
|