Fontis_Australia - Version 2.0.7

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). Also supports creating product information feeds for the Shopbot, Getprice and MyShopping services.

Download this release

Release Info

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


Code changes from version 2.0.4 to 2.0.7

app/code/community/Fontis/Australia/Model/Config/ProductAttributes.php ADDED
@@ -0,0 +1,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
+ * 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 Tom Greenaway
18
+ * @copyright Copyright (c) 2010 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
+ * List all available product attributes
24
+ *
25
+ * @category Fontis
26
+ * @package Fontis_Australia
27
+ */
28
+ class Fontis_Australia_Model_Config_ProductAttributes {
29
+ public function toOptionArray() {
30
+ $eav_config = Mage::getModel('eav/config');
31
+ $attributes = $eav_config->getEntityAttributeCodes('catalog_product');
32
+
33
+ $options = array();
34
+ $options[0] = "No Attribute";
35
+
36
+ foreach($attributes as $att_code)
37
+ {
38
+ $attribute = $eav_config->getAttribute('catalog_product', $att_code);
39
+ Mage::log($attribute);
40
+
41
+ if ($att_code != '')
42
+ {
43
+ $options[$att_code] = $att_code;
44
+ }
45
+ }
46
+
47
+ return $options;
48
+ }
49
+ }
50
+
app/code/community/Fontis/Australia/Model/Getprice/Child.php CHANGED
@@ -30,11 +30,58 @@ $store_id = $argv[3];
30
require_once $mage_path . '/app/Mage.php';
31
Mage::app($store_id);
32
33
// This array is translated into XML when fed back to the cron parent PHP.
34
$products = array();
35
foreach(unserialize($product_ids) as $product_id) {
36
// Load product, tax helper and generate final price information
37
$product = Mage::getModel('catalog/product')->load($product_id);
38
$tax = Mage::helper('tax');
39
$final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
40
@@ -77,7 +124,6 @@ foreach(unserialize($product_ids) as $product_id) {
77
$array['category_name'] = Mage::getStoreConfig('fontis_feeds/getpricefeed/defaultcategory');
78
}
79
80
- //$array['description'] = htmlspecialchars($product->getDescription());
81
$array['image'] = (string)Mage::helper('catalog/image')->init($product, 'image');
82
$array['price'] = $final_price;
83
$array['currency'] = Mage::getStoreConfig('fontis_feeds/getpricefeed/currency');
@@ -85,5 +131,7 @@ foreach(unserialize($product_ids) as $product_id) {
85
$products[] = $array;
86
}
87
88
// Serialize and print as a string for the cron parent PHP code to grab.
89
echo json_encode($products);
30
require_once $mage_path . '/app/Mage.php';
31
Mage::app($store_id);
32
33
+ Mage::log('Fontis/Australia_Model_Getprice_Child: Successfully entered child process');
34
+
35
+ $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = $mage_path . "/app/code/community/Fontis/Australia/Model/Getprice/Child.php";
36
+
37
+ // Check and assign mode
38
+ if (Mage::getStoreConfig('fontis_feeds/getpricefeed/include_all_products') == 1) {
39
+ $include_all = true;
40
+ } else {
41
+ $include_all = false;
42
+ }
43
+
44
// This array is translated into XML when fed back to the cron parent PHP.
45
$products = array();
46
foreach(unserialize($product_ids) as $product_id) {
47
+
48
// Load product, tax helper and generate final price information
49
$product = Mage::getModel('catalog/product')->load($product_id);
50
+
51
+ // Check for overrride attribute
52
+ // Fetch override attribute
53
+ $override_attribute_code = Mage::getStoreConfig('fontis_feeds/getpricefeed/custom_filter_attribute');
54
+
55
+ Mage::log('Fontis/Australia_Model_Getprice_Child: Override attribute: ' . $override_attribute_code);
56
+
57
+ // Check product for that attribute
58
+ if ($override_attribute_code != '0') {
59
+ Mage::log('Fontis/Australia_Model_Getprice_Child: Attempting to load attribute value');
60
+ $attribute_value = $product->getResource()->getAttribute($override_attribute_code)->getFrontend()->getValue($product);
61
+ Mage::log('Fontis/Australia_Model_Getprice_Child: Attribute value: ' . $attribute_value);
62
+
63
+ if ($attribute_value === '' || $attribute_value === 0 || $attribute_value === '0' || strtolower($attribute_value) == 'no') {
64
+ $override_attribute = false;
65
+ } else {
66
+ $override_attribute = true;
67
+ }
68
+ } else {
69
+ Mage::log('Fontis/Australia_Model_Getprice_Child: No override attribute set');
70
+ $override_attribute = false;
71
+ }
72
+
73
+ // If mode is includeall and override is true don't include this product
74
+ if ($include_all && $override_attribute) {
75
+ Mage::log('Fontis/Australia_Model_Getprice_Child: Skipping due to include_all && override_attribute');
76
+ continue;
77
+ }
78
+
79
+ // If mode is excludeall and override is false don't include this product
80
+ if (!$include_all && !$override_attribute) {
81
+ Mage::log('Fontis/Australia_Model_Getprice_Child: Skipping due to !include_all && !override_attribute');
82
+ continue;
83
+ }
84
+
85
$tax = Mage::helper('tax');
86
$final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
87
124
$array['category_name'] = Mage::getStoreConfig('fontis_feeds/getpricefeed/defaultcategory');
125
}
126
127
$array['image'] = (string)Mage::helper('catalog/image')->init($product, 'image');
128
$array['price'] = $final_price;
129
$array['currency'] = Mage::getStoreConfig('fontis_feeds/getpricefeed/currency');
131
$products[] = $array;
132
}
133
134
+ Mage::log('Fontis/Australia_Model_Getprice_Child: Finishing child processing. Returning encoded JSON data.');
135
+
136
// Serialize and print as a string for the cron parent PHP code to grab.
137
echo json_encode($products);
app/code/community/Fontis/Australia/Model/Getprice/Cron.php CHANGED
@@ -22,8 +22,7 @@
22
// Callback used by the Magento resource iterator walk() method. Adds a
23
// product ID to a static array and calls addProductXmlgetPrice() to
24
// generate XML when the array reaches the batch size.
25
- function addProductXmlCallbackGetPrice($args)
26
- {
27
Fontis_Australia_Model_GetPrice_Cron::$accumulator[] = $args['row']['entity_id'];
28
29
$length = count(Fontis_Australia_Model_GetPrice_Cron::$accumulator);
@@ -34,15 +33,14 @@ function addProductXmlCallbackGetPrice($args)
34
35
// Runs a subprocesss to create feed XML for the product IDs in the static
36
// array, then empties the array.
37
- function addProductXmlGetPrice()
38
- {
39
$length = count(Fontis_Australia_Model_GetPrice_Cron::$accumulator);
40
if($length > 0) {
41
- Mage::log("Processing product IDs " . Fontis_Australia_Model_GetPrice_Cron::$accumulator[0] .
42
" to " . Fontis_Australia_Model_GetPrice_Cron::$accumulator[$length - 1]);
43
$store_id = Fontis_Australia_Model_GetPrice_Cron::$store->getId();
44
45
- $data = exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Getprice/Child.php " .
46
Mage::getBaseDir() . " '" . serialize(Fontis_Australia_Model_GetPrice_Cron::$accumulator) .
47
"' " . $store_id);
48
Fontis_Australia_Model_GetPrice_Cron::$accumulator = array();
@@ -62,20 +60,19 @@ function addProductXmlGetPrice()
62
}
63
}
64
if(!empty($codes)) {
65
- Mage::log("Codes: ".implode(",", $codes));
66
}
67
} else {
68
- Mage::log("Could not unserialize to array:");
69
Mage::log($data);
70
Mage::log($array);
71
}
72
73
- Mage::log(strlen($data) . " characters returned");
74
}
75
}
76
77
- class Fontis_Australia_Model_GetPrice_Cron
78
- {
79
const BATCH_SIZE = 100;
80
81
public static $doc;
@@ -84,13 +81,11 @@ class Fontis_Australia_Model_GetPrice_Cron
84
public static $accumulator;
85
public static $debugCount = 0;
86
87
- protected function _construct()
88
- {
89
self::$accumulator = array();
90
}
91
92
- protected function getPath()
93
- {
94
$path = "";
95
$config_path = Mage::getStoreConfig('fontis_feeds/getpricefeed/output');
96
@@ -103,14 +98,12 @@ class Fontis_Australia_Model_GetPrice_Cron
103
return str_replace('//', '/', $path);
104
}
105
106
- public function nonstatic()
107
- {
108
self::update();
109
}
110
111
- public static function update()
112
- {
113
- Mage::log('Fontis/Australia_Model_Getprice_Cron: entered update function');
114
115
if (Mage::getStoreConfig('fontis_feeds/getpricefeed/active')) {
116
$io = new Varien_Io_File();
@@ -118,41 +111,45 @@ class Fontis_Australia_Model_GetPrice_Cron
118
119
$io->open(array('path' => self::getPath()));
120
121
foreach(Mage::app()->getStores() as $store) {
122
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
123
-
124
// Write the entire products xml file:
125
- Mage::log('Creating GetPrice products file...');
126
$products_result = self::getProductsXml($store);
127
$io->write($clean_store_name . '-products.xml', $products_result['xml']);
128
-
129
// Write the leaf categories xml file:
130
- Mage::log('Creating GetPrice categories index file...');
131
$categories_result = self::getCategoriesXml($store);
132
$io->write($clean_store_name . '-categories.xml', $categories_result['xml']);
133
134
// Write for each leaf category, their products xml file:
135
foreach($categories_result['link_ids'] as $link_id) {
136
- Mage::log("Creating GetPrice category file for ID {$categories_result['link_ids']}...");
137
$subcategory_products_result = self::getProductsXml($store, $link_id);
138
$io->write($clean_store_name . '-products-'.$link_id.'.xml', $subcategory_products_result['xml']);
139
}
140
}
141
142
$io->close();
143
} else {
144
- Mage::log('Fontis/Australia_Model_Getprice_Cron: disabled');
145
}
146
}
147
148
- public function getCategoriesXml($store)
149
- {
150
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
151
-
152
$result = array();
153
$categories = Mage::getModel('catalog/category')->getCollection()
154
- ->setStoreId($store->getId())
155
- ->addAttributeToFilter('is_active', 1);
156
157
$categories->load()->getItems();
158
@@ -192,8 +189,7 @@ class Fontis_Australia_Model_GetPrice_Cron
192
return $result;
193
}
194
195
- public function getProductsXml($store, $cat_id = -1)
196
- {
197
Fontis_Australia_Model_GetPrice_Cron::$store = $store;
198
$result = array();
199
@@ -203,11 +199,9 @@ class Fontis_Australia_Model_GetPrice_Cron
203
$products->addStoreFilter();
204
$products->addAttributeToSelect('*');
205
$products->addAttributeToSelect(array('name', 'price', 'image', 'status', 'manufacturer'), 'left');
206
- $products->addAttributeToFilter('type_id', 'simple');
207
208
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
209
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
210
-
211
if ($cat_id != -1) {
212
$products->getSelect()->where("e.entity_id IN (
213
SELECT product_id FROM catalog_category_product WHERE category_id = ".$cat_id."
@@ -224,16 +218,18 @@ class Fontis_Australia_Model_GetPrice_Cron
224
self::$doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
225
self::$root_node = self::$doc->addChild('products');
226
227
Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallbackGetPrice'), array('product' => $product));
228
// call XML generation function one last time to process remaining batch
229
addProductXmlGetPrice();
230
231
$result['xml'] = self::formatSimpleXML(self::$doc);
232
return $result;
233
}
234
235
- public static function formatSimpleXML($doc)
236
- {
237
$dom = new DOMDocument('1.0');
238
$dom->preserveWhiteSpace = false;
239
$dom->formatOutput = true;
22
// Callback used by the Magento resource iterator walk() method. Adds a
23
// product ID to a static array and calls addProductXmlgetPrice() to
24
// generate XML when the array reaches the batch size.
25
+ function addProductXmlCallbackGetPrice($args) {
26
Fontis_Australia_Model_GetPrice_Cron::$accumulator[] = $args['row']['entity_id'];
27
28
$length = count(Fontis_Australia_Model_GetPrice_Cron::$accumulator);
33
34
// Runs a subprocesss to create feed XML for the product IDs in the static
35
// array, then empties the array.
36
+ function addProductXmlGetPrice() {
37
$length = count(Fontis_Australia_Model_GetPrice_Cron::$accumulator);
38
if($length > 0) {
39
+ Mage::log("Fontis/Australia_Model_Getprice_Cron: Processing product IDs " . Fontis_Australia_Model_GetPrice_Cron::$accumulator[0] .
40
" to " . Fontis_Australia_Model_GetPrice_Cron::$accumulator[$length - 1]);
41
$store_id = Fontis_Australia_Model_GetPrice_Cron::$store->getId();
42
43
+ $data = shell_exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Getprice/Child.php " .
44
Mage::getBaseDir() . " '" . serialize(Fontis_Australia_Model_GetPrice_Cron::$accumulator) .
45
"' " . $store_id);
46
Fontis_Australia_Model_GetPrice_Cron::$accumulator = array();
60
}
61
}
62
if(!empty($codes)) {
63
+ Mage::log("Fontis/Australia_Model_Getprice_Cron: Codes: ".implode(",", $codes));
64
}
65
} else {
66
+ Mage::log("Fontis/Australia_Model_Getprice_Cron: Could not unserialize to array:");
67
Mage::log($data);
68
Mage::log($array);
69
}
70
71
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: ' . strlen($data) . ' characters returned');
72
}
73
}
74
75
+ class Fontis_Australia_Model_GetPrice_Cron {
76
const BATCH_SIZE = 100;
77
78
public static $doc;
81
public static $accumulator;
82
public static $debugCount = 0;
83
84
+ protected function _construct() {
85
self::$accumulator = array();
86
}
87
88
+ protected function getPath() {
89
$path = "";
90
$config_path = Mage::getStoreConfig('fontis_feeds/getpricefeed/output');
91
98
return str_replace('//', '/', $path);
99
}
100
101
+ public function nonstatic() {
102
self::update();
103
}
104
105
+ public static function update() {
106
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Entered update function');
107
108
if (Mage::getStoreConfig('fontis_feeds/getpricefeed/active')) {
109
$io = new Varien_Io_File();
111
112
$io->open(array('path' => self::getPath()));
113
114
+ // Loop through all stores:
115
foreach(Mage::app()->getStores() as $store) {
116
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Processing store: ' . $store->getName());
117
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
118
+
119
// Write the entire products xml file:
120
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Generating All Products XML File');
121
$products_result = self::getProductsXml($store);
122
$io->write($clean_store_name . '-products.xml', $products_result['xml']);
123
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Wrote to file: ' . $clean_store_name . '-products.xml', $products_result['xml']);
124
+
125
// Write the leaf categories xml file:
126
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Generating Categories XML File');
127
$categories_result = self::getCategoriesXml($store);
128
$io->write($clean_store_name . '-categories.xml', $categories_result['xml']);
129
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Wrote to file: ' . $clean_store_name . '-categories.xml', $categories_result['xml']);
130
131
// Write for each leaf category, their products xml file:
132
foreach($categories_result['link_ids'] as $link_id) {
133
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Generating Product Category XML File: ' . $link_id);
134
$subcategory_products_result = self::getProductsXml($store, $link_id);
135
$io->write($clean_store_name . '-products-'.$link_id.'.xml', $subcategory_products_result['xml']);
136
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Wrote to file: ' . $clean_store_name . '-products-'.$link_id.'.xml', $subcategory_products_result['xml']);
137
}
138
}
139
140
$io->close();
141
} else {
142
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Disabled');
143
}
144
}
145
146
+ public function getCategoriesXml($store) {
147
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
148
+
149
$result = array();
150
$categories = Mage::getModel('catalog/category')->getCollection()
151
+ ->setStoreId($store->getId())
152
+ ->addAttributeToFilter('is_active', 1);
153
154
$categories->load()->getItems();
155
189
return $result;
190
}
191
192
+ public function getProductsXml($store, $cat_id = -1) {
193
Fontis_Australia_Model_GetPrice_Cron::$store = $store;
194
$result = array();
195
199
$products->addStoreFilter();
200
$products->addAttributeToSelect('*');
201
$products->addAttributeToSelect(array('name', 'price', 'image', 'status', 'manufacturer'), 'left');
202
+ $products->addAttributeToFilter('status', 1);
203
+ $products->addAttributeToFilter('visibility', 4);
204
205
if ($cat_id != -1) {
206
$products->getSelect()->where("e.entity_id IN (
207
SELECT product_id FROM catalog_category_product WHERE category_id = ".$cat_id."
218
self::$doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
219
self::$root_node = self::$doc->addChild('products');
220
221
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Iterating: ' . $products->getSize() . ' products...');
222
Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallbackGetPrice'), array('product' => $product));
223
+
224
// call XML generation function one last time to process remaining batch
225
addProductXmlGetPrice();
226
+ Mage::log('Fontis/Australia_Model_Getprice_Cron: Iteration complete');
227
228
$result['xml'] = self::formatSimpleXML(self::$doc);
229
return $result;
230
}
231
232
+ public static function formatSimpleXML($doc) {
233
$dom = new DOMDocument('1.0');
234
$dom->preserveWhiteSpace = false;
235
$dom->formatOutput = true;
app/code/community/Fontis/Australia/Model/Myshopping/Child.php CHANGED
@@ -30,11 +30,58 @@ $store_id = $argv[3];
30
require_once $mage_path . '/app/Mage.php';
31
Mage::app($store_id);
32
33
// This array is translated into XML when fed back to the cron parent PHP.
34
$products = array();
35
foreach(unserialize($product_ids) as $product_id) {
36
// Load product, tax helper and generate final price information
37
$product = Mage::getModel('catalog/product')->load($product_id);
38
$tax = Mage::helper('tax');
39
$final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
40
@@ -56,9 +103,9 @@ foreach(unserialize($product_ids) as $product_id) {
56
$array['Category'] = utf8_encode($c->getName());
57
58
$loaded_categories = Mage::getModel('catalog/category')
59
- ->getCollection()
60
- ->addIdFilter(array($c->getId()))
61
- ->addAttributeToSelect(array('name'), 'inner')->load();
62
63
foreach($loaded_categories as $loaded_category) {
64
$array['Category'] = utf8_encode($loaded_category->getName());
@@ -85,10 +132,8 @@ foreach(unserialize($product_ids) as $product_id) {
85
}
86
87
$linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/myshoppingfeed/m_to_xml_attributes', $store_id));
88
- if(!empty($linkedAttributes))
89
- {
90
- foreach($linkedAttributes as $la)
91
- {
92
$magentoAtt = $la['magento'];
93
$xmlAtt = $la['xmlfeed'];
94
30
require_once $mage_path . '/app/Mage.php';
31
Mage::app($store_id);
32
33
+ Mage::log('Fontis/Australia_Model_Myshopping_Child: Successfully entered child process');
34
+
35
+ $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = $mage_path . "/app/code/community/Fontis/Australia/Model/Myshopping/Child.php";
36
+
37
+ // Check and assign mode
38
+ if (Mage::getStoreConfig('fontis_feeds/myshoppingfeed/include_all_products') == 1) {
39
+ $include_all = true;
40
+ } else {
41
+ $include_all = false;
42
+ }
43
+
44
// This array is translated into XML when fed back to the cron parent PHP.
45
$products = array();
46
foreach(unserialize($product_ids) as $product_id) {
47
+
48
// Load product, tax helper and generate final price information
49
$product = Mage::getModel('catalog/product')->load($product_id);
50
+
51
+ // Check for overrride attribute
52
+ // Fetch override attribute
53
+ $override_attribute_code = Mage::getStoreConfig('fontis_feeds/myshoppingfeed/custom_filter_attribute');
54
+
55
+ Mage::log('Fontis/Australia_Model_Myshopping_Child: Override attribute: ' . $override_attribute_code);
56
+
57
+ // Check product for that attribute
58
+ if ($override_attribute_code != '0') {
59
+ Mage::log('Fontis/Australia_Model_Myshopping_Child: Attempting to load attribute value');
60
+ $attribute_value = $product->getResource()->getAttribute($override_attribute_code)->getFrontend()->getValue($product);
61
+ Mage::log('Fontis/Australia_Model_Myshopping_Child: Attribute value: ' . $attribute_value);
62
+
63
+ if ($attribute_value === '' || $attribute_value === 0 || $attribute_value === '0' || strtolower($attribute_value) == 'no') {
64
+ $override_attribute = false;
65
+ } else {
66
+ $override_attribute = true;
67
+ }
68
+ } else {
69
+ Mage::log('Fontis/Australia_Model_Myshopping_Child: No override attribute set');
70
+ $override_attribute = false;
71
+ }
72
+
73
+ // If mode is includeall and override is true don't include this product
74
+ if ($include_all && $override_attribute) {
75
+ Mage::log('Fontis/Australia_Model_Myshopping_Child: Skipping due to include_all && override_attribute');
76
+ continue;
77
+ }
78
+
79
+ // If mode is excludeall and override is false don't include this product
80
+ if (!$include_all && !$override_attribute) {
81
+ Mage::log('Fontis/Australia_Model_Myshopping_Child: Skipping due to !include_all && !override_attribute');
82
+ continue;
83
+ }
84
+
85
$tax = Mage::helper('tax');
86
$final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
87
103
$array['Category'] = utf8_encode($c->getName());
104
105
$loaded_categories = Mage::getModel('catalog/category')
106
+ ->getCollection()
107
+ ->addIdFilter(array($c->getId()))
108
+ ->addAttributeToSelect(array('name'), 'inner')->load();
109
110
foreach($loaded_categories as $loaded_category) {
111
$array['Category'] = utf8_encode($loaded_category->getName());
132
}
133
134
$linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/myshoppingfeed/m_to_xml_attributes', $store_id));
135
+ if(!empty($linkedAttributes)) {
136
+ foreach($linkedAttributes as $la) {
137
$magentoAtt = $la['magento'];
138
$xmlAtt = $la['xmlfeed'];
139
app/code/community/Fontis/Australia/Model/Myshopping/Cron.php CHANGED
@@ -22,9 +22,8 @@
22
// Callback used by the Magento resource iterator walk() method. Adds a
23
// product ID to a static array and calls addProductXmlMyShopping() to
24
// generate XML when the array reaches the batch size.
25
- function addProductXmlCallbackMyShopping($args)
26
- {
27
- Fontis_Australia_Model_MyShopping_Cron::$accumulator[] = $args['row']['entity_id'];
28
29
$length = count(Fontis_Australia_Model_MyShopping_Cron::$accumulator);
30
if($length >= Fontis_Australia_Model_MyShopping_Cron::BATCH_SIZE) {
@@ -34,19 +33,18 @@ function addProductXmlCallbackMyShopping($args)
34
35
// Runs a subprocesss to create feed XML for the product IDs in the static
36
// array, then empties the array.
37
- function addProductXmlMyShopping()
38
- {
39
$length = count(Fontis_Australia_Model_MyShopping_Cron::$accumulator);
40
if($length > 0) {
41
- Mage::log("Processing product IDs " . Fontis_Australia_Model_MyShopping_Cron::$accumulator[0] .
42
" to " . Fontis_Australia_Model_MyShopping_Cron::$accumulator[$length - 1]);
43
$store_id = Fontis_Australia_Model_MyShopping_Cron::$store->getId();
44
45
- $data = exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Myshopping/Child.php " .
46
Mage::getBaseDir() . " '" . serialize(Fontis_Australia_Model_MyShopping_Cron::$accumulator) .
47
"' " . $store_id);
48
Fontis_Australia_Model_MyShopping_Cron::$accumulator = array();
49
-
50
$array = json_decode($data, true);
51
52
if(is_array($array)) {
@@ -62,35 +60,32 @@ function addProductXmlMyShopping()
62
}
63
}
64
if(!empty($codes)) {
65
- Mage::log("Codes: ".implode(",", $codes));
66
}
67
} else {
68
- Mage::log("Could not unserialize to array:");
69
Mage::log($data);
70
Mage::log($array);
71
}
72
-
73
- Mage::log(strlen($data) . " characters returned");
74
}
75
}
76
77
- class Fontis_Australia_Model_MyShopping_Cron
78
- {
79
const BATCH_SIZE = 100;
80
-
81
public static $doc;
82
public static $root_node;
83
public static $store;
84
public static $accumulator;
85
public static $debugCount = 0;
86
87
- protected function _construct()
88
- {
89
self::$accumulator = array();
90
}
91
92
- protected function getPath()
93
- {
94
$path = "";
95
$config_path = Mage::getStoreConfig('fontis_feeds/myshoppingfeed/output');
96
@@ -103,39 +98,43 @@ class Fontis_Australia_Model_MyShopping_Cron
103
return str_replace('//', '/', $path);
104
}
105
106
- public static function update()
107
- {
108
- Mage::log('Fontis/Australia_Model_MyShopping_Cron: entered update function');
109
if (Mage::getStoreConfig('fontis_feeds/myshoppingfeed/active')) {
110
$io = new Varien_Io_File();
111
$io->setAllowCreateFolders(true);
112
113
$io->open(array('path' => self::getPath()));
114
115
foreach(Mage::app()->getStores() as $store) {
116
- Mage::log('for each store');
117
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
118
Fontis_Australia_Model_MyShopping_Cron::$debugCount = 0;
119
- $products_result = self::getProductsXml($store);
120
121
// Write the entire products xml file:
122
$filename = $clean_store_name . '-products.xml';
123
$io->write($filename, $products_result['xml']);
124
- Mage::log("Wrote " . Fontis_Australia_Model_MyShopping_Cron::$debugCount
125
. " records to " . self::getPath() . $filename);
126
}
127
128
$io->close();
129
}
130
}
131
132
- public function nonstatic()
133
- {
134
- self::update();
135
- }
136
-
137
- public function getProductsXml($store)
138
- {
139
Mage::log('new getproductsxml');
140
Fontis_Australia_Model_MyShopping_Cron::$store = $store;
141
@@ -146,9 +145,8 @@ class Fontis_Australia_Model_MyShopping_Cron
146
$products->setStoreId($store);
147
$products->addStoreFilter();
148
$products->addAttributeToSelect('*');
149
-
150
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
151
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
152
153
$storeUrl = $store->getBaseUrl();
154
$shopName = $store->getName();
@@ -158,11 +156,12 @@ class Fontis_Australia_Model_MyShopping_Cron
158
self::$doc = new SimpleXMLElement('<productset></productset>');
159
self::$root_node = self::$doc;
160
161
- Mage::log("About to walk {$products->getSize()} products...");
162
Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallbackMyShopping'));
163
// call XML generation function one last time to process remaining batch
164
addProductXmlMyShopping();
165
- Mage::log('Walked');
166
167
$dom = new DOMDocument('1.0');
168
$dom->preserveWhiteSpace = false;
22
// Callback used by the Magento resource iterator walk() method. Adds a
23
// product ID to a static array and calls addProductXmlMyShopping() to
24
// generate XML when the array reaches the batch size.
25
+ function addProductXmlCallbackMyShopping($args) {
26
+ Fontis_Australia_Model_MyShopping_Cron::$accumulator[] = $args['row']['entity_id'];
27
28
$length = count(Fontis_Australia_Model_MyShopping_Cron::$accumulator);
29
if($length >= Fontis_Australia_Model_MyShopping_Cron::BATCH_SIZE) {
33
34
// Runs a subprocesss to create feed XML for the product IDs in the static
35
// array, then empties the array.
36
+ function addProductXmlMyShopping() {
37
$length = count(Fontis_Australia_Model_MyShopping_Cron::$accumulator);
38
if($length > 0) {
39
+ Mage::log("Fontis/Australia_Model_Myshopping_Cron: Processing product IDs " . Fontis_Australia_Model_MyShopping_Cron::$accumulator[0] .
40
" to " . Fontis_Australia_Model_MyShopping_Cron::$accumulator[$length - 1]);
41
$store_id = Fontis_Australia_Model_MyShopping_Cron::$store->getId();
42
43
+ $data = shell_exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Myshopping/Child.php " .
44
Mage::getBaseDir() . " '" . serialize(Fontis_Australia_Model_MyShopping_Cron::$accumulator) .
45
"' " . $store_id);
46
Fontis_Australia_Model_MyShopping_Cron::$accumulator = array();
47
+
48
$array = json_decode($data, true);
49
50
if(is_array($array)) {
60
}
61
}
62
if(!empty($codes)) {
63
+ Mage::log("Fontis/Australia_Model_Myshopping_Cron: Codes: ".implode(",", $codes));
64
}
65
} else {
66
+ Mage::log("Fontis/Australia_Model_Myshopping_Cron: Could not unserialize to array:");
67
Mage::log($data);
68
Mage::log($array);
69
}
70
+
71
+ Mage::log("Fontis/Australia_Model_Myshopping_Cron: " . strlen($data) . " characters returned");
72
}
73
}
74
75
+ class Fontis_Australia_Model_MyShopping_Cron {
76
const BATCH_SIZE = 100;
77
+
78
public static $doc;
79
public static $root_node;
80
public static $store;
81
public static $accumulator;
82
public static $debugCount = 0;
83
84
+ protected function _construct() {
85
self::$accumulator = array();
86
}
87
88
+ protected function getPath() {
89
$path = "";
90
$config_path = Mage::getStoreConfig('fontis_feeds/myshoppingfeed/output');
91
98
return str_replace('//', '/', $path);
99
}
100
101
+ public function nonstatic() {
102
+ self::update();
103
+ }
104
+
105
+ public static function update() {
106
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: Entered update function');
107
+
108
if (Mage::getStoreConfig('fontis_feeds/myshoppingfeed/active')) {
109
$io = new Varien_Io_File();
110
$io->setAllowCreateFolders(true);
111
112
$io->open(array('path' => self::getPath()));
113
114
+ // Loop through all stores:
115
foreach(Mage::app()->getStores() as $store) {
116
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: Processing store: ' . $store->getName());
117
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
118
+
119
Fontis_Australia_Model_MyShopping_Cron::$debugCount = 0;
120
121
// Write the entire products xml file:
122
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: Generating All Products XML File');
123
+ $products_result = self::getProductsXml($store);
124
+
125
$filename = $clean_store_name . '-products.xml';
126
$io->write($filename, $products_result['xml']);
127
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: Wrote ' . Fontis_Australia_Model_MyShopping_Cron::$debugCount
128
. " records to " . self::getPath() . $filename);
129
}
130
131
$io->close();
132
+ } else {
133
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: Disabled');
134
}
135
}
136
137
+ public function getProductsXml($store) {
138
Mage::log('new getproductsxml');
139
Fontis_Australia_Model_MyShopping_Cron::$store = $store;
140
145
$products->setStoreId($store);
146
$products->addStoreFilter();
147
$products->addAttributeToSelect('*');
148
+ $products->addAttributeToFilter('status', 1);
149
+ $products->addAttributeToFilter('visibility', 4);
150
151
$storeUrl = $store->getBaseUrl();
152
$shopName = $store->getName();
156
self::$doc = new SimpleXMLElement('<productset></productset>');
157
self::$root_node = self::$doc;
158
159
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: Iterating: ' . $products->getSize() . ' products...');
160
Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallbackMyShopping'));
161
+
162
// call XML generation function one last time to process remaining batch
163
addProductXmlMyShopping();
164
+ Mage::log('Fontis/Australia_Model_MyShopping_Cron: Iteration complete');
165
166
$dom = new DOMDocument('1.0');
167
$dom->preserveWhiteSpace = false;
app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php CHANGED
@@ -264,9 +264,6 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost
264
265
protected function _createMethod($request, $method_code, $title, $price, $cost)
266
{
267
- $shippingPrice = $request->getBaseCurrency()->convert($price, $request->getPackageCurrency());
268
- $shippingCost = $request->getBaseCurrency()->convert($cost, $request->getPackageCurrency());
269
-
270
$method = Mage::getModel('shipping/rate_result_method');
271
272
$method->setCarrier('australiapost');
@@ -275,8 +272,8 @@ class Fontis_Australia_Model_Shipping_Carrier_Australiapost
275
$method->setMethod($method_code);
276
$method->setMethodTitle($title);
277
278
- $method->setPrice($this->getFinalPriceWithHandlingFee($shippingPrice));
279
- $method->setCost($shippingCost);
280
281
return $method;
282
}
264
265
protected function _createMethod($request, $method_code, $title, $price, $cost)
266
{
267
$method = Mage::getModel('shipping/rate_result_method');
268
269
$method->setCarrier('australiapost');
272
$method->setMethod($method_code);
273
$method->setMethodTitle($title);
274
275
+ $method->setPrice($this->getFinalPriceWithHandlingFee($price));
276
+ $method->setCost($cost);
277
278
return $method;
279
}
app/code/community/Fontis/Australia/Model/Shopbot/Child.php CHANGED
@@ -30,11 +30,58 @@ $store_id = $argv[3];
30
require_once $mage_path . '/app/Mage.php';
31
Mage::app($store_id);
32
33
// This array is translated into XML when fed back to the cron parent PHP.
34
$products = array();
35
foreach(unserialize($product_ids) as $product_id) {
36
// Load product, tax helper and generate final price information
37
$product = Mage::getModel('catalog/product')->load($product_id);
38
$tax = Mage::helper('tax');
39
$final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
40
@@ -52,16 +99,14 @@ foreach(unserialize($product_ids) as $product_id) {
52
}
53
54
$linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store_id));
55
- if(!empty($linkedAttributes))
56
- {
57
- foreach($linkedAttributes as $la)
58
- {
59
$magentoAtt = $la['magento'];
60
$xmlAtt = $la['xmlfeed'];
61
62
if ($magentoAtt == "manufacturer") {
63
$manufacturer_name = $product->getResource()->
64
- getAttribute('manufacturer')->getFrontend()->getValue($product);
65
66
if ($manufacturer_name != 'No') {
67
$array['manufacturer'] = $manufacturer_name;
@@ -82,9 +127,9 @@ foreach(unserialize($product_ids) as $product_id) {
82
$array['category_name'] = $c->getName();
83
84
$loaded_categories = Mage::getModel('catalog/category')
85
- ->getCollection()
86
- ->addIdFilter(array($c->getId()))
87
- ->addAttributeToSelect(array('name'), 'inner')->load();
88
89
foreach($loaded_categories as $loaded_category) {
90
$array['category_name'] = $loaded_category->getName();
30
require_once $mage_path . '/app/Mage.php';
31
Mage::app($store_id);
32
33
+ Mage::log('Fontis/Australia_Model_Shopbot_Child: Successfully entered child process');
34
+
35
+ $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = $mage_path . "/app/code/community/Fontis/Australia/Model/Shopbot/Child.php";
36
+
37
+ // Check and assign mode
38
+ if (Mage::getStoreConfig('fontis_feeds/shopbotfeed/include_all_products') == 1) {
39
+ $include_all = true;
40
+ } else {
41
+ $include_all = false;
42
+ }
43
+
44
// This array is translated into XML when fed back to the cron parent PHP.
45
$products = array();
46
foreach(unserialize($product_ids) as $product_id) {
47
+
48
// Load product, tax helper and generate final price information
49
$product = Mage::getModel('catalog/product')->load($product_id);
50
+
51
+ // Check for overrride attribute
52
+ // Fetch override attribute
53
+ $override_attribute_code = Mage::getStoreConfig('fontis_feeds/shopbotfeed/custom_filter_attribute');
54
+
55
+ Mage::log('Fontis/Australia_Model_Shopbot_Child: Override attribute: ' . $override_attribute_code);
56
+
57
+ // Check product for that attribute
58
+ if ($override_attribute_code != '0') {
59
+ Mage::log('Fontis/Australia_Model_Shopbot_Child: Attempting to load attribute value');
60
+ $attribute_value = $product->getResource()->getAttribute($override_attribute_code)->getFrontend()->getValue($product);
61
+ Mage::log('Fontis/Australia_Model_Shopbot_Child: Attribute value: ' . $attribute_value);
62
+
63
+ if ($attribute_value === '' || $attribute_value === 0 || $attribute_value === '0' || strtolower($attribute_value) == 'no') {
64
+ $override_attribute = false;
65
+ } else {
66
+ $override_attribute = true;
67
+ }
68
+ } else {
69
+ Mage::log('Fontis/Australia_Model_Shopbot_Child: No override attribute set');
70
+ $override_attribute = false;
71
+ }
72
+
73
+ // If mode is includeall and override is true don't include this product
74
+ if ($include_all && $override_attribute) {
75
+ Mage::log('Fontis/Australia_Model_Shopbot_Child: Skipping due to include_all && override_attribute');
76
+ continue;
77
+ }
78
+
79
+ // If mode is excludeall and override is false don't include this product
80
+ if (!$include_all && !$override_attribute) {
81
+ Mage::log('Fontis/Australia_Model_Shopbot_Child: Skipping due to !include_all && !override_attribute');
82
+ continue;
83
+ }
84
+
85
$tax = Mage::helper('tax');
86
$final_price = $tax->getPrice($product, $product->getFinalPrice(), true);
87
99
}
100
101
$linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store_id));
102
+ if(!empty($linkedAttributes)) {
103
+ foreach($linkedAttributes as $la) {
104
$magentoAtt = $la['magento'];
105
$xmlAtt = $la['xmlfeed'];
106
107
if ($magentoAtt == "manufacturer") {
108
$manufacturer_name = $product->getResource()->
109
+ getAttribute('manufacturer')->getFrontend()->getValue($product);
110
111
if ($manufacturer_name != 'No') {
112
$array['manufacturer'] = $manufacturer_name;
127
$array['category_name'] = $c->getName();
128
129
$loaded_categories = Mage::getModel('catalog/category')
130
+ ->getCollection()
131
+ ->addIdFilter(array($c->getId()))
132
+ ->addAttributeToSelect(array('name'), 'inner')->load();
133
134
foreach($loaded_categories as $loaded_category) {
135
$array['category_name'] = $loaded_category->getName();
app/code/community/Fontis/Australia/Model/Shopbot/Cron.php CHANGED
@@ -22,8 +22,7 @@
22
// Callback used by the Magento resource iterator walk() method. Adds a
23
// product ID to a static array and calls addProductXmlShopBot() to
24
// generate XML when the array reaches the batch size.
25
- function addProductXmlCallbackShopBot($args)
26
- {
27
Fontis_Australia_Model_ShopBot_Cron::$accumulator[] = $args['row']['entity_id'];
28
29
$length = count(Fontis_Australia_Model_ShopBot_Cron::$accumulator);
@@ -34,15 +33,14 @@ function addProductXmlCallbackShopBot($args)
34
35
// Runs a subprocesss to create feed XML for the product IDs in the static
36
// array, then empties the array.
37
- function addProductXmlShopBot()
38
- {
39
$length = count(Fontis_Australia_Model_ShopBot_Cron::$accumulator);
40
if($length > 0) {
41
- Mage::log("Processing product IDs " . Fontis_Australia_Model_ShopBot_Cron::$accumulator[0] .
42
" to " . Fontis_Australia_Model_ShopBot_Cron::$accumulator[$length - 1]);
43
$store_id = Fontis_Australia_Model_ShopBot_Cron::$store->getId();
44
45
- $data = exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Shopbot/Child.php " .
46
Mage::getBaseDir() . " '" . serialize(Fontis_Australia_Model_ShopBot_Cron::$accumulator) .
47
"' " . $store_id);
48
Fontis_Australia_Model_ShopBot_Cron::$accumulator = array();
@@ -62,21 +60,20 @@ function addProductXmlShopBot()
62
}
63
}
64
if(!empty($codes)) {
65
- Mage::log("Codes: ".implode(",", $codes));
66
}
67
} else {
68
- Mage::log("Could not unserialize to array:");
69
Mage::log($data);
70
Mage::log($array);
71
}
72
-
73
- Mage::log(strlen($data) . " characters returned");
74
}
75
}
76
77
78
- class Fontis_Australia_Model_ShopBot_Cron
79
- {
80
const BATCH_SIZE = 100;
81
82
public static $doc;
@@ -85,13 +82,11 @@ class Fontis_Australia_Model_ShopBot_Cron
85
public static $accumulator;
86
public static $debugCount = 0;
87
88
- protected function _construct()
89
- {
90
self::$accumulator = array();
91
}
92
93
- protected function getPath()
94
- {
95
$path = "";
96
$config_path = Mage::getStoreConfig('fontis_feeds/shopbotfeed/output');
97
@@ -104,9 +99,12 @@ class Fontis_Australia_Model_ShopBot_Cron
104
return str_replace('//', '/', $path);
105
}
106
107
- public static function update()
108
- {
109
- Mage::log('Fontis/Australia_Model_Shopbot_Cron: entered update function');
110
if (Mage::getStoreConfig('fontis_feeds/shopbotfeed/active')) {
111
$io = new Varien_Io_File();
112
$io->setAllowCreateFolders(true);
@@ -114,30 +112,28 @@ class Fontis_Australia_Model_ShopBot_Cron
114
$io->open(array('path' => self::getPath()));
115
116
foreach(Mage::app()->getStores() as $store) {
117
- Mage::log('for each store');
118
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
119
- Fontis_Australia_Model_ShopBot_Cron::$debugCount = 0;
120
- $products_result = self::getProductsXml($store);
121
122
// Write the entire products xml file:
123
$filename = $clean_store_name . '-products.xml';
124
$io->write($filename, $products_result['xml']);
125
- Mage::log("Wrote " . Fontis_Australia_Model_ShopBot_Cron::$debugCount
126
. " records to " . self::getPath() . $filename);
127
}
128
129
$io->close();
130
}
131
}
132
133
- public function nonstatic()
134
- {
135
- self::update();
136
- }
137
-
138
- public function getProductsXml($store)
139
- {
140
- Mage::log('new getproductsxml');
141
Fontis_Australia_Model_ShopBot_Cron::$store = $store;
142
143
$result = array();
@@ -147,13 +143,13 @@ class Fontis_Australia_Model_ShopBot_Cron
147
$products->setStoreId($store);
148
$products->addStoreFilter();
149
$products->addAttributeToSelect('*');
150
151
$attributes_select_array = array('name', 'price', 'image', 'status');
152
$linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store->getId()));
153
- if(!empty($linkedAttributes))
154
- {
155
- foreach($linkedAttributes as $la)
156
- {
157
if (strpos($la['magento'], 'FONTIS') === false) {
158
$attributes_select_array[] = $la['magento'];
159
}
@@ -162,10 +158,6 @@ class Fontis_Australia_Model_ShopBot_Cron
162
Mage::log(var_export($attributes_select_array, true));
163
164
$products->addAttributeToSelect($attributes_select_array, 'left');
165
- $products->addAttributeToFilter('type_id', 'simple');
166
-
167
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
168
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
169
170
$storeUrl = $store->getBaseUrl();
171
$shopName = $store->getName();
@@ -175,12 +167,13 @@ class Fontis_Australia_Model_ShopBot_Cron
175
self::$doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
176
self::$root_node = self::$doc->addChild('products');
177
178
- Mage::log('about to walk');
179
Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallbackShopBot'));
180
// call XML generation function one last time to process remaining batch
181
addProductXmlShopBot();
182
- Mage::log('walked');
183
-
184
$dom = new DOMDocument('1.0');
185
$dom->preserveWhiteSpace = false;
186
$dom->formatOutput = true;
22
// Callback used by the Magento resource iterator walk() method. Adds a
23
// product ID to a static array and calls addProductXmlShopBot() to
24
// generate XML when the array reaches the batch size.
25
+ function addProductXmlCallbackShopBot($args) {
26
Fontis_Australia_Model_ShopBot_Cron::$accumulator[] = $args['row']['entity_id'];
27
28
$length = count(Fontis_Australia_Model_ShopBot_Cron::$accumulator);
33
34
// Runs a subprocesss to create feed XML for the product IDs in the static
35
// array, then empties the array.
36
+ function addProductXmlShopBot() {
37
$length = count(Fontis_Australia_Model_ShopBot_Cron::$accumulator);
38
if($length > 0) {
39
+ Mage::log("Fontis/Australia_Model_Shopbot_Cron: Processing product IDs " . Fontis_Australia_Model_ShopBot_Cron::$accumulator[0] .
40
" to " . Fontis_Australia_Model_ShopBot_Cron::$accumulator[$length - 1]);
41
$store_id = Fontis_Australia_Model_ShopBot_Cron::$store->getId();
42
43
+ $data = shell_exec("php " . Mage::getBaseDir() . "/app/code/community/Fontis/Australia/Model/Shopbot/Child.php " .
44
Mage::getBaseDir() . " '" . serialize(Fontis_Australia_Model_ShopBot_Cron::$accumulator) .
45
"' " . $store_id);
46
Fontis_Australia_Model_ShopBot_Cron::$accumulator = array();
60
}
61
}
62
if(!empty($codes)) {
63
+ Mage::log("Fontis/Australia_Model_Shopbot_Cron: Codes: ".implode(",", $codes));
64
}
65
} else {
66
+ Mage::log("Fontis/Australia_Model_Shopbot_Cron: Could not unserialize to array:");
67
Mage::log($data);
68
Mage::log($array);
69
}
70
+
71
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: ' . strlen($data) . " characters returned");
72
}
73
}
74
75
76
+ class Fontis_Australia_Model_ShopBot_Cron {
77
const BATCH_SIZE = 100;
78
79
public static $doc;
82
public static $accumulator;
83
public static $debugCount = 0;
84
85
+ protected function _construct() {
86
self::$accumulator = array();
87
}
88
89
+ protected function getPath() {
90
$path = "";
91
$config_path = Mage::getStoreConfig('fontis_feeds/shopbotfeed/output');
92
99
return str_replace('//', '/', $path);
100
}
101
102
+ public function nonstatic() {
103
+ self::update();
104
+ }
105
+
106
+ public static function update() {
107
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: Entered update function');
108
if (Mage::getStoreConfig('fontis_feeds/shopbotfeed/active')) {
109
$io = new Varien_Io_File();
110
$io->setAllowCreateFolders(true);
112
$io->open(array('path' => self::getPath()));
113
114
foreach(Mage::app()->getStores() as $store) {
115
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: Processing store: ' . $store->getName());
116
$clean_store_name = str_replace('+', '-', strtolower(urlencode($store->getName())));
117
118
+ Fontis_Australia_Model_ShopBot_Cron::$debugCount = 0;
119
+
120
// Write the entire products xml file:
121
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: Generating All Products XML File');
122
+ $products_result = self::getProductsXml($store);
123
+
124
$filename = $clean_store_name . '-products.xml';
125
$io->write($filename, $products_result['xml']);
126
+ Mage::log("Fontis/Australia_Model_Shopbot_Cron: Wrote " . Fontis_Australia_Model_ShopBot_Cron::$debugCount
127
. " records to " . self::getPath() . $filename);
128
}
129
130
$io->close();
131
+ } else {
132
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: Disabled');
133
}
134
}
135
136
+ public function getProductsXml($store) {
137
Fontis_Australia_Model_ShopBot_Cron::$store = $store;
138
139
$result = array();
143
$products->setStoreId($store);
144
$products->addStoreFilter();
145
$products->addAttributeToSelect('*');
146
+ $products->addAttributeToFilter('status', 1);
147
+ $products->addAttributeToFilter('visibility', 4);
148
149
$attributes_select_array = array('name', 'price', 'image', 'status');
150
$linkedAttributes = @unserialize(Mage::getStoreConfig('fontis_feeds/shopbotfeed/m_to_xml_attributes', $store->getId()));
151
+ if(!empty($linkedAttributes)) {
152
+ foreach($linkedAttributes as $la) {
153
if (strpos($la['magento'], 'FONTIS') === false) {
154
$attributes_select_array[] = $la['magento'];
155
}
158
Mage::log(var_export($attributes_select_array, true));
159
160
$products->addAttributeToSelect($attributes_select_array, 'left');
161
162
$storeUrl = $store->getBaseUrl();
163
$shopName = $store->getName();
167
self::$doc = new SimpleXMLElement('<store url="' . $storeUrl. '" date="'.$date.'" time="'.$time.'" name="' . $shopName . '"></store>');
168
self::$root_node = self::$doc->addChild('products');
169
170
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: Iterating: ' . $products->getSize() . ' products...');
171
Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array('addProductXmlCallbackShopBot'));
172
+
173
// call XML generation function one last time to process remaining batch
174
addProductXmlShopBot();
175
+ Mage::log('Fontis/Australia_Model_Shopbot_Cron: Iteration complete');
176
+
177
$dom = new DOMDocument('1.0');
178
$dom->preserveWhiteSpace = false;
179
$dom->formatOutput = true;
app/code/community/Fontis/Australia/etc/config.xml CHANGED
@@ -23,7 +23,7 @@
23
<config>
24
<modules>
25
<Fontis_Australia>
26
- <version>2.0.3</version>
27
<depends>
28
<Mage_Shipping />
29
<Mage_Payment />
@@ -232,16 +232,19 @@
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>
23
<config>
24
<modules>
25
<Fontis_Australia>
26
+ <version>2.0.7</version>
27
<depends>
28
<Mage_Shipping />
29
<Mage_Payment />
232
<getpricefeed>
233
<output>getprice-feeds</output>
234
<defaultcategory>Products</defaultcategory>
235
+ <include_all_products>1</include_all_products>
236
<currency>AUS</currency>
237
</getpricefeed>
238
<shopbotfeed>
239
<output>shopbot-feeds/</output>
240
<defaultcategory>Products</defaultcategory>
241
+ <include_all_products>1</include_all_products>
242
<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>
243
</shopbotfeed>
244
<myshopping>
245
<output>myshopping-feeds/</output>
246
<defaultcategory>Products</defaultcategory>
247
+ <include_all_products>1</include_all_products>
248
<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>
249
</myshopping>
250
</fontis_feeds>
app/code/community/Fontis/Australia/etc/system.xml CHANGED
@@ -746,10 +746,30 @@
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>
@@ -758,7 +778,7 @@
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>
@@ -768,7 +788,7 @@
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>
@@ -776,7 +796,7 @@
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>
@@ -800,10 +820,30 @@
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>
@@ -812,7 +852,7 @@
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>
@@ -847,10 +887,30 @@
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>
@@ -859,7 +919,7 @@
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>
746
<show_in_website>1</show_in_website>
747
<show_in_store>0</show_in_store>
748
</active>
749
+ <include_all_products translate="label">
750
+ <label>Include products by default</label>
751
+ <frontend_type>select</frontend_type>
752
+ <source_model>adminhtml/system_config_source_yesno</source_model>
753
+ <sort_order>2</sort_order>
754
+ <show_in_default>1</show_in_default>
755
+ <show_in_website>1</show_in_website>
756
+ <show_in_store>0</show_in_store>
757
+ <comment>If 'yes', products will be included by default and excluded if the override attribute resolves true for the product. If 'no', products will be excluded by default and only included if the override attribute resolves true for the product.</comment>
758
+ </include_all_products>
759
+ <custom_filter_attribute translate="label">
760
+ <label>Override individual products with attribute</label>
761
+ <frontend_type>select</frontend_type>
762
+ <source_model>australia/config_productAttributes</source_model>
763
+ <sort_order>3</sort_order>
764
+ <show_in_default>1</show_in_default>
765
+ <show_in_website>1</show_in_website>
766
+ <show_in_store>1</show_in_store>
767
+ <comment>Products with this selected attribute and where the attribute resolves to true for the product will be excluded from the feed if inclusion is set to default (see above option). Otherwise products will only be included if this attribute is available for the product and the attribute resolves to true when inclusion by default is turned off (see above option).</comment>
768
+ </custom_filter_attribute>
769
<output translate="label">
770
<label>Output Filename</label>
771
<frontend_type>text</frontend_type>
772
+ <sort_order>4</sort_order>
773
<show_in_default>1</show_in_default>
774
<show_in_website>1</show_in_website>
775
<show_in_store>1</show_in_store>
778
<defaultcategory translate="label">
779
<label>Default Category</label>
780
<frontend_type>text</frontend_type>
781
+ <sort_order>5</sort_order>
782
<show_in_default>1</show_in_default>
783
<show_in_website>1</show_in_website>
784
<show_in_store>1</show_in_store>
788
<label>Show Manufacturer</label>
789
<frontend_type>select</frontend_type>
790
<source_model>adminhtml/system_config_source_yesno</source_model>
791
+ <sort_order>6</sort_order>
792
<show_in_default>1</show_in_default>
793
<show_in_website>1</show_in_website>
794
<show_in_store>0</show_in_store>
796
<currency translate="label">
797
<label>Currency</label>
798
<frontend_type>text</frontend_type>
799
+ <sort_order>7</sort_order>
800
<show_in_default>1</show_in_default>
801
<show_in_website>1</show_in_website>
802
<show_in_store>0</show_in_store>
820
<show_in_website>1</show_in_website>
821
<show_in_store>0</show_in_store>
822
</active>
823
+ <include_all_products translate="label">
824
+ <label>Include products by default</label>
825
+ <frontend_type>select</frontend_type>
826
+ <source_model>adminhtml/system_config_source_yesno</source_model>
827
+ <sort_order>2</sort_order>
828
+ <show_in_default>1</show_in_default>
829
+ <show_in_website>1</show_in_website>
830
+ <show_in_store>0</show_in_store>
831
+ <comment>If 'yes', products will be included by default and excluded if the override attribute resolves true for the product. If 'no', products will be excluded by default and only included if the override attribute resolves true for the product.</comment>
832
+ </include_all_products>
833
+ <custom_filter_attribute translate="label">
834
+ <label>Override individual products with attribute</label>
835
+ <frontend_type>select</frontend_type>
836
+ <source_model>australia/config_productAttributes</source_model>
837
+ <sort_order>3</sort_order>
838
+ <show_in_default>1</show_in_default>
839
+ <show_in_website>1</show_in_website>
840
+ <show_in_store>1</show_in_store>
841
+ <comment>Products with this selected attribute and where the attribute resolves to true for the product will be excluded from the feed if inclusion is set to default (see above option). Otherwise products will only be included if this attribute is available for the product and the attribute resolves to true when inclusion by default is turned off (see above option).</comment>
842
+ </custom_filter_attribute>
843
<output translate="label">
844
<label>Output Path</label>
845
<frontend_type>text</frontend_type>
846
+ <sort_order>4</sort_order>
847
<show_in_default>1</show_in_default>
848
<show_in_website>1</show_in_website>
849
<show_in_store>1</show_in_store>
852
<defaultcategory translate="label">
853
<label>Default Category</label>
854
<frontend_type>text</frontend_type>
855
+ <sort_order>5</sort_order>
856
<show_in_default>1</show_in_default>
857
<show_in_website>1</show_in_website>
858
<show_in_store>1</show_in_store>
887
<show_in_website>1</show_in_website>
888
<show_in_store>0</show_in_store>
889
</active>
890
+ <include_all_products translate="label">
891
+ <label>Include products by default</label>
892
+ <frontend_type>select</frontend_type>
893
+ <source_model>adminhtml/system_config_source_yesno</source_model>
894
+ <sort_order>2</sort_order>
895
+ <show_in_default>1</show_in_default>
896
+ <show_in_website>1</show_in_website>
897
+ <show_in_store>0</show_in_store>
898
+ <comment>If 'yes', products will be included by default and excluded if the override attribute resolves true for the product. If 'no', products will be excluded by default and only included if the override attribute resolves true for the product.</comment>
899
+ </include_all_products>
900
+ <custom_filter_attribute translate="label">
901
+ <label>Override individual products with attribute</label>
902
+ <frontend_type>select</frontend_type>
903
+ <source_model>australia/config_productAttributes</source_model>
904
+ <sort_order>3</sort_order>
905
+ <show_in_default>1</show_in_default>
906
+ <show_in_website>1</show_in_website>
907
+ <show_in_store>1</show_in_store>
908
+ <comment>Products with this selected attribute and where the attribute resolves to true for the product will be excluded from the feed if inclusion is set to default (see above option). Otherwise products will only be included if this attribute is available for the product and the attribute resolves to true when inclusion by default is turned off (see above option).</comment>
909
+ </custom_filter_attribute>
910
<output translate="label">
911
<label>Output Path</label>
912
<frontend_type>text</frontend_type>
913
+ <sort_order>4</sort_order>
914
<show_in_default>1</show_in_default>
915
<show_in_website>1</show_in_website>
916
<show_in_store>1</show_in_store>
919
<defaultcategory translate="label">
920
<label>Default Category</label>
921
<frontend_type>text</frontend_type>
922
+ <sort_order>5</sort_order>
923
<show_in_default>1</show_in_default>
924
<show_in_website>1</show_in_website>
925
<show_in_store>1</show_in_store>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>Fontis_Australia</name>
4
- <version>2.0.4</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
<channel>community</channel>
@@ -10,9 +10,9 @@
10
<description>This extension is intended to provide most of the functionality needed to run a Magento store in Australia. This includes all essential payment and shipping methods as well as small localisations such as adding the store's ABN, adding Australian states and territories to the region directory and adding in a postcode database.</description>
11
<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). Also supports creating product information feeds for the Shopbot, Getprice and MyShopping services.</notes>
12
<authors><author><name>Chris Norton</name><user>auto-converted</user><email>chris.norton@fontis.com.au</email></author><author><name>Lloyd Hazlett</name><user>auto-converted</user><email>hazzard43@fastmail.fm</email></author><author><name>Fontis</name><user>auto-converted</user><email>magento@fontis.com.au</email></author></authors>
13
- <date>2010-04-16</date>
14
- <time>06:07:28</time>
15
- <contents><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="7245a655eac2513f8cd6c1a825586936"/><file name="info.phtml" hash="d4836cf6f5316b76b56ddefc48b67d94"/></dir><dir name="directdeposit"><file name="form.phtml" hash="0e5272781aa7c4d25c1c243fcf00487e"/><file name="info.phtml" hash="38112ef511c67c91a3f2ad43da7929da"/></dir></dir><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array_dropdown.phtml" hash="bdce71494213de5fe194873b5d0bed56"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="fontis_australia.xml" hash="d33f99fc5dfc156de09254e95a2c82eb"/></dir><dir name="template"><dir name="fontis"><dir name="australia"><dir name="payment"><dir name="bpay"><file name="form.phtml" hash="3895f9afa025444eb9a1cdc38582069d"/><file name="info.phtml" hash="47d1e0cc3ae676dff49990eba0ac4608"/><file name="success.phtml" hash="115a1710b1f3b0ef3ecf0b957651bb43"/></dir><dir name="directdeposit"><file name="form.phtml" hash="8cf9d09e42ba30206aabf01a3ec38239"/><file name="info.phtml" hash="8bc98b2fd1d1943f17d2831a67c97db3"/><file name="success.phtml" hash="0545f8c3c9d37a2045a20f442991e8d7"/></dir></dir><file name="postcode-checkout.phtml" hash="51867acd43c4f8c982ab1fea103a579f"/><file name="postcode.phtml" hash="b0d7bfa170c7ca3bd4a256f0404d7189"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Fontis"><dir name="Australia"><dir name="Block"><dir name="Bpay"><file name="Form.php" hash="958e11d14d7c87054a68d34b60c498d6"/><file name="Info.php" hash="a28f40be3c76637eb43ba80c61031512"/></dir><dir name="Directdeposit"><file name="Form.php" hash="13589d5d85499678bdc62fde04107095"/><file name="Info.php" hash="0f31ac7451127c87813c823423a9057b"/></dir><file name="Autocomplete.php" hash="4f33f809dae969781ead580b13e9bd3a"/><file name="Myshopping.php" hash="1e9b9149a867136f541b765d54ba402b"/><file name="Shopbot.php" hash="fca48ea13a60bdd1b207913f536bce45"/></dir><dir name="controllers"><file name="AjaxController.php" hash="5fb086e3236446b6a6f10f4c78eb3fcb"/></dir><dir name="etc"><file name="config.xml" hash="000d6232e765380bd90a0eecbdd64b21"/><file name="system.xml" hash="bfcebc05a66fb2d2c0b4f13ebae6fc7a"/></dir><dir name="Helper"><file name="Bpay.php" hash="a2565444f18b28e70c8d29f802297057"/><file name="Data.php" hash="e493486d7a5ccd5589d99d08b136b819"/></dir><dir name="Model"><dir name="Config"><file name="CustomerGroupAccess.php" hash="e531a8049b9a877e01c2b806b065dbef"/><file name="CustomerGroups.php" hash="8014e56b1141cb9bbb63f807ec1c87a5"/></dir><dir name="Getprice"><file name="Child.php" hash="8d2a0464526986a20a8fb6d66f5c393f"/><file name="Cron.php" hash="17cd541d978413c0626ea11b14cc7bc8"/></dir><dir name="Myshopping"><file name="Child.php" hash="ba5f6c81fe010ca629bea5de7e0a1a94"/><file name="Cron.php" hash="a7a7f5301cbc5d3768eb202c1148d540"/></dir><dir name="Mysql4"><dir name="Shipping"><dir name="Carrier"><dir name="Eparcel"><file name="Collection.php" hash="87f450c6b318060b83e7d7d0662cdf50"/></dir><file name="Eparcel.php" hash="9614eed4296b17a429db745c289d42cf"/></dir></dir></dir><dir name="Payment"><file name="Bpay.php" hash="b60d9a61b06b100164fff49fc5113f71"/><file name="Directdeposit.php" hash="c80ba74494bfeea040dc2bf942cec5f0"/></dir><dir name="Shipping"><dir name="Carrier"><file name="Australiapost.php" hash="bde64f52effdf89143cb8aacf631ddf9"/><file name="Eparcel.php" hash="b65cd938b27b4666e22b6833ca738226"/></dir><dir name="Config"><file name="Eparcel.php" hash="8c754cdc86316dbee53db68f0e2652bc"/><file name="Eparcelcondition.php" hash="b8cc830ab6e0e397d32bf574f60b0500"/><file name="Weightunits.php" hash="e13ba9de393ae67420f863d4008c3c72"/></dir></dir><dir name="Shopbot"><file name="Child.php" hash="0b5fd4a11a35d29abc50c9a243849bd4"/><file name="Cron.php" hash="385a356a0b8f30dba623e4b2f804e79c"/></dir></dir><dir name="sql"><dir name="australia_setup"><file name="mysql4-install-0.7.0.php" hash="f475b13bb5319599c4a852cfb8788f9a"/><file name="mysql4-upgrade-1.2.1-1.2.2.php" hash="9a381c07ec9ee53e2ffaa7ea7da4559d"/><file name="postcodes.txt" hash="21083a0f94e200259c9b4540666b251e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><dir name="fontis"><file name="bpay.png" hash="481c9ee07049203aca13d6d2c2948cf7"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fontis_Australia.xml" hash="a60b83cf1b1b449a16fe09da16342a4d"/></dir></target></contents>
16
<compatible/>
17
<dependencies/>
18
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>Fontis_Australia</name>
4
+ <version>2.0.7</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
<channel>community</channel>
10
<description>This extension is intended to provide most of the functionality needed to run a Magento store in Australia. This includes all essential payment and shipping methods as well as small localisations such as adding the store's ABN, adding Australian states and territories to the region directory and adding in a postcode database.</description>
11
<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). Also supports creating product information feeds for the Shopbot, Getprice and MyShopping services.</notes>
12
<authors><author><name>Chris Norton</name><user>auto-converted</user><email>chris.norton@fontis.com.au</email></author><author><name>Lloyd Hazlett</name><user>auto-converted</user><email>hazzard43@fastmail.fm</email></author><author><name>Fontis</name><user>auto-converted</user><email>magento@fontis.com.au</email></author></authors>
13
+ <date>2010-06-17</date>
14
+ <time>05:13:43</time>
15
+ <contents><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="7245a655eac2513f8cd6c1a825586936"/><file name="info.phtml" hash="d4836cf6f5316b76b56ddefc48b67d94"/></dir><dir name="directdeposit"><file name="form.phtml" hash="0e5272781aa7c4d25c1c243fcf00487e"/><file name="info.phtml" hash="38112ef511c67c91a3f2ad43da7929da"/></dir></dir><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array_dropdown.phtml" hash="bdce71494213de5fe194873b5d0bed56"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="fontis_australia.xml" hash="d33f99fc5dfc156de09254e95a2c82eb"/></dir><dir name="template"><dir name="fontis"><dir name="australia"><dir name="payment"><dir name="bpay"><file name="form.phtml" hash="3895f9afa025444eb9a1cdc38582069d"/><file name="info.phtml" hash="47d1e0cc3ae676dff49990eba0ac4608"/><file name="success.phtml" hash="115a1710b1f3b0ef3ecf0b957651bb43"/></dir><dir name="directdeposit"><file name="form.phtml" hash="8cf9d09e42ba30206aabf01a3ec38239"/><file name="info.phtml" hash="8bc98b2fd1d1943f17d2831a67c97db3"/><file name="success.phtml" hash="0545f8c3c9d37a2045a20f442991e8d7"/></dir></dir><file name="postcode-checkout.phtml" hash="51867acd43c4f8c982ab1fea103a579f"/><file name="postcode.phtml" hash="b0d7bfa170c7ca3bd4a256f0404d7189"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Fontis"><dir name="Australia"><dir name="Block"><dir name="Bpay"><file name="Form.php" hash="958e11d14d7c87054a68d34b60c498d6"/><file name="Info.php" hash="a28f40be3c76637eb43ba80c61031512"/></dir><dir name="Directdeposit"><file name="Form.php" hash="13589d5d85499678bdc62fde04107095"/><file name="Info.php" hash="0f31ac7451127c87813c823423a9057b"/></dir><file name="Autocomplete.php" hash="4f33f809dae969781ead580b13e9bd3a"/><file name="Myshopping.php" hash="1e9b9149a867136f541b765d54ba402b"/><file name="Shopbot.php" hash="fca48ea13a60bdd1b207913f536bce45"/></dir><dir name="controllers"><file name="AjaxController.php" hash="5fb086e3236446b6a6f10f4c78eb3fcb"/></dir><dir name="etc"><file name="config.xml" hash="e969b8612135e92ed71a3c99c4f8adf3"/><file name="system.xml" hash="66521865e3be5af17279967ffefe7874"/></dir><dir name="Helper"><file name="Bpay.php" hash="a2565444f18b28e70c8d29f802297057"/><file name="Data.php" hash="e493486d7a5ccd5589d99d08b136b819"/></dir><dir name="Model"><dir name="Config"><file name="CustomerGroupAccess.php" hash="e531a8049b9a877e01c2b806b065dbef"/><file name="CustomerGroups.php" hash="8014e56b1141cb9bbb63f807ec1c87a5"/><file name="ProductAttributes.php" hash="44f5a322c2c6c5e1ae7650a9633acd2c"/></dir><dir name="Getprice"><file name="Child.php" hash="dfabad93d15f2429737557edf129e5b6"/><file name="Cron.php" hash="b26abaacab672a4d23a030fdb3ad447c"/></dir><dir name="Myshopping"><file name="Child.php" hash="eed4b19b9461d31fa398804a6dd83b5b"/><file name="Cron.php" hash="8501d2489b5d6738f1eb3075bca3e7e3"/></dir><dir name="Mysql4"><dir name="Shipping"><dir name="Carrier"><dir name="Eparcel"><file name="Collection.php" hash="87f450c6b318060b83e7d7d0662cdf50"/></dir><file name="Eparcel.php" hash="9614eed4296b17a429db745c289d42cf"/></dir></dir></dir><dir name="Payment"><file name="Bpay.php" hash="b60d9a61b06b100164fff49fc5113f71"/><file name="Directdeposit.php" hash="c80ba74494bfeea040dc2bf942cec5f0"/></dir><dir name="Shipping"><dir name="Carrier"><file name="Australiapost.php" hash="30b8f63dda623d65e1505780c6b52737"/><file name="Eparcel.php" hash="b65cd938b27b4666e22b6833ca738226"/></dir><dir name="Config"><file name="Eparcel.php" hash="8c754cdc86316dbee53db68f0e2652bc"/><file name="Eparcelcondition.php" hash="b8cc830ab6e0e397d32bf574f60b0500"/><file name="Weightunits.php" hash="e13ba9de393ae67420f863d4008c3c72"/></dir></dir><dir name="Shopbot"><file name="Child.php" hash="121df42f2ea7cc7945a88227412438ca"/><file name="Cron.php" hash="d264199e5ba497465b5331d72fca5997"/></dir></dir><dir name="sql"><dir name="australia_setup"><file name="mysql4-install-0.7.0.php" hash="f475b13bb5319599c4a852cfb8788f9a"/><file name="mysql4-upgrade-1.2.1-1.2.2.php" hash="9a381c07ec9ee53e2ffaa7ea7da4559d"/><file name="postcodes.txt" hash="21083a0f94e200259c9b4540666b251e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><dir name="fontis"><file name="bpay.png" hash="481c9ee07049203aca13d6d2c2948cf7"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fontis_Australia.xml" hash="a60b83cf1b1b449a16fe09da16342a4d"/></dir></target></contents>
16
<compatible/>
17
<dependencies/>
18
</package>