Fontis_Australia - Version 2.0

Version Notes

Currently active are modules for BPAY, direct deposit, Australia Post, the addition of regions and postcodes, and the addition of ABN and phone number to the general configuration values (although currently not in use).

Download this release

Release Info

Developer Magento Core Team
Extension Fontis_Australia
Version 2.0
Comparing to
See all releases


Code changes from version 1.2.6 to 2.0

Files changed (25) hide show
  1. app/code/community/Fontis/Australia/Block/Bpay/Info.php.~1~ +80 -0
  2. app/code/community/Fontis/Australia/Block/Myshopping.php +83 -0
  3. app/code/community/Fontis/Australia/Block/Shopbot.php +88 -0
  4. app/code/community/Fontis/Australia/Helper/Bpay.php +58 -0
  5. app/code/community/Fontis/Australia/Model/Getprice/Child.php +83 -0
  6. app/code/community/Fontis/Australia/Model/Getprice/Cron.php +190 -0
  7. app/code/community/Fontis/Australia/Model/Myshopping/Child.php +101 -0
  8. app/code/community/Fontis/Australia/Model/Myshopping/Cron.php +146 -0
  9. app/code/community/Fontis/Australia/Model/Payment/Bpay.php +47 -56
  10. app/code/community/Fontis/Australia/Model/Payment/Directdeposit.php +0 -3
  11. app/code/community/Fontis/Australia/Model/Shopbot/Child.php +107 -0
  12. app/code/community/Fontis/Australia/Model/Shopbot/Cron.php +144 -0
  13. app/code/community/Fontis/Australia/Model/Shopbot/Cron.php~ +290 -0
  14. app/code/community/Fontis/Australia/etc/config.xml +113 -24
  15. app/code/community/Fontis/Australia/etc/system.xml +194 -20
  16. app/design/adminhtml/default/default/template/fontis/australia/payment/bpay/info.phtml +6 -5
  17. app/design/adminhtml/default/default/template/fontis/australia/system/config/form/field/array_dropdown.phtml +180 -0
  18. app/design/frontend/default/default/layout/fontis_australia.xml +45 -0
  19. app/design/frontend/default/default/template/fontis/australia/payment/bpay/form.phtml +3 -78
  20. app/design/frontend/default/default/template/fontis/australia/payment/bpay/info.phtml +4 -7
  21. app/design/frontend/default/default/template/fontis/australia/payment/bpay/success.phtml +40 -0
  22. app/design/frontend/default/default/template/fontis/australia/payment/directdeposit/success.phtml +38 -0
  23. app/design/frontend/default/default/template/fontis/australia/postcode.phtml.~1~ +0 -128
  24. package.xml +4 -4
  25. skin/frontend/default/default/images/fontis/bpay.png +0 -0
app/code/community/Fontis/Australia/Block/Bpay/Info.php.~1~ ADDED
@@ -0,0 +1,80 @@
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
+ * 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) 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
+
22
+
23
+ class Fontis_Australia_Block_Bpay_Info extends Mage_Payment_Block_Info
24
+ {
25
+
26
+ protected $_billerCode;
27
+ protected $_ref;
28
+
29
+ protected function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->setTemplate('fontis/australia/payment/bpay/info.phtml');
33
+ }
34
+
35
+ /**
36
+ * Gets the bank account name as set by the admin.
37
+ *
38
+ * @return string
39
+ */
40
+ public function getBillerCode()
41
+ {
42
+ if (is_null($this->_billerCode)) {
43
+ $this->_convertAdditionalData();
44
+ }
45
+ return $this->_billerCode;
46
+ }
47
+
48
+ /**
49
+ * Gets the ref code for this customer.
50
+ *
51
+ * @return string
52
+ */
53
+ public function getRef()
54
+ {
55
+ Mage::log('Info: ' . print_r($this->getInfo(), true), null, 'bpay.log');
56
+ if (is_null($this->_ref)) {
57
+ $this->_convertAdditionalData();
58
+ }
59
+ return $this->_ref;
60
+ }
61
+
62
+ /**
63
+ * Gets any additional data saved by the BPAY payment module.
64
+ *
65
+ * @return Fontis_Australia_Block_Bpay_Info
66
+ */
67
+ protected function _convertAdditionalData()
68
+ {
69
+ $details = @unserialize($this->getInfo()->getAdditionalData());
70
+ if (is_array($details)) {
71
+ $this->_billerCode = isset($details['biller_code']) ? (string) $details['biller_code'] : '';
72
+ $this->_ref = isset($details['ref']) ? (string) $details['ref'] : '';
73
+ } else {
74
+ $this->_billerCode = '';
75
+ $this->_ref = '';
76
+ }
77
+ return $this;
78
+ }
79
+
80
+ }
app/code/community/Fontis/Australia/Block/Myshopping.php ADDED
@@ -0,0 +1,83 @@
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
+ * 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;
24
+
25
+ public function __construct()
26
+ {
27
+ $this->addColumn('magento', array(
28
+ 'label' => Mage::helper('adminhtml')->__('Magento product attribute'),
29
+ 'size' => 28,
30
+ ));
31
+ $this->addColumn('xmlfeed', array(
32
+ 'label' => Mage::helper('adminhtml')->__('Shopbot feed tag'),
33
+ 'size' => 28
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');
44
+
45
+ foreach($attributes as $att_code)
46
+ {
47
+ $attribute = $eav_config_model->getAttribute('catalog_product', $att_code);
48
+ Mage::log($attribute);
49
+
50
+ if ($att_code != ''
51
+ )
52
+ {
53
+ $this->magentoOptions[$att_code] = $att_code;
54
+ }
55
+ }
56
+ asort($this->magentoOptions);
57
+ }
58
+
59
+ protected function _renderCellTemplate($columnName)
60
+ {
61
+ if (empty($this->_columns[$columnName])) {
62
+ throw new Exception('Wrong column name specified.');
63
+ }
64
+ $column = $this->_columns[$columnName];
65
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
66
+
67
+ if($columnName == 'magento')
68
+ {
69
+ $rendered = '<select name="'.$inputName.'">';
70
+ foreach($this->magentoOptions as $att => $name)
71
+ {
72
+ $rendered .= '<option value="'.$att.'">'.$name.'</option>';
73
+ }
74
+ $rendered .= '</select>';
75
+ }
76
+ else
77
+ {
78
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}" ' . ($column['size'] ? 'size="' . $column['size'] . '"' : '') . '/>';
79
+ }
80
+
81
+ return $rendered;
82
+ }
83
+ }
app/code/community/Fontis/Australia/Block/Shopbot.php ADDED
@@ -0,0 +1,88 @@
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
+ * 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;
24
+
25
+ public function __construct()
26
+ {
27
+ $this->addColumn('magento', array(
28
+ 'label' => Mage::helper('adminhtml')->__('Magento product attribute'),
29
+ 'size' => 28,
30
+ ));
31
+ $this->addColumn('xmlfeed', array(
32
+ 'label' => Mage::helper('adminhtml')->__('Shopbot feed tag'),
33
+ 'size' => 28
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';
44
+ $this->magentoOptions['FONTIS-image-link'] = 'Product Image Link';
45
+
46
+ // product options
47
+ $eav_config_model = Mage::getModel('eav/config');
48
+ $attributes = $eav_config_model->getEntityAttributeCodes('catalog_product');
49
+
50
+ foreach($attributes as $att_code)
51
+ {
52
+ $attribute = $eav_config_model->getAttribute('catalog_product', $att_code);
53
+ Mage::log($attribute);
54
+
55
+ if ($att_code != ''
56
+ )
57
+ {
58
+ $this->magentoOptions[$att_code] = $att_code;
59
+ }
60
+ }
61
+ asort($this->magentoOptions);
62
+ }
63
+
64
+ protected function _renderCellTemplate($columnName)
65
+ {
66
+ if (empty($this->_columns[$columnName])) {
67
+ throw new Exception('Wrong column name specified.');
68
+ }
69
+ $column = $this->_columns[$columnName];
70
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
71
+
72
+ if($columnName == 'magento')
73
+ {
74
+ $rendered = '<select name="'.$inputName.'">';
75
+ foreach($this->magentoOptions as $att => $name)
76
+ {
77
+ $rendered .= '<option value="'.$att.'">'.$name.'</option>';
78
+ }
79
+ $rendered .= '</select>';
80
+ }
81
+ else
82
+ {
83
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}" ' . ($column['size'] ? 'size="' . $column['size'] . '"' : '') . '/>';
84
+ }
85
+
86
+ return $rendered;
87
+ }
88
+ }
app/code/community/Fontis/Australia/Helper/Bpay.php ADDED
@@ -0,0 +1,58 @@
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
+ * 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) 2009 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
+ /**
23
+ * BPAY-specific helper
24
+ */
25
+ class Fontis_Australia_Helper_Bpay extends Mage_Core_Helper_Abstract
26
+ {
27
+ public function bpayInfoBlock($billerCode, $customerReferenceNumber)
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/default/default/images/fontis/bpay.png' . '" height="82" width="51">
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;">
38
+ <b>Biller Code</b>: ' . $billerCode . '<br>
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 &amp; Internet Banking &mdash; BPAY&reg;</p>
46
+ <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, credit card or transaction account. More info: www.bpay.com.au</p>
47
+ </div>';
48
+ } else {
49
+ $output .= '<div>
50
+ <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 &amp; Internet Banking &mdash; BPAY&reg;</p>
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, credit card or transaction account. More info: www.bpay.com.au</p>
52
+ </div>';
53
+ }
54
+
55
+ $output .= '</div>';
56
+ return $output;
57
+ }
58
+ }
app/code/community/Fontis/Australia/Model/Getprice/Child.php ADDED
@@ -0,0 +1,83 @@
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
+ * 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
+
22
+ if (!isset($argv[1]) or !isset($argv[2]) or !isset($argv[3])) {
23
+ exit;
24
+ }
25
+ $mage_path = $argv[1];
26
+ $product_id = $argv[2];
27
+ $store_id = $argv[3];
28
+
29
+ // Start-up Magento stack
30
+ require_once $mage_path . '/app/Mage.php';
31
+ Mage::app($store_id);
32
+
33
+ // Load product, tax helper and generate final price information
34
+ $product = Mage::getModel('catalog/product')->load($product_id);
35
+ $tax = Mage::helper('tax');
36
+ $final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
37
+
38
+ // This array is translated into XML when fed back to the cron parent PHP.
39
+ $array = array();
40
+
41
+ $array['num'] = $product->getEntityId();
42
+ $array['attribute1'] = htmlspecialchars($product->getName());
43
+ $array['upc'] = $product->getSku();
44
+ $array['product_url'] = $product->getProductUrl();
45
+
46
+ if (Mage::getStoreConfig('fontis_feeds/getpricefeed/manufacturer')) {
47
+ $manufacturer_name = $product->getResource()->
48
+ getAttribute('manufacturer')->getFrontend()->getValue($product);
49
+
50
+ if ($manufacturer_name != 'No') {
51
+ $array['manufacturer'] = $manufacturer_name;
52
+ }
53
+ }
54
+
55
+ $category_found = false;
56
+ $array['category_name'] = '';
57
+ foreach($product->getCategoryCollection() as $c) {
58
+ $children = $c->getData('children_count');
59
+ if ($children <= 0) {
60
+ $category_node[0] = $c->getName();
61
+
62
+ $loaded_categories = Mage::getModel('catalog/category')
63
+ ->getCollection()
64
+ ->addIdFilter(array($c->getId()))
65
+ ->addAttributeToSelect(array('name'), 'inner')->load();
66
+
67
+ foreach($loaded_categories as $loaded_category) {
68
+ $array['category_name'] = $loaded_category->getName();
69
+ }
70
+ $category_found = true;
71
+ }
72
+ }
73
+ if (!$category_found) {
74
+ $array['category_name'] = Mage::getStoreConfig('fontis_feeds/getpricefeed/defaultcategory');
75
+ }
76
+
77
+ $array['description'] = $product->getDescription();
78
+ $array['image'] = (string)Mage::helper('catalog/image')->init($product, 'image');
79
+ $array['price'] = $final_price;
80
+ $array['currency'] = Mage::getStoreConfig('fontis_feeds/getpricefeed/currency');
81
+
82
+ // Serialize and print as a string for the cron parent PHP code to grab.
83
+ echo serialize($array);
app/code/community/Fontis/Australia/Model/Getprice/Cron.php ADDED
@@ -0,0 +1,190 @@
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
+ * 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
+
22
+ function addProductXmlCallback($args)
23
+ {
24
+ $product = $args['product'];
25
+ $product->setData($args['row']);
26
+ addProductXml($product);
27
+ }
28
+
29
+ function addProductXml($product)
30
+ {
31
+ $product_id = $product->getId();
32
+ $store_id = Fontis_Australia_Model_GetPrice_Cron::$store->getId();
33
+
34
+ $data = exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Getprice/Child.php " . Mage::getBaseDir() . " " . $product_id . " " . $store_id);
35
+ $array = unserialize($data);
36
+
37
+ $product_node = Fontis_Australia_Model_GetPrice_Cron::$root_node->addChild('product');
38
+
39
+ foreach($array as $key => $val) {
40
+ if ($key == "num") {
41
+ $product_node->addAttribute($key, $val);
42
+ } else {
43
+ $product_node->addChild($key, $val);
44
+ }
45
+ }
46
+ }
47
+
48
+ class Fontis_Australia_Model_GetPrice_Cron
49
+ {
50
+ public static $doc;
51
+ public static $root_node;
52
+ public static $store;
53
+
54
+ protected function _construct()
55
+ {
56
+ }
57
+
58
+ protected function getPath()
59
+ {
60
+ $path = "";
61
+ $config_path = Mage::getStoreConfig('fontis_feeds/getpricefeed/output');
62
+
63
+ if (substr($config_path, 0, 1) == "/") {
64
+ $path = $config_path . '/';
65
+ } else {
66
+ $path = Mage::getBaseDir() . '/' . $config_path . '/';
67
+ }
68
+
69
+ return str_replace('//', '/', $path);
70
+ }
71
+
72
+ public function nonstatic()
73
+ {
74
+ self::update();
75
+ }
76
+
77
+ public static function update()
78
+ {
79
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: entered update function');
80
+ session_start();
81
+
82
+ if (Mage::getStoreConfig('fontis_feeds/getpricefeed/active')) {
83
+ $io = new Varien_Io_File();
84
+ $io->setAllowCreateFolders(true);
85
+
86
+ $io->open(array('path' => self::getPath()));
87
+
88
+ foreach(Mage::app()->getStores() as $store) {
89
+ $clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
90
+
91
+ $categories_result = self::getCategoriesXml($store);
92
+ $products_result = self::getProductsXml($store);
93
+
94
+ // Write the leaf categories xml file:
95
+ $io->write($clean_store_name . '-categories.xml', $categories_result['xml']);
96
+
97
+ // Write the entire products xml file:
98
+ $io->write($clean_store_name . '-products.xml', $products_result['xml']);
99
+
100
+ // Write for each leaf category, their products xml file:
101
+ foreach($categories_result['link_ids'] as $link_id) {
102
+ $subcategory_products_result = self::getProductsXml($store, $link_id);
103
+ $io->write($clean_store_name . '-products-'.$link_id.'.xml', $subcategory_products_result['xml']);
104
+ }
105
+ }
106
+
107
+ $io->close();
108
+ }
109
+ }
110
+
111
+ public function getCategoriesXml($store)
112
+ {
113
+ $result = array();
114
+ $categories = Mage::getModel('catalog/category')->getCollection()
115
+ ->setStoreId($store->getId())
116
+ ->addAttributeToFilter('is_active', 1);
117
+
118
+ $categories->load()->getItems();
119
+
120
+ $full_categories = array();
121
+
122
+ foreach($categories as $category) {
123
+ $id = $category->getId();
124
+ $category = Mage::getModel('catalog/category')->load($id);
125
+
126
+ $children = $category->getAllChildren(true);
127
+ if (count($children) <= 1) {
128
+ $full_categories[] = $category;
129
+ }
130
+ }
131
+
132
+ $storeUrl = $store->getBaseUrl();
133
+ $shopName = $store->getName();
134
+ $date = date("d-m-Y", Mage::getModel('core/date')->timestamp(time()));
135
+ $time = date("h:i:s", Mage::getModel('core/date')->timestamp(time()));
136
+
137
+ $doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
138
+
139
+ foreach($full_categories as $category) {
140
+ $category_node = $doc->addChild('cat');
141
+
142
+ $title_node = $category_node->addChild('name');
143
+ $title_node[0] = $category->getName();
144
+
145
+ $link_node = $category_node->addChild('link');
146
+ $link_node[0] = Mage::getStoreConfig('web/unsecure/base_url') . 'products-' . $category->getId() . '.xml';
147
+
148
+ $result['link_ids'][] = $category->getId();
149
+ }
150
+
151
+ $result['xml'] = $doc->asXml();
152
+ return $result;
153
+ }
154
+
155
+ public function getProductsXml($store, $cat_id = -1)
156
+ {
157
+ Fontis_Australia_Model_GetPrice_Cron::$store = $store;
158
+ $result = array();
159
+
160
+ $product = Mage::getModel('catalog/product');
161
+ $products = $product->getCollection();
162
+ $products->setStoreId($store);
163
+ $products->addStoreFilter();
164
+ $products->addAttributeToSelect('*');
165
+ $products->addAttributeToSelect(array('name', 'price', 'image', 'status', 'manufacturer'), 'left');
166
+ $products->addAttributeToFilter('type_id', 'simple');
167
+
168
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
169
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
170
+
171
+ if ($cat_id != -1) {
172
+ $products->getSelect()->where("e.entity_id IN (
173
+ SELECT product_id FROM catalog_category_product WHERE category_id = ".$cat_id."
174
+ )");
175
+ }
176
+
177
+ $storeUrl = $store->getBaseUrl();
178
+ $shopName = $store->getName();
179
+ $date = date("d-m-Y", Mage::getModel('core/date')->timestamp(time()));
180
+ $time = date("h:i:s", Mage::getModel('core/date')->timestamp(time()));
181
+
182
+ self::$doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
183
+ self::$root_node = self::$doc->addChild('products');
184
+
185
+ Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallback'), array('product' => $product));
186
+
187
+ $result['xml'] = self::$doc->asXml();
188
+ return $result;
189
+ }
190
+ }
app/code/community/Fontis/Australia/Model/Myshopping/Child.php ADDED
@@ -0,0 +1,101 @@
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
+ * 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
+
22
+ if (!isset($argv[1]) or !isset($argv[2]) or !isset($argv[3])) {
23
+ exit;
24
+ }
25
+ $mage_path = $argv[1];
26
+ $product_id = $argv[2];
27
+ $store_id = $argv[3];
28
+
29
+ // Start-up Magento stack
30
+ require_once $mage_path . '/app/Mage.php';
31
+ Mage::app($store_id);
32
+
33
+ // Load product, tax helper and generate final price information
34
+ $product = Mage::getModel('catalog/product')->load($product_id);
35
+ $tax = Mage::helper('tax');
36
+ $final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
37
+
38
+ // This array is translated into XML when fed back to the cron parent PHP.
39
+ $array = array();
40
+
41
+ $array['Code'] = $product->getId();
42
+ $array['Name'] = htmlspecialchars($product->getName());
43
+ $array['Price'] = $final_price;
44
+ $array['Description'] = substr($product->getDescription(), 0, 255);
45
+ $array['Product_URL'] = $product->getProductUrl();
46
+ $array['Image_URL'] = (string)Mage::helper('catalog/image')->init($product, 'image');
47
+
48
+ $category_found = false;
49
+ $array['Category'] = "";
50
+ foreach($product->getCategoryCollection() as $c) {
51
+ $children = $c->getData('children_count');
52
+ if ($children <= 0) {
53
+ $array['Category'] = $c->getName();
54
+
55
+ $loaded_categories = Mage::getModel('catalog/category')
56
+ ->getCollection()
57
+ ->addIdFilter(array($c->getId()))
58
+ ->addAttributeToSelect(array('name'), 'inner')->load();
59
+
60
+ foreach($loaded_categories as $loaded_category) {
61
+ $array['Category'] = $loaded_category->getName();
62
+ }
63
+ $category_found = true;
64
+ }
65
+ }
66
+ if (!$category_found) {
67
+ $array['Category'] = Mage::getStoreConfig('fontis_feeds/myshoppingfeed/defaultcategory');
68
+ }
69
+
70
+ if ($product->isSaleable()) {
71
+ $array['InStock'] = 'Y';
72
+ } else {
73
+ $array['InStock'] = 'N';
74
+ }
75
+
76
+ $manufacturer_name = $product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($product);
77
+
78
+ if ($manufacturer_name == 'No') {
79
+ $array['Brand'] = 'Generic';
80
+ } else {
81
+ $array['Brand'] = $manufacturer_name;
82
+ }
83
+
84
+ $linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/myshoppingfeed/m_to_xml_attributes', $store_id));
85
+ if(!empty($linkedAttributes))
86
+ {
87
+ foreach($linkedAttributes as $la)
88
+ {
89
+ $magentoAtt = $la['magento'];
90
+ $xmlAtt = $la['xmlfeed'];
91
+
92
+ $value = $product->getResource()->getAttribute($magentoAtt)->getFrontend()->getValue($product);
93
+
94
+ if ($value != "") {
95
+ $array[$xmlAtt] = htmlspecialchars($value);
96
+ }
97
+ }
98
+ }
99
+
100
+ // Serialize and print as a string for the cron parent PHP code to grab.
101
+ echo serialize($array);
app/code/community/Fontis/Australia/Model/Myshopping/Cron.php ADDED
@@ -0,0 +1,146 @@
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
+ * 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) 2009 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
+ function addProductXmlCallback($args)
23
+ {
24
+ $product = $args['product'];
25
+ $product->setData($args['row']);
26
+ addProductXml($product);
27
+ }
28
+
29
+ function addProductXml($product)
30
+ {
31
+ $product_id = $product->getId();
32
+ $store_id = Fontis_Australia_Model_MyShopping_Cron::$store->getId();
33
+
34
+ $data = exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Myshopping/Child.php " . Mage::getBaseDir() . " " . $product_id . " " . $store_id);
35
+ $array = unserialize($data);
36
+
37
+ $product_node = Fontis_Australia_Model_Myshopping_Cron::$root_node->addChild('product');
38
+
39
+ Mage::log(var_export($array, true));
40
+
41
+ foreach($array as $key => $val) {
42
+ $product_node->addChild($key, $val);
43
+ }
44
+ }
45
+
46
+ class Fontis_Australia_Model_MyShopping_Cron
47
+ {
48
+ public static $doc;
49
+ public static $root_node;
50
+ public static $store;
51
+
52
+ protected function _construct()
53
+ {
54
+ }
55
+
56
+ protected function getPath()
57
+ {
58
+ $path = "";
59
+ $config_path = Mage::getStoreConfig('fontis_feeds/myshoppingfeed/output');
60
+
61
+ if (substr($config_path, 0, 1) == "/") {
62
+ $path = $config_path . '/';
63
+ } else {
64
+ $path = Mage::getBaseDir() . '/' . $config_path . '/';
65
+ }
66
+
67
+ return str_replace('//', '/', $path);
68
+ }
69
+
70
+ public static function update()
71
+ {
72
+ session_start();
73
+
74
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: entered update function');
75
+ if (Mage::getStoreConfig('fontis_feeds/myshoppingfeed/active')) {
76
+ $io = new Varien_Io_File();
77
+ $io->setAllowCreateFolders(true);
78
+
79
+ $io->open(array('path' => self::getPath()));
80
+
81
+ foreach(Mage::app()->getStores() as $store) {
82
+ Mage::log('for each store');
83
+ $clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
84
+ $products_result = self::getProductsXml($store);
85
+
86
+ // Write the entire products xml file:
87
+ $io->write($clean_store_name . '-products.xml', $products_result['xml']);
88
+ Mage::log('successful write?');
89
+ }
90
+
91
+ $io->close();
92
+ }
93
+ }
94
+
95
+ public function nonstatic()
96
+ {
97
+ self::update();
98
+ }
99
+
100
+ public function getProductsXml($store)
101
+ {
102
+ Mage::log('new getproductsxml');
103
+ Fontis_Australia_Model_MyShopping_Cron::$store = $store;
104
+
105
+ $result = array();
106
+
107
+ $product = Mage::getModel('catalog/product');
108
+ $products = $product->getCollection();
109
+ $products->setStoreId($store);
110
+ $products->addStoreFilter();
111
+ $products->addAttributeToSelect('*');
112
+
113
+ $attributes_select_array = array('name', 'price', 'image', 'status');
114
+ $linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/myshoppingfeed/m_to_xml_attributes', $store->getId()));
115
+ if(!empty($linkedAttributes))
116
+ {
117
+ foreach($linkedAttributes as $la)
118
+ {
119
+ if (strpos($la['magento'], 'FONTIS') === false) {
120
+ $attributes_select_array[] = $la['magento'];
121
+ }
122
+ }
123
+ }
124
+
125
+ $products->addAttributeToSelect($attributes_select_array, 'left');
126
+ $products->addAttributeToFilter('type_id', 'simple');
127
+
128
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
129
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
130
+
131
+ $storeUrl = $store->getBaseUrl();
132
+ $shopName = $store->getName();
133
+ $date = date("d-m-Y", Mage::getModel('core/date')->timestamp(time()));
134
+ $time = date("h:i:s", Mage::getModel('core/date')->timestamp(time()));
135
+
136
+ self::$doc = new SimpleXMLElement('<productset></productset>');
137
+ self::$root_node = self::$doc;
138
+
139
+ Mage::log('about to walk');
140
+ Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallback'), array('product' => $product));
141
+ Mage::log('walked');
142
+
143
+ $result['xml'] = self::$doc->asXml();
144
+ return $result;
145
+ }
146
+ }
app/code/community/Fontis/Australia/Model/Payment/Bpay.php CHANGED
@@ -33,9 +33,6 @@ class Fontis_Australia_Model_Payment_Bpay extends Mage_Payment_Model_Method_Abst
33
34
protected $_ref = null;
35
36
- // Set to allow the admin to set whether or not payment has been received.
37
- protected $_canCapture = true;
38
-
39
public function isAvailable($quote = null)
40
{
41
$groupAccess = $this->getConfigData('customer_group_access');
@@ -105,66 +102,60 @@ class Fontis_Australia_Model_Payment_Bpay extends Mage_Payment_Model_Method_Abst
105
106
public function getRef()
107
{
108
- if($this->_ref)
109
- {
110
return $this->_ref;
111
- }
112
- else
113
- {
114
// Check whether we will be calculating the reference code based on
115
// the customer ID or the order ID.
116
- if($this->getConfigData('calculate_using_customerid'))
117
- {
118
- $customer_id = Mage::getSingleton('customer/session')->getCustomerId();
119
-
120
- if($customer_id)
121
- {
122
- $this->_ref = $this->calculateRef($customer_id);
123
- return $this->_ref;
124
- }
125
- else
126
- {
127
- return null;
128
}
129
- }
130
- else
131
- {
132
$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
133
- $this->_ref = 0123456789;
134
- return $this->_ref;
135
- }
136
-
137
- }
138
}
139
140
- public function calculateRef($number)
141
{
142
- $revstr = strrev(intval($number));
143
- $total = 0;
144
- for ($i = 0;$i < strlen($revstr); $i++)
145
- {
146
- if ($i%2 == 0)
147
- {
148
- $multiplier = 2;
149
- }
150
- else
151
- {
152
- $multiplier = 1;
153
- }
154
-
155
- $sub_total = intval($revstr[$i]) * $multiplier;
156
-
157
- if ($sub_total >= 10)
158
- {
159
- $temp = (string) $sub_total;
160
- $sub_total = intval($temp[0]) + intval($temp[1]);
161
- }
162
-
163
- $total += $sub_total;
164
- }
165
-
166
- $check_digit = (10 - ($total % 10))%10;
167
- $crn = str_pad($number,6-1,0,STR_PAD_LEFT) . $check_digit ;
168
- return $crn;
169
}
170
}
33
34
protected $_ref = null;
35
36
public function isAvailable($quote = null)
37
{
38
$groupAccess = $this->getConfigData('customer_group_access');
102
103
public function getRef()
104
{
105
+ if($this->_ref) {
106
return $this->_ref;
107
+ } else {
108
// Check whether we will be calculating the reference code based on
109
// the customer ID or the order ID.
110
+ if($this->getConfigData('calculate_using_customerid')) {
111
+ $customer_id = Mage::getSingleton('customer/session')->getCustomerId();
112
+ if($customer_id) {
113
+ $customer = Mage::getModel('customer/customer')->load($customer_id);
114
+ $this->_ref = $this->_calculateRef($customer->getIncrementId());
115
+ } else {
116
+ $customer_id = Mage::getSingleton('checkout/session')->getQuote()->getCustomerId();
117
+ if($customer_id) {
118
+ $customer = Mage::getModel('customer/customer')->load($customer_id);
119
+ $this->_ref = $this->_calculateRef($customer->getIncrementId());
120
+ } else {
121
+ return null;
122
+ }
123
}
124
+ } else {
125
$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
126
+ $this->_ref = $this->_calculateRef($order_id);
127
+ }
128
+ //$this->assignData();
129
+ }
130
+ return $this->_ref;
131
}
132
133
+ public function getMessage()
134
{
135
+ return $this->getConfigData('message');
136
}
137
+
138
+ protected function _calculateRef($ref, $seperator = '', $crn_length = 6)
139
+ {
140
+ $revstr = strrev(intval($ref));
141
+ $total = 0;
142
+ for ($i = 0;$i < strlen($revstr); $i++) {
143
+
144
+ if ($i%2 == 0) {
145
+ $multiplier = 2;
146
+ }
147
+ else $multiplier = 1;
148
+
149
+ $sub_total = intval($revstr[$i]) * $multiplier;
150
+ if ($sub_total >= 10) {
151
+ $temp = (string) $sub_total;
152
+ $sub_total = intval($temp[0]) + intval($temp[1]);
153
+ }
154
+ $total += $sub_total;
155
+ }
156
+
157
+ $check_digit = (10 - ($total % 10))%10;
158
+ $crn = str_pad(ltrim($ref, "0"),$crn_length-1,0,STR_PAD_LEFT) .$seperator. $check_digit;
159
+ return $crn;
160
+ }
161
}
app/code/community/Fontis/Australia/Model/Payment/Directdeposit.php CHANGED
@@ -33,9 +33,6 @@ class Fontis_Australia_Model_Payment_Directdeposit extends Mage_Payment_Model_Me
33
protected $_code = 'directdeposit_au';
34
protected $_formBlockType = 'fontis_australia_block_directdeposit_form';
35
protected $_infoBlockType = 'fontis_australia_block_directdeposit_info';
36
-
37
- // Set to allow the admin to set whether or not payment has been received.
38
- protected $_canCapture = true;
39
40
public function isAvailable($quote = null)
41
{
33
protected $_code = 'directdeposit_au';
34
protected $_formBlockType = 'fontis_australia_block_directdeposit_form';
35
protected $_infoBlockType = 'fontis_australia_block_directdeposit_info';
36
37
public function isAvailable($quote = null)
38
{
app/code/community/Fontis/Australia/Model/Shopbot/Child.php ADDED
@@ -0,0 +1,107 @@
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
+ * 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
+
22
+ if (!isset($argv[1]) or !isset($argv[2]) or !isset($argv[3])) {
23
+ exit;
24
+ }
25
+ $mage_path = $argv[1];
26
+ $product_id = $argv[2];
27
+ $store_id = $argv[3];
28
+
29
+ // Start-up Magento stack
30
+ require_once $mage_path . '/app/Mage.php';
31
+ Mage::app($store_id);
32
+
33
+ // Load product, tax helper and generate final price information
34
+ $product = Mage::getModel('catalog/product')->load($product_id);
35
+ $tax = Mage::helper('tax');
36
+ $final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
37
+
38
+ // This array is translated into XML when fed back to the cron parent PHP.
39
+ $array = array();
40
+
41
+ $array['name'] = htmlspecialchars($product->getName());
42
+ $array['price'] = $final_price;
43
+ $array['link'] = $product->getProductUrl();
44
+
45
+ if ($product->isSaleable()) {
46
+ $array['availability'] = 'yes';
47
+ } else {
48
+ $array['availability'] = 'no';
49
+ }
50
+
51
+ $linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store_id));
52
+ if(!empty($linkedAttributes))
53
+ {
54
+ foreach($linkedAttributes as $la)
55
+ {
56
+ $magentoAtt = $la['magento'];
57
+ $xmlAtt = $la['xmlfeed'];
58
+
59
+ if ($magentoAtt == "manufacturer") {
60
+ $manufacturer_name = $product->getResource()->
61
+ getAttribute('manufacturer')->getFrontend()->getValue($product);
62
+
63
+ if ($manufacturer_name != 'No') {
64
+ $array['manufacturer'] = $manufacturer_name;
65
+ }
66
+
67
+ } elseif ($magentoAtt == "FONTIS-image-link") {
68
+ $array[$xmlAtt] = (string)Mage::helper('catalog/image')->init($product, 'image');
69
+
70
+ } elseif ($magentoAtt == "FONTIS-product-id") {
71
+ $array[$xmlAtt] = $product->getId();
72
+
73
+ } elseif ($magentoAtt == "FONTIS-category") {
74
+ $category_found = false;
75
+ $array['category_name'] = "";
76
+ foreach($product->getCategoryCollection() as $c) {
77
+ $children = $c->getData('children_count');
78
+ if ($children <= 0) {
79
+ $array['category_name'] = $c->getName();
80
+
81
+ $loaded_categories = Mage::getModel('catalog/category')
82
+ ->getCollection()
83
+ ->addIdFilter(array($c->getId()))
84
+ ->addAttributeToSelect(array('name'), 'inner')->load();
85
+
86
+ foreach($loaded_categories as $loaded_category) {
87
+ $array['category_name'] = $loaded_category->getName();
88
+ }
89
+ $category_found = true;
90
+ }
91
+ }
92
+ if (!$category_found) {
93
+ $array['category_name'] = Mage::getStoreConfig('fontis_feeds/shopbotfeed/defaultcategory');
94
+ }
95
+
96
+ } else {
97
+ $value = $product->getResource()->getAttribute($magentoAtt)->getFrontend()->getValue($product);
98
+
99
+ if ($value != "") {
100
+ $array[$xmlAtt] = htmlspecialchars($value);
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ // Serialize and print as a string for the cron parent PHP code to grab.
107
+ echo serialize($array);
app/code/community/Fontis/Australia/Model/Shopbot/Cron.php ADDED
@@ -0,0 +1,144 @@
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
+ * 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) 2009 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
+ function addProductXmlCallback($args)
23
+ {
24
+ $product = $args['product'];
25
+ $product->setData($args['row']);
26
+ addProductXml($product);
27
+ }
28
+
29
+ function addProductXml($product)
30
+ {
31
+ $product_id = $product->getId();
32
+ $store_id = Fontis_Australia_Model_ShopBot_Cron::$store->getId();
33
+
34
+ $data = exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Shopbot/Child.php " . Mage::getBaseDir() . " " . $product_id . " " . $store_id);
35
+ $array = unserialize($data);
36
+
37
+ $product_node = Fontis_Australia_Model_Shopbot_Cron::$root_node->addChild('product');
38
+
39
+ foreach($array as $key => $val) {
40
+ $product_node->addChild($key, $val);
41
+ }
42
+ }
43
+
44
+ class Fontis_Australia_Model_ShopBot_Cron
45
+ {
46
+ public static $doc;
47
+ public static $root_node;
48
+ public static $store;
49
+
50
+ protected function _construct()
51
+ {
52
+ }
53
+
54
+ protected function getPath()
55
+ {
56
+ $path = "";
57
+ $config_path = Mage::getStoreConfig('fontis_feeds/shopbotfeed/output');
58
+
59
+ if (substr($config_path, 0, 1) == "/") {
60
+ $path = $config_path . '/';
61
+ } else {
62
+ $path = Mage::getBaseDir() . '/' . $config_path . '/';
63
+ }
64
+
65
+ return str_replace('//', '/', $path);
66
+ }
67
+
68
+ public static function update()
69
+ {
70
+ session_start();
71
+
72
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: entered update function');
73
+ if (Mage::getStoreConfig('fontis_feeds/shopbotfeed/active')) {
74
+ $io = new Varien_Io_File();
75
+ $io->setAllowCreateFolders(true);
76
+
77
+ $io->open(array('path' => self::getPath()));
78
+
79
+ foreach(Mage::app()->getStores() as $store) {
80
+ Mage::log('for each store');
81
+ $clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
82
+ $products_result = self::getProductsXml($store);
83
+
84
+ // Write the entire products xml file:
85
+ $io->write($clean_store_name . '-products.xml', $products_result['xml']);
86
+ }
87
+
88
+ $io->close();
89
+ }
90
+ }
91
+
92
+ public function nonstatic()
93
+ {
94
+ self::update();
95
+ }
96
+
97
+ public function getProductsXml($store)
98
+ {
99
+ Mage::log('new getproductsxml');
100
+ Fontis_Australia_Model_ShopBot_Cron::$store = $store;
101
+
102
+ $result = array();
103
+
104
+ $product = Mage::getModel('catalog/product');
105
+ $products = $product->getCollection();
106
+ $products->setStoreId($store);
107
+ $products->addStoreFilter();
108
+ $products->addAttributeToSelect('*');
109
+
110
+ $attributes_select_array = array('name', 'price', 'image', 'status');
111
+ $linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store->getId()));
112
+ if(!empty($linkedAttributes))
113
+ {
114
+ foreach($linkedAttributes as $la)
115
+ {
116
+ if (strpos($la['magento'], 'FONTIS') === false) {
117
+ $attributes_select_array[] = $la['magento'];
118
+ }
119
+ }
120
+ }
121
+ Mage::log(var_export($attributes_select_array, true));
122
+
123
+ $products->addAttributeToSelect($attributes_select_array, 'left');
124
+ $products->addAttributeToFilter('type_id', 'simple');
125
+
126
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
127
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
128
+
129
+ $storeUrl = $store->getBaseUrl();
130
+ $shopName = $store->getName();
131
+ $date = date("d-m-Y", Mage::getModel('core/date')->timestamp(time()));
132
+ $time = date("h:i:s", Mage::getModel('core/date')->timestamp(time()));
133
+
134
+ self::$doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
135
+ self::$root_node = self::$doc->addChild('products');
136
+
137
+ Mage::log('about to walk');
138
+ Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallback'), array('product' => $product));
139
+ Mage::log('walked');
140
+
141
+ $result['xml'] = self::$doc->asXml();
142
+ return $result;
143
+ }
144
+ }
app/code/community/Fontis/Australia/Model/Shopbot/Cron.php~ ADDED
@@ -0,0 +1,290 @@
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
+ * 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) 2009 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
+ function addProductXmlCallback($args)
23
+ {
24
+ $product = $args['product'];
25
+ $product->setData($args['row']);
26
+ addProductXml($product);
27
+ }
28
+
29
+ function addProductXml($product)
30
+ {
31
+ $store = Fontis_Australia_Model_ShopBot_Cron::$store;
32
+
33
+ Mage::log('walking');
34
+
35
+ $product_node = Fontis_Australia_Model_ShopBot_Cron::$root_node
36
+ ->addChild('product');
37
+
38
+ $name_node = $product_node->addChild('name', $product->getName());
39
+
40
+ $price_node = $product_node->addChild('price', $product->getPrice());
41
+
42
+ $link_node = $product_node->addChild('link', $product->getProductUrl());
43
+
44
+ $availability_node = $product_node->addChild('availability');
45
+ if ($product->isSaleable()) {
46
+ $availability_node[0] = 'yes';
47
+ } else {
48
+ $availability_node[0] = 'no';
49
+ }
50
+
51
+ Mage::log('serialized area');
52
+ $linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store->getId()));
53
+ if(!empty($linkedAttributes))
54
+ {
55
+ foreach($linkedAttributes as $la)
56
+ {
57
+ $magentoAtt = $la['magento'];
58
+ $xmlAtt = $la['xmlfeed'];
59
+
60
+ if ($magentoAtt == "FONTIS-image-link") {
61
+ $image_node = $product_node->addChild($xmlAtt);
62
+ $image_node[0] = (string)Mage::helper('catalog/image')->init($product, 'image');
63
+
64
+ } elseif ($magentoAtt == "FONTIS-product-id") {
65
+ $id_node = $product_node->addChild($xmlAtt);
66
+ $id_node[0] = $product->getId();
67
+
68
+ } elseif ($magentoAtt == "FONTIS-category") {
69
+ $category_found = false;
70
+ $category_node = $product_node->addChild('category_name');
71
+ foreach($product->getCategoryCollection() as $c) {
72
+ $children = $c->getData('children_count');
73
+ if ($children <= 0) {
74
+ $category_node[0] = $c->getName();
75
+
76
+ $loaded_categories = Mage::getModel('catalog/category')
77
+ ->getCollection()
78
+ ->addIdFilter(array($c->getId()))
79
+ ->addAttributeToSelect(array('name'), 'inner')->load();
80
+
81
+ foreach($loaded_categories as $loaded_category) {
82
+ $category_node[0] = $loaded_category->getName();
83
+ }
84
+ $category_found = true;
85
+ }
86
+ }
87
+ if (!$category_found) {
88
+ $category_node[0] = Mage::getStoreConfig('fontis_feeds/shopbotfeed/defaultcategory');
89
+ }
90
+
91
+ } else {
92
+ $value = $product->getResource()->getAttribute($magentoAtt)->getFrontend()->getValue($product);
93
+
94
+ if ($value != "") {
95
+ $extra_node = $product_node->addChild($xmlAtt);
96
+ $extra_node[0] = $value;
97
+ }
98
+ }
99
+ }
100
+ }
101
+ Mage::log('end of serialized area');
102
+ }
103
+
104
+ class Fontis_Australia_Model_ShopBot_Cron
105
+ {
106
+ public static $doc;
107
+ public static $root_node;
108
+ public static $store;
109
+
110
+ protected function _construct()
111
+ {
112
+ session_start();
113
+ }
114
+
115
+ protected function getPath()
116
+ {
117
+ $path = "";
118
+ $config_path = Mage::getStoreConfig('fontis_feeds/shopbotfeed/output');
119
+
120
+ if (substr($config_path, 0, 1) == "/") {
121
+ $path = $config_path . '/';
122
+ } else {
123
+ $path = Mage::getBaseDir() . '/' . $config_path . '/';
124
+ }
125
+
126
+ return str_replace('//', '/', $path);
127
+ }
128
+
129
+ public static function update()
130
+ {
131
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: entered update function');
132
+ if (Mage::getStoreConfig('fontis_feeds/shopbotfeed/active')) {
133
+ $io = new Varien_Io_File();
134
+ $io->setAllowCreateFolders(true);
135
+
136
+ $io->open(array('path' => self::getPath()));
137
+
138
+ foreach(Mage::app()->getStores() as $store) {
139
+ Mage::log('for each store');
140
+ $clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
141
+ $products_result = self::getProductsXml($store);
142
+
143
+ // Write the entire products xml file:
144
+ $io->write($clean_store_name . '-products.xml', $products_result['xml']);
145
+ }
146
+
147
+ $io->close();
148
+ }
149
+ }
150
+
151
+ public function nonstatic()
152
+ {
153
+ self::update();
154
+ }
155
+
156
+ public function getProductsXml($store)
157
+ {
158
+ Mage::log('new getproductsxml');
159
+ Fontis_Australia_Model_ShopBot_Cron::$store = $store;
160
+
161
+ $result = array();
162
+
163
+ $product = Mage::getModel('catalog/product');
164
+ $products = $product->getCollection();
165
+ $products->setStoreId($store);
166
+ $products->addStoreFilter();
167
+ $products->addAttributeToSelect('*');
168
+
169
+ $attributes_select_array = array('name', 'price', 'image', 'status');
170
+ $linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store->getId()));
171
+ if(!empty($linkedAttributes))
172
+ {
173
+ foreach($linkedAttributes as $la)
174
+ {
175
+ if (strpos($la['magento'], 'FONTIS') === false) {
176
+ $attributes_select_array[] = $la['magento'];
177
+ }
178
+ }
179
+ }
180
+ Mage::log(var_export($attributes_select_array, true));
181
+
182
+ $products->addAttributeToSelect($attributes_select_array, 'left');
183
+
184
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
185
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
186
+
187
+ $storeUrl = $store->getBaseUrl();
188
+ $shopName = $store->getName();
189
+ $date = date("d-m-Y", Mage::getModel('core/date')->timestamp(time()));
190
+ $time = date("h:i:s", Mage::getModel('core/date')->timestamp(time()));
191
+
192
+ self::$doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
193
+ self::$root_node = self::$doc->addChild('products');
194
+
195
+ Mage::log('about to walk');
196
+ Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallback'), array('product' => $product));
197
+ Mage::log('walked');
198
+
199
+ $result['xml'] = self::$doc->asXml();
200
+ return $result;
201
+ }
202
+
203
+ public function getProductsXmlOLD($store)
204
+ {
205
+ $result = array();
206
+
207
+ $products = Mage::getModel('catalog/product')->getCollection()
208
+ ->setStoreId($store->getId())
209
+ ->addAttributeToSelect('*')->addAttributeToFilter('status', 1);
210
+
211
+ $products->load()->getItems();
212
+
213
+ $storeUrl = $store->getBaseUrl();
214
+ $shopName = $store->getName();
215
+ $date = date("d-m-Y", Mage::getModel('core/date')->timestamp(time()));
216
+ $time = date("h:i:s", Mage::getModel('core/date')->timestamp(time()));
217
+
218
+ $doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
219
+ $root_node = $doc->addChild('products');
220
+
221
+ foreach($products as $product) {
222
+ $product_node = $root_node->addChild('product');
223
+
224
+ $name_node = $product_node->addChild('name');
225
+ $name_node[0] = $product->getName();
226
+
227
+ $price_node = $product_node->addChild('price');
228
+ $price_node[0] = $product->getPrice();
229
+
230
+ $link_node = $product_node->addChild('link');
231
+ $link_node[0] = $product->getProductUrl();
232
+
233
+ $availability_node = $product_node->addChild('availability');
234
+ if ($product->isSaleable()) {
235
+ $availability_node[0] = 'yes';
236
+ } else {
237
+ $availability_node[0] = 'no';
238
+ }
239
+
240
+ $linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store->getId()));
241
+ if(!empty($linkedAttributes))
242
+ {
243
+ foreach($linkedAttributes as $la)
244
+ {
245
+ $magentoAtt = $la['magento'];
246
+ $xmlAtt = $la['xmlfeed'];
247
+
248
+ if ($magentoAtt == "FONTIS-image-link") {
249
+ $image_node = $product_node->addChild($xmlAtt);
250
+ $image_node[0] = (string)Mage::helper('catalog/image')->init($product, 'image');
251
+
252
+ } elseif ($magentoAtt == "FONTIS-product-id") {
253
+ $id_node = $product_node->addChild($xmlAtt);
254
+ $id_node[0] = $product->getId();
255
+
256
+ } elseif ($magentoAtt == "FONTIS-category") {
257
+ $category_found = false;
258
+ $category_node = $product_node->addChild($xmlAtt);
259
+
260
+ foreach($product->getCategoryCollection() as $c) {
261
+ $cat = Mage::getModel('catalog/category')->load($c->getId());
262
+
263
+ $children = $cat->getAllChildren(true);
264
+
265
+ if (count($children) <= 1) {
266
+ $category_node[0] = $cat->getName();
267
+ $category_found = true;
268
+ }
269
+ }
270
+
271
+ if (!$category_found) {
272
+ $category_node[0] = Mage::getStoreConfig('fontis_feeds/shopbotfeed/defaultcategory');
273
+ }
274
+
275
+ } else {
276
+ $value = $product->getResource()->getAttribute($magentoAtt)->getFrontend()->getValue($product);
277
+
278
+ if ($value != "") {
279
+ $extra_node = $product_node->addChild($xmlAtt);
280
+ $extra_node[0] = $value;
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+
287
+ $result['xml'] = $doc->asXml();
288
+ return $result;
289
+ }
290
+ }
app/code/community/Fontis/Australia/etc/config.xml CHANGED
@@ -23,7 +23,7 @@
23
<config>
24
<modules>
25
<Fontis_Australia>
26
- <version>1.2.6</version>
27
<depends>
28
<Mage_Shipping />
29
<Mage_Payment />
@@ -32,6 +32,34 @@
32
</depends>
33
</Fontis_Australia>
34
</modules>
35
<global>
36
<models>
37
<australia>
@@ -92,6 +120,20 @@
92
</gst>
93
</methods>
94
</tax>
95
</sales>
96
<events>
97
<sales_order_shipment_save_after>
@@ -159,29 +201,76 @@
159
</carriers>
160
161
<payment>
162
- <bpay>
163
- <active>0</active>
164
- <model>australia/payment_bpay</model>
165
- <order_status>pending</order_status>
166
- <customer_group_access>0</customer_group_access>
167
- <customer_group>0</customer_group>
168
- <title>BPAY</title>
169
- <allowspecific>0</allowspecific>
170
- <calculate_using_customerid>0</calculate_using_customerid>
171
- </bpay>
172
- <directdeposit_au>
173
- <active>0</active>
174
- <model>australia/payment_directdeposit</model>
175
- <order_status>pending</order_status>
176
- <customer_group_access>0</customer_group_access>
177
- <customer_group>0</customer_group>
178
- <title>Direct Deposit</title>
179
- <account_name></account_name>
180
- <account_bsb>000000</account_bsb>
181
- <account_number>00000000</account_number>
182
- <allowspecific>0</allowspecific>
183
- <message>Please quote order number (displayed after checkout confirmation) when making your deposit. Order will be processed once payment has been received.</message>
184
- </directdeposit_au>
185
</payment>
186
</default>
187
</config>
23
<config>
24
<modules>
25
<Fontis_Australia>
26
+ <version>2.0</version>
27
<depends>
28
<Mage_Shipping />
29
<Mage_Payment />
32
</depends>
33
</Fontis_Australia>
34
</modules>
35
+ <crontab>
36
+ <jobs>
37
+ <Fontis_Australia_Myshopping>
38
+ <schedule>
39
+ <cron_expr>0 0 * * *</cron_expr>
40
+ </schedule>
41
+ <run>
42
+ <model>australia/myshopping_cron::update</model>
43
+ </run>
44
+ </Fontis_Australia_Myshopping>
45
+ <Fontis_Australia_Shopbot>
46
+ <schedule>
47
+ <cron_expr>0 0 * * *</cron_expr>
48
+ </schedule>
49
+ <run>
50
+ <model>australia/shopbot_cron::update</model>
51
+ </run>
52
+ </Fontis_Australia_Shopbot>
53
+ <Fontis_Australia_Getprice>
54
+ <schedule>
55
+ <cron_expr>0 0 * * *</cron_expr>
56
+ </schedule>
57
+ <run>
58
+ <model>australia/getprice_cron::update</model>
59
+ </run>
60
+ </Fontis_Australia_Getprice>
61
+ </jobs>
62
+ </crontab>
63
<global>
64
<models>
65
<australia>
120
</gst>
121
</methods>
122
</tax>
123
+ <order>
124
+ <statuses>
125
+ <pending_bpay translate="label"><label>Pending BPAY</label></pending_bpay>
126
+ <pending_deposit translate="label"><label>Pending Direct Deposit</label></pending_deposit>
127
+ </statuses>
128
+ <states>
129
+ <new>
130
+ <statuses>
131
+ <pending_bpay/>
132
+ <pending_deposit/>
133
+ </statuses>
134
+ </new>
135
+ </states>
136
+ </order>
137
</sales>
138
<events>
139
<sales_order_shipment_save_after>
201
</carriers>
202
203
<payment>
204
+ <bpay>
205
+ <active>0</active>
206
+ <model>australia/payment_bpay</model>
207
+ <order_status>pending</order_status>
208
+ <customer_group_access>0</customer_group_access>
209
+ <customer_group>0</customer_group>
210
+ <title>BPAY</title>
211
+ <allowspecific>0</allowspecific>
212
+ <calculate_using_customerid>0</calculate_using_customerid>
213
+ <accept_credit_cards>1</accept_credit_cards>
214
+ <message>Payment details will be displayed on order confirmation screen.</message>
215
+ </bpay>
216
+ <directdeposit_au>
217
+ <active>0</active>
218
+ <model>australia/payment_directdeposit</model>
219
+ <order_status>pending</order_status>
220
+ <customer_group_access>0</customer_group_access>
221
+ <customer_group>0</customer_group>
222
+ <title>Direct Deposit</title>
223
+ <account_name></account_name>
224
+ <account_bsb>000000</account_bsb>
225
+ <account_number>00000000</account_number>
226
+ <allowspecific>0</allowspecific>
227
+ <message>Please quote order number (displayed after checkout confirmation) when making your deposit. Order will be processed once payment has been received.</message>
228
+ </directdeposit_au>
229
</payment>
230
+
231
+ <fontis_feeds>
232
+ <getpricefeed>
233
+ <output>getprice-feeds</output>
234
+ <defaultcategory>Products</defaultcategory>
235
+ <currency>AUS</currency>
236
+ </getpricefeed>
237
+ <shopbotfeed>
238
+ <output>shopbot-feeds/</output>
239
+ <defaultcategory>Products</defaultcategory>
240
+ <m_to_xml_attributes>a:4:{s:18:"_1260239763475_475";a:2:{s:7:"magento";s:12:"manufacturer";s:7:"xmlfeed";s:5:"brand";}s:18:"_1260241020747_747";a:2:{s:7:"magento";s:11:"description";s:7:"xmlfeed";s:11:"description";}s:18:"_1260413375112_112";a:2:{s:7:"magento";s:15:"FONTIS-category";s:7:"xmlfeed";s:8:"category";}s:18:"_1260420319241_241";a:2:{s:7:"magento";s:17:"FONTIS-image-link";s:7:"xmlfeed";s:5:"image";}}</m_to_xml_attributes>
241
+ </shopbotfeed>
242
+ <myshopping>
243
+ <output>myshopping-feeds/</output>
244
+ <defaultcategory>Products</defaultcategory>
245
+ <m_to_xml_attributes>a:4:{s:18:"_1260239763475_475";a:2:{s:7:"magento";s:12:"manufacturer";s:7:"xmlfeed";s:5:"brand";}s:18:"_1260241020747_747";a:2:{s:7:"magento";s:11:"description";s:7:"xmlfeed";s:11:"description";}s:18:"_1260413375112_112";a:2:{s:7:"magento";s:15:"FONTIS-category";s:7:"xmlfeed";s:8:"category";}s:18:"_1260420319241_241";a:2:{s:7:"magento";s:17:"FONTIS-image-link";s:7:"xmlfeed";s:5:"image";}}</m_to_xml_attributes>
246
+ </myshopping>
247
+ </fontis_feeds>
248
</default>
249
+ <adminhtml>
250
+ <acl>
251
+ <resources>
252
+ <all>
253
+ <title>Allow Everything</title>
254
+ </all>
255
+ <admin>
256
+ <children>
257
+ <system>
258
+ <children>
259
+ <config>
260
+ <children>
261
+ <fontis_australia>
262
+ <title>Australia</title>
263
+ </fontis_australia>
264
+ <fontis_feeds>
265
+ <title>Feeds</title>
266
+ </fontis_feeds>
267
+ </children>
268
+ </config>
269
+ </children>
270
+ </system>
271
+ </children>
272
+ </admin>
273
+ </resources>
274
+ </acl>
275
+ </adminhtml>
276
</config>
app/code/community/Fontis/Australia/etc/system.xml CHANGED
@@ -21,6 +21,12 @@
21
*/
22
-->
23
<config>
24
<sections>
25
<carriers>
26
<groups>
@@ -448,15 +454,6 @@
448
<show_in_website>1</show_in_website>
449
<show_in_store>0</show_in_store>
450
</active>
451
- <order_status translate="label">
452
- <label>New order status</label>
453
- <frontend_type>select</frontend_type>
454
- <source_model>adminhtml/system_config_source_order_status</source_model>
455
- <sort_order>2</sort_order>
456
- <show_in_default>1</show_in_default>
457
- <show_in_website>1</show_in_website>
458
- <show_in_store>0</show_in_store>
459
- </order_status>
460
<customer_group_access translate="label">
461
<label>Customer Group Access</label>
462
<frontend_type>select</frontend_type>
@@ -506,7 +503,26 @@
506
<show_in_default>1</show_in_default>
507
<show_in_website>1</show_in_website>
508
<show_in_store>1</show_in_store>
509
</calculate_using_customerid>
510
<allowspecific translate="label">
511
<label>Payment from applicable countries</label>
512
<frontend_type>allowspecific</frontend_type>
@@ -562,15 +578,6 @@
562
<show_in_website>1</show_in_website>
563
<show_in_store>0</show_in_store>
564
</active>
565
- <order_status translate="label">
566
- <label>New order status</label>
567
- <frontend_type>select</frontend_type>
568
- <source_model>adminhtml/system_config_source_order_status</source_model>
569
- <sort_order>2</sort_order>
570
- <show_in_default>1</show_in_default>
571
- <show_in_website>1</show_in_website>
572
- <show_in_store>0</show_in_store>
573
- </order_status>
574
<customer_group_access translate="label">
575
<label>Customer Group Access</label>
576
<frontend_type>select</frontend_type>
@@ -674,7 +681,14 @@
674
</groups>
675
</payment>
676
677
- <general>
678
<groups>
679
<business translate="label">
680
<label>Business Details</label>
@@ -704,6 +718,166 @@
704
</fields>
705
</business>
706
</groups>
707
- </general>
708
</sections>
709
</config>
21
*/
22
-->
23
<config>
24
+ <tabs>
25
+ <fontis_extensions translate="label" module="australia">
26
+ <label>Fontis Extensions</label>
27
+ <sort_order>1000000</sort_order>
28
+ </fontis_extensions>
29
+ </tabs>
30
<sections>
31
<carriers>
32
<groups>
454
<show_in_website>1</show_in_website>
455
<show_in_store>0</show_in_store>
456
</active>
457
<customer_group_access translate="label">
458
<label>Customer Group Access</label>
459
<frontend_type>select</frontend_type>
503
<show_in_default>1</show_in_default>
504
<show_in_website>1</show_in_website>
505
<show_in_store>1</show_in_store>
506
+ <comment>Normally set to NO unless you use BPAY for recurring payments. Guest checkouts are NOT supported if this is set to YES.</comment>
507
</calculate_using_customerid>
508
+ <accept_credit_cards translate="label">
509
+ <label>Accepts Credit Cards</label>
510
+ <frontend_type>select</frontend_type>
511
+ <source_model>adminhtml/system_config_source_yesno</source_model>
512
+ <sort_order>63</sort_order>
513
+ <show_in_default>1</show_in_default>
514
+ <show_in_website>1</show_in_website>
515
+ <show_in_store>1</show_in_store>
516
+ <comment>Set to NO if you do not accept credit card payments through BPAY. This simply changes the text presented to the customer.</comment>
517
+ </accept_credit_cards>
518
+ <message translate="label">
519
+ <label>Message</label>
520
+ <sort_order>64</sort_order>
521
+ <show_in_default>1</show_in_default>
522
+ <show_in_website>1</show_in_website>
523
+ <show_in_store>1</show_in_store>
524
+ <comment>Displayed during checkout. Customise this to notify your customers that they will be presented with BPAY information after checkout.</comment>
525
+ </message>
526
<allowspecific translate="label">
527
<label>Payment from applicable countries</label>
528
<frontend_type>allowspecific</frontend_type>
578
<show_in_website>1</show_in_website>
579
<show_in_store>0</show_in_store>
580
</active>
581
<customer_group_access translate="label">
582
<label>Customer Group Access</label>
583
<frontend_type>select</frontend_type>
681
</groups>
682
</payment>
683
684
+ <fontis_australia>
685
+ <label>Australia</label>
686
+ <tab>fontis_extensions</tab>
687
+ <frontend_type>text</frontend_type>
688
+ <sort_order>999999</sort_order>
689
+ <show_in_default>1</show_in_default>
690
+ <show_in_website>1</show_in_website>
691
+ <show_in_store>1</show_in_store>
692
<groups>
693
<business translate="label">
694
<label>Business Details</label>
718
</fields>
719
</business>
720
</groups>
721
+ </fontis_australia>
722
+
723
+ <fontis_feeds>
724
+ <label>Feeds Generator</label>
725
+ <tab>fontis_extensions</tab>
726
+ <frontend_type>text</frontend_type>
727
+ <sort_order>999999</sort_order>
728
+ <show_in_default>1</show_in_default>
729
+ <show_in_website>1</show_in_website>
730
+ <show_in_store>1</show_in_store>
731
+ <groups>
732
+ <getpricefeed>
733
+ <label>GetPrice</label>
734
+ <frontend_type>text</frontend_type>
735
+ <sort_order>0</sort_order>
736
+ <show_in_default>1</show_in_default>
737
+ <show_in_website>1</show_in_website>
738
+ <show_in_store>1</show_in_store>
739
+ <fields>
740
+ <active translate="label">
741
+ <label>Enabled</label>
742
+ <frontend_type>select</frontend_type>
743
+ <source_model>adminhtml/system_config_source_yesno</source_model>
744
+ <sort_order>1</sort_order>
745
+ <show_in_default>1</show_in_default>
746
+ <show_in_website>1</show_in_website>
747
+ <show_in_store>0</show_in_store>
748
+ </active>
749
+ <output translate="label">
750
+ <label>Output Filename</label>
751
+ <frontend_type>text</frontend_type>
752
+ <sort_order>2</sort_order>
753
+ <show_in_default>1</show_in_default>
754
+ <show_in_website>1</show_in_website>
755
+ <show_in_store>1</show_in_store>
756
+ <comment>XML files will be generated into this path.</comment>
757
+ </output>
758
+ <defaultcategory translate="label">
759
+ <label>Default Category</label>
760
+ <frontend_type>text</frontend_type>
761
+ <sort_order>3</sort_order>
762
+ <show_in_default>1</show_in_default>
763
+ <show_in_website>1</show_in_website>
764
+ <show_in_store>1</show_in_store>
765
+ <comment>Products with no category assigned will be assigned this category label.</comment>
766
+ </defaultcategory>
767
+ <manufacturer translate="label">
768
+ <label>Show Manufacturer</label>
769
+ <frontend_type>select</frontend_type>
770
+ <source_model>adminhtml/system_config_source_yesno</source_model>
771
+ <sort_order>4</sort_order>
772
+ <show_in_default>1</show_in_default>
773
+ <show_in_website>1</show_in_website>
774
+ <show_in_store>0</show_in_store>
775
+ </manufacturer>
776
+ <currency translate="label">
777
+ <label>Currency</label>
778
+ <frontend_type>text</frontend_type>
779
+ <sort_order>5</sort_order>
780
+ <show_in_default>1</show_in_default>
781
+ <show_in_website>1</show_in_website>
782
+ <show_in_store>0</show_in_store>
783
+ </currency>
784
+ </fields>
785
+ </getpricefeed>
786
+ <shopbotfeed>
787
+ <label>ShopBot</label>
788
+ <frontend_type>text</frontend_type>
789
+ <sort_order>0</sort_order>
790
+ <show_in_default>1</show_in_default>
791
+ <show_in_website>1</show_in_website>
792
+ <show_in_store>1</show_in_store>
793
+ <fields>
794
+ <active translate="label">
795
+ <label>Enabled</label>
796
+ <frontend_type>select</frontend_type>
797
+ <source_model>adminhtml/system_config_source_yesno</source_model>
798
+ <sort_order>1</sort_order>
799
+ <show_in_default>1</show_in_default>
800
+ <show_in_website>1</show_in_website>
801
+ <show_in_store>0</show_in_store>
802
+ </active>
803
+ <output translate="label">
804
+ <label>Output Path</label>
805
+ <frontend_type>text</frontend_type>
806
+ <sort_order>2</sort_order>
807
+ <show_in_default>1</show_in_default>
808
+ <show_in_website>1</show_in_website>
809
+ <show_in_store>1</show_in_store>
810
+ <comment>XML files will be generated into this path.</comment>
811
+ </output>
812
+ <defaultcategory translate="label">
813
+ <label>Default Category</label>
814
+ <frontend_type>text</frontend_type>
815
+ <sort_order>3</sort_order>
816
+ <show_in_default>1</show_in_default>
817
+ <show_in_website>1</show_in_website>
818
+ <show_in_store>1</show_in_store>
819
+ <comment>Products with no category assigned will be assigned this category label.</comment>
820
+ </defaultcategory>
821
+ <m_to_xml_attributes translate="comment">
822
+ <label>Attributes to include in product feed</label>
823
+ <frontend_model>fontis_australia_block_shopbot</frontend_model>
824
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
825
+ <sort_order>25</sort_order>
826
+ <show_in_default>1</show_in_default>
827
+ <show_in_website>1</show_in_website>
828
+ <show_in_store>1</show_in_store>
829
+ <comment></comment>
830
+ </m_to_xml_attributes>
831
+ </fields>
832
+ </shopbotfeed>
833
+ <myshoppingfeed>
834
+ <label>MyShopping</label>
835
+ <frontend_type>text</frontend_type>
836
+ <sort_order>0</sort_order>
837
+ <show_in_default>1</show_in_default>
838
+ <show_in_website>1</show_in_website>
839
+ <show_in_store>1</show_in_store>
840
+ <fields>
841
+ <active translate="label">
842
+ <label>Enabled</label>
843
+ <frontend_type>select</frontend_type>
844
+ <source_model>adminhtml/system_config_source_yesno</source_model>
845
+ <sort_order>1</sort_order>
846
+ <show_in_default>1</show_in_default>
847
+ <show_in_website>1</show_in_website>
848
+ <show_in_store>0</show_in_store>
849
+ </active>
850
+ <output translate="label">
851
+ <label>Output Path</label>
852
+ <frontend_type>text</frontend_type>
853
+ <sort_order>2</sort_order>
854
+ <show_in_default>1</show_in_default>
855
+ <show_in_website>1</show_in_website>
856
+ <show_in_store>1</show_in_store>
857
+ <comment>XML files will be generated into this path.</comment>
858
+ </output>
859
+ <defaultcategory translate="label">
860
+ <label>Default Category</label>
861
+ <frontend_type>text</frontend_type>
862
+ <sort_order>3</sort_order>
863
+ <show_in_default>1</show_in_default>
864
+ <show_in_website>1</show_in_website>
865
+ <show_in_store>1</show_in_store>
866
+ <comment>Products with no category assigned will be assigned this category label.</comment>
867
+ </defaultcategory>
868
+ <m_to_xml_attributes translate="comment">
869
+ <label>Attributes to include in product feed</label>
870
+ <frontend_model>fontis_australia_block_myshopping</frontend_model>
871
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
872
+ <sort_order>25</sort_order>
873
+ <show_in_default>1</show_in_default>
874
+ <show_in_website>1</show_in_website>
875
+ <show_in_store>1</show_in_store>
876
+ <comment></comment>
877
+ </m_to_xml_attributes>
878
+ </fields>
879
+ </myshoppingfeed>
880
+ </groups>
881
+ </fontis_feeds>
882
</sections>
883
</config>
app/design/adminhtml/default/default/template/fontis/australia/payment/bpay/info.phtml CHANGED
@@ -15,17 +15,18 @@
15
* @category Fontis
16
* @package Fontis_Australia
17
* @author Chris Norton
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
?>
22
<div>
23