Pepperjam_Network - Version 1.3.0.0

Version Notes

Changelog for 1.3.0.0
Added attribution
New option to report orders via feed instead of pixel
No longer including orders in correction feed if they were not part of a network transaction
Fixed "divide by zero" issue

Download this release

Release Info

Developer Philip Preston
Extension Pepperjam_Network
Version 1.3.0.0
Comparing to
See all releases


Code changes from version 1.2.2.0 to 1.3.0.0

Files changed (52) hide show
  1. app/code/community/Pepperjam/Network/Block/Adminhtml/System/Config/Form/Button.php +47 -47
  2. app/code/community/Pepperjam/Network/Block/Beacon.php +361 -332
  3. app/code/community/Pepperjam/Network/Block/Tracking.php +77 -45
  4. app/code/community/Pepperjam/Network/Exception/Configuration.php +20 -20
  5. app/code/community/Pepperjam/Network/Helper/Config.php +433 -301
  6. app/code/community/Pepperjam/Network/Helper/Data.php +218 -178
  7. app/code/community/Pepperjam/Network/Helper/Map.php +112 -112
  8. app/code/community/Pepperjam/Network/Helper/Map/Order.php +198 -172
  9. app/code/community/Pepperjam/Network/Helper/Map/Product.php +135 -135
  10. app/code/community/Pepperjam/Network/Model/Feed/Abstract.php +340 -335
  11. app/code/community/Pepperjam/Network/Model/Feed/Order/Abstract.php +189 -70
  12. app/code/community/Pepperjam/Network/Model/Feed/Order/Basic.php +42 -73
  13. app/code/community/Pepperjam/Network/Model/Feed/Order/Dynamic.php +40 -82
  14. app/code/community/Pepperjam/Network/Model/Feed/Order/Itemized.php +39 -80
  15. app/code/community/Pepperjam/Network/Model/Feed/Product.php +108 -96
  16. app/code/community/Pepperjam/Network/Model/Observer.php +123 -74
  17. app/code/community/Pepperjam/Network/Model/Product/Attribute/Source/CommissioningCategory.php +43 -43
  18. app/code/community/Pepperjam/Network/Model/System/Config/Source/Attributes.php +73 -73
  19. app/code/community/Pepperjam/Network/Model/System/Config/Source/Categories.php +35 -35
  20. app/code/community/Pepperjam/Network/Model/System/Config/Source/Ordertypes.php +39 -39
  21. app/code/community/Pepperjam/Network/Model/System/Config/Source/Stockquantity.php +35 -35
  22. app/code/community/Pepperjam/Network/Model/System/Config/Source/Stockyesno.php +35 -35
  23. app/code/community/Pepperjam/Network/Model/System/Config/Source/Trackingmethods.php +35 -0
  24. app/code/community/Pepperjam/Network/Model/System/Config/Source/Transactiontype.php +28 -28
  25. app/code/community/Pepperjam/Network/Model/System/Config/Source/Visibilityyesno.php +35 -35
  26. app/code/community/Pepperjam/Network/Test/Block/BeaconTest.php +253 -253
  27. app/code/community/Pepperjam/Network/Test/Block/providers/testShowBeacon.yaml +99 -99
  28. app/code/community/Pepperjam/Network/Test/Helper/DataTest.php +53 -53
  29. app/code/community/Pepperjam/Network/Test/Helper/Map/ProductTest.php +173 -173
  30. app/code/community/Pepperjam/Network/Test/Helper/providers/testIsValidCookie.yaml +12 -12
  31. app/code/community/Pepperjam/Network/Test/Model/Feed/AbstractTest.php +291 -291
  32. app/code/community/Pepperjam/Network/Test/Model/Feed/Order/AbstractTest.php +58 -58
  33. app/code/community/Pepperjam/Network/Test/Model/Feed/Order/BasicTest.php +38 -38
  34. app/code/community/Pepperjam/Network/Test/Model/Feed/Order/ItemizedTest.php +38 -38
  35. app/code/community/Pepperjam/Network/Test/Model/Feed/ProductTest.php +167 -167
  36. app/code/community/Pepperjam/Network/Test/Model/ObserverTest.php +61 -61
  37. app/code/community/Pepperjam/Network/controllers/Adminhtml/PepperjamNetworkController.php +99 -100
  38. app/code/community/Pepperjam/Network/etc/adminhtml.xml +37 -37
  39. app/code/community/Pepperjam/Network/etc/config.xml +1111 -1041
  40. app/code/community/Pepperjam/Network/etc/system.xml +985 -950
  41. app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/install-1.0.0.1.php +23 -23
  42. app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-data-upgrade-1.2.1.0-1.2.2.0.php +116 -116
  43. app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-data-upgrade-1.2.2.0-1.3.0.0.php +26 -0
  44. app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-install-1.0.0.1.php +23 -23
  45. app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-upgrade-1.0.0.1-1.2.0.0.php +52 -52
  46. app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-upgrade-1.2.99.99-1.3.0.0.php +47 -0
  47. app/design/adminhtml/default/default/template/pepperjam_network/system/config/button.phtml +32 -32
  48. app/design/frontend/base/default/layout/pepperjam_network.xml +35 -35
  49. app/design/frontend/base/default/template/pepperjam_network/beacon.phtml +34 -34
  50. app/design/frontend/base/default/template/pepperjam_network/tracking.phtml +104 -98
  51. app/etc/modules/Pepperjam_Network.xml +23 -23
  52. package.xml +13 -11
app/code/community/Pepperjam/Network/Block/Adminhtml/System/Config/Form/Button.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- class Pepperjam_Network_Block_Adminhtml_System_Config_Form_Button extends Mage_Adminhtml_Block_System_Config_Form_Field
19
- {
20
- protected function _construct()
21
- {
22
- parent::_construct();
23
- $this->setTemplate('pepperjam_network/system/config/button.phtml');
24
- }
25
-
26
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
27
- {
28
- return $this->_toHtml();
29
- }
30
-
31
- public function getAjaxUninstallUrl()
32
- {
33
- return Mage::helper('adminhtml')->getUrl('adminhtml/pepperjamNetwork/uninstall');
34
- }
35
-
36
- public function getButtonHtml()
37
- {
38
- $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(
39
- array(
40
- 'id' => 'pepperjam_network_uninstall',
41
- 'label' => $this->helper('adminhtml')->__('Uninstall'),
42
- 'onclick' => 'javascript:uninstall(); return false;',
43
- ));
44
-
45
- return $button->toHtml();
46
- }
47
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ class Pepperjam_Network_Block_Adminhtml_System_Config_Form_Button extends Mage_Adminhtml_Block_System_Config_Form_Field
19
+ {
20
+ protected function _construct()
21
+ {
22
+ parent::_construct();
23
+ $this->setTemplate('pepperjam_network/system/config/button.phtml');
24
+ }
25
+
26
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
27
+ {
28
+ return $this->_toHtml();
29
+ }
30
+
31
+ public function getAjaxUninstallUrl()
32
+ {
33
+ return Mage::helper('adminhtml')->getUrl('adminhtml/pepperjamNetwork/uninstall');
34
+ }
35
+
36
+ public function getButtonHtml()
37
+ {
38
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(
39
+ array(
40
+ 'id' => 'pepperjam_network_uninstall',
41
+ 'label' => $this->helper('adminhtml')->__('Uninstall'),
42
+ 'onclick' => 'javascript:uninstall(); return false;',
43
+ ));
44
+
45
+ return $button->toHtml();
46
+ }
47
+ }
app/code/community/Pepperjam/Network/Block/Beacon.php CHANGED
@@ -1,332 +1,361 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- class Pepperjam_Network_Block_Beacon extends Mage_Core_Block_Template
19
- {
20
- /**
21
- * The 'PID' beacon URL querystring key
22
- */
23
- const KEY_PID = 'PID';
24
-
25
- /**
26
- * The 'OID' beacon URL querystring key
27
- */
28
- const KEY_OID = 'OID';
29
-
30
- /**
31
- * The 'AMOUNT' beacon URL querystring key
32
- */
33
- const KEY_AMOUNT = 'AMOUNT';
34
-
35
- /**
36
- * The 'TYPE' beacon URL querystring key
37
- */
38
- const KEY_TYPE = 'TYPE';
39
-
40
- /**
41
- * The 'QTY' beacon URL querystring key
42
- */
43
- const KEY_QTY = 'QTY';
44
-
45
- /**
46
- * The 'TOTALAMOUNT' beacon URL querystring key
47
- */
48
- const KEY_TOTALAMOUNT = 'TOTALAMOUNT';
49
-
50
- /**
51
- * The 'INT' beacon URL querystring key
52
- */
53
- const KEY_INT = 'INT';
54
-
55
- /**
56
- * The 'ITEM' beacon URL querystring key
57
- */
58
- const KEY_ITEM = 'ITEM';
59
-
60
- /**
61
- * The 'PROMOCODE' beacon URL querystring key
62
- */
63
- const KEY_PROMOCODE = 'PROMOCODE';
64
-
65
- /**
66
- * Dynamic query keys
67
- */
68
- const KEY_DYNAMIC_PROGRAM_ID = 'PROGRAM_ID';
69
- const KEY_DYNAMIC_ORDER_ID = 'ORDER_ID';
70
- const KEY_DYNAMIC_ITEM_ID = 'ITEM_ID';
71
- const KEY_DYNAMIC_ITEM_PRICE = 'ITEM_PRICE';
72
- const KEY_DYNAMIC_QUANTITY = 'QUANTITY';
73
- const KEY_DYNAMIC_CATEGORY = 'CATEGORY';
74
- const KEY_DYNAMIC_NEW_TO_FILE = 'NEW_TO_FILE';
75
- const KEY_DYNAMIC_COUPON = 'COUPON';
76
-
77
- /**
78
- * @var Mage_Sales_Model_Order
79
- * @see self::_getOrder
80
- */
81
- protected $_order;
82
-
83
- /** @var Pepperjam_Network_Helper_Data */
84
- protected $_helper = null;
85
-
86
- /** @var Pepperjam_Network_Helper_Config */
87
- protected $_configHelper = null;
88
-
89
- /**
90
- * @return Pepperjam_Network_Helper_Data
91
- */
92
- protected function _getHelper()
93
- {
94
- if (!$this->_helper) {
95
- $this->_helper = Mage::helper('pepperjam_network');
96
- }
97
-
98
- return $this->_helper;
99
- }
100
-
101
- /**
102
- * @return Pepperjam_Network_Helper_Config
103
- */
104
- protected function _getConfigHelper()
105
- {
106
- if (!$this->_configHelper) {
107
- $this->_configHelper = Mage::helper('pepperjam_network/config');
108
- }
109
-
110
- return $this->_configHelper;
111
- }
112
-
113
- /**
114
- * Get the last order.
115
- * @return Mage_Sales_Model_Order | null
116
- */
117
- protected function _getOrder()
118
- {
119
- if (!($this->_order instanceof Mage_Sales_Model_Order)) {
120
- $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
121
- if ($orderId) {
122
- $this->_order = Mage::getModel('sales/order')->load($orderId);
123
- }
124
- }
125
- return $this->_order;
126
- }
127
-
128
- /**
129
- * Get the beacon URL.
130
- * @return string | null
131
- */
132
- public function getBeaconUrl()
133
- {
134
- $order = $this->_getOrder();
135
-
136
- $url = null;
137
-
138
- if ($order instanceof Mage_Sales_Model_Order) {
139
- if (Mage::helper('pepperjam_network/config')->isItemizedOrders()) {
140
- $params = $this->_buildItemizedParams($order);
141
- } elseif (Mage::helper('pepperjam_network/config')->isDynamicOrders()) {
142
- $params = $this->_buildDynamicParams($order);
143
- } else {
144
- $params = $this->_buildBasicParams($order);
145
- }
146
-
147
- $url = Mage::helper('pepperjam_network')->buildBeaconUrl($params);
148
- }
149
- return $url;
150
- }
151
-
152
- /**
153
- * build common params array
154
- * @param Mage_Sales_Model_Order $order
155
- * @return array
156
- */
157
- protected function _buildCommonParams(Mage_Sales_Model_Order $order)
158
- {
159
- $params = array(
160
- static::KEY_PID => Mage::helper('pepperjam_network/config')->getProgramId(),
161
- static::KEY_OID => $order->getIncrementId(),
162
- );
163
- $couponCode = trim($order->getCouponCode());
164
- return ($couponCode !== '')?
165
- array_merge($params, array(static::KEY_PROMOCODE => $couponCode)) : $params;
166
- }
167
-
168
- /**
169
- * build basic params array for non itemized beacon URL
170
- * @param Mage_Sales_Model_Order $order
171
- * @return array
172
- */
173
- protected function _buildBasicParams(Mage_Sales_Model_Order $order)
174
- {
175
- $params = $this->_buildCommonParams($order);
176
- $params[static::KEY_AMOUNT] = number_format($order->getSubtotal() + $order->getDiscountAmount() + $order->getShippingDiscountAmount(), 2, '.', '');
177
- $params[static::KEY_TYPE] = Mage::helper('pepperjam_network/config')->getTransactionType();
178
-
179
- return $params;
180
- }
181
-
182
- /**
183
- * build itemized order params array for itemized beacon URL
184
- * @param Mage_Sales_Model_Order $order
185
- * @return array
186
- */
187
- protected function _buildItemizedParams(Mage_Sales_Model_Order $order)
188
- {
189
- $params = $this->_buildCommonParams($order);
190
- $params[static::KEY_INT] = Mage::helper('pepperjam_network/config')->getInt();
191
- $increment = 1; // incrementer for the unique item keys
192
- foreach ($order->getAllItems() as $item) {
193
- // need to ignore the bundle parent as it will contain collected total
194
- // for children but not discounts
195
- $position = $this->_getDupePosition($params, $item);
196
- // ignore the parent configurable quantity - quantity of config products
197
- // will come from the simple used product with the same SKU
198
- $quantity = $item->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE ?
199
- 0 : (int) $item->getQtyOrdered();
200
- // consider parent bundle products to be 0.00 total (if the pricing is dynamic)
201
- // total of the bundleis the sum of all child products which are also included
202
- // in the beacon so including both totals would effectively double the price of
203
- // the bundle
204
- //
205
- // Divide discount amount by quantity to get per item discount
206
- $total = $item->getPrice() - ($item->getDiscountAmount() / $item->getQtyOrdered());
207
- if ($item->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE && $item->getProduct()->getPriceType() == Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC) {
208
- $total = 0.00;
209
- }
210
-
211
- if ($position) {
212
- // we detected that the current item already exist in the params array
213
- // and have the key increment position let's simply adjust
214
- // the qty and total amount
215
- $params[static::KEY_QTY . $position] += $quantity;
216
- $amtKey = static::KEY_AMOUNT . $position;
217
- $params[$amtKey] = number_format($params[$amtKey] + $total, 2, '.', '');
218
- } else {
219
- $params = array_merge($params, array(
220
- static::KEY_ITEM . $increment => $item->getSku(),
221
- static::KEY_QTY . $increment => $quantity,
222
- static::KEY_AMOUNT . $increment => number_format($total, 2, '.', ''),
223
- ));
224
- $increment++; // only get incremented when a unique key have been appended
225
- }
226
- }
227
- return $params;
228
- }
229
-
230
- /**
231
- * build dynamic order params array for dynamic beacon URL
232
- * @param Mage_Sales_Model_Order $order
233
- * @return array
234
- */
235
- protected function _buildDynamicParams(Mage_Sales_Model_Order $order)
236
- {
237
- $helper = Mage::helper('pepperjam_network');
238
-
239
- $params = $this->_buildItemizedParams($order);
240
-
241
- // Swap query key names for dynamic versions
242
- $params[self::KEY_DYNAMIC_PROGRAM_ID] = $params[self::KEY_PID];
243
- $params[self::KEY_DYNAMIC_ORDER_ID] = $params[self::KEY_OID];
244
- unset($params[self::KEY_PID]);
245
- unset($params[self::KEY_OID]);
246
- if (isset($params[self::KEY_PROMOCODE])) {
247
- $params[self::KEY_DYNAMIC_COUPON] = $params[self::KEY_PROMOCODE];
248
- unset($params[self::KEY_PROMOCODE]);
249
- }
250
-
251
- // See if email has any history
252
- $params[self::KEY_DYNAMIC_NEW_TO_FILE] = (int)$helper->isNewToFile($order);
253
-
254
- $productIds = array();
255
- foreach($order->getAllItems() as $item) {
256
- $productIds[] = $item->getProduct()->getId();
257
- }
258
-
259
- $productCollection = Mage::getModel('catalog/product')->getCollection()
260
- ->addAttributeToFilter('entity_id', array('in', $productIds))
261
- ->addCategoryIds();
262
-
263
- // No need for increment, all items are in param already
264
- $lastPosition = 0;
265
- foreach($order->getAllItems() as $item) {
266
- // Every item should be found here
267
- $position = $this->_getDupePosition($params, $item);
268
-
269
- // Add category IDs
270
- $product = $productCollection->getItemById($item->getProduct()->getId());
271
- $item->getProduct()->setCategoryIds($product->getCategoryIds());
272
-
273
- // Get item's category
274
- $params[self::KEY_DYNAMIC_CATEGORY . $position] = $helper->getCommissioningCategory($item);
275
-
276
- // Update last position
277
- $lastPosition = max($lastPosition, $position);
278
- }
279
-
280
- // Swap key names for dynamic versions
281
- for($position = 1; $position <= $lastPosition; $position += 1) {
282
- // Replace query string keys
283
- $params[self::KEY_DYNAMIC_ITEM_ID . $position] = $params[self::KEY_ITEM . $position];
284
- $params[self::KEY_DYNAMIC_ITEM_PRICE . $position] = $params[self::KEY_AMOUNT . $position];
285
- $params[self::KEY_DYNAMIC_QUANTITY . $position] = $params[self::KEY_QTY . $position];
286
- unset($params[self::KEY_ITEM . $position]);
287
- unset($params[self::KEY_AMOUNT . $position]);
288
- unset($params[self::KEY_QTY . $position]);
289
- }
290
-
291
- return $params;
292
- }
293
-
294
- /**
295
- * check if the current sku already exists in the params data if so return
296
- * the position it is found in
297
- * @param array $params the given array of keys needed to build the beacon URL querystring
298
- * @param Mage_Sales_Model_Order_Item $item
299
- * @return int the item position where dupe found otherwise zero
300
- */
301
- protected function _getDupePosition(array $params, Mage_Sales_Model_Order_Item $item)
302
- {
303
- $key = array_search($item->getSku(), $params, true);
304
- return ($key !== false)?
305
- (int) str_replace(static::KEY_ITEM, '', $key) : 0;
306
- }
307
-
308
- /**
309
- * Whether or not to display the beacon.
310
- *
311
- * Show the pixel only if tracking is enabled and we have a valid order
312
- * AND either conditional pixel logic is OFF or it is ON and we have
313
- * a valid cookie.
314
- *
315
- * @return bool
316
- */
317
- public function showBeacon()
318
- {
319
- $config = $this->_getConfigHelper();
320
-
321
- return (
322
- (
323
- $config->isEnabled() &&
324
- $this->_getOrder() instanceof Mage_Sales_Model_Order
325
- ) &&
326
- (
327
- $this->_getHelper()->isValidCookie() ||
328
- !$config->isConditionalPixelEnabled()
329
- )
330
- );
331
- }
332
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ class Pepperjam_Network_Block_Beacon extends Mage_Core_Block_Template
19
+ {
20
+ /**
21
+ * The 'PID' beacon URL querystring key
22
+ */
23
+ const KEY_PID = 'PID';
24
+
25
+ /**
26
+ * The 'OID' beacon URL querystring key
27
+ */
28
+ const KEY_OID = 'OID';
29
+
30
+ /**
31
+ * The 'AMOUNT' beacon URL querystring key
32
+ */
33
+ const KEY_AMOUNT = 'AMOUNT';
34
+
35
+ /**
36
+ * The 'TYPE' beacon URL querystring key
37
+ */
38
+ const KEY_TYPE = 'TYPE';
39
+
40
+ /**
41
+ * The 'QTY' beacon URL querystring key
42
+ */
43
+ const KEY_QTY = 'QTY';
44
+
45
+ /**
46
+ * The 'TOTALAMOUNT' beacon URL querystring key
47
+ */
48
+ const KEY_TOTALAMOUNT = 'TOTALAMOUNT';
49
+
50
+ /**
51
+ * The 'INT' beacon URL querystring key
52
+ */
53
+ const KEY_INT = 'INT';
54
+
55
+ /**
56
+ * The 'ITEM' beacon URL querystring key
57
+ */
58
+ const KEY_ITEM = 'ITEM';
59
+
60
+ /**
61
+ * The 'PROMOCODE' beacon URL querystring key
62
+ */
63
+ const KEY_PROMOCODE = 'PROMOCODE';
64
+
65
+ /**
66
+ * Dynamic query keys
67
+ */
68
+ const KEY_DYNAMIC_PROGRAM_ID = 'PROGRAM_ID';
69
+ const KEY_DYNAMIC_ORDER_ID = 'ORDER_ID';
70
+ const KEY_DYNAMIC_ITEM_ID = 'ITEM_ID';
71
+ const KEY_DYNAMIC_ITEM_PRICE = 'ITEM_PRICE';
72
+ const KEY_DYNAMIC_QUANTITY = 'QUANTITY';
73
+ const KEY_DYNAMIC_CATEGORY = 'CATEGORY';
74
+ const KEY_DYNAMIC_NEW_TO_FILE = 'NEW_TO_FILE';
75
+ const KEY_DYNAMIC_COUPON = 'COUPON';
76
+
77
+ /**
78
+ * @var Mage_Sales_Model_Order
79
+ * @see self::_getOrder
80
+ */
81
+ protected $_order;
82
+
83
+ /** @var Pepperjam_Network_Helper_Data */
84
+ protected $_helper = null;
85
+
86
+ /** @var Pepperjam_Network_Helper_Config */
87
+ protected $_configHelper = null;
88
+
89
+ protected function _construct()
90
+ {
91
+ $helper = Mage::helper('pepperjam_network');
92
+
93
+ if ($helper->isValidCookie()) {
94
+ $helper = $this->_getHelper();
95
+ $order = $this->_getOrder();
96
+
97
+ $order->setNetworkSource($helper->getCookieValue($helper->getSourceCookieName()));
98
+ $order->setNetworkClickId($helper->getCookieValue($helper->getClickCookieName()));
99
+ $order->setNetworkPublisherId($helper->getCookieValue($helper->getPublisherCookieName()));
100
+
101
+ $order->save();
102
+ }
103
+ }
104
+
105
+ /**
106
+ * @return Pepperjam_Network_Helper_Data
107
+ */
108
+ protected function _getHelper()
109
+ {
110
+ if (!$this->_helper) {
111
+ $this->_helper = Mage::helper('pepperjam_network');
112
+ }
113
+
114
+ return $this->_helper;
115
+ }
116
+
117
+ /**
118
+ * @return Pepperjam_Network_Helper_Config
119
+ */
120
+ protected function _getConfigHelper()
121
+ {
122
+ if (!$this->_configHelper) {
123
+ $this->_configHelper = Mage::helper('pepperjam_network/config');
124
+ }
125
+
126
+ return $this->_configHelper;
127
+ }
128
+
129
+ /**
130
+ * Get the last order.
131
+ * @return Mage_Sales_Model_Order | null
132
+ */
133
+ protected function _getOrder()
134
+ {
135
+ if (!($this->_order instanceof Mage_Sales_Model_Order)) {
136
+ $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
137
+ if ($orderId) {
138
+ $this->_order = Mage::getModel('sales/order')->load($orderId);
139
+ }
140
+ }
141
+ return $this->_order;
142
+ }
143
+
144
+ /**
145
+ * Get the beacon URL.
146
+ * @return string | null
147
+ */
148
+ public function getBeaconUrl()
149
+ {
150
+ $order = $this->_getOrder();
151
+
152
+ $url = null;
153
+
154
+ if ($order instanceof Mage_Sales_Model_Order) {
155
+ if (Mage::helper('pepperjam_network/config')->isItemizedOrders()) {
156
+ $params = $this->_buildItemizedParams($order);
157
+ } elseif (Mage::helper('pepperjam_network/config')->isDynamicOrders()) {
158
+ $params = $this->_buildDynamicParams($order);
159
+ } else {
160
+ $params = $this->_buildBasicParams($order);
161
+ }
162
+
163
+ $url = Mage::helper('pepperjam_network')->buildBeaconUrl($params);
164
+ }
165
+ return $url;
166
+ }
167
+
168
+ /**
169
+ * build common params array
170
+ * @param Mage_Sales_Model_Order $order
171
+ * @return array
172
+ */
173
+ protected function _buildCommonParams(Mage_Sales_Model_Order $order)
174
+ {
175
+ $params = array(
176
+ static::KEY_PID => Mage::helper('pepperjam_network/config')->getProgramId(),
177
+ static::KEY_OID => $order->getIncrementId(),
178
+ );
179
+ $couponCode = trim($order->getCouponCode());
180
+ return ($couponCode !== '')?
181
+ array_merge($params, array(static::KEY_PROMOCODE => $couponCode)) : $params;
182
+ }
183
+
184
+ /**
185
+ * build basic params array for non itemized beacon URL
186
+ * @param Mage_Sales_Model_Order $order
187
+ * @return array
188
+ */
189
+ protected function _buildBasicParams(Mage_Sales_Model_Order $order)
190
+ {
191
+ $params = $this->_buildCommonParams($order);
192
+ $params[static::KEY_AMOUNT] = number_format($order->getSubtotal() + $order->getDiscountAmount() + $order->getShippingDiscountAmount(), 2, '.', '');
193
+ $params[static::KEY_TYPE] = Mage::helper('pepperjam_network/config')->getTransactionType();
194
+
195
+ return $params;
196
+ }
197
+
198
+ /**
199
+ * build itemized order params array for itemized beacon URL
200
+ * @param Mage_Sales_Model_Order $order
201
+ * @return array
202
+ */
203
+ protected function _buildItemizedParams(Mage_Sales_Model_Order $order)
204
+ {
205
+ $params = $this->_buildCommonParams($order);
206
+ $params[static::KEY_INT] = Mage::helper('pepperjam_network/config')->getInt();
207
+ $increment = 1; // incrementer for the unique item keys
208
+ foreach ($order->getAllItems() as $item) {
209
+ // need to ignore the bundle parent as it will contain collected total
210
+ // for children but not discounts
211
+ $position = $this->_getDupePosition($params, $item);
212
+ // ignore the parent configurable quantity - quantity of config products
213
+ // will come from the simple used product with the same SKU
214
+ $quantity = $item->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE ?
215
+ 0 : (int) $item->getQtyOrdered();
216
+ // consider parent bundle products to be 0.00 total (if the pricing is dynamic)
217
+ // total of the bundleis the sum of all child products which are also included
218
+ // in the beacon so including both totals would effectively double the price of
219
+ // the bundle
220
+ //
221
+ // Divide discount amount by quantity to get per item discount
222
+ $total = $item->getRowTotal() - $item->getDiscountAmount();
223
+ if ($item->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE && $item->getProduct()->getPriceType() == Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC) {
224
+ $total = 0.00;
225
+ }
226
+
227
+ if ($position) {
228
+ // we detected that the current item already exist in the params array
229
+ // and have the key increment position let's simply adjust
230
+ // the qty and total amount
231
+
232
+ $params[static::KEY_QTY . $position] += $quantity;
233
+ $params[static::KEY_AMOUNT . $position] += $total;
234
+ } else {
235
+ $params = array_merge($params, array(
236
+ static::KEY_ITEM . $increment => $item->getSku(),
237
+ static::KEY_QTY . $increment => $quantity,
238
+ static::KEY_AMOUNT . $increment => $total,
239
+ ));
240
+ $increment++; // only get incremented when a unique key have been appended
241
+ }
242
+ }
243
+
244
+ // Calculate average cost
245
+ for ($i = 1; $i < $increment; $i++) {
246
+ $itemTotal = $params[static::KEY_AMOUNT . $i];
247
+ $itemQuantity = $params[static::KEY_QTY . $i];
248
+ $averageAmount = 0;
249
+ if ($itemQuantity > 0 ) $averageAmount = $itemTotal/$itemQuantity;
250
+
251
+ $params[static::KEY_AMOUNT . $i] = number_format($averageAmount, 2, '.', '');
252
+ }
253
+
254
+
255
+ return $params;
256
+ }
257
+
258
+ /**
259
+ * build dynamic order params array for dynamic beacon URL
260
+ * @param Mage_Sales_Model_Order $order
261
+ * @return array
262
+ */
263
+ protected function _buildDynamicParams(Mage_Sales_Model_Order $order)
264
+ {
265
+ $helper = Mage::helper('pepperjam_network');
266
+
267
+ $params = $this->_buildItemizedParams($order);
268
+
269
+ // Swap query key names for dynamic versions
270
+ $params[self::KEY_DYNAMIC_PROGRAM_ID] = $params[self::KEY_PID];
271
+ $params[self::KEY_DYNAMIC_ORDER_ID] = $params[self::KEY_OID];
272
+ unset($params[self::KEY_PID]);
273
+ unset($params[self::KEY_OID]);
274
+ if (isset($params[self::KEY_PROMOCODE])) {
275
+ $params[self::KEY_DYNAMIC_COUPON] = $params[self::KEY_PROMOCODE];
276
+ unset($params[self::KEY_PROMOCODE]);
277
+ }
278
+
279
+ // See if email has any history
280
+ $params[self::KEY_DYNAMIC_NEW_TO_FILE] = (int)$helper->isNewToFile($order);
281
+
282
+ $productIds = array();
283
+ foreach($order->getAllItems() as $item) {
284
+ $productIds[] = $item->getProduct()->getId();
285
+ }
286
+
287
+ $productCollection = Mage::getModel('catalog/product')->getCollection()
288
+ ->addAttributeToFilter('entity_id', array('in', $productIds))
289
+ ->addCategoryIds();
290
+
291
+ // No need for increment, all items are in param already
292
+ $lastPosition = 0;
293
+ foreach($order->getAllItems() as $item) {
294
+ // Every item should be found here
295
+ $position = $this->_getDupePosition($params, $item);
296
+
297
+ // Add category IDs
298
+ $product = $productCollection->getItemById($item->getProduct()->getId());
299
+ $item->getProduct()->setCategoryIds($product->getCategoryIds());
300
+
301
+ // Get item's category
302
+ $params[self::KEY_DYNAMIC_CATEGORY . $position] = $helper->getCommissioningCategory($item);
303
+
304
+ // Update last position
305
+ $lastPosition = max($lastPosition, $position);
306
+ }
307
+
308
+ // Swap key names for dynamic versions
309
+ for($position = 1; $position <= $lastPosition; $position += 1) {
310
+ // Replace query string keys
311
+ $params[self::KEY_DYNAMIC_ITEM_ID . $position] = $params[self::KEY_ITEM . $position];
312
+ $params[self::KEY_DYNAMIC_ITEM_PRICE . $position] = $params[self::KEY_AMOUNT . $position];
313
+ $params[self::KEY_DYNAMIC_QUANTITY . $position] = $params[self::KEY_QTY . $position];
314
+ unset($params[self::KEY_ITEM . $position]);
315
+ unset($params[self::KEY_AMOUNT . $position]);
316
+ unset($params[self::KEY_QTY . $position]);
317
+ }
318
+
319
+ return $params;
320
+ }
321
+
322
+ /**
323
+ * check if the current sku already exists in the params data if so return
324
+ * the position it is found in
325
+ * @param array $params the given array of keys needed to build the beacon URL querystring
326
+ * @param Mage_Sales_Model_Order_Item $item
327
+ * @return int the item position where dupe found otherwise zero
328
+ */
329
+ protected function _getDupePosition(array $params, Mage_Sales_Model_Order_Item $item)
330
+ {
331
+ $key = array_search($item->getSku(), $params, true);
332
+ return ($key !== false)?
333
+ (int) str_replace(static::KEY_ITEM, '', $key) : 0;
334
+ }
335
+
336
+ /**
337
+ * Whether or not to display the beacon.
338
+ *
339
+ * Show the pixel only if tracking is enabled and we have a valid order
340
+ * AND either conditional pixel logic is OFF or it is ON and we have
341
+ * a valid cookie.
342
+ *
343
+ * @return bool
344
+ */
345
+ public function showBeacon()
346
+ {
347
+ $config = $this->_getConfigHelper();
348
+
349
+ return (
350
+ $config->trackByPixel() &&
351
+ (
352
+ $config->isEnabled() &&
353
+ $this->_getOrder() instanceof Mage_Sales_Model_Order
354
+ ) &&
355
+ (
356
+ $this->_getHelper()->isValidCookie() ||
357
+ !$config->isConditionalPixelEnabled()
358
+ )
359
+ );
360
+ }
361
+ }
app/code/community/Pepperjam/Network/Block/Tracking.php CHANGED
@@ -1,45 +1,77 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- class Pepperjam_Network_Block_Tracking extends Mage_Core_Block_Template
19
- {
20
- /**
21
- * @return string | null
22
- */
23
- public function getCookieName()
24
- {
25
- return Mage::helper('pepperjam_network')->getSourceCookieName();
26
- }
27
-
28
- /**
29
- * @return string | null
30
- */
31
- public function getQueryStringKeyName()
32
- {
33
- return Mage::helper('pepperjam_network/config')->getSourceKeyName();
34
- }
35
-
36
- /**
37
- * Whether or not to inject the javascript to set the tracking cookie
38
- *
39
- * @return bool
40
- */
41
- public function injectJavaScript()
42
- {
43
- return (Mage::helper('pepperjam_network/config')->isConditionalPixelEnabled());
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ class Pepperjam_Network_Block_Tracking extends Mage_Core_Block_Template
19
+ {
20
+ /**
21
+ * @return string | null
22
+ */
23
+ public function getSourceCookieName()
24
+ {
25
+ return Mage::helper('pepperjam_network')->getSourceCookieName();
26
+ }
27
+
28
+ /**
29
+ * @return string | null
30
+ */
31
+ public function getSourceKeyName()
32
+ {
33
+ return Mage::helper('pepperjam_network/config')->getSourceKeyName();
34
+ }
35
+
36
+ /**
37
+ * @return string | null
38
+ */
39
+ public function getClickCookieName()
40
+ {
41
+ return Mage::helper('pepperjam_network')->getClickCookieName();
42
+ }
43
+
44
+ /**
45
+ * @return string | null
46
+ */
47
+ public function getClickKeyName()
48
+ {
49
+ return Mage::helper('pepperjam_network/config')->getClickKeyName();
50
+ }
51
+
52
+ /**
53
+ * @return string | null
54
+ */
55
+ public function getPublisherCookieName()
56
+ {
57
+ return Mage::helper('pepperjam_network')->getPublisherCookieName();
58
+ }
59
+
60
+ /**
61
+ * @return string | null
62
+ */
63
+ public function getPublisherKeyName()
64
+ {
65
+ return Mage::helper('pepperjam_network/config')->getPublisherKeyName();
66
+ }
67
+
68
+ /**
69
+ * Whether or not to inject the javascript to set the tracking cookie
70
+ *
71
+ * @return bool
72
+ */
73
+ public function injectJavaScript()
74
+ {
75
+ return (Mage::helper('pepperjam_network/config')->isAttributionEnabled());
76
+ }
77
+ }
app/code/community/Pepperjam/Network/Exception/Configuration.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- class Pepperjam_Network_Exception_Configuration extends Mage_Core_Exception
19
- {
20
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ class Pepperjam_Network_Exception_Configuration extends Mage_Core_Exception
19
+ {
20
+ }
app/code/community/Pepperjam/Network/Helper/Config.php CHANGED
@@ -1,301 +1,433 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- /**
19
- * @codeCoverageIgnore
20
- */
21
- class Pepperjam_Network_Helper_Config
22
- {
23
- const BEACON_URL_PATH = 'pepperjam/pepperjam_network/beacon_url';
24
- const ENABLED_PATH = 'pepperjam/pepperjam_network/active';
25
- const ORDER_TYPE_PATH = 'pepperjam/pepperjam_network/order_type';
26
- const PROGRAM_ID_PATH = 'pepperjam/pepperjam_network/program_id';
27
- const TRANSACTION_TYPE_PATH = 'pepperjam/pepperjam_network/transaction_type';
28
- const EXPORT_FILE_PATH_CONFIG_PATH = 'pepperjam/pepperjam_network/export_path';
29
- const CALLBACK_MAPPINGS_PATH = 'pepperjam/pepperjam_network/feeds/callback_mappings';
30
- const PRODUCT_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network_product_attribute_map';
31
- const PRODUCT_FEED_FILENAME_FORMAT_PATH = 'pepperjam/pepperjam_network/feeds/product/file_name_format';
32
- const DYNAMIC_ORDER_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_dynamic/fields';
33
- const ITEMIZED_ORDER_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_itemized/fields';
34
- const BASIC_ORDER_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_basic/fields';
35
- const DYNAMIC_ORDER_FEED_FILE_FORMAT_PATH = 'pepperjam/pepperjam_network/feeds/order_dynamic/file_name_format';
36
- const ITEMIZED_ORDER_FEED_FILE_FORMAT_PATH = 'pepperjam/pepperjam_network/feeds/order_itemized/file_name_format';
37
- const BASIC_ORDER_FEED_FILE_FORMAT_PATH = 'pepperjam/pepperjam_network/feeds/order_basic/file_name_format';
38
- const ORDER_LAST_RUN_PATH = 'pepperjam/pepperjam_network/feed/last_run_time';
39
- const JS_FILES = 'pepperjam/pepperjam_network/js_files';
40
- const CONDITIONAL_PIXEL_ENABLED = 'pepperjam/pepperjam_network/conditional_pixel_enabled';
41
- const SOURCE_KEY_NAME = 'pepperjam/pepperjam_network/source_key_name';
42
- const PRODUCT_FEED_ENABLED = 'pepperjam/pepperjam_network/product_feed_enabled';
43
- const ORDER_FEED_ENABLED = 'pepperjam/pepperjam_network/order_feed_enabled';
44
-
45
- const TRANSACTION_TYPE_SALE = '1';
46
- const TRANSACTION_TYPE_LEAD = '2';
47
-
48
- const ORDER_TYPE_BASIC = 'basic';
49
- const ORDER_TYPE_ITEMIZED = 'itemized';
50
- const ORDER_TYPE_DYNAMIC = 'dynamic';
51
-
52
- /**
53
- * retrieve the program id from store config
54
- * @param mixed $store
55
- * @return string
56
- */
57
- public function getProgramId($store = null)
58
- {
59
- return Mage::getStoreConfig(static::PROGRAM_ID_PATH, $store);
60
- }
61
-
62
- /**
63
- * retrieve the transaction type from store config
64
- * @param mixed $store
65
- * @return string
66
- */
67
- public function getTransactionType($store = null)
68
- {
69
- return Mage::getStoreConfig(static::TRANSACTION_TYPE_PATH, $store);
70
- }
71
-
72
- /**
73
- * retrieve the order type from store config
74
- * @param mixed $store
75
- * @return string
76
- */
77
- public function getOrderType($store = null)
78
- {
79
- return Mage::getStoreConfig(static::ORDER_TYPE_PATH, $store);
80
- }
81
-
82
- /**
83
- * determine if orders should be itemized
84
- * @param mixed $store
85
- * @return bool
86
- */
87
- public function isItemizedOrders($store = null)
88
- {
89
- return $this->getOrderType() == static::ORDER_TYPE_ITEMIZED;
90
- }
91
-
92
- /**
93
- * determine if orders should be dynamic
94
- * @param mixed $store
95
- * @return bool
96
- */
97
- public function isDynamicOrders($store = null)
98
- {
99
- return $this->getOrderType() == static::ORDER_TYPE_DYNAMIC;
100
- }
101
-
102
- /**
103
- * check if beacon pixel is enable in the store config
104
- * @param mixed $store
105
- * @return bool
106
- */
107
- public function isEnabled($store = null)
108
- {
109
- return Mage::getStoreConfigFlag(static::ENABLED_PATH, $store);
110
- }
111
-
112
- /**
113
- * retrieve the int from store config
114
- * @param mixed $store
115
- * @return string
116
- */
117
- public function getInt($store = null)
118
- {
119
- return strtoupper(self::getOrderType());
120
- }
121
-
122
- /**
123
- * retrieve the base url of the beacon from store config
124
- * @param mixed $store
125
- * @return string
126
- */
127
- public function getBeaconBaseUrl($store = null)
128
- {
129
- return Mage::getStoreConfig(static::BEACON_URL_PATH, $store);
130
- }
131
-
132
- /**
133
- * Get the configured export file path.
134
- * @param mixed $store
135
- * @return string
136
- */
137
- public function getExportFilePath($store = null)
138
- {
139
- return Mage::getStoreConfig(static::EXPORT_FILE_PATH_CONFIG_PATH, $store);
140
- }
141
-
142
- /**
143
- * Get the callback mappings from the config
144
- * @param mixed $store
145
- * @return array
146
- */
147
- public function getCallbackMappings($store = null)
148
- {
149
- return Mage::getStoreConfig(static::CALLBACK_MAPPINGS_PATH, $store);
150
- }
151
- /**
152
- * Get the configured feed mapping for the product feed.
153
- * @param mixed $store
154
- * @return array
155
- */
156
- public function getProductFeedFields($store = null)
157
- {
158
- return array_filter(Mage::getStoreConfig(static::PRODUCT_FEED_MAPPING_PATH, $store));
159
- }
160
-
161
- /**
162
- * Get the configured product feed file name format
163
- * @param mixed $store
164
- * @return string
165
- */
166
- public function getProductFeedFilenameFormat($store = null)
167
- {
168
- return Mage::getStoreConfig(static::PRODUCT_FEED_FILENAME_FORMAT_PATH, $store);
169
- }
170
-
171
- /**
172
- * Get the configured feed mapping for the dynamic orders feed.
173
- * @param mixed $store
174
- * @return array
175
- */
176
- public function getDynamicOrderFeedFields($store = null)
177
- {
178
- return Mage::getStoreConfig(static::DYNAMIC_ORDER_FEED_MAPPING_PATH, $store);
179
- }
180
-
181
- /**
182
- * Get the configured feed mapping for the itemized orders feed.
183
- * @param mixed $store
184
- * @return array
185
- */
186
- public function getItemizedOrderFeedFields($store = null)
187
- {
188
- return Mage::getStoreConfig(static::ITEMIZED_ORDER_FEED_MAPPING_PATH, $store);
189
- }
190
-
191
- /**
192
- * Get the configured feed mapping for the basic orders feed.
193
- * @param mixed $store
194
- * @return array
195
- */
196
- public function getBasicOrderFeedFields($store = null)
197
- {
198
- return Mage::getStoreConfig(static::BASIC_ORDER_FEED_MAPPING_PATH, $store);
199
- }
200
-
201
- /**
202
- * Get the configured dynamic order feed file format
203
- * @param mixed $store
204
- * @return string
205
- */
206
- public function getDynamicOrderFeedFileFormat($store = null)
207
- {
208
- return Mage::getStoreConfig(static::DYNAMIC_ORDER_FEED_FILE_FORMAT_PATH, $store);
209
- }
210
-
211
- /**
212
- * Get the configured itemized order feed file format
213
- * @param mixed $store
214
- * @return string
215
- */
216
- public function getItemizedOrderFeedFileFormat($store = null)
217
- {
218
- return Mage::getStoreConfig(static::ITEMIZED_ORDER_FEED_FILE_FORMAT_PATH, $store);
219
- }
220
-
221
- /**
222
- * Get the configured basic order feed file format
223
- * @param mixed $store
224
- * @return string
225
- */
226
- public function getBasicOrderFeedFileFormat($store = null)
227
- {
228
- return Mage::getStoreConfig(static::BASIC_ORDER_FEED_FILE_FORMAT_PATH, $store);
229
- }
230
-
231
- /**
232
- * Update the last run time of the order create feed to the specified time,
233
- * or the current time it no time is given. Always set globally so no need to
234
- * ever be given a store context.
235
- * @param string $time
236
- * @return self
237
- */
238
- public function updateOrderLastRunTime($time = null)
239
- {
240
- Mage::getConfig()->saveConfig(self::ORDER_LAST_RUN_PATH, $time ?: time());
241
- Mage::app()->getStore()->resetConfig();
242
- return $this;
243
- }
244
-
245
- /**
246
- * Get the last time the order corrections feed was run. Returns the string
247
- * value saved in config. Always set globally so no need for a store context.
248
- * @return string
249
- */
250
- public function getOrderLastRunTime()
251
- {
252
- return Mage::getStoreConfig(self::ORDER_LAST_RUN_PATH);
253
- }
254
-
255
- /**
256
- * Enable/disable conditional pixel logic
257
- *
258
- * @param null $store
259
- * @return bool
260
- */
261
- public function isConditionalPixelEnabled($store = null)
262
- {
263
- return Mage::getStoreConfig(self::CONDITIONAL_PIXEL_ENABLED, $store);
264
- }
265
-
266
- /**
267
- * Name of the affiliate source
268
- *
269
- * If conditional pixel logic is enabled then only display the pixel
270
- * if the query string contains a key with this name
271
- *
272
- * @param null $store
273
- * @return string
274
- */
275
- public function getSourceKeyName($store = null)
276
- {
277
- return Mage::getStoreConfig(self::SOURCE_KEY_NAME, $store);
278
- }
279
-
280
- /**
281
- * Enable/disable product feed
282
- *
283
- * @param null $store
284
- * @return boolean
285
- */
286
- public function isProductFeedEnabled($store = null)
287
- {
288
- return Mage::getStoreConfig(self::PRODUCT_FEED_ENABLED, $store);
289
- }
290
-
291
- /**
292
- * Enable/disable order feed
293
- *
294
- * @param null $store
295
- * @return boolean
296
- */
297
- public function isOrderFeedEnabled($store = null)
298
- {
299
- return Mage::getStoreConfig(self::ORDER_FEED_ENABLED, $store);
300
- }
301
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ /**
19
+ * @codeCoverageIgnore
20
+ */
21
+ class Pepperjam_Network_Helper_Config
22
+ {
23
+ const BEACON_URL_PATH = 'pepperjam/pepperjam_network/beacon_url';
24
+ const ENABLED_PATH = 'pepperjam/pepperjam_network/active';
25
+ const ORDER_TYPE_PATH = 'pepperjam/pepperjam_network/order_type';
26
+ const TRACKING_METHOD_PATH = 'pepperjam/pepperjam_network/tracking_method';
27
+ const PROGRAM_ID_PATH = 'pepperjam/pepperjam_network/program_id';
28
+ const TRANSACTION_TYPE_PATH = 'pepperjam/pepperjam_network/transaction_type';
29
+ const EXPORT_FILE_PATH_CONFIG_PATH = 'pepperjam/pepperjam_network/export_path';
30
+ const CALLBACK_MAPPINGS_PATH = 'pepperjam/pepperjam_network/feeds/callback_mappings';
31
+ const PRODUCT_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network_product_attribute_map';
32
+ const PRODUCT_FEED_FILENAME_FORMAT_PATH = 'pepperjam/pepperjam_network/feeds/product/file_name_format';
33
+ const DYNAMIC_ORDER_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_dynamic/fields';
34
+ const ITEMIZED_ORDER_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_itemized/fields';
35
+ const BASIC_ORDER_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_basic/fields';
36
+ const DYNAMIC_ORDER_CORRECTION_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_correction_dynamic/fields';
37
+ const ITEMIZED_ORDER_CORRECTION_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_correction_itemized/fields';
38
+ const BASIC_ORDER_CORRECTION_FEED_MAPPING_PATH = 'pepperjam/pepperjam_network/feeds/order_correction_basic/fields';
39
+ const ORDER_FEED_FILE_FORMAT_PATH = 'pepperjam/pepperjam_network/feeds/order_feed/file_name_format';
40
+ const ORDER_CORRECTION_FEED_FILE_FORMAT_PATH = 'pepperjam/pepperjam_network/feeds/order_correction_feed/file_name_format';
41
+ const ORDER_LAST_RUN_PATH = 'pepperjam/pepperjam_network/order_feed/last_run_time';
42
+ const ORDER_CORRECTION_LAST_RUN_PATH = 'pepperjam/pepperjam_network/order_correction_feed/last_run_time';
43
+ const JS_FILES = 'pepperjam/pepperjam_network/js_files';
44
+ const ATTRIBUTION_ENABLED = 'pepperjam/pepperjam_network/attribution_enabled';
45
+ const SOURCE_KEY_NAME = 'pepperjam/pepperjam_network/source_key_name';
46
+ const CLICK_KEY_NAME = 'pepperjam/pepperjam_network/click_id_key_name';
47
+ const PUBLISHER_KEY_NAME = 'pepperjam/pepperjam_network/publisher_id_key_name';
48
+ const PRODUCT_FEED_ENABLED = 'pepperjam/pepperjam_network/product_feed_enabled';
49
+ const ORDER_CORRECTION_FEED_ENABLED = 'pepperjam/pepperjam_network/order_correction_feed_enabled';
50
+
51
+ const TRANSACTION_TYPE_SALE = '1';
52
+ const TRANSACTION_TYPE_LEAD = '2';
53
+
54
+ const ORDER_TYPE_BASIC = 'basic';
55
+ const ORDER_TYPE_ITEMIZED = 'itemized';
56
+ const ORDER_TYPE_DYNAMIC = 'dynamic';
57
+
58
+ const TRACKING_METHOD_PIXEL = 'pixel';
59
+ const TRACKING_METHOD_FEED = 'feed';
60
+
61
+ /**
62
+ * retrieve the program id from store config
63
+ * @param mixed $store
64
+ * @return string
65
+ */
66
+ public function getProgramId($store = null)
67
+ {
68
+ return Mage::getStoreConfig(static::PROGRAM_ID_PATH, $store);
69
+ }
70
+
71
+ /**
72
+ * retrieve the transaction type from store config
73
+ * @param mixed $store
74
+ * @return string
75
+ */
76
+ public function getTransactionType($store = null)
77
+ {
78
+ return Mage::getStoreConfig(static::TRANSACTION_TYPE_PATH, $store);
79
+ }
80
+
81
+ /**
82
+ * retrieve the order type from store config
83
+ * @param mixed $store
84
+ * @return string
85
+ */
86
+ public function getOrderType($store = null)
87
+ {
88
+ return Mage::getStoreConfig(static::ORDER_TYPE_PATH, $store);
89
+ }
90
+
91
+ /**
92
+ * determine if orders should be itemized
93
+ * @param mixed $store
94
+ * @return bool
95
+ */
96
+ public function isItemizedOrders($store = null)
97
+ {
98
+ return $this->getOrderType() == static::ORDER_TYPE_ITEMIZED;
99
+ }
100
+
101
+ /**
102
+ * determine if orders should be dynamic
103
+ * @param mixed $store
104
+ * @return bool
105
+ */
106
+ public function isDynamicOrders($store = null)
107
+ {
108
+ return $this->getOrderType($store) == static::ORDER_TYPE_DYNAMIC;
109
+ }
110
+
111
+ /**
112
+ * retrieve tracking method
113
+ * @param mixed $store
114
+ * @return string
115
+ */
116
+ public function getTrackingMethod($store = null)
117
+ {
118
+ return Mage::getStoreConfig(self::TRACKING_METHOD_PATH, $store);
119
+ }
120
+
121
+ /**
122
+ * should tracking be done via pixel?
123
+ * @param mixed $store
124
+ * @return bool
125
+ */
126
+ public function trackByPixel($store = null)
127
+ {
128
+ return $this->getTrackingMethod($store) == self::TRACKING_METHOD_PIXEL;
129
+ }
130
+
131
+ /**
132
+ * should tracking be done via feed?
133
+ * @param mixed $store
134
+ * @return bool
135
+ */
136
+ public function trackByFeed($store = null)
137
+ {
138
+ return $this->getTrackingMethod($store) == self::TRACKING_METHOD_FEED;
139
+ }
140
+
141
+ /**
142
+ * check if beacon pixel is enable in the store config
143
+ * @param mixed $store
144
+ * @return bool
145
+ */
146
+ public function isEnabled($store = null)
147
+ {
148
+ return Mage::getStoreConfigFlag(static::ENABLED_PATH, $store);
149
+ }
150
+
151
+ /**
152
+ * retrieve the int from store config
153
+ * @param mixed $store
154
+ * @return string
155
+ */
156
+ public function getInt($store = null)
157
+ {
158
+ return strtoupper(self::getOrderType());
159
+ }
160
+
161
+ /**
162
+ * retrieve the base url of the beacon from store config
163
+ * @param mixed $store
164
+ * @return string
165
+ */
166
+ public function getBeaconBaseUrl($store = null)
167
+ {
168
+ return Mage::getStoreConfig(static::BEACON_URL_PATH, $store);
169
+ }
170
+
171
+ /**
172
+ * Get the configured export file path.
173
+ * @param mixed $store
174
+ * @return string
175
+ */
176
+ public function getExportFilePath($store = null)
177
+ {
178
+ return Mage::getStoreConfig(static::EXPORT_FILE_PATH_CONFIG_PATH, $store);
179
+ }
180
+
181
+ /**
182
+ * Get the callback mappings from the config
183
+ * @param mixed $store
184
+ * @return array
185
+ */
186
+ public function getCallbackMappings($store = null)
187
+ {
188
+ return Mage::getStoreConfig(static::CALLBACK_MAPPINGS_PATH, $store);
189
+ }
190
+
191
+ /**
192
+ * Get the configured feed mapping for the product feed.
193
+ * @param mixed $store
194
+ * @return array
195
+ */
196
+ public function getProductFeedFields($store = null)
197
+ {
198
+ return array_filter(Mage::getStoreConfig(static::PRODUCT_FEED_MAPPING_PATH, $store));
199
+ }
200
+
201
+ /**
202
+ * Get the fields that are required for the product feed
203
+ * @param mixed
204
+ * @return array
205
+ */
206
+ public function getRequiredProductFeedFields($store = null)
207
+ {
208
+ // Following the same method magento uses to render the config page
209
+ $config = Mage::getSingleton('adminhtml/config');
210
+ $pepperjamConfig = $config->getSection('pepperjam', '', '');
211
+ $pepperjamConfig = $pepperjamConfig->groups->pepperjam_network_product_attribute_map->fields;
212
+ $pepperjamFields = $pepperjamConfig->asArray();
213
+ $requiredFields = array_keys(array_filter($pepperjamFields, function ($value) {
214
+ return isset($value['validate']) && in_array('required-entry', explode(' ', $value['validate']));
215
+ }));
216
+
217
+ $allMappedFields = $this->getProductFeedFields($store);
218
+ $requiredMappedFields = array_intersect_key($allMappedFields, array_flip($requiredFields));
219
+
220
+ return $requiredMappedFields;
221
+ }
222
+
223
+ /**
224
+ * Get the configured product feed file name format
225
+ * @param mixed $store
226
+ * @return string
227
+ */
228
+ public function getProductFeedFilenameFormat($store = null)
229
+ {
230
+ return Mage::getStoreConfig(static::PRODUCT_FEED_FILENAME_FORMAT_PATH, $store);
231
+ }
232
+
233
+ /**
234
+ * Get the configured feed mapping for the dynamic orders feed.
235
+ * @param mixed $store
236
+ * @return array
237
+ */
238
+ public function getDynamicOrderFeedFields($store = null)
239
+ {
240
+ return Mage::getStoreConfig(static::DYNAMIC_ORDER_FEED_MAPPING_PATH, $store);
241
+ }
242
+
243
+ /**
244
+ * Get the configured feed mapping for the itemized orders feed.
245
+ * @param mixed $store
246
+ * @return array
247
+ */
248
+ public function getItemizedOrderFeedFields($store = null)
249
+ {
250
+ return Mage::getStoreConfig(static::ITEMIZED_ORDER_FEED_MAPPING_PATH, $store);
251
+ }
252
+
253
+ /**
254
+ * Get the configured feed mapping for the basic orders feed.
255
+ * @param mixed $store
256
+ * @return array
257
+ */
258
+ public function getBasicOrderFeedFields($store = null)
259
+ {
260
+ return Mage::getStoreConfig(static::BASIC_ORDER_FEED_MAPPING_PATH, $store);
261
+ }
262
+
263
+ /**
264
+ * Get the configured feed mapping for the dynamic order correction feed.
265
+ * @param mixed $store
266
+ * @return array
267
+ */
268
+ public function getDynamicOrderCorrectionFeedFields($store = null)
269
+ {
270
+ return Mage::getStoreConfig(static::DYNAMIC_ORDER_CORRECTION_FEED_MAPPING_PATH, $store);
271
+ }
272
+
273
+ /**
274
+ * Get the configured feed mapping for the itemized order correction feed.
275
+ * @param mixed $store
276
+ * @return array
277
+ */
278
+ public function getItemizedOrderCorrectionFeedFields($store = null)
279
+ {
280
+ return Mage::getStoreConfig(static::ITEMIZED_ORDER_CORRECTION_FEED_MAPPING_PATH, $store);
281
+ }
282
+
283
+ /**
284
+ * Get the configured feed mapping for the basic order correction feed.
285
+ * @param mixed $store
286
+ * @return array
287
+ */
288
+ public function getBasicOrderCorrectionFeedFields($store = null)
289
+ {
290
+ return Mage::getStoreConfig(static::BASIC_ORDER_CORRECTION_FEED_MAPPING_PATH, $store);
291
+ }
292
+
293
+ /**
294
+ * Get the configured order feed file format
295
+ * @param mixed $store
296
+ * @return string
297
+ */
298
+ public function getOrderFeedFileFormat($store = null)
299
+ {
300
+ return Mage::getStoreConfig(static::ORDER_FEED_FILE_FORMAT_PATH, $store);
301
+ }
302
+
303
+ /**
304
+ * Get the configured order correction feed file format
305
+ * @param mixed $store
306
+ * @return string
307
+ */
308
+ public function getOrderCorrectionFeedFileFormat($store = null)
309
+ {
310
+ return Mage::getStoreConfig(static::ORDER_CORRECTION_FEED_FILE_FORMAT_PATH, $store);
311
+ }
312
+
313
+ /**
314
+ * Update the last run time of the order create feed to the specified time,
315
+ * or the current time it no time is given. Always set globally so no need to
316
+ * ever be given a store context.
317
+ * @param string $time
318
+ * @return self
319
+ */
320
+ public function updateOrderLastRunTime($time = null)
321
+ {
322
+ Mage::getConfig()->saveConfig(self::ORDER_LAST_RUN_PATH, $time ?: time());
323
+ Mage::app()->getStore()->resetConfig();
324
+ return $this;
325
+ }
326
+
327
+ /**
328
+ * Update the last run time of the order create feed to the specified time,
329
+ * or the current time it no time is given. Always set globally so no need to
330
+ * ever be given a store context.
331
+ * @param string $time
332
+ * @return self
333
+ */
334
+ public function updateOrderCorrectionLastRunTime($time = null)
335
+ {
336
+ Mage::getConfig()->saveConfig(self::ORDER_CORRECTION_LAST_RUN_PATH, $time ?: time());
337
+ Mage::app()->getStore()->resetConfig();
338
+ return $this;
339
+ }
340
+
341
+ /**
342
+ * Get the last time the order corrections feed was run. Returns the string
343
+ * value saved in config. Always set globally so no need for a store context.
344
+ * @return string
345
+ */
346
+ public function getOrderLastRunTime()
347
+ {
348
+ return Mage::getStoreConfig(self::ORDER_LAST_RUN_PATH);
349
+ }
350
+
351
+ /**
352
+ * Get the last time the order corrections feed was run. Returns the string
353
+ * value saved in config. Always set globally so no need for a store context.
354
+ * @return string
355
+ */
356
+ public function getOrderCorrectionLastRunTime()
357
+ {
358
+ return Mage::getStoreConfig(self::ORDER_CORRECTION_LAST_RUN_PATH);
359
+ }
360
+
361
+ /**
362
+ * Enable/disable conditional pixel logic
363
+ *
364
+ * @param null $store
365
+ * @return bool
366
+ */
367
+ public function isAttributionEnabled($store = null)
368
+ {
369
+ return Mage::getStoreConfig(self::ATTRIBUTION_ENABLED, $store);
370
+ }
371
+
372
+ /**
373
+ * Name of the affiliate source
374
+ *
375
+ * If conditional pixel logic is enabled then only display the pixel
376
+ * if the query string contains a key with this name
377
+ *
378
+ * @param null $store
379
+ * @return string
380
+ */
381
+ public function getSourceKeyName($store = null)
382
+ {
383
+ return Mage::getStoreConfig(self::SOURCE_KEY_NAME, $store);
384
+ }
385
+
386
+ /**
387
+ * ID of the affiliate click
388
+ *
389
+ * If attribution logic is enabled, include the click id in the pixel
390
+ *
391
+ * @param null $store
392
+ * @return string
393
+ */
394
+ public function getClickKeyName($store = null)
395
+ {
396
+ return Mage::getStoreConfig(self::CLICK_KEY_NAME, $store);
397
+ }
398
+
399
+ /**
400
+ * ID of the affiliate publisher
401
+ *
402
+ * If attribution logic is enabled, include the publisher id in the pixel
403
+ *
404
+ * @param null $store
405
+ * @return string
406
+ */
407
+ public function getPublisherKeyName($store = null)
408
+ {
409
+ return Mage::getStoreConfig(self::PUBLISHER_KEY_NAME, $store);
410
+ }
411
+
412
+ /**
413
+ * Enable/disable product feed
414
+ *
415
+ * @param null $store
416
+ * @return boolean
417
+ */
418
+ public function isProductFeedEnabled($store = null)
419
+ {
420
+ return Mage::getStoreConfig(self::PRODUCT_FEED_ENABLED, $store);
421
+ }
422
+
423
+ /**
424
+ * Enable/disable order Correction feed
425
+ *
426
+ * @param null $store
427
+ * @return boolean
428
+ */
429
+ public function isOrderCorrectionFeedEnabled($store = null)
430
+ {
431
+ return Mage::getStoreConfig(self::ORDER_CORRECTION_FEED_ENABLED, $store);
432
+ }
433
+ }
app/code/community/Pepperjam/Network/Helper/Data.php CHANGED
@@ -1,178 +1,218 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- class Pepperjam_Network_Helper_Data extends Mage_Core_Helper_Abstract
19
- {
20
- /** value for the source cookie */
21
- const SOURCE_KEY_VALUE_EBAY = 'eean';
22
- const SOURCE_KEY_VALUE_PEPPERJAM = 'pepperjam';
23
- /** prefix added to the source key name set in the admin panel to create a unique cookie name */
24
- const SOURCE_COOKIE_PREFIX = 'pepperjam_network_';
25
-
26
- /**
27
- * Build the beacon url given an array keys
28
- * @param array $params
29
- * @return string
30
- */
31
- public function buildBeaconUrl(array $params)
32
- {
33
- return Mage::helper('pepperjam_network/config')->getBeaconBaseUrl() . '?' .
34
- http_build_query($params);
35
- }
36
-
37
- /**
38
- * Get all unique configured program ids. Program ids may only be set at the
39
- * website level, so only get the program id for the default store for
40
- * each website.
41
- * @return array
42
- */
43
- public function getAllProgramIds()
44
- {
45
- $config = Mage::helper('pepperjam_network/config');
46
- return array_unique(array_filter(array_map(
47
- function ($website) use ($config) {
48
- return $config->getProgramId($website->getDefaultStore());
49
- },
50
- Mage::app()->getWebsites()
51
- )));
52
- }
53
-
54
- /**
55
- * Get a single store view for a program id. As program ids are configured
56
- * only at the global or website level, the store view selecetd will be
57
- * the default store view for the scope the configuration is set at. When
58
- * set globally, the default store view for the Magento instance will be
59
- * selected. When set at a website level, the default store view for that
60
- * website will be used.
61
- * @param string $programId
62
- * @return Mage_Core_Model_Store|null
63
- */
64
- public function getStoreForProgramId($programId)
65
- {
66
- $config = Mage::helper('pepperjam_network/config');
67
- // Check for the default store view to be this program id first, will match
68
- // when the program id is set at the global level.
69
- $defaultStoreView = Mage::app()->getDefaultStoreView();
70
- $defaultProgramId = $config->getProgramId($defaultStoreView);
71
- if ($programId === $defaultProgramId) {
72
- return $defaultStoreView;
73
- }
74
- // When set at the website level, use the first website encountered
75
- // with a matching program id
76
- foreach (Mage::app()->getWebsites() as $website) {
77
- $storeView = $website->getDefaultStore();
78
- if ($config->getProgramId($storeView) === $programId) {
79
- return $storeView;
80
- }
81
- }
82
- return null;
83
- }
84
-
85
- /**
86
- * Get all store views that have a program id that matches the given
87
- * program id
88
- * @param string $programId
89
- * @return Mage_Core_Model_Store[]
90
- */
91
- public function getAllStoresForProgramId($programId)
92
- {
93
- $config = Mage::helper('pepperjam_network/config');
94
- return array_filter(
95
- Mage::app()->getStores(),
96
- function ($store) use ($config, $programId) {
97
- return $config->getProgramId($store) === $programId;
98
- }
99
- );
100
- }
101
-
102
- /**
103
- * take a boolean value and return the string 'yes' or 'no' when the boolean
104
- * value is true or false
105
- * @param bool $value
106
- * @return string
107
- * @codeCoverageIgnore
108
- */
109
- public function parseBoolToYesNo($value)
110
- {
111
- return $value?'yes':'no';
112
- }
113
-
114
- /**
115
- * helper function to take the source key name set in the admin panel
116
- * and prepend a string to create a unique name for the cookie
117
- *
118
- * @return string
119
- */
120
- public function getSourceCookieName()
121
- {
122
- $key = Mage::helper('pepperjam_network/config')->getSourceKeyName();
123
-
124
- return self::SOURCE_COOKIE_PREFIX.$key;
125
- }
126
-
127
- /**
128
- * True if the cookie exists and has a value of SOURCE_KEY_VALUE
129
- * False otherwise
130
- *
131
- * @return bool
132
- */
133
- public function isValidCookie()
134
- {
135
- $cookie = $this->getSourceCookieName();
136
- $value = Mage::getModel('core/cookie')->get($cookie);
137
- return in_array($value, array(self::SOURCE_KEY_VALUE_PEPPERJAM, self::SOURCE_KEY_VALUE_EBAY));
138
- }
139
-
140
- /**
141
- * Check to see if any orders have been made by the customer before
142
- * @param Mage_Sales_Model_Order $order
143
- * @return boolean This is the first order by this customer (email address)
144
- */
145
- public function isNewToFile(Mage_Sales_Model_Order $order)
146
- {
147
- // Customers are being identified by emails
148
- $customerEmail = $order->getCustomerEmail();
149
-
150
- // Look up any orders that use the same email
151
- $orderCollection = Mage::getModel('sales/order')->getCollection();
152
- $orderCollection->addFieldToFilter('customer_email', $customerEmail);
153
-
154
- // Current order should be only order if new
155
- return $orderCollection->count() <= 1;
156
- }
157
-
158
- /**
159
- * Get Commissioning Category assigned to the item or pick one of the assigned categories if one isn't set
160
- * @param Mage_Sales_Model_Order_Item $item Order Item
161
- * @return int Category ID
162
- */
163
- public function getCommissioningCategory(Mage_Sales_Model_Order_Item $item)
164
- {
165
- $category = $item->getProduct()->getCommissioningCategory();
166
- if ($category == '' || $category == null) {
167
-
168
- $categoryIds = $item->getProduct()->getCategoryIds();
169
- // if there are any categories, grab the first
170
- if (count($categoryIds))
171
- $category = $categoryIds[0];
172
- else
173
- $category = 0;
174
- }
175
-
176
- return $category;
177
- }
178
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ class Pepperjam_Network_Helper_Data extends Mage_Core_Helper_Abstract
19
+ {
20
+ /** value for the source cookie */
21
+ const SOURCE_KEY_VALUE_EBAY = 'eean';
22
+ const SOURCE_KEY_VALUE_PEPPERJAM = 'pepperjam';
23
+ /** prefix added to the source key name set in the admin panel to create a unique cookie name */
24
+ const SOURCE_COOKIE_PREFIX = 'pepperjam_network_';
25
+
26
+ /**
27
+ * Build the beacon url given an array keys
28
+ * @param array $params
29
+ * @return string
30
+ */
31
+ public function buildBeaconUrl(array $params)
32
+ {
33
+ return Mage::helper('pepperjam_network/config')->getBeaconBaseUrl() . '?' .
34
+ http_build_query($params);
35
+ }
36
+
37
+ /**
38
+ * Get all unique configured program ids. Program ids may only be set at the
39
+ * website level, so only get the program id for the default store for
40
+ * each website.
41
+ * @return array
42
+ */
43
+ public function getAllProgramIds()
44
+ {
45
+ $config = Mage::helper('pepperjam_network/config');
46
+ return array_unique(array_filter(array_map(
47
+ function ($website) use ($config) {
48
+ return $config->getProgramId($website->getDefaultStore());
49
+ },
50
+ Mage::app()->getWebsites()
51
+ )));
52
+ }
53
+
54
+ /**
55
+ * Get a single store view for a program id. As program ids are configured
56
+ * only at the global or website level, the store view selecetd will be
57
+ * the default store view for the scope the configuration is set at. When
58
+ * set globally, the default store view for the Magento instance will be
59
+ * selected. When set at a website level, the default store view for that
60
+ * website will be used.
61
+ * @param string $programId
62
+ * @return Mage_Core_Model_Store|null
63
+ */
64
+ public function getStoreForProgramId($programId)
65
+ {
66
+ $config = Mage::helper('pepperjam_network/config');
67
+ // Check for the default store view to be this program id first, will match
68
+ // when the program id is set at the global level.
69
+ $defaultStoreView = Mage::app()->getDefaultStoreView();
70
+ $defaultProgramId = $config->getProgramId($defaultStoreView);
71
+ if ($programId === $defaultProgramId) {
72
+ return $defaultStoreView;
73
+ }
74
+ // When set at the website level, use the first website encountered
75
+ // with a matching program id
76
+ foreach (Mage::app()->getWebsites() as $website) {
77
+ $storeView = $website->getDefaultStore();
78
+ if ($config->getProgramId($storeView) === $programId) {
79
+ return $storeView;
80
+ }
81
+ }
82
+ return null;
83
+ }
84
+
85
+ /**
86
+ * Get all store views that have a program id that matches the given
87
+ * program id
88
+ * @param string $programId
89
+ * @return Mage_Core_Model_Store[]
90
+ */
91
+ public function getAllStoresForProgramId($programId)
92
+ {
93
+ $config = Mage::helper('pepperjam_network/config');
94
+ return array_filter(
95
+ Mage::app()->getStores(),
96
+ function ($store) use ($config, $programId) {
97
+ return $config->getProgramId($store) === $programId;
98
+ }
99
+ );
100
+ }
101
+
102
+ /**
103
+ * take a boolean value and return the string 'yes' or 'no' when the boolean
104
+ * value is true or false
105
+ * @param bool $value
106
+ * @return string
107
+ * @codeCoverageIgnore
108
+ */
109
+ public function parseBoolToYesNo($value)
110
+ {
111
+ return $value?'yes':'no';
112
+ }
113
+
114
+ /**
115
+ * helper function to take the source key name set in the admin panel
116
+ * and prepend a string to create a unique name for the cookie
117
+ *
118
+ * @return string
119
+ */
120
+ public function getSourceCookieName()
121
+ {
122
+ $key = Mage::helper('pepperjam_network/config')->getSourceKeyName();
123
+
124
+ return self::SOURCE_COOKIE_PREFIX.$key;
125
+ }
126
+
127
+ /**
128
+ * helper function to take the source key name set in the admin panel
129
+ * and prepend a string to create a unique name for the cookie
130
+ *
131
+ * @return string
132
+ */
133
+ public function getClickCookieName()
134
+ {
135
+ $key = Mage::helper('pepperjam_network/config')->getClickKeyName();
136
+
137
+ return self::SOURCE_COOKIE_PREFIX.$key;
138
+ }
139
+
140
+ /**
141
+ * helper function to take the source key name set in the admin panel
142
+ * and prepend a string to create a unique name for the cookie
143
+ *
144
+ * @return string
145
+ */
146
+ public function getPublisherCookieName()
147
+ {
148
+ $key = Mage::helper('pepperjam_network/config')->getPublisherKeyName();
149
+
150
+ return self::SOURCE_COOKIE_PREFIX.$key;
151
+ }
152
+
153
+ /**
154
+ * True if the cookie exists and has a value of SOURCE_KEY_VALUE_X
155
+ * False otherwise
156
+ *
157
+ * @return bool
158
+ */
159
+ public function isValidCookie()
160
+ {
161
+ $key = Mage::helper('pepperjam_network/config')->getSourceKeyName();
162
+
163
+ return self::SOURCE_COOKIE_PREFIX.$key;
164
+ }
165
+
166
+ public function validSourceValues()
167
+ {
168
+ return array(self::SOURCE_KEY_VALUE_EBAY, self::SOURCE_KEY_VALUE_PEPPERJAM);
169
+ }
170
+
171
+ /**
172
+ * Check to see if any orders have been made by the customer before
173
+ * @param Mage_Sales_Model_Order $order
174
+ * @return boolean This is the first order by this customer (email address)
175
+ */
176
+ public function isNewToFile(Mage_Sales_Model_Order $order)
177
+ {
178
+ // Customers are being identified by emails
179
+ $customerEmail = $order->getCustomerEmail();
180
+
181
+ // Look up any orders that use the same email
182
+ $orderCollection = Mage::getModel('sales/order')->getCollection();
183
+ $orderCollection->addFieldToFilter('customer_email', $customerEmail);
184
+
185
+ // Current order should be only order if new
186
+ return $orderCollection->count() <= 1;
187
+ }
188
+
189
+ /**
190
+ * Get Commissioning Category assigned to the item or pick one of the assigned categories if one isn't set
191
+ * @param Mage_Sales_Model_Order_Item $item Order Item
192
+ * @return int Category ID
193
+ */
194
+ public function getCommissioningCategory(Mage_Sales_Model_Order_Item $item)
195
+ {
196
+ $category = $item->getProduct()->getCommissioningCategory();
197
+ if ($category == '' || $category == null) {
198
+
199
+ $categoryIds = $item->getProduct()->getCategoryIds();
200
+ // if there are any categories, grab the first
201
+ if (count($categoryIds))
202
+ $category = $categoryIds[0];
203
+ else
204
+ $category = 0;
205
+ }
206
+
207
+ return $category;
208
+ }
209
+
210
+ public function getCookieValue($cookieName)
211
+ {
212
+ if ($_COOKIE[$cookieName]) {
213
+ return $_COOKIE[$cookieName];
214
+ }
215
+
216
+ return false;
217
+ }
218
+ }
app/code/community/Pepperjam/Network/Helper/Map.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- /**
19
- * This class is composed of methods used as callbacks to the feed generation
20
- * process. All methods accepting a generic `$params` argument are allowed to
21
- * make the following assumptions about the contents of the array:
22
- * 1. It will always include an "item" key with a value of the object
23
- * being prcessed.
24
- * 2. It will always include a "store" key with a value of the store context
25
- * in which the feed is being processed.
26
- * 3. Will contain additioanl key/value pairs set in the callback mappings
27
- * in config.xml
28
- *
29
- * Additional key/value pairs may be included but may not be guaranteed.
30
- * If the methods make any additional assumptions about the contents of the
31
- * `$params` array, they must be stated with the method. This should include
32
- * any additional key/value pairs expected to be set in the config.xml.
33
- *
34
- * All such mapping methods are expected to return a single value that can be
35
- * inserted directly into the resulting feed file.
36
- */
37
- class Pepperjam_Network_Helper_Map
38
- {
39
- /**
40
- * Get the program id using the store passed in params. Pass through to the
41
- * config helper using the store included in the $params array as the store
42
- * context to get the config value from.
43
- * @param array $params
44
- * @return string
45
- */
46
- public function getProgramId($params)
47
- {
48
- return Mage::helper('pepperjam_network/config')->getProgramId($params['store']);
49
- }
50
- /**
51
- * Get data for the key from the item. Expects "item" to be a Varien_Object,
52
- * "key" must be set. Additionally, if "format" is also included, it must
53
- * be a valid string format and will be used to format the data before it is
54
- * returned from this method.
55
- * @param array $params
56
- * @return mixed
57
- * @throws Mage_Core_Exception If the value of the `item` key is not a Varien_Object or the `key` key/value pair is not set.
58
- */
59
- public function getDataValue($params)
60
- {
61
- if (!$params['item'] instanceof Varien_Object) {
62
- throw new Mage_Core_Exception(
63
- sprintf(
64
- 'Item of type %s not compatible with %s',
65
- get_class($params['item']),
66
- __METHOD__
67
- )
68
- );
69
- }
70
- if (!isset($params['key'])) {
71
- throw new Mage_Core_Exception(
72
- 'The data "key" must be provided in the configured params for this callback.'
73
- );
74
- }
75
- $helper = Mage::helper('core');
76
- return sprintf(
77
- isset($params['format']) ? $params['format'] : '%s',
78
- preg_replace('/\s\s+/', ' ', $helper->stripTags($params['item']->getDataUsingMethod($params['key'])))
79
- );
80
- }
81
- /**
82
- * Simply return the "value" included in the params.
83
- * @param array $params
84
- * @return string
85
- * @throws Mage_Core_Exception If the `value` key/value pair is not set.
86
- */
87
- public function passStatic($params)
88
- {
89
- if (!isset($params['value'])) {
90
- throw new Mage_Core_Exception(sprintf(
91
- 'No value provided to return from %s',
92
- __METHOD__
93
- ));
94
- }
95
- return $params['value'];
96
- }
97
- /**
98
- * check if an attribute has value then return 'yes' otherwise return
99
- * 'no'
100
- * @param array $params
101
- * @return string
102
- */
103
- public function getValueYesNo(array $params)
104
- {
105
- return sprintf(
106
- isset($params['format']) ? $params['format'] : '%s',
107
- Mage::helper('pepperjam_network')->parseBoolToYesNo(
108
- $params['item']->getDataUsingMethod($params['key'])
109
- )
110
- );
111
- }
112
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ /**
19
+ * This class is composed of methods used as callbacks to the feed generation
20
+ * process. All methods accepting a generic `$params` argument are allowed to
21
+ * make the following assumptions about the contents of the array:
22
+ * 1. It will always include an "item" key with a value of the object
23
+ * being prcessed.
24
+ * 2. It will always include a "store" key with a value of the store context
25
+ * in which the feed is being processed.
26
+ * 3. Will contain additioanl key/value pairs set in the callback mappings
27
+ * in config.xml
28
+ *
29
+ * Additional key/value pairs may be included but may not be guaranteed.
30
+ * If the methods make any additional assumptions about the contents of the
31
+ * `$params` array, they must be stated with the method. This should include
32
+ * any additional key/value pairs expected to be set in the config.xml.
33
+ *
34
+ * All such mapping methods are expected to return a single value that can be
35
+ * inserted directly into the resulting feed file.
36
+ */
37
+ class Pepperjam_Network_Helper_Map
38
+ {
39
+ /**
40
+ * Get the program id using the store passed in params. Pass through to the
41
+ * config helper using the store included in the $params array as the store
42
+ * context to get the config value from.
43
+ * @param array $params
44
+ * @return string
45
+ */
46
+ public function getProgramId($params)
47
+ {
48
+ return Mage::helper('pepperjam_network/config')->getProgramId($params['store']);
49
+ }
50
+ /**
51
+ * Get data for the key from the item. Expects "item" to be a Varien_Object,
52
+ * "key" must be set. Additionally, if "format" is also included, it must
53
+ * be a valid string format and will be used to format the data before it is
54
+ * returned from this method.
55
+ * @param array $params
56
+ * @return mixed
57
+ * @throws Mage_Core_Exception If the value of the `item` key is not a Varien_Object or the `key` key/value pair is not set.
58
+ */
59
+ public function getDataValue($params)
60
+ {
61
+ if (!$params['item'] instanceof Varien_Object) {
62
+ throw new Mage_Core_Exception(
63
+ sprintf(
64
+ 'Item of type %s not compatible with %s',
65
+ get_class($params['item']),
66
+ __METHOD__
67
+ )
68
+ );
69
+ }
70
+ if (!isset($params['key'])) {
71
+ throw new Mage_Core_Exception(
72
+ 'The data "key" must be provided in the configured params for this callback.'
73
+ );
74
+ }
75
+ $helper = Mage::helper('core');
76
+ return sprintf(
77
+ isset($params['format']) ? $params['format'] : '%s',
78
+ preg_replace('/\s\s+/', ' ', $helper->stripTags($params['item']->getDataUsingMethod($params['key'])))
79
+ );
80
+ }
81
+ /**
82
+ * Simply return the "value" included in the params.
83
+ * @param array $params
84
+ * @return string
85
+ * @throws Mage_Core_Exception If the `value` key/value pair is not set.
86
+ */
87
+ public function passStatic($params)
88
+ {
89
+ if (!isset($params['value'])) {
90
+ throw new Mage_Core_Exception(sprintf(
91
+ 'No value provided to return from %s',
92
+ __METHOD__
93
+ ));
94
+ }
95
+ return $params['value'];
96
+ }
97
+ /**
98
+ * check if an attribute has value then return 'yes' otherwise return
99
+ * 'no'
100
+ * @param array $params
101
+ * @return string
102
+ */
103
+ public function getValueYesNo(array $params)
104
+ {
105
+ return sprintf(
106
+ isset($params['format']) ? $params['format'] : '%s',
107
+ Mage::helper('pepperjam_network')->parseBoolToYesNo(
108
+ $params['item']->getDataUsingMethod($params['key'])
109
+ )
110
+ );
111
+ }
112
+ }
app/code/community/Pepperjam/Network/Helper/Map/Order.php CHANGED
@@ -1,172 +1,198 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- /**
19
- * The public methods of this class are all expected to be used as callbacks
20
- * for building the Affiliate corrected orders feeds.
21
- * @see Pepperjam_Network_Helper_Map
22
- */
23
- class Pepperjam_Network_Helper_Map_Order
24
- {
25
- /**
26
- * Get the order increment id from the order the item was created for. Expects
27
- * the "item" to be a Mage_Sales_Model_Order_Item and the "format" to be a
28
- * valid string format.
29
- * @param array $params
30
- * @return string
31
- */
32
- public function getItemOrderId($params)
33
- {
34
- $item = $params['item'];
35
- return sprintf(
36
- $params['format'],
37
- $item->getOriginalIncrementId() ?: $item->getIncrementId()
38
- );
39
- }
40
- /**
41
- * Get the updated item quantity - original quantity less any refunded
42
- * or canceled. Expects the "item" to be a Mage_Sales_Model_Order_Item.
43
- * @param array $params
44
- * @return int
45
- */
46
- public function getItemQuantity($params)
47
- {
48
- $item = $params['item'];
49
- // field limit doesn't allow this to go above 99
50
- return (int) ($item->getQtyOrdered() - $item->getQtyRefunded() - $item->getQtyCanceled());
51
- }
52
- /**
53
- * Calculate a row total including discounts.
54
- * @param array $params
55
- * @return float
56
- */
57
- private function _calculateDiscountedItemPrice($params)
58
- {
59
- $item = $params['item'];
60
- // tread bundle items as 0.00 total as their total will be represented by
61
- // the total of their children products
62
- if ($item->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
63
- return 0.00;
64
- }
65
- // don't allow negative amounts - could happen if a discounted item was cancelled
66
- return max(
67
- 0,
68
- $item->getBasePrice() - (($item->getBaseDiscountAmount() - $item->getBaseDiscountRefunded()) / $this->getItemQuantity($params))
69
- );
70
- }
71
- /**
72
- * Get the corrected total for the row - price * corrected qty. Expects the
73
- * "item" to be a Mage_Sales_Model_Order_Item, "format" to be a valid
74
- * format string and "store" to be a Mage_Core_Model_Store or otherwise viable
75
- * store identifier.
76
- * @param array $params
77
- * @return string
78
- */
79
- public function getItemPrice($params)
80
- {
81
- $config = Mage::helper('pepperjam_network/config');
82
- // transaction type of Lead should always just be "0"
83
- if ($config->getTransactionType($params['store']) === $config::TRANSACTION_TYPE_LEAD) {
84
- return 0;
85
- }
86
- return sprintf(
87
- $params['format'],
88
- $this->_calculateDiscountedItemPrice($params)
89
- );
90
- }
91
- /**
92
- * Get the corrected amount of the order. Expects "item" to be a
93
- * Mage_Sales_Model_Order, "store" to be a Mage_Core_Model_Store or otherwise
94
- * valid store identifier, and "format" to be a valid format string.
95
- * @param array $params
96
- * @return string
97
- */
98
- public function getOrderAmount($params)
99
- {
100
- $config = Mage::helper('pepperjam_network/config');
101
- // transaction type of Lead should always just be "0"
102
- if ($config->getTransactionType($params['store']) === $config::TRANSACTION_TYPE_LEAD) {
103
- return 0;
104
- }
105
- $order = $params['item'];
106
- return sprintf(
107
- $params['format'],
108
- // prevent sub-zero amounts for canceled orders with discounts
109
- max(
110
- 0,
111
- ($order->getBaseSubtotal() + $order->getBaseDiscountAmount()) -
112
- ($order->getBaseSubtotalRefunded() + $order->getBaseDiscountRefunded()) -
113
- ($order->getBaseSubtotalCanceled() + $order->getBaseDiscountCanceled())
114
- )
115
- );
116
- }
117
- /**
118
- * Get the transaction type configured for the store the order was received
119
- * in. Expects "store" to be a Mage_Core_Model_Store or otherwise valid
120
- * store identifier.
121
- * @param array $params
122
- * @return int
123
- */
124
- public function getTransactionType($params)
125
- {
126
- return (int) Mage::helper('pepperjam_network/config')->getTransactionType($params['store']);
127
- }
128
- /**
129
- * Get the order item increment id. For orders that are the result of an edit,
130
- * get the increment id of the original order. Expects "item" to be a
131
- * Mage_Sales_Model_Oorder and "format" to be a valid format string.
132
- * @param array $params
133
- * @return string
134
- */
135
- public function getOrderId($params)
136
- {
137
- $order = $params['item'];
138
- return sprintf(
139
- $params['format'],
140
- $order->getOriginalIncrementId() ?: $order->getIncrementId()
141
- );
142
- }
143
- /**
144
- * Get the SKU of the item with any prohibited characters in the SKU removed.
145
- * Expects "format" to be a valid format string. As this method also passes
146
- * through to Pepperjam_Network_Helper_Map::getDataValue, `$params`
147
- * must also adhere to the requirements of that method - "item" is a subclass
148
- * of Varien_Object, have a "key" value set.
149
- * @param array $params
150
- * @return string
151
- */
152
- public function getItemId($params)
153
- {
154
- return sprintf(
155
- $params['format'],
156
- preg_replace('/[^a-zA-Z0-9\-_]/', '', Mage::helper('pepperjam_network/map')->getDataValue($params))
157
- );
158
- }
159
-
160
- public function getCategory($params)
161
- {
162
- $item = $params['item'];
163
- return Mage::helper('pepperjam_network')->getCommissioningCategory($item);
164
- }
165
-
166
- public function getNewToFile($params)
167
- {
168
- $order = $params['item']->getOrder();
169
-
170
- return (int) Mage::helper('pepperjam_network')->isNewToFile($order);
171
- }
172
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ /**
19
+ * The public methods of this class are all expected to be used as callbacks
20
+ * for building the Affiliate corrected orders feeds.
21
+ * @see Pepperjam_Network_Helper_Map
22
+ */
23
+ class Pepperjam_Network_Helper_Map_Order
24
+ {
25
+ const DATE_FORMAT_MASK = "Y-m-d H:i:s";
26
+
27
+ /**
28
+ * Get the order increment id from the order the item was created for. Expects
29
+ * the "item" to be a Mage_Sales_Model_Order_Item and the "format" to be a
30
+ * valid string format.
31
+ * @param array $params
32
+ * @return string
33
+ */
34
+ public function getItemOrderId($params)
35
+ {
36
+ $item = $params['item'];
37
+ return sprintf(
38
+ $params['format'],
39
+ $item->getOriginalIncrementId() ?: $item->getIncrementId()
40
+ );
41
+ }
42
+ /**
43
+ * Get the updated item quantity - original quantity less any refunded
44
+ * or canceled. Expects the "item" to be a Mage_Sales_Model_Order_Item.
45
+ * @param array $params
46
+ * @return int
47
+ */
48
+ public function getItemQuantity($params)
49
+ {
50
+ $item = $params['item'];
51
+ // field limit doesn't allow this to go above 99
52
+ return (int) ($item->getQtyOrdered() - $item->getQtyRefunded() - $item->getQtyCanceled());
53
+ }
54
+ /**
55
+ * Calculate a row total including discounts.
56
+ * @param array $params
57
+ * @return float
58
+ */
59
+ private function _calculateDiscountedItemPrice($params)
60
+ {
61
+ $item = $params['item'];
62
+ // tread bundle items as 0.00 total as their total will be represented by
63
+ // the total of their children products
64
+ if ($item->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
65
+ return 0.00;
66
+ }
67
+
68
+ if ($this->getItemQuantity($params)) {
69
+ $amount = $item->getBasePrice() - (($item->getBaseDiscountAmount() - $item->getBaseDiscountRefunded()) / $this->getItemQuantity($params));
70
+ } else {
71
+ $amount = 0;
72
+ }
73
+ // don't allow negative amounts - could happen if a discounted item was cancelled
74
+ return max(0, $amount);
75
+ }
76
+ /**
77
+ * Get the corrected total for the row - price * corrected qty. Expects the
78
+ * "item" to be a Mage_Sales_Model_Order_Item, "format" to be a valid
79
+ * format string and "store" to be a Mage_Core_Model_Store or otherwise viable
80
+ * store identifier.
81
+ * @param array $params
82
+ * @return string
83
+ */
84
+ public function getItemPrice($params)
85
+ {
86
+ $config = Mage::helper('pepperjam_network/config');
87
+ // transaction type of Lead should always just be "0"
88
+ if ($config->getTransactionType($params['store']) === $config::TRANSACTION_TYPE_LEAD) {
89
+ return 0;
90
+ }
91
+ return sprintf(
92
+ $params['format'],
93
+ $this->_calculateDiscountedItemPrice($params)
94
+ );
95
+ }
96
+ /**
97
+ * Get the corrected amount of the order. Expects "item" to be a
98
+ * Mage_Sales_Model_Order, "store" to be a Mage_Core_Model_Store or otherwise
99
+ * valid store identifier, and "format" to be a valid format string.
100
+ * @param array $params
101
+ * @return string
102
+ */
103
+ public function getOrderAmount($params)
104
+ {
105
+ $config = Mage::helper('pepperjam_network/config');
106
+ // transaction type of Lead should always just be "0"
107
+ if ($config->getTransactionType($params['store']) === $config::TRANSACTION_TYPE_LEAD) {
108
+ return 0;
109
+ }
110
+ $order = $params['item'];
111
+ return sprintf(
112
+ $params['format'],
113
+ // prevent sub-zero amounts for canceled orders with discounts
114
+ max(
115
+ 0,
116
+ ($order->getBaseSubtotal() + $order->getBaseDiscountAmount()) -
117
+ ($order->getBaseSubtotalRefunded() + $order->getBaseDiscountRefunded()) -
118
+ ($order->getBaseSubtotalCanceled() + $order->getBaseDiscountCanceled())
119
+ )
120
+ );
121
+ }
122
+ /**
123
+ * Get the transaction type configured for the store the order was received
124
+ * in. Expects "store" to be a Mage_Core_Model_Store or otherwise valid
125
+ * store identifier.
126
+ * @param array $params
127
+ * @return int
128
+ */
129
+ public function getTransactionType($params)
130
+ {
131
+ return (int) Mage::helper('pepperjam_network/config')->getTransactionType($params['store']);
132
+ }
133
+ /**
134
+ * Get the order item increment id. For orders that are the result of an edit,
135
+ * get the increment id of the original order. Expects "item" to be a
136
+ * Mage_Sales_Model_Oorder and "format" to be a valid format string.
137
+ * @param array $params
138
+ * @return string
139
+ */
140
+ public function getOrderId($params)
141
+ {
142
+ $order = $params['item'];
143
+ return sprintf(
144
+ $params['format'],
145
+ $order->getOriginalIncrementId() ?: $order->getIncrementId()
146
+ );
147
+ }
148
+ /**
149
+ * Get the SKU of the item with any prohibited characters in the SKU removed.
150
+ * Expects "format" to be a valid format string. As this method also passes
151
+ * through to Pepperjam_Network_Helper_Map::getDataValue, `$params`
152
+ * must also adhere to the requirements of that method - "item" is a subclass
153
+ * of Varien_Object, have a "key" value set.
154
+ * @param array $params
155
+ * @return string
156
+ */
157
+ public function getItemId($params)
158
+ {
159
+ return sprintf(
160
+ $params['format'],
161
+ preg_replace('/[^a-zA-Z0-9\-_]/', '', Mage::helper('pepperjam_network/map')->getDataValue($params))
162
+ );
163
+ }
164
+
165
+ public function getCategory($params)
166
+ {
167
+ $item = $params['item'];
168
+ return Mage::helper('pepperjam_network')->getCommissioningCategory($item);
169
+ }
170
+
171
+ public function getNewToFile($params)
172
+ {
173
+ $order = $params['item']->getOrder();
174
+
175
+ return (int) Mage::helper('pepperjam_network')->isNewToFile($order);
176
+ }
177
+
178
+ public function getClickId($params)
179
+ {
180
+ $order = $params['item']->getOrder();
181
+
182
+ return $order->getNetworkClickId();
183
+ }
184
+
185
+ public function getPublisherId($params)
186
+ {
187
+ $order = $params['item']->getOrder();
188
+
189
+ return $order->getNetworkPublisherId();
190
+ }
191
+
192
+ public function getOrderDate($params)
193
+ {
194
+ $order = $params['item']->getOrder();
195
+
196
+ return date(self::DATE_FORMAT_MASK, strtotime($order->getCreatedAt()));
197
+ }
198
+ }
app/code/community/Pepperjam/Network/Helper/Map/Product.php CHANGED
@@ -1,135 +1,135 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- /**
19
- * The public methods of this class are all expected to be used as callbacks
20
- * for building the Affiliate product feed.
21
- * @see Pepperjam_Network_Helper_Map
22
- */
23
- class Pepperjam_Network_Helper_Map_Product
24
- {
25
- const MEDIA_PATH = 'catalog/product';
26
- const NO_SELECTION = 'no_selection';
27
- /**
28
- * Get a product first chained categories meaning that a product can be
29
- * long to many chained of categories. Chained of categories here mean that
30
- * a category root to it's inner most leaf child. Expects "item" to be a
31
- * Mage_Catalog_Model_Product. If "format" is included in `$params`, it will
32
- * must be a valid format string and will be used to format the data returned
33
- * from this method.
34
- * @param array $params
35
- * @return string
36
- */
37
- public function getCategory(array $params)
38
- {
39
- $categories = $params['item']->getCategoryCollection();
40
- $category = $categories->getFirstItem();
41
- $format = isset($params['format']) ? $params['format'] : '%s';
42
- return !is_null($category) ?
43
- sprintf($format, $this->_buildCategoryTree($category)) : null;
44
- }
45
- /**
46
- * Take an array of category entity ids return a collection of categories
47
- * in this array of category ids
48
- * @param array $entityIds list of category ids
49
- * @return Mage_Catalog_Model_Resource_Category_Collection
50
- */
51
- protected function _getCategoriesByIds(array $entityIds)
52
- {
53
- return Mage::getResourceModel('catalog/category_collection')
54
- ->addAttributeToSelect(array('name', 'entity_id'))
55
- ->addAttributeToFilter(array(array('attribute' => 'entity_id', 'in' => $entityIds)))
56
- ->load();
57
- }
58
- /**
59
- * Take a Mage_Catalog_Model_Category object and build a category tree from
60
- * the child leaf to the root of the category (root > inner child > inner most child)
61
- * @param Mage_Catalog_Model_Category $category the inner most child
62
- * @return string
63
- */
64
- protected function _buildCategoryTree(Mage_Catalog_Model_Category $category)
65
- {
66
- $collecton = $this->_getCategoriesByIds(explode('/', $category->getPath()));
67
- $categories = array();
68
- foreach ($collecton as $cat) {
69
- $categories[] = $cat->getName();
70
- }
71
- return implode(' > ', array_filter($categories));
72
- }
73
- /**
74
- * get a product image view URL
75
- * Note: calling Mage_Catalog_Model_Product::getImageUrl, or getThumbnailUrl
76
- * will return the wrong URL when running the feed via CRONJOB will return
77
- * to something similar to this:
78
- * (http://<host>/skin/frontend/default/default/images/catalog/product/placeholder/image.jpg)
79
- * so this method will try to extrapolate as best it can the absolute path of
80
- * the image by calling getImage or getThumbnail which will give the
81
- * a relative path to the image in which we passed to a specialize method to try
82
- * to build the absolute URL path to the image
83
- * @param array $params
84
- * @return string
85
- */
86
- public function getImageUrl(array $params)
87
- {
88
- $item = $params['item'];
89
- // calling the getThumbnail or getImage will return a relative path
90
- // to where we think product image will live, see (self::MEDIA_PATH) constant
91
- $image = trim($item->getDataUsingMethod($params['key']));
92
- $format = isset($params['format']) ? $params['format'] : '%s';
93
- return ($image !== '' && $image !== static::NO_SELECTION)?
94
- sprintf($format, $this->_getAbsoluteImagePath($image)) : null;
95
- }
96
- /**
97
- * get the absolute URL product media path
98
- * @param string $image the relative image
99
- * @return string
100
- * @codeCoverageIgnore
101
- */
102
- protected function _getAbsoluteImagePath($image)
103
- {
104
- // concatenating magento absolute path to the media folder, with a class
105
- // constant base on observation of where we assume all product images stay
106
- // and along with the passed in image relative path
107
- return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) .
108
- static::MEDIA_PATH . $image;
109
- }
110
- /**
111
- * get a product manage stock quantity
112
- * @param array $params
113
- * @return string
114
- */
115
- public function getInStockQty(array $params)
116
- {
117
- return (int) Mage::getModel('cataloginventory/stock_item')
118
- ->loadByProduct($params['item'])
119
- ->getQty();
120
- }
121
- /**
122
- * check if a product is in stock and return 'yes' or 'no' in respect to
123
- * the outcome
124
- * @param array $params
125
- * @return string
126
- */
127
- public function getInStockYesNo(array $params)
128
- {
129
- return Mage::helper('pepperjam_network')->parseBoolToYesNo(
130
- Mage::getModel('cataloginventory/stock_item')
131
- ->loadByProduct($params['item'])
132
- ->getIsInStock()
133
- );
134
- }
135
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ /**
19
+ * The public methods of this class are all expected to be used as callbacks
20
+ * for building the Affiliate product feed.
21
+ * @see Pepperjam_Network_Helper_Map
22
+ */
23
+ class Pepperjam_Network_Helper_Map_Product
24
+ {
25
+ const MEDIA_PATH = 'catalog/product';
26
+ const NO_SELECTION = 'no_selection';
27
+ /**
28
+ * Get a product first chained categories meaning that a product can be
29
+ * long to many chained of categories. Chained of categories here mean that
30
+ * a category root to it's inner most leaf child. Expects "item" to be a
31
+ * Mage_Catalog_Model_Product. If "format" is included in `$params`, it will
32
+ * must be a valid format string and will be used to format the data returned
33
+ * from this method.
34
+ * @param array $params
35
+ * @return string
36
+ */
37
+ public function getCategory(array $params)
38
+ {
39
+ $categories = $params['item']->getCategoryCollection();
40
+ $category = $categories->getFirstItem();
41
+ $format = isset($params['format']) ? $params['format'] : '%s';
42
+ return !is_null($category) ?
43
+ sprintf($format, $this->_buildCategoryTree($category)) : null;
44
+ }
45
+ /**
46
+ * Take an array of category entity ids return a collection of categories
47
+ * in this array of category ids
48
+ * @param array $entityIds list of category ids
49
+ * @return Mage_Catalog_Model_Resource_Category_Collection
50
+ */
51
+ protected function _getCategoriesByIds(array $entityIds)
52
+ {
53
+ return Mage::getResourceModel('catalog/category_collection')
54
+ ->addAttributeToSelect(array('name', 'entity_id'))
55
+ ->addAttributeToFilter(array(array('attribute' => 'entity_id', 'in' => $entityIds)))
56
+ ->load();
57
+ }
58
+ /**
59
+ * Take a Mage_Catalog_Model_Category object and build a category tree from
60
+ * the child leaf to the root of the category (root > inner child > inner most child)
61
+ * @param Mage_Catalog_Model_Category $category the inner most child
62
+ * @return string
63
+ */
64
+ protected function _buildCategoryTree(Mage_Catalog_Model_Category $category)
65
+ {
66
+ $collecton = $this->_getCategoriesByIds(explode('/', $category->getPath()));
67
+ $categories = array();
68
+ foreach ($collecton as $cat) {
69
+ $categories[] = $cat->getName();
70
+ }
71
+ return implode(' > ', array_filter($categories));
72
+ }
73
+ /**
74
+ * get a product image view URL
75
+ * Note: calling Mage_Catalog_Model_Product::getImageUrl, or getThumbnailUrl
76
+ * will return the wrong URL when running the feed via CRONJOB will return
77
+ * to something similar to this:
78
+ * (http://<host>/skin/frontend/default/default/images/catalog/product/placeholder/image.jpg)
79
+ * so this method will try to extrapolate as best it can the absolute path of
80
+ * the image by calling getImage or getThumbnail which will give the
81
+ * a relative path to the image in which we passed to a specialize method to try
82
+ * to build the absolute URL path to the image
83
+ * @param array $params
84
+ * @return string
85
+ */
86
+ public function getImageUrl(array $params)
87
+ {
88
+ $item = $params['item'];
89
+ // calling the getThumbnail or getImage will return a relative path
90
+ // to where we think product image will live, see (self::MEDIA_PATH) constant
91
+ $image = trim($item->getDataUsingMethod($params['key']));
92
+ $format = isset($params['format']) ? $params['format'] : '%s';
93
+ return ($image !== '' && $image !== static::NO_SELECTION)?
94
+ sprintf($format, $this->_getAbsoluteImagePath($image)) : null;
95
+ }
96
+ /**
97
+ * get the absolute URL product media path
98
+ * @param string $image the relative image
99
+ * @return string
100
+ * @codeCoverageIgnore
101
+ */
102
+ protected function _getAbsoluteImagePath($image)
103
+ {
104
+ // concatenating magento absolute path to the media folder, with a class
105
+ // constant base on observation of where we assume all product images stay
106
+ // and along with the passed in image relative path
107
+ return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) .
108
+ static::MEDIA_PATH . $image;
109
+ }
110
+ /**
111
+ * get a product manage stock quantity
112
+ * @param array $params
113
+ * @return string
114
+ */
115
+ public function getInStockQty(array $params)
116
+ {
117
+ return (int) Mage::getModel('cataloginventory/stock_item')
118
+ ->loadByProduct($params['item'])
119
+ ->getQty();
120
+ }
121
+ /**
122
+ * check if a product is in stock and return 'yes' or 'no' in respect to
123
+ * the outcome
124
+ * @param array $params
125
+ * @return string
126
+ */
127
+ public function getInStockYesNo(array $params)
128
+ {
129
+ return Mage::helper('pepperjam_network')->parseBoolToYesNo(
130
+ Mage::getModel('cataloginventory/stock_item')
131
+ ->loadByProduct($params['item'])
132
+ ->getIsInStock()
133
+ );
134
+ }
135
+ }
app/code/community/Pepperjam/Network/Model/Feed/Abstract.php CHANGED
@@ -1,335 +1,340 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- abstract class Pepperjam_Network_Model_Feed_Abstract
18
- {
19
- /**
20
- * The store context the feed is generated for. May be set to any viable store
21
- * identified.
22
- * @var Mage_Core_Model_Store
23
- */
24
- protected $_store;
25
- /**
26
- * Get a collection of items to be included in the feed.
27
- * @return Varien_Data_Collection
28
- */
29
- abstract protected function _getItems();
30
- /**
31
- * Get fields to include in the feed. Fields are expected to map to existing
32
- * callbacks defined in the config.xml.
33
- * @see self::_invokeCallback
34
- * @return array
35
- */
36
- abstract protected function _getFeedFields();
37
- /**
38
- * Gets the filename format for the feed from config for this feed.
39
- * @return string
40
- */
41
- abstract protected function _getFileName();
42
- /**
43
- * Get the delimiter to use in the csv file
44
- * @return string
45
- * @codeCoverageIgnore
46
- */
47
- protected function _getDelimiter()
48
- {
49
- return ',';
50
- }
51
- /**
52
- * Get the encolsure to use in the csv file
53
- * @return string
54
- * @codeCoverageIgnore
55
- */
56
- protected function _getEnclosure()
57
- {
58
- return '"';
59
- }
60
- /**
61
- * Set up the store property.
62
- */
63
- public function __construct($args = array())
64
- {
65
- // Set the store context to the given store or null which whill
66
- // result in the "current" store.
67
- $this->setStore(isset($args['store']) ? $args['store'] : null);
68
- }
69
- /**
70
- * Set the store context for the feed, converting whatever viable store
71
- * ID is passed in to an actual store instance.
72
- * @see Mage_Core_Model_App::getStore for how various identifiers may be used to represent a store
73
- * @param null|string|bool|int|Mage_Core_Model_Store
74
- * @codeCoverageIgnore
75
- */
76
- public function setStore($storeId)
77
- {
78
- $this->_store = Mage::app()->getStore($storeId);
79
- return $this;
80
- }
81
- /**
82
- * Get the store instance the feed is being executed within.
83
- * @return Mage_Core_Model_Store
84
- * @codeCoverageIgnore
85
- */
86
- public function getStore()
87
- {
88
- return $this->_store;
89
- }
90
- /**
91
- * Create the feed file and drop it in the configured export directory.
92
- * @return self
93
- */
94
- public function generateFeed()
95
- {
96
- $this->_generateFile($this->_buildFeedData());
97
- return $this;
98
- }
99
- /**
100
- * Create arrays of data that should be included in the feed file. Each array
101
- * should included a value for every field that is expected to be in the feed.
102
- * @return array
103
- */
104
- protected function _buildFeedData()
105
- {
106
- $items = $this->_getItems();
107
- Mage::log(sprintf('building feed for %d items', $items->count()));
108
- // array_map must be on an array - $items is a collection so need to get the
109
- // underlying array to pass to array_map
110
- return array_map(array($this, '_applyMapping'), $items->getItems());
111
- }
112
- /**
113
- * Use the callback mapping to create the data that represents the given item
114
- * in the feed.
115
- * @param mixed $item Likely a Varien_Object but could really be anything.
116
- * @return array
117
- */
118
- protected function _applyMapping($item)
119
- {
120
- $fields = array();
121
- $mappings = Mage::helper('pepperjam_network/config')->getCallbackMappings();
122
- foreach ($this->_getFeedFields() as $feedField) {
123
- // If the mapping doesn't exist, supplying an empty array will eventually
124
- // result in an exception for being an invalid config mapping.
125
- // @see self::_validateCallbackConfig
126
- $callback = isset($mappings[$feedField]) ? $mappings[$feedField] : array();
127
- // exclude any mappings that have a type of "disabled"
128
- if (!isset($callback['type']) || $callback['type'] !== 'disabled') {
129
- $fields[] = $this->_invokeCallback($callback, $item);
130
- }
131
- }
132
- return $fields;
133
- }
134
- /**
135
- * Given a set of callback configuration and an item, invoke the configured
136
- * callback and return the value. The callback configuration must meet the
137
- * following requirements:
138
- * - May contain a "type" key indicating the type of factory to use. May be
139
- * one of:
140
- * - "disabled" - will not be included in the feed
141
- * - "helper" - will use the Mage::helper factory
142
- * - "model" - will use the Mage::getModel factory
143
- * - "singleton" - will use the Mage::getSingleton factory
144
- * - If not included, will default to "singleton"
145
- * - When type is "disabled" no other key/value pairs are required.
146
- * - If type is not "disabled" the following must be included:
147
- * - "class" must be a valid class alias for the configured factory type
148
- * - "method" must be a valid method on the configured class
149
- * - A "params" key may also be included. If included, its value must be
150
- * an array of key/value pairs that will be included in the params array
151
- * passed to the callback method.
152
- * Every callback will be called with an array of params. The array will
153
- * contain any key/value pairs added in the config as well as an "item" key
154
- * which will have the item being mapped as the value and a "store" key which
155
- * will have the store instance representing the store view context the feed
156
- * is being generated for.
157
- *
158
- * Example configuration:
159
- * <code>
160
- * // This callback configuration array:
161
- * $cfg = array(
162
- * 'type' => 'helper',
163
- * 'class' => 'pepperjam_network/map',
164
- * 'column_name' => 'OID',
165
- * 'params' => array(
166
- * 'key' => 'increment_id',
167
- * ),
168
- * );
169
- * // Will result in the following invocation:
170
- * Mage::helper('pepperjam_network/map')->getDataValue(
171
- * array('key' => 'increment_id', 'item' => $item)
172
- * );
173
- * </code>
174
- *
175
- * @see src/app/code/community/Pepperjam/Network/etc/config.xml pepperjam/pepperjam_network/feeds contains mappings used for the affiliate feeds
176
- * @param array $callbackConfig
177
- * @param mixed $item
178
- * @return mixed
179
- */
180
- protected function _invokeCallback($callbackConfig, $item)
181
- {
182
- $obj = $this->_getCallbackInstance($callbackConfig);
183
- $params = isset($callbackConfig['params']) ? $callbackConfig['params'] : array();
184
- $item->setStoreId($this->getStore()->getId());
185
- $params['item'] = $item;
186
- $params['store'] = $this->getStore();
187
- $method = $callbackConfig['method'];
188
- if (method_exists($obj, $method)) {
189
- return $obj->$method($params);
190
- } else {
191
- throw new Pepperjam_Network_Exception_Configuration(
192
- sprintf(
193
- 'Configured callback method %s::%s does not exist',
194
- get_class($obj),
195
- $method
196
- )
197
- );
198
- }
199
- }
200
- /**
201
- * Get an instance of the configured callback.
202
- * @param array $callbackConfig
203
- * @return mixed
204
- */
205
- protected function _getCallbackInstance($callbackConfig)
206
- {
207
- $this->_validateCallbackConfig($callbackConfig);
208
- switch ($callbackConfig['type']) {
209
- // 'disabled' type callback mappings shouldn't pass through here under
210
- // "normal" circumstances (filtered out in apply mapping) but if they do,
211
- // do nothing and return null
212
- case 'disabled':
213
- return null;
214
- case 'helper':
215
- return Mage::helper($callbackConfig['class']);
216
- case 'model':
217
- return Mage::getModel($callbackConfig['class']);
218
- case 'singleton':
219
- default:
220
- return Mage::getSingleton($callbackConfig['class']);
221
- }
222
- }
223
- /**
224
- * Make sure the callback configuration is valid. If it isn't throw an
225
- * exception.
226
- * @param array $callbackConfig
227
- * @return self
228
- * @throws Pepperjam_Network_Exception_Configuration If callback configuration is not valid
229
- */
230
- protected function _validateCallbackConfig($callbackConfig)
231
- {
232
- if (empty($callbackConfig)) {
233
- throw new Pepperjam_Network_Exception_Configuration('Callback configuration is empty or missing.');
234
- }
235
- // When the callback is "disabled" no other configuration is necessary.
236
- if (isset($callbackConfig['type']) && $callbackConfig['type'] === 'disabled') {
237
- return $this;
238
- }
239
- // If not disabled, must have a class and method - separate checks for
240
- // more simply providing more useful error messages.
241
- $missingFields = array_diff(array('class', 'method', 'column_name'), array_keys($callbackConfig));
242
- if ($missingFields) {
243
- throw new Pepperjam_Network_Exception_Configuration(
244
- sprintf('Callback missing %s configuration.', implode(', ', $missingFields))
245
- );
246
- }
247
- return $this;
248
- }
249
- /**
250
- * Create the file and drop it in the configured export directory.
251
- * @param array $feedData
252
- * @return self
253
- */
254
- protected function _generateFile($feedData)
255
- {
256
- if (empty($feedData)) {
257
- return $this;
258
- }
259
- $delimiter = $this->_getDelimiter();
260
- $enclosure = $this->_getEnclosure();
261
-
262
- $tmpFile = fopen('php://temp', 'r+');
263
- fputcsv($tmpFile, $this->_getHeaders(), $delimiter, $enclosure);
264
- foreach ($feedData as $row) {
265
- fputcsv($tmpFile, $row, $delimiter, $enclosure);
266
- }
267
- rewind($tmpFile);
268
-
269
- $targetPath = $this->_generateFilePath();
270
- $this->_checkAndCreateFolder(dirname($targetPath));
271
-
272
- // send the contents of the temp stream to the actual file
273
- file_put_contents(
274
- $targetPath,
275
- stream_get_contents($tmpFile)
276
- );
277
- return $this;
278
- }
279
- /**
280
- * Generate the full path to the location where the file should be created.
281
- * @return string
282
- */
283
- protected function _generateFilePath()
284
- {
285
- return self::normalPaths(
286
- Mage::getBaseDir(),
287
- Mage::helper('pepperjam_network/config', $this->getStore())->getExportFilePath(),
288
- $this->_getFileName()
289
- );
290
- }
291
- /**
292
- * The CSV file headers should be the keys used in the configured mappings.
293
- * @return array
294
- */
295
- protected function _getHeaders()
296
- {
297
- $mappings = Mage::helper('pepperjam_network/config')->getCallbackMappings();
298
- $headers = array();
299
- foreach ($this->_getFeedFields() as $field) {
300
- $callbackMapping = isset($mappings[$field]) ? $mappings[$field] : array();
301
- if (!isset($callbackMapping['type']) || $callbackMapping['type'] !== 'disabled') {
302
- $this->_validateCallbackConfig($callbackMapping);
303
- $headers[] = $callbackMapping['column_name'];
304
- }
305
- }
306
- return $headers;
307
- }
308
- /**
309
- * Make sure that all necessary directories in the given path exist. Create
310
- * any that do not.
311
- * @param string $dirPath
312
- * @return self
313
- */
314
- protected function _checkAndCreateFolder($dirPath)
315
- {
316
- // Use the model factory to allow for DI via the factory
317
- $fileIo = Mage::getModel('Varien_Io_File');
318
- $fileIo->open(array('path' => Mage::getBaseDir()));
319
- $fileIo->checkAndCreateFolder($dirPath);
320
- return $this;
321
- }
322
- /**
323
- * Given an arbitrary array of arguments, join them to make a valid path.
324
- * @param string $_,... Parts of the path to be joined
325
- * @return string
326
- */
327
- public static function normalPaths()
328
- {
329
- $paths = implode(DS, func_get_args());
330
- // Retain a single leading slash; otherwise remove all leading, trailing
331
- // and duplicate slashes.
332
- return ((substr($paths, 0, 1) === DS) ? DS : '') .
333
- implode(DS, array_filter(explode(DS, $paths)));
334
- }
335
- }
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ abstract class Pepperjam_Network_Model_Feed_Abstract
18
+ {
19
+ // Query types for items
20
+ const ITEMS_CORRECTIONS = 'corrections';
21
+ const ITEMS_NEW = 'new';
22
+
23
+ /**
24
+ * The store context the feed is generated for. May be set to any viable store
25
+ * identified.
26
+ * @var Mage_Core_Model_Store
27
+ */
28
+ protected $_store;
29
+ protected $_feedType;
30
+ /**
31
+ * Get a collection of items to be included in the feed.
32
+ * @return Varien_Data_Collection
33
+ */
34
+ abstract protected function _getItems();
35
+ /**
36
+ * Get fields to include in the feed. Fields are expected to map to existing
37
+ * callbacks defined in the config.xml.
38
+ * @see self::_invokeCallback
39
+ * @return array
40
+ */
41
+ abstract protected function _getFeedFields();
42
+ /**
43
+ * Gets the filename format for the feed from config for this feed.
44
+ * @return string
45
+ */
46
+ abstract protected function _getFileName();
47
+ /**
48
+ * Get the delimiter to use in the csv file
49
+ * @return string
50
+ * @codeCoverageIgnore
51
+ */
52
+ protected function _getDelimiter()
53
+ {
54
+ return ',';
55
+ }
56
+ /**
57
+ * Get the encolsure to use in the csv file
58
+ * @return string
59
+ * @codeCoverageIgnore
60
+ */
61
+ protected function _getEnclosure()
62
+ {
63
+ return '"';
64
+ }
65
+ /**
66
+ * Set up the store property.
67
+ */
68
+ public function __construct($args = array())
69
+ {
70
+ // Set the store context to the given store or null which whill
71
+ // result in the "current" store.
72
+ $this->setStore(isset($args['store']) ? $args['store'] : null);
73
+ }
74
+ /**
75
+ * Set the store context for the feed, converting whatever viable store
76
+ * ID is passed in to an actual store instance.
77
+ * @see Mage_Core_Model_App::getStore for how various identifiers may be used to represent a store
78
+ * @param null|string|bool|int|Mage_Core_Model_Store
79
+ * @codeCoverageIgnore
80
+ */
81
+ public function setStore($storeId)
82
+ {
83
+ $this->_store = Mage::app()->getStore($storeId);
84
+ return $this;
85
+ }
86
+ /**
87
+ * Get the store instance the feed is being executed within.
88
+ * @return Mage_Core_Model_Store
89
+ * @codeCoverageIgnore
90
+ */
91
+ public function getStore()
92
+ {
93
+ return $this->_store;
94
+ }
95
+ /**
96
+ * Create the feed file and drop it in the configured export directory.
97
+ * @return self
98
+ */
99
+ public function generateFeed($feedType)
100
+ {
101
+ $this->_feedType = $feedType;
102
+ $this->_generateFile($this->_buildFeedData());
103
+ return $this;
104
+ }
105
+ /**
106
+ * Create arrays of data that should be included in the feed file. Each array
107
+ * should included a value for every field that is expected to be in the feed.
108
+ * @return array
109
+ */
110
+ protected function _buildFeedData()
111
+ {
112
+ $items = $this->_getItems();
113
+ // array_map must be on an array - $items is a collection so need to get the
114
+ // underlying array to pass to array_map
115
+ return array_map(array($this, '_applyMapping'), $items->getItems());
116
+ }
117
+ /**
118
+ * Use the callback mapping to create the data that represents the given item
119
+ * in the feed.
120
+ * @param mixed $item Likely a Varien_Object but could really be anything.
121
+ * @return array
122
+ */
123
+ protected function _applyMapping($item)
124
+ {
125
+ $fields = array();
126
+ $mappings = Mage::helper('pepperjam_network/config')->getCallbackMappings();
127
+ foreach ($this->_getFeedFields() as $feedField) {
128
+ // If the mapping doesn't exist, supplying an empty array will eventually
129
+ // result in an exception for being an invalid config mapping.
130
+ // @see self::_validateCallbackConfig
131
+ $callback = isset($mappings[$feedField]) ? $mappings[$feedField] : array();
132
+ // exclude any mappings that have a type of "disabled"
133
+ if (!isset($callback['type']) || $callback['type'] !== 'disabled') {
134
+ $fields[] = $this->_invokeCallback($callback, $item);
135
+ }
136
+ }
137
+ return $fields;
138
+ }
139
+ /**
140
+ * Given a set of callback configuration and an item, invoke the configured
141
+ * callback and return the value. The callback configuration must meet the
142
+ * following requirements:
143
+ * - May contain a "type" key indicating the type of factory to use. May be
144
+ * one of:
145
+ * - "disabled" - will not be included in the feed
146
+ * - "helper" - will use the Mage::helper factory
147
+ * - "model" - will use the Mage::getModel factory
148
+ * - "singleton" - will use the Mage::getSingleton factory
149
+ * - If not included, will default to "singleton"
150
+ * - When type is "disabled" no other key/value pairs are required.
151
+ * - If type is not "disabled" the following must be included:
152
+ * - "class" must be a valid class alias for the configured factory type
153
+ * - "method" must be a valid method on the configured class
154
+ * - A "params" key may also be included. If included, its value must be
155
+ * an array of key/value pairs that will be included in the params array
156
+ * passed to the callback method.
157
+ * Every callback will be called with an array of params. The array will
158
+ * contain any key/value pairs added in the config as well as an "item" key
159
+ * which will have the item being mapped as the value and a "store" key which
160
+ * will have the store instance representing the store view context the feed
161
+ * is being generated for.
162
+ *
163
+ * Example configuration:
164
+ * <code>
165
+ * // This callback configuration array:
166
+ * $cfg = array(
167
+ * 'type' => 'helper',
168
+ * 'class' => 'pepperjam_network/map',
169
+ * 'column_name' => 'OID',
170
+ * 'params' => array(
171
+ * 'key' => 'increment_id',
172
+ * ),
173
+ * );
174
+ * // Will result in the following invocation:
175
+ * Mage::helper('pepperjam_network/map')->getDataValue(
176
+ * array('key' => 'increment_id', 'item' => $item)
177
+ * );
178
+ * </code>
179
+ *
180
+ * @see src/app/code/community/Pepperjam/Network/etc/config.xml pepperjam/pepperjam_network/feeds contains mappings used for the affiliate feeds
181
+ * @param array $callbackConfig
182
+ * @param mixed $item
183
+ * @return mixed
184
+ */
185
+ protected function _invokeCallback($callbackConfig, $item)
186
+ {
187
+ $obj = $this->_getCallbackInstance($callbackConfig);
188
+ $params = isset($callbackConfig['params']) ? $callbackConfig['params'] : array();
189
+ $item->setStoreId($this->getStore()->getId());
190
+ $params['item'] = $item;
191
+ $params['store'] = $this->getStore();
192
+ $method = $callbackConfig['method'];
193
+ if (method_exists($obj, $method)) {
194
+ return $obj->$method($params);
195
+ } else {
196
+ throw new Pepperjam_Network_Exception_Configuration(
197
+ sprintf(
198
+ 'Configured callback method %s::%s does not exist',
199
+ get_class($obj),
200
+ $method
201
+ )
202
+ );
203
+ }
204
+ }
205
+ /**
206
+ * Get an instance of the configured callback.
207
+ * @param array $callbackConfig
208
+ * @return mixed
209
+ */
210
+ protected function _getCallbackInstance($callbackConfig)
211
+ {
212
+ $this->_validateCallbackConfig($callbackConfig);
213
+ switch ($callbackConfig['type']) {
214
+ // 'disabled' type callback mappings shouldn't pass through here under
215
+ // "normal" circumstances (filtered out in apply mapping) but if they do,
216
+ // do nothing and return null
217
+ case 'disabled':
218
+ return null;
219
+ case 'helper':
220
+ return Mage::helper($callbackConfig['class']);
221
+ case 'model':
222
+ return Mage::getModel($callbackConfig['class']);
223
+ case 'singleton':
224
+ default:
225
+ return Mage::getSingleton($callbackConfig['class']);
226
+ }
227
+ }
228
+ /**
229
+ * Make sure the callback configuration is valid. If it isn't throw an
230
+ * exception.
231
+ * @param array $callbackConfig
232
+ * @return self
233
+ * @throws Pepperjam_Network_Exception_Configuration If callback configuration is not valid
234
+ */
235
+ protected function _validateCallbackConfig($callbackConfig)
236
+ {
237
+ if (empty($callbackConfig)) {
238
+ throw new Pepperjam_Network_Exception_Configuration('Callback configuration is empty or missing.');
239
+ }
240
+ // When the callback is "disabled" no other configuration is necessary.
241
+ if (isset($callbackConfig['type']) && $callbackConfig['type'] === 'disabled') {
242
+ return $this;
243
+ }
244
+ // If not disabled, must have a class and method - separate checks for
245
+ // more simply providing more useful error messages.
246
+ $missingFields = array_diff(array('class', 'method', 'column_name'), array_keys($callbackConfig));
247
+ if ($missingFields) {
248
+ throw new Pepperjam_Network_Exception_Configuration(
249
+ sprintf('Callback missing %s configuration.', implode(', ', $missingFields))
250
+ );
251
+ }
252
+ return $this;
253
+ }
254
+ /**
255
+ * Create the file and drop it in the configured export directory.
256
+ * @param array $feedData
257
+ * @return self
258
+ */
259
+ protected function _generateFile($feedData)
260
+ {
261
+ if (empty($feedData)) {
262
+ return $this;
263
+ }
264
+ $delimiter = $this->_getDelimiter();
265
+ $enclosure = $this->_getEnclosure();
266
+
267
+ $tmpFile = fopen('php://temp', 'r+');
268
+ fputcsv($tmpFile, $this->_getHeaders(), $delimiter, $enclosure);
269
+ foreach ($feedData as $row) {
270
+ fputcsv($tmpFile, $row, $delimiter, $enclosure);
271
+ }
272
+ rewind($tmpFile);
273
+
274
+ $targetPath = $this->_generateFilePath();
275
+ $this->_checkAndCreateFolder(dirname($targetPath));
276
+
277
+ // send the contents of the temp stream to the actual file
278
+ file_put_contents(
279
+ $targetPath,
280
+ stream_get_contents($tmpFile)
281
+ );
282
+ return $this;
283
+ }
284
+ /**
285
+ * Generate the full path to the location where the file should be created.
286
+ * @return string
287
+ */
288
+ protected function _generateFilePath()
289
+ {
290
+ return self::normalPaths(
291
+ Mage::getBaseDir(),
292
+ Mage::helper('pepperjam_network/config', $this->getStore())->getExportFilePath(),
293
+ $this->_getFileName()
294
+ );
295
+ }
296
+ /**
297
+ * The CSV file headers should be the keys used in the configured mappings.
298
+ * @return array
299
+ */
300
+ protected function _getHeaders()
301
+ {
302
+ $mappings = Mage::helper('pepperjam_network/config')->getCallbackMappings();
303
+ $headers = array();
304
+ foreach ($this->_getFeedFields() as $field) {
305
+ $callbackMapping = isset($mappings[$field]) ? $mappings[$field] : array();
306
+ if (!isset($callbackMapping['type']) || $callbackMapping['type'] !== 'disabled') {
307
+ $this->_validateCallbackConfig($callbackMapping);
308
+ $headers[] = $callbackMapping['column_name'];
309
+ }
310
+ }
311
+ return $headers;
312
+ }
313
+ /**
314
+ * Make sure that all necessary directories in the given path exist. Create
315
+ * any that do not.
316
+ * @param string $dirPath
317
+ * @return self
318
+ */
319
+ protected function _checkAndCreateFolder($dirPath)
320
+ {
321
+ // Use the model factory to allow for DI via the factory
322
+ $fileIo = Mage::getModel('Varien_Io_File');
323
+ $fileIo->open(array('path' => Mage::getBaseDir()));
324
+ $fileIo->checkAndCreateFolder($dirPath);
325
+ return $this;
326
+ }
327
+ /**
328
+ * Given an arbitrary array of arguments, join them to make a valid path.
329
+ * @param string $_,... Parts of the path to be joined
330
+ * @return string
331
+ */
332
+ public static function normalPaths()
333
+ {
334
+ $paths = implode(DS, func_get_args());
335
+ // Retain a single leading slash; otherwise remove all leading, trailing
336
+ // and duplicate slashes.
337
+ return ((substr($paths, 0, 1) === DS) ? DS : '') .
338
+ implode(DS, array_filter(explode(DS, $paths)));
339
+ }
340
+ }
app/code/community/Pepperjam/Network/Model/Feed/Order/Abstract.php CHANGED
@@ -1,70 +1,189 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- abstract class Pepperjam_Network_Model_Feed_Order_Abstract extends Pepperjam_Network_Model_Feed_Abstract
18
- {
19
- // Time format to use for the SQL statements
20
- const SELECT_TIME_FORMAT = 'Y-m-d H:i:s';
21
- const FILENAME_TIME_FORMAT = 'YmdHis';
22
- /**
23
- * Time stamp considered to be the time at which the feed runs - used for
24
- * generating the file name and the cutoff time for capturing order changes.
25
- * @var int
26
- */
27
- protected $_startTime;
28
- /**
29
- * Allow for the "start" time of the feed to be passed in the constructor
30
- * $args array. If given, this should be the time at which the feed is run.
31
- * @param array $args
32
- */
33
- public function __construct($args = array())
34
- {
35
- parent::__construct($args);
36
- $this->_startTime = isset($args['start_time']) ? $args['start_time'] : time();
37
- }
38
- /**
39
- * Get the ids of all stores that should be included in the feed. Only orders
40
- * placed for these stores will be included in the corrected feed.
41
- * @return array
42
- */
43
- protected function _getStoreIdsToInclude()
44
- {
45
- return array_map(
46
- function ($store) {
47
- return $store->getId();
48
- },
49
- Mage::helper('pepperjam_network')->getAllStoresForProgramId(
50
- Mage::helper('pepperjam_network/config')->getProgramId($this->_store)
51
- )
52
- );
53
- }
54
- /**
55
- * @see parent::_getFileName
56
- */
57
- protected function _getFileName()
58
- {
59
- return sprintf(
60
- $this->_getFileNameFormat(),
61
- Mage::helper('pepperjam_network/config')->getProgramId($this->getStore()),
62
- date(static::FILENAME_TIME_FORMAT, $this->_startTime)
63
- );
64
- }
65
- /**
66
- * Get the format string used to build the feed file name.
67
- * @return string
68
- */
69
- abstract protected function _getFileNameFormat();
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ abstract class Pepperjam_Network_Model_Feed_Order_Abstract extends Pepperjam_Network_Model_Feed_Abstract
18
+ {
19
+ // Time format to use for the SQL statements
20
+ const SELECT_TIME_FORMAT = 'Y-m-d H:i:s';
21
+ const FILENAME_TIME_FORMAT = 'YmdHis';
22
+
23
+ /**
24
+ * Time stamp considered to be the time at which the feed runs - used for
25
+ * generating the file name and the cutoff time for capturing order changes.
26
+ * @var int
27
+ */
28
+ protected $_startTime;
29
+ /**
30
+ * Allow for the "start" time of the feed to be passed in the constructor
31
+ * $args array. If given, this should be the time at which the feed is run.
32
+ * @param array $args
33
+ */
34
+ public function __construct($args = array())
35
+ {
36
+ parent::__construct($args);
37
+ $this->_startTime = isset($args['start_time']) ? $args['start_time'] : time();
38
+ }
39
+ /**
40
+ * Get the ids of all stores that should be included in the feed. Only orders
41
+ * placed for these stores will be included in the corrected feed.
42
+ * @return array
43
+ */
44
+ protected function _getStoreIdsToInclude()
45
+ {
46
+ return array_map(
47
+ function ($store) {
48
+ return $store->getId();
49
+ },
50
+ Mage::helper('pepperjam_network')->getAllStoresForProgramId(
51
+ Mage::helper('pepperjam_network/config')->getProgramId($this->_store)
52
+ )
53
+ );
54
+ }
55
+ /**
56
+ * @see parent::_getFileName
57
+ */
58
+ protected function _getFileName()
59
+ {
60
+ return sprintf(
61
+ $this->_getFileNameFormat(),
62
+ Mage::helper('pepperjam_network/config')->getProgramId($this->getStore()),
63
+ date(static::FILENAME_TIME_FORMAT, $this->_startTime)
64
+ );
65
+ }
66
+ /**
67
+ * Get the format string used to build the feed file name.
68
+ * @return string
69
+ */
70
+ protected function _getFileNameFormat()
71
+ {
72
+ if ($this->_feedType == self::ITEMS_NEW) {
73
+ return Mage::helper('pepperjam_network/config')->getOrderFeedFileFormat();
74
+ } else {
75
+ return Mage::helper('pepperjam_network/config')->getOrderCorrectionFeedFileFormat();
76
+ }
77
+ }
78
+
79
+ protected function _getBasicItems()
80
+ {
81
+ if ($this->_feedType == self::ITEMS_NEW) {
82
+ $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderLastRunTime() ?: 0);
83
+ } else {
84
+ $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderCorrectionLastRunTime() ?: 0);
85
+ }
86
+ $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderLastRunTime() ?: 0);
87
+ $startTime = date(static::SELECT_TIME_FORMAT, $this->_startTime);
88
+ $storeIds = $this->_getStoreIdsToInclude();
89
+
90
+ $collection = Mage::getResourceModel('sales/order_collection');
91
+ $select = $collection->getSelect();
92
+ $select
93
+ ->joinLeft(
94
+ array('cmo' => $collection->getTable('sales/creditmemo')),
95
+ 'main_table.entity_id = cmo.order_id',
96
+ array()
97
+ )
98
+ // this is far more pure SQL than should be here but I don't see a way to
99
+ // get the proper groupings of where clauses without doing this
100
+ ->where(
101
+ 'main_table.store_id IN (?) AND main_table.network_source IS NOT NULL',
102
+ $storeIds
103
+ );
104
+
105
+ if ($this->_feedType == self::ITEMS_NEW) {
106
+ $config = Mage::helper('pepperjam_network/config');
107
+ if ($config->trackByFeed()) {
108
+ $select->where("main_table.state = 'complete'")
109
+ ->where("main_table.created_at >= :lastRunTime")
110
+ ->where("main_table.created_at < :startTime");
111
+ } else {
112
+ $select->where("relation_parent_id IS NOT NULL")
113
+ ->where("main_table.state = 'complete'")
114
+ ->where("main_table.created_at >= :lastRunTime")
115
+ ->where("main_table.created_at < :startTime");
116
+ }
117
+ } else {
118
+ $select->where(
119
+ "(cmo.created_at IS NOT NULL AND cmo.created_at >= :lastRunTime AND cmo.created_at < :startTime) OR" .
120
+ "(main_table.state = 'canceled' AND main_table.updated_at >= :lastRunTime AND main_table.updated_at < :startTime)"
121
+ );
122
+ }
123
+
124
+ $collection->addBindParam(':lastRunTime', $lastRunTime)
125
+ ->addBindParam(':startTime', $startTime);
126
+
127
+ return $collection;
128
+ }
129
+
130
+ protected function _getItemizedItems()
131
+ {
132
+ if ($this->_feedType == self::ITEMS_NEW) {
133
+ $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderLastRunTime() ?: 0);
134
+ } else {
135
+ $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderCorrectionLastRunTime() ?: 0);
136
+ }
137
+ $startTime = date(static::SELECT_TIME_FORMAT, $this->_startTime);
138
+ $storeIds = $this->_getStoreIdsToInclude();
139
+
140
+ $collection = Mage::getResourceModel('sales/order_item_collection');
141
+ $select = $collection->getSelect();
142
+ $select
143
+ ->joinLeft(
144
+ array('o' => $collection->getTable('sales/order')),
145
+ 'main_table.order_id = o.entity_id',
146
+ array('o.increment_id', 'o.original_increment_id')
147
+ )
148
+ ->joinLeft(
149
+ array('cmo' => $collection->getTable('sales/creditmemo')),
150
+ 'main_table.order_id = cmo.order_id',
151
+ array()
152
+ )
153
+ // this is far more pure SQL than should be here but I don't see a way to
154
+ // get the proper groupings of where clauses without doing this
155
+ ->where(
156
+ // get only items within the correct store scope and filter out any
157
+ // configurable used simple products
158
+ 'main_table.store_id IN (?) AND o.network_source IS NOT NULL AND NOT (main_table.product_type="simple" AND main_table.parent_item_id IS NOT NULL AND main_table.row_total=0)',
159
+ $storeIds
160
+ )
161
+ // The left joins can leave duplicate item rows
162
+ // But the selected items will be identical, so we don't need them.
163
+ ->distinct();
164
+
165
+ if ($this->_feedType == self::ITEMS_NEW) {
166
+ $config = Mage::helper('pepperjam_network/config');
167
+ if ($config->trackByFeed()) {
168
+ $select->where("o.state = 'complete'")
169
+ ->where("o.updated_at >= :lastRunTime")
170
+ ->where("o.updated_at < :startTime");
171
+ } else {
172
+ $select->where("o.relation_parent_id IS NOT NULL")
173
+ ->where("o.state = 'complete'")
174
+ ->where("o.updated_at >= :lastRunTime")
175
+ ->where("o.updated_at < :startTime");
176
+ }
177
+ } else {
178
+ $select->where(
179
+ "(cmo.created_at IS NOT NULL AND cmo.created_at >= :lastRunTime AND cmo.created_at < :startTime) OR " .
180
+ "(o.state = 'canceled' AND o.updated_at >= :lastRunTime AND o.updated_at < :startTime)"
181
+ );
182
+ }
183
+
184
+ $collection->addBindParam(':lastRunTime', $lastRunTime)
185
+ ->addBindParam(':startTime', $startTime);
186
+
187
+ return $collection;
188
+ }
189
+ }
app/code/community/Pepperjam/Network/Model/Feed/Order/Basic.php CHANGED
@@ -1,73 +1,42 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_Feed_Order_Basic extends Pepperjam_Network_Model_Feed_Order_Abstract
18
- {
19
- /**
20
- * @see parent::_getItems
21
- */
22
- protected function _getItems()
23
- {
24
- $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderLastRunTime() ?: 0);
25
- $startTime = date(static::SELECT_TIME_FORMAT, $this->_startTime);
26
- $storeIds = $this->_getStoreIdsToInclude();
27
-
28
- $collection = Mage::getResourceModel('sales/order_collection');
29
- $select = $collection->getSelect();
30
- $select
31
- ->joinLeft(
32
- array('cmo' => $collection->getTable('sales/creditmemo')),
33
- 'main_table.entity_id = cmo.order_id',
34
- array()
35
- )
36
- // this is far more pure SQL than should be here but I don't see a way to
37
- // get the proper groupings of where clauses without doing this
38
- ->where(
39
- 'main_table.store_id IN (?)',
40
- $storeIds
41
- )
42
- ->where(
43
- "(main_table.original_increment_id IS NOT NULL AND main_table.created_at >= :lastRunTime AND main_table.created_at < :startTime) OR" .
44
- "(cmo.created_at IS NOT NULL AND cmo.created_at >= :lastRunTime AND cmo.created_at < :startTime) OR" .
45
- "(main_table.state = 'canceled' AND main_table.updated_at >= :lastRunTime AND main_table.updated_at < :startTime AND main_table.relation_child_id IS NULL)"
46
- );
47
-
48
- $collection->addBindParam(':lastRunTime', $lastRunTime)
49
- ->addBindParam(':startTime', $startTime);
50
-
51
- return $collection;
52
- }
53
- /**
54
- * Get an array of callback mappings for the feed. Should result in an array
55
- * with keys for the field in the CSV and a value of an array used to
56
- * represent a mapping callback.
57
- * @see parent::_invokeCallback
58
- */
59
- protected function _getFeedFields()
60
- {
61
- return explode(',', Mage::helper('pepperjam_network/config')->getBasicOrderFeedFields());
62
- }
63
- /**
64
- * Get the file name format from config. Doesn't pass store context as the
65
- * file name format should only ever exist at the global level.
66
- * @see parent::_getFileNameFormat
67
- * @codeCoverageIgnore
68
- */
69
- protected function _getFileNameFormat()
70
- {
71
- return Mage::helper('pepperjam_network/config')->getBasicOrderFeedFileFormat();
72
- }
73
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_Feed_Order_Basic extends Pepperjam_Network_Model_Feed_Order_Abstract
18
+ {
19
+ /**
20
+ * @see parent::_getItems
21
+ */
22
+ protected function _getItems()
23
+ {
24
+ return $this->_getBasicItems();
25
+ }
26
+ /**
27
+ * Get an array of callback mappings for the feed. Should result in an array
28
+ * with keys for the field in the CSV and a value of an array used to
29
+ * represent a mapping callback.
30
+ * @see parent::_invokeCallback
31
+ */
32
+ protected function _getFeedFields()
33
+ {
34
+ if ($this->_feedType == self::ITEMS_NEW) {
35
+ $fields = Mage::helper('pepperjam_network/config')->getBasicOrderFeedFields();
36
+ } else {
37
+ $fields = Mage::helper('pepperjam_network/config')->getBasicOrderCorrectionFeedFields();
38
+ }
39
+
40
+ return explode(',', $fields);
41
+ }
42
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Pepperjam/Network/Model/Feed/Order/Dynamic.php CHANGED
@@ -1,82 +1,40 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_Feed_Order_Dynamic extends Pepperjam_Network_Model_Feed_Order_Abstract
18
- {
19
- /**
20
- * @see parent::_getItems
21
- */
22
- protected function _getItems()
23
- {
24
- $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderLastRunTime() ?: 0);
25
- $startTime = date(static::SELECT_TIME_FORMAT, $this->_startTime);
26
- $storeIds = $this->_getStoreIdsToInclude();
27
-
28
- $collection = Mage::getResourceModel('sales/order_item_collection');
29
- $select = $collection->getSelect();
30
- $select
31
- ->joinLeft(
32
- array('o' => $collection->getTable('sales/order')),
33
- 'main_table.order_id = o.entity_id',
34
- array('o.increment_id', 'o.original_increment_id')
35
- )
36
- ->joinLeft(
37
- array('cmo' => $collection->getTable('sales/creditmemo')),
38
- 'main_table.order_id = cmo.order_id',
39
- array()
40
- )
41
- // this is far more pure SQL than should be here but I don't see a way to
42
- // get the proper groupings of where clauses without doing this
43
- ->where(
44
- // get only items within the correct store scope and filter out any
45
- // configurable used simple products
46
- 'main_table.store_id IN (?) AND NOT (main_table.product_type="simple" AND main_table.parent_item_id IS NOT NULL AND main_table.row_total=0)',
47
- $storeIds
48
- )
49
- ->where(
50
- "(o.original_increment_id IS NOT NULL AND o.created_at >= :lastRunTime AND o.created_at < :startTime) OR " .
51
- "(cmo.created_at IS NOT NULL AND cmo.created_at >= :lastRunTime AND cmo.created_at < :startTime) OR " .
52
- "(o.state = 'canceled' AND o.updated_at >= :lastRunTime AND o.updated_at < :startTime AND o.relation_child_id IS NULL)"
53
- )
54
- // The left joins can leave duplicate item rows
55
- // But the selected items will be identical, so we don't need them.
56
- ->distinct();
57
-
58
- $collection->addBindParam(':lastRunTime', $lastRunTime)
59
- ->addBindParam(':startTime', $startTime);
60
-
61
- return $collection;
62
- }
63
-
64
- /**
65
- * @see parent::_getFeedFields
66
- */
67
- protected function _getFeedFields()
68
- {
69
- return explode(',', Mage::helper('pepperjam_network/config')->getDynamicOrderFeedFields());
70
- }
71
-
72
- /**
73
- * Get the file name format from config. Doesn't pass store context as the
74
- * file name format should only ever exist at the global level.
75
- * @see parent::_getFileNameFormat
76
- * @codeCoverageIgnore
77
- */
78
- protected function _getFileNameFormat()
79
- {
80
- return Mage::helper('pepperjam_network/config')->getDynamicOrderFeedFileFormat();
81
- }
82
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_Feed_Order_Dynamic extends Pepperjam_Network_Model_Feed_Order_Abstract
18
+ {
19
+ /**
20
+ * @see parent::_getItems
21
+ */
22
+ protected function _getItems()
23
+ {
24
+ return $this->_getItemizedItems();
25
+ }
26
+
27
+ /**
28
+ * @see parent::_getFeedFields
29
+ */
30
+ protected function _getFeedFields()
31
+ {
32
+ if ($this->_feedType == self::ITEMS_NEW) {
33
+ $fields = Mage::helper('pepperjam_network/config')->getDynamicOrderFeedFields();
34
+ } else {
35
+ $fields = Mage::helper('pepperjam_network/config')->getDynamicOrderCorrectionFeedFields();
36
+ }
37
+
38
+ return explode(',', $fields);
39
+ }
40
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Pepperjam/Network/Model/Feed/Order/Itemized.php CHANGED
@@ -1,80 +1,39 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_Feed_Order_Itemized extends Pepperjam_Network_Model_Feed_Order_Abstract
18
- {
19
- /**
20
- * @see parent::_getItems
21
- */
22
- protected function _getItems()
23
- {
24
- $lastRunTime = date(static::SELECT_TIME_FORMAT, Mage::helper('pepperjam_network/config')->getOrderLastRunTime() ?: 0);
25
- $startTime = date(static::SELECT_TIME_FORMAT, $this->_startTime);
26
- $storeIds = $this->_getStoreIdsToInclude();
27
-
28
- $collection = Mage::getResourceModel('sales/order_item_collection');
29
- $select = $collection->getSelect();
30
- $select
31
- ->joinLeft(
32
- array('o' => $collection->getTable('sales/order')),
33
- 'main_table.order_id = o.entity_id',
34
- array('o.increment_id', 'o.original_increment_id')
35
- )
36
- ->joinLeft(
37
- array('cmo' => $collection->getTable('sales/creditmemo')),
38
- 'main_table.order_id = cmo.order_id',
39
- array()
40
- )
41
- // this is far more pure SQL than should be here but I don't see a way to
42
- // get the proper groupings of where clauses without doing this
43
- ->where(
44
- // get only items within the correct store scope and filter out any
45
- // configurable used simple products
46
- 'main_table.store_id IN (?) AND NOT (main_table.product_type="simple" AND main_table.parent_item_id IS NOT NULL AND main_table.row_total=0)',
47
- $storeIds
48
- )
49
- ->where(
50
- "(o.original_increment_id IS NOT NULL AND o.created_at >= :lastRunTime AND o.created_at < :startTime) OR " .
51
- "(cmo.created_at IS NOT NULL AND cmo.created_at >= :lastRunTime AND cmo.created_at < :startTime) OR " .
52
- "(o.state = 'canceled' AND o.updated_at >= :lastRunTime AND o.updated_at < :startTime AND o.relation_child_id IS NULL)"
53
- )
54
- // The left joins can leave duplicate item rows
55
- // But the selected items will be identical, so we don't need them.
56
- ->distinct();
57
-
58
- $collection->addBindParam(':lastRunTime', $lastRunTime)
59
- ->addBindParam(':startTime', $startTime);
60
-
61
- return $collection;
62
- }
63
- /**
64
- * @see parent::_getFeedFields
65
- */
66
- protected function _getFeedFields()
67
- {
68
- return explode(',', Mage::helper('pepperjam_network/config')->getItemizedOrderFeedFields());
69
- }
70
- /**
71
- * Get the file name format from config. Doesn't pass store context as the
72
- * file name format should only ever exist at the global level.
73
- * @see parent::_getFileNameFormat
74
- * @codeCoverageIgnore
75
- */
76
- protected function _getFileNameFormat()
77
- {
78
- return Mage::helper('pepperjam_network/config')->getItemizedOrderFeedFileFormat();
79
- }
80
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_Feed_Order_Itemized extends Pepperjam_Network_Model_Feed_Order_Abstract
18
+ {
19
+ /**
20
+ * @see parent::_getItems
21
+ */
22
+ protected function _getItems()
23
+ {
24
+ return $this->_getItemizedItems();
25
+ }
26
+ /**
27
+ * @see parent::_getFeedFields
28
+ */
29
+ protected function _getFeedFields()
30
+ {
31
+ if ($this->_feedType == self::ITEMS_NEW) {
32
+ $fields = Mage::helper('pepperjam_network/config')->getItemizedOrderFeedFields();
33
+ } else {
34
+ $fields = Mage::helper('pepperjam_network/config')->getItemizedOrderCorrectionFeedFields();
35
+ }
36
+
37
+ return explode(',', $fields);
38
+ }
39
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Pepperjam/Network/Model/Feed/Product.php CHANGED
@@ -1,96 +1,108 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_Feed_Product extends Pepperjam_Network_Model_Feed_Abstract
18
- {
19
- const DELIMITER = "\t";
20
- /**
21
- * @see parent::_getItems
22
- */
23
- protected function _getItems()
24
- {
25
- return Mage::getResourceModel('catalog/product_collection')
26
- ->setStore($this->getStore())
27
- ->addAttributeToSelect(array('*'))
28
- ->addStoreFilter($this->getStore())
29
- ->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
30
- }
31
- /**
32
- * Get an array of callback mappings for the feed. Should result in an array
33
- * with keys for the field in the CSV and a value of an array used to
34
- * represent a mapping callback.
35
- * @see parent::_invokeCallback
36
- */
37
- protected function _getFeedFields()
38
- {
39
- $store = $this->getStore();
40
- $callbackMap = Mage::helper('pepperjam_network/config')->getCallbackMappings($store);
41
- return array_filter(array_map(
42
- function ($key) use ($callbackMap) {
43
- return isset($callbackMap[$key])? $callbackMap[$key]['column_name'] : null;
44
- },
45
- array_keys(Mage::helper('pepperjam_network/config')->getProductFeedFields($store))
46
- ));
47
- }
48
- /**
49
- * @see parent::_applyMapping
50
- * @param mixed $item Likely a Varien_Object but could really be anything.
51
- * @return array
52
- */
53
- protected function _applyMapping($item)
54
- {
55
- $fields = array();
56
- $helper = Mage::helper('pepperjam_network/config');
57
- $store = $this->getStore();
58
- $mappings = $helper->getCallbackMappings($store);
59
- $columns = $helper->getProductFeedFields($store);
60
- foreach ($this->_getFeedFields() as $feedField) {
61
- // If the mapping doesn't exist, supplying an empty array will eventually
62
- // result in an exception for being an invalid config mapping.
63
- // @see self::_validateCallbackConfig
64
- $callback = isset($mappings[$feedField]) ? $mappings[$feedField] : array();
65
- if ($columns[$feedField]) {
66
- $callback['params']['key'] = $columns[$feedField];
67
- }
68
- // exclude any mappings that have a type of "disabled"
69
- if (!isset($callback['type']) || $callback['type'] !== 'disabled') {
70
- $fields[] = $this->_invokeCallback($callback, $item);
71
- }
72
- }
73
- return $fields;
74
- }
75
- /**
76
- * @see parent::_getFileName
77
- */
78
- protected function _getFileName()
79
- {
80
- $config = Mage::helper('pepperjam_network/config');
81
- $store = $this->getStore();
82
- return sprintf(
83
- $config->getProductFeedFilenameFormat($store),
84
- $config->getProgramId($this->getStore($store))
85
- );
86
- }
87
- /**
88
- * @see Pepperjam_Network_Model_Feed_Abstract::_getDelimiter
89
- * @return string
90
- * @codeCoverageIgnore
91
- */
92
- protected function _getDelimiter()
93
- {
94
- return static::DELIMITER;
95
- }
96
- }
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_Feed_Product extends Pepperjam_Network_Model_Feed_Abstract
18
+ {
19
+ const DELIMITER = "\t";
20
+ const FIELD_PRODUCT_URL = 'product_url';
21
+ /**
22
+ * @see parent::_getItems
23
+ */
24
+ protected function _getItems()
25
+ {
26
+ $store = $this->getStore();
27
+ $requiredMap = Mage::helper('pepperjam_network/config')->getRequiredProductFeedFields($store);
28
+
29
+ $productCollection = Mage::getResourceModel('catalog/product_collection')
30
+ ->setStore($this->getStore())
31
+ ->addAttributeToSelect(array('*'))
32
+ ->addStoreFilter($this->getStore())
33
+ ->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
34
+
35
+ foreach ($requiredMap as $field) {
36
+ if ($field != self::FIELD_PRODUCT_URL) {
37
+ $productCollection->addFieldToFilter($field, array('notnull' => true));
38
+ }
39
+ }
40
+
41
+ return $productCollection;
42
+ }
43
+ /**
44
+ * Get an array of callback mappings for the feed. Should result in an array
45
+ * with keys for the field in the CSV and a value of an array used to
46
+ * represent a mapping callback.
47
+ * @see parent::_invokeCallback
48
+ */
49
+ protected function _getFeedFields()
50
+ {
51
+ $store = $this->getStore();
52
+ $callbackMap = Mage::helper('pepperjam_network/config')->getCallbackMappings($store);
53
+ return array_filter(array_map(
54
+ function ($key) use ($callbackMap) {
55
+ return isset($callbackMap[$key])? $callbackMap[$key]['column_name'] : null;
56
+ },
57
+ array_keys(Mage::helper('pepperjam_network/config')->getProductFeedFields($store))
58
+ ));
59
+ }
60
+ /**
61
+ * @see parent::_applyMapping
62
+ * @param mixed $item Likely a Varien_Object but could really be anything.
63
+ * @return array
64
+ */
65
+ protected function _applyMapping($item)
66
+ {
67
+ $fields = array();
68
+ $helper = Mage::helper('pepperjam_network/config');
69
+ $store = $this->getStore();
70
+ $mappings = $helper->getCallbackMappings($store);
71
+ $columns = $helper->getProductFeedFields($store);
72
+ foreach ($this->_getFeedFields() as $feedField) {
73
+ // If the mapping doesn't exist, supplying an empty array will eventually
74
+ // result in an exception for being an invalid config mapping.
75
+ // @see self::_validateCallbackConfig
76
+ $callback = isset($mappings[$feedField]) ? $mappings[$feedField] : array();
77
+ if ($columns[$feedField]) {
78
+ $callback['params']['key'] = $columns[$feedField];
79
+ }
80
+ // exclude any mappings that have a type of "disabled"
81
+ if (!isset($callback['type']) || $callback['type'] !== 'disabled') {
82
+ $fields[] = $this->_invokeCallback($callback, $item);
83
+ }
84
+ }
85
+ return $fields;
86
+ }
87
+ /**
88
+ * @see parent::_getFileName
89
+ */
90
+ protected function _getFileName()
91
+ {
92
+ $config = Mage::helper('pepperjam_network/config');
93
+ $store = $this->getStore();
94
+ return sprintf(
95
+ $config->getProductFeedFilenameFormat($store),
96
+ $config->getProgramId($this->getStore($store))
97
+ );
98
+ }
99
+ /**
100
+ * @see Pepperjam_Network_Model_Feed_Abstract::_getDelimiter
101
+ * @return string
102
+ * @codeCoverageIgnore
103
+ */
104
+ protected function _getDelimiter()
105
+ {
106
+ return static::DELIMITER;
107
+ }
108
+ }
app/code/community/Pepperjam/Network/Model/Observer.php CHANGED
@@ -1,74 +1,123 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_Observer
18
- {
19
- const PRODUCT_LOG_MESSAGE = 'Generating Product feed: program id %s, default store view: %s';
20
- /**
21
- * This observer method is the entry point to generating product feed when
22
- * the CRONJOB 'pepperjam_network_generate_product_feed' run.
23
- * @return void
24
- */
25
- public function createProductFeed()
26
- {
27
- if (!Mage::getStoreConfig('pepperjam/pepperjam_network/product_feed_enabled')) {
28
- Mage::log(Mage::helper('pepperjam_network')->__('Product feed disabled'), Zend_Log::NOTICE);
29
- return;
30
- }
31
-
32
- $helper = Mage::helper('pepperjam_network');
33
- foreach ($helper->getAllProgramIds() as $programId) {
34
- $store = $helper->getStoreForProgramId($programId);
35
- Mage::log(
36
- sprintf(static::PRODUCT_LOG_MESSAGE, $programId, $store->getName()),
37
- Zend_Log::INFO
38
- );
39
-
40
- Mage::getModel('pepperjam_network/feed_product', array(
41
- 'store' => $store
42
- ))->generateFeed();
43
- }
44
- }
45
- /**
46
- * Generate the order corrected feed.
47
- * @return self
48
- */
49
- public function createCorrectedOrdersFeed()
50
- {
51
- if (!Mage::getStoreConfig('pepperjam/pepperjam_network/order_feed_enabled')) {
52
- Mage::log(Mage::helper('pepperjam_network')->__('Corrected order feed disabled'), Zend_Log::NOTICE);
53
- return;
54
- }
55
-
56
- $startTime = time();
57
-
58
- $feedAlias = 'feed_order_'.Mage::helper('pepperjam_network/config')->getOrderType();
59
-
60
- Mage::log(sprintf('[%s] Generating %s feed', __CLASS__, $feedAlias), Zend_Log::INFO);
61
-
62
- $helper = Mage::helper('pepperjam_network');
63
- foreach ($helper->getAllProgramIds() as $programId) {
64
- Mage::getModel(
65
- "pepperjam_network/{$feedAlias}",
66
- array('store' => $helper->getStoreForProgramId($programId), 'start_time' => $startTime)
67
- )->generateFeed();
68
- }
69
-
70
- Mage::helper('pepperjam_network/config')->updateOrderLastRunTime($startTime);
71
-
72
- return $this;
73
- }
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_Observer
18
+ {
19
+ const PRODUCT_LOG_MESSAGE = 'Generating Product feed: program id %s, default store view: %s';
20
+ /**
21
+ * This observer method is the entry point to generating product feed when
22
+ * the CRONJOB 'pepperjam_network_generate_product_feed' run.
23
+ * @return void
24
+ */
25
+ public function createProductFeed()
26
+ {
27
+ $config = Mage::helper('pepperjam_network/config');
28
+
29
+ if (!isProductFeedEnabled()) {
30
+ Mage::log(Mage::helper('pepperjam_network')->__('Product feed disabled'), Zend_Log::NOTICE);
31
+ return;
32
+ }
33
+
34
+ $helper = Mage::helper('pepperjam_network');
35
+ foreach ($helper->getAllProgramIds() as $programId) {
36
+ $store = $helper->getStoreForProgramId($programId);
37
+ Mage::log(
38
+ sprintf(static::PRODUCT_LOG_MESSAGE, $programId, $store->getName()),
39
+ Zend_Log::INFO
40
+ );
41
+
42
+ Mage::getModel('pepperjam_network/feed_product', array(
43
+ 'store' => $store
44
+ ))->generateFeed();
45
+ }
46
+ }
47
+ /**
48
+ * Generate the order corrected feed.
49
+ * @return self
50
+ */
51
+ public function createCorrectedOrdersFeed()
52
+ {
53
+ $config = Mage::helper('pepperjam_network/config');
54
+
55
+ if (!$config->isAttributionEnabled() || !$config->isOrderCorrectionFeedEnabled()) {
56
+ Mage::log(Mage::helper('pepperjam_network')->__('Corrected order feed disabled'), Zend_Log::NOTICE);
57
+ return;
58
+ }
59
+
60
+ $startTime = time();
61
+
62
+ $feedAlias = 'feed_order_'.$config->getOrderType();
63
+
64
+ Mage::log(sprintf('[%s] Generating %s correction feed', __CLASS__, $feedAlias), Zend_Log::INFO);
65
+
66
+ $helper = Mage::helper('pepperjam_network');
67
+ foreach ($helper->getAllProgramIds() as $programId) {
68
+ Mage::getModel(
69
+ "pepperjam_network/{$feedAlias}",
70
+ array('store' => $helper->getStoreForProgramId($programId), 'start_time' => $startTime)
71
+ )->generateFeed('corrections');
72
+ }
73
+
74
+ Mage::helper('pepperjam_network/config')->updateOrderCorrectionLastRunTime($startTime);
75
+ return $this;
76
+ }
77
+
78
+ /**
79
+ * Generate the order feed.
80
+ * @return self
81
+ */
82
+ public function createOrdersFeed()
83
+ {
84
+ $config = Mage::helper('pepperjam_network/config');
85
+
86
+ $startTime = time();
87
+
88
+ $feedAlias = 'feed_order_'.$config->getOrderType();
89
+
90
+ Mage::log("[".__CLASS__."] Generating $feedAlias feed", Zend_Log::INFO);
91
+
92
+ $helper = Mage::helper('pepperjam_network');
93
+ foreach($helper->getAllProgramIds() as $programId) {
94
+ $feedModel = Mage::getModel(
95
+ "pepperjam_network/$feedAlias",
96
+ array('store' => $helper->getStoreForProgramId($programId), 'start_time' => $startTime)
97
+ )->generateFeed('new');
98
+ }
99
+
100
+ $config->updateOrderLastRunTime($startTime);
101
+
102
+ return $this;
103
+ }
104
+
105
+ /**
106
+ * Transfer attribution attributes to new order after edit
107
+ * @param Varien_Event_Observer $observer
108
+ * @return self
109
+ */
110
+ public function transferAttribution($observer)
111
+ {
112
+ $order = $observer->getEvent()->getData('order');
113
+ if (!is_null($order->getRelationParentId())) {
114
+ $parentOrder = Mage::getModel('sales/order')->load($order->getRelationParentId());
115
+
116
+ $order->setNetworkSource($parentOrder->getNetworkSource());
117
+ $order->setNetworkClickId($parentOrder->getNetworkClickId());
118
+ $order->setNetworkPublisherId($parentOrder->getNetworkPublisherId());
119
+ }
120
+
121
+ return $this;
122
+ }
123
+ }
app/code/community/Pepperjam/Network/Model/Product/Attribute/Source/CommissioningCategory.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_Product_Attribute_Source_CommissioningCategory extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
18
- {
19
- public function getAllOptions()
20
- {
21
- $rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
22
- $rootCategories = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('name')->addFieldToFilter('parent_id', $rootCategoryId);
23
-
24
- $categoryOptions = array(array('value' => '', 'label' => ''));
25
-
26
- $this->_addChildren($categoryOptions, $rootCategories->getFirstItem()->getChildrenCategories(), 0);
27
-
28
- return $categoryOptions;
29
- }
30
-
31
- protected function _addChildren(&$options, $categories, $level)
32
- {
33
- if (!$categories->count())
34
- return;
35
-
36
- foreach($categories as $category) {
37
- $options[] = array('value' => $category->getId(), 'label' => str_repeat('-', $level) . $category->getName());
38
-
39
- $subcategories = $category->getChildrenCategories();
40
- $this->_addChildren($options, $subcategories, $level+1);
41
- }
42
- }
43
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_Product_Attribute_Source_CommissioningCategory extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
18
+ {
19
+ public function getAllOptions()
20
+ {
21
+ $rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
22
+ $rootCategories = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('name')->addFieldToFilter('parent_id', $rootCategoryId);
23
+
24
+ $categoryOptions = array(array('value' => '', 'label' => ''));
25
+
26
+ $this->_addChildren($categoryOptions, $rootCategories->getFirstItem()->getChildrenCategories(), 0);
27
+
28
+ return $categoryOptions;
29
+ }
30
+
31
+ protected function _addChildren(&$options, $categories, $level)
32
+ {
33
+ if (!$categories->count())
34
+ return;
35
+
36
+ foreach($categories as $category) {
37
+ $options[] = array('value' => $category->getId(), 'label' => str_repeat('-', $level) . $category->getName());
38
+
39
+ $subcategories = $category->getChildrenCategories();
40
+ $this->_addChildren($options, $subcategories, $level+1);
41
+ }
42
+ }
43
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Attributes.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_System_Config_Source_Attributes
18
- {
19
- const PRODUCT_URL_VALUE = 'product_url';
20
- const PRODUCT_URL_LABEL = 'Product Url';
21
- /**
22
- * Get product attributes
23
- * @return array
24
- */
25
- public function toOptionArray()
26
- {
27
- $helper = Mage::helper('catalog');
28
- $collection = Mage::getSingleton('eav/config')
29
- ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
30
- ->getAttributeCollection();
31
- $attributes = array(array('value' => '', 'label' => ''));
32
- foreach ($collection as $attribute) {
33
- $attributes[] = array(
34
- 'value' => $attribute->getAttributeCode(),
35
- 'label' => $helper->__($attribute->getFrontendLabel() ?
36
- $attribute->getFrontendLabel() :
37
- $this->_convertToTitleCase($attribute->getAttributeCode()))
38
- );
39
- }
40
- $attributes[] = array(
41
- 'value' => static::PRODUCT_URL_VALUE,
42
- 'label' => $helper->__(static::PRODUCT_URL_LABEL)
43
- );
44
- // sort the attribute options by label
45
- usort($attributes, array($this, '_compareLabels'));
46
- return $attributes;
47
- }
48
- /**
49
- * Convert the attribute code to title case. Replace '_'s with spaces
50
- * and capitalize each word.
51
- * @param string $attributeCode
52
- * @return string
53
- */
54
- protected function _convertToTitleCase($attributeCode)
55
- {
56
- return ucwords(str_replace('_', ' ', $attributeCode));
57
- }
58
- /**
59
- * Comparison method for sorting options by "label" key.
60
- * @param array $a
61
- * @param array $b
62
- * @return int
63
- */
64
- protected function _compareLabels($a, $b)
65
- {
66
- $aLabel = strtolower($a['label']);
67
- $bLabel = strtolower($b['label']);
68
- if ($aLabel === $bLabel) {
69
- return 0;
70
- }
71
- return $aLabel < $bLabel ? -1 : 1;
72
- }
73
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Attributes
18
+ {
19
+ const PRODUCT_URL_VALUE = 'product_url';
20
+ const PRODUCT_URL_LABEL = 'Product Url';
21
+ /**
22
+ * Get product attributes
23
+ * @return array
24
+ */
25
+ public function toOptionArray()
26
+ {
27
+ $helper = Mage::helper('catalog');
28
+ $collection = Mage::getSingleton('eav/config')
29
+ ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
30
+ ->getAttributeCollection();
31
+ $attributes = array(array('value' => '', 'label' => ''));
32
+ foreach ($collection as $attribute) {
33
+ $attributes[] = array(
34
+ 'value' => $attribute->getAttributeCode(),
35
+ 'label' => $helper->__($attribute->getFrontendLabel() ?
36
+ $attribute->getFrontendLabel() :
37
+ $this->_convertToTitleCase($attribute->getAttributeCode()))
38
+ );
39
+ }
40
+ $attributes[] = array(
41
+ 'value' => static::PRODUCT_URL_VALUE,
42
+ 'label' => $helper->__(static::PRODUCT_URL_LABEL)
43
+ );
44
+ // sort the attribute options by label
45
+ usort($attributes, array($this, '_compareLabels'));
46
+ return $attributes;
47
+ }
48
+ /**
49
+ * Convert the attribute code to title case. Replace '_'s with spaces
50
+ * and capitalize each word.
51
+ * @param string $attributeCode
52
+ * @return string
53
+ */
54
+ protected function _convertToTitleCase($attributeCode)
55
+ {
56
+ return ucwords(str_replace('_', ' ', $attributeCode));
57
+ }
58
+ /**
59
+ * Comparison method for sorting options by "label" key.
60
+ * @param array $a
61
+ * @param array $b
62
+ * @return int
63
+ */
64
+ protected function _compareLabels($a, $b)
65
+ {
66
+ $aLabel = strtolower($a['label']);
67
+ $bLabel = strtolower($b['label']);
68
+ if ($aLabel === $bLabel) {
69
+ return 0;
70
+ }
71
+ return $aLabel < $bLabel ? -1 : 1;
72
+ }
73
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Categories.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_System_Config_Source_Categories
18
- {
19
- const CATEGORY_VALUE = 'category';
20
- const CATEGORY_LABEL = 'Product Categories';
21
- /**
22
- * Get category attributes
23
- * @return array
24
- */
25
- public function toOptionArray()
26
- {
27
- return array(
28
- array('value' => '', 'label' => ''),
29
- array(
30
- 'value' => static::CATEGORY_VALUE,
31
- 'label' => Mage::helper('catalog')->__(static::CATEGORY_LABEL)
32
- )
33
- );
34
- }
35
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Categories
18
+ {
19
+ const CATEGORY_VALUE = 'category';
20
+ const CATEGORY_LABEL = 'Product Categories';
21
+ /**
22
+ * Get category attributes
23
+ * @return array
24
+ */
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => '', 'label' => ''),
29
+ array(
30
+ 'value' => static::CATEGORY_VALUE,
31
+ 'label' => Mage::helper('catalog')->__(static::CATEGORY_LABEL)
32
+ )
33
+ );
34
+ }
35
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Ordertypes.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_System_Config_Source_Ordertypes
18
- {
19
- public function toOptionArray()
20
- {
21
- $helper = Mage::helper('pepperjam_network');
22
- $config = Mage::helper('pepperjam_network/config');
23
-
24
- return array(
25
- array(
26
- 'value' => $config::ORDER_TYPE_BASIC,
27
- 'label' => $helper->__('Basic'),
28
- ),
29
- array(
30
- 'value' => $config::ORDER_TYPE_ITEMIZED,
31
- 'label' => $helper->__('Itemized'),
32
- ),
33
- array(
34
- 'value' => $config::ORDER_TYPE_DYNAMIC,
35
- 'label' => $helper->__('Dynamic'),
36
- ),
37
- );
38
- }
39
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Ordertypes
18
+ {
19
+ public function toOptionArray()
20
+ {
21
+ $helper = Mage::helper('pepperjam_network');
22
+ $config = Mage::helper('pepperjam_network/config');
23
+
24
+ return array(
25
+ array(
26
+ 'value' => $config::ORDER_TYPE_BASIC,
27
+ 'label' => $helper->__('Basic'),
28
+ ),
29
+ array(
30
+ 'value' => $config::ORDER_TYPE_ITEMIZED,
31
+ 'label' => $helper->__('Itemized'),
32
+ ),
33
+ array(
34
+ 'value' => $config::ORDER_TYPE_DYNAMIC,
35
+ 'label' => $helper->__('Dynamic'),
36
+ ),
37
+ );
38
+ }
39
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Stockquantity.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_System_Config_Source_Stockquantity
18
- {
19
- const STOCK_QTY_VALUE = 'qty';
20
- const STOCK_QTY_LABEL = 'Quantity';
21
- /**
22
- * Get quantity in stock list
23
- * @return array
24
- */
25
- public function toOptionArray()
26
- {
27
- return array(
28
- array('value' => '', 'label' => ''),
29
- array(
30
- 'value' => static::STOCK_QTY_VALUE,
31
- 'label' => Mage::helper('catalog')->__(static::STOCK_QTY_LABEL)
32
- )
33
- );
34
- }
35
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Stockquantity
18
+ {
19
+ const STOCK_QTY_VALUE = 'qty';
20
+ const STOCK_QTY_LABEL = 'Quantity';
21
+ /**
22
+ * Get quantity in stock list
23
+ * @return array
24
+ */
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => '', 'label' => ''),
29
+ array(
30
+ 'value' => static::STOCK_QTY_VALUE,
31
+ 'label' => Mage::helper('catalog')->__(static::STOCK_QTY_LABEL)
32
+ )
33
+ );
34
+ }
35
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Stockyesno.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_System_Config_Source_Stockyesno
18
- {
19
- const IN_STOCK_VALUE = 'in_stock';
20
- const IN_STOCK_LABEL = 'Inventory Stock Availability';
21
- /**
22
- * Get in stock list
23
- * @return array
24
- */
25
- public function toOptionArray()
26
- {
27
- return array(
28
- array('value' => '', 'label' => ''),
29
- array(
30
- 'value' => static::IN_STOCK_VALUE,
31
- 'label' => Mage::helper('catalog')->__(static::IN_STOCK_LABEL)
32
- )
33
- );
34
- }
35
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Stockyesno
18
+ {
19
+ const IN_STOCK_VALUE = 'in_stock';
20
+ const IN_STOCK_LABEL = 'Inventory Stock Availability';
21
+ /**
22
+ * Get in stock list
23
+ * @return array
24
+ */
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => '', 'label' => ''),
29
+ array(
30
+ 'value' => static::IN_STOCK_VALUE,
31
+ 'label' => Mage::helper('catalog')->__(static::IN_STOCK_LABEL)
32
+ )
33
+ );
34
+ }
35
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Trackingmethods.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Trackingmethods
18
+ {
19
+ public function toOptionArray()
20
+ {
21
+ $helper = Mage::helper('pepperjam_network');
22
+ $config = Mage::helper('pepperjam_network/config');
23
+
24
+ return array(
25
+ array(
26
+ 'value' => $config::TRACKING_METHOD_PIXEL,
27
+ 'label' => $helper->__('Pixel'),
28
+ ),
29
+ array(
30
+ 'value' => $config::TRACKING_METHOD_FEED,
31
+ 'label' => $helper->__('Feed'),
32
+ ),
33
+ );
34
+ }
35
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Transactiontype.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_System_Config_Source_Transactiontype
18
- {
19
- /**
20
- * Get available Transaction Type options
21
- * @return array
22
- */
23
- public function toOptionArray()
24
- {
25
- $helper = Mage::helper('pepperjam_network');
26
- return array('1' => $helper->__('Sale'), '2' => $helper->__('Lead'));
27
- }
28
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Transactiontype
18
+ {
19
+ /**
20
+ * Get available Transaction Type options
21
+ * @return array
22
+ */
23
+ public function toOptionArray()
24
+ {
25
+ $helper = Mage::helper('pepperjam_network');
26
+ return array('1' => $helper->__('Sale'), '2' => $helper->__('Lead'));
27
+ }
28
+ }
app/code/community/Pepperjam/Network/Model/System/Config/Source/Visibilityyesno.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Model_System_Config_Source_Visibilityyesno
18
- {
19
- const VISIBILITY_VALUE = 'visibility';
20
- const VISIBILITY_LABEL = 'Visibility';
21
- /**
22
- * Get product visibility list
23
- * @return array
24
- */
25
- public function toOptionArray()
26
- {
27
- return array(
28
- array('value' => '', 'label' => ''),
29
- array(
30
- 'value' => static::VISIBILITY_VALUE,
31
- 'label' => Mage::helper('catalog')->__(static::VISIBILITY_LABEL)
32
- )
33
- );
34
- }
35
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Model_System_Config_Source_Visibilityyesno
18
+ {
19
+ const VISIBILITY_VALUE = 'visibility';
20
+ const VISIBILITY_LABEL = 'Visibility';
21
+ /**
22
+ * Get product visibility list
23
+ * @return array
24
+ */
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => '', 'label' => ''),
29
+ array(
30
+ 'value' => static::VISIBILITY_VALUE,
31
+ 'label' => Mage::helper('catalog')->__(static::VISIBILITY_LABEL)
32
+ )
33
+ );
34
+ }
35
+ }
app/code/community/Pepperjam/Network/Test/Block/BeaconTest.php CHANGED
@@ -1,253 +1,253 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Block_BeaconTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Get a mock of the config helper to return expected system configurations.
21
- * @param string $programId
22
- * @param string $transactionType
23
- * @param string $itemizeOrders
24
- * @return Mock_Pepperjam_Network_Helper_Config
25
- */
26
- protected function _getConfigHelper($programId, $transactionType, $itemizeOrders)
27
- {
28
- $helper = $this->getHelperMock('pepperjam_network/config', array(
29
- 'getProgramId', 'getTransactionType', 'isItemizedOrders', 'isDynamicOrders',
30
- ));
31
- $helper->expects($this->any())
32
- ->method('getProgramId')
33
- ->will($this->returnValue($programId));
34
- $helper->expects($this->any())
35
- ->method('getTransactionType')
36
- ->will($this->returnValue($transactionType));
37
- $helper->expects($this->any())
38
- ->method('isItemizedOrders')
39
- ->will($this->returnValue($itemizeOrders));
40
- $helper->expects($this->any())
41
- ->method('isDynamicOrders')
42
- ->will($this->returnValue($itemizeOrders));
43
- return $helper;
44
- }
45
- /**
46
- * Test building the basic beacon url. Should only include order level
47
- * information about the order in the url params.
48
- */
49
- public function testGetBeaconUrlBasic()
50
- {
51
- $orderId = '000012';
52
- $subtotal = '10.99';
53
- $discount = '-5.00';
54
- $couponCode = 'COUPON';
55
- $programId = 'PROGRAM ID';
56
- $transactionType = 'TRANS TYPE';
57
- $itemizeOrders = false;
58
- $params = array(
59
- 'PID' => $programId,
60
- 'OID' => $orderId,
61
- 'PROMOCODE' => $couponCode,
62
- 'AMOUNT' => '5.99',
63
- 'TYPE' => $transactionType
64
- );
65
- $beaconUrl = 'https://example.com/track';
66
- $order = Mage::getModel('sales/order', array(
67
- 'increment_id' => $orderId,
68
- 'subtotal' => $subtotal,
69
- 'coupon_code' => $couponCode,
70
- 'discount_amount' => $discount,
71
- ));
72
- // mock out the config helper to setup expected system configurations
73
- $this->replaceByMock(
74
- 'helper',
75
- 'pepperjam_network/config',
76
- $this->_getConfigHelper($programId, $transactionType, $itemizeOrders)
77
- );
78
- $helper = $this->getHelperMock('pepperjam_network/data', array('buildBeaconUrl'));
79
- $helper->expects($this->once())
80
- ->method('buildBeaconUrl')
81
- ->with($this->identicalTo($params))
82
- ->will($this->returnValue($beaconUrl));
83
- $this->replaceByMock('helper', 'pepperjam_network', $helper);
84
-
85
- $block = $this->getBlockMock('pepperjam_network/beacon', array('_getOrder'));
86
- $block->expects($this->any())
87
- ->method('_getOrder')
88
- ->will($this->returnValue($order));
89
-
90
- $this->assertSame($beaconUrl, $block->getBeaconUrl());
91
- }
92
- /**
93
- * Test building the itemized beacon url. Should include item level details
94
- * in the url params for each item in the order.
95
- */
96
- public function testGetBeaconUrlItemized()
97
- {
98
- $programId = 'PROGRAM ID';
99
- // should use itemized beacon when itemize orders is true
100
- $itemizeOrders = true;
101
- $orderId = '000012';
102
- $couponCode = 'COUPON';
103
- $itemSku = 'sku-12345';
104
- $altSku = 'sku-54321';
105
- $itemQty = 2;
106
- $altQty = 3;
107
- $itemAmt = '12.34';
108
- $altAmt = '10.67';
109
- $discountAmt = '5.00';
110
- $bundleSku = 'bundle-sku-made-up-of-child-skus';
111
- $bundleQty = 1;
112
- // This is the expected final output from the method - gets returned from
113
- // the pepperjam_network/data helper when called with the right params.
114
- $beaconUrl = 'https://example.com/track?PARAM=Value';
115
- // These are the "correct" params the helper method should be called with.
116
- // Order of the array is significant - both to the test and the
117
- // actual implementation.
118
- $beaconParams = array(
119
- 'PID' => $programId,
120
- 'OID' => $orderId,
121
- 'PROMOCODE' => $couponCode,
122
- 'INT' => 'ITEMIZED',
123
- 'ITEM1' => $itemSku,
124
- 'QTY1' => $itemQty * 2,
125
- 'TOTALAMOUNT1' => number_format(($itemAmt - $discountAmt) * 2, 2),
126
- 'ITEM2' => $altSku,
127
- 'QTY2' => $altQty,
128
- 'TOTALAMOUNT2' => $altAmt,
129
- 'ITEM3' => $bundleSku,
130
- 'QTY3' => $bundleQty,
131
- 'TOTALAMOUNT3' => '0.00',
132
- );
133
-
134
- $item = Mage::getModel('sales/order_item', array(
135
- 'sku' => $itemSku, 'qty_ordered' => $itemQty, 'row_total' => $itemAmt,
136
- 'parent_item_id' => null, 'discount_amount' => $discountAmt,
137
- 'product_type' => 'simple',
138
- ));
139
- $itemDupe = Mage::getModel('sales/order_item', array(
140
- 'sku' => $itemSku, 'qty_ordered' => $itemQty, 'row_total' => $itemAmt,
141
- 'parent_item_id' => null, 'discount_amount' => $discountAmt,
142
- 'product_type' => 'simple',
143
- ));
144
- $parentItem = Mage::getModel('sales/order_item', array(
145
- 'sku' => $altSku, 'qty_ordered' => $altQty, 'row_total' => $altAmt,
146
- 'parent_item_id' => null, 'discount_amount' => 0.00,
147
- 'product_type' => 'configurable',
148
- ));
149
- $altItem = Mage::getModel('sales/order_item', array(
150
- 'sku' => $altSku, 'qty_ordered' => $altQty, 'row_total' => 0.00,
151
- 'parent_item_id' => '2', 'discount_amount' => 0.00,
152
- 'product_type' => 'simple',
153
- ));
154
- $bundleItem = Mage::getModel('sales/order_item', array(
155
- 'sku' => $bundleSku, 'qty_ordered' => $bundleQty, 'row_total' => '500.00',
156
- 'parent_item_id' => null, 'discount_amount' => 0.00,
157
- 'product_type' => 'bundle',
158
- ));
159
- $order = Mage::getModel('sales/order', array(
160
- 'increment_id' => $orderId, 'coupon_code' => $couponCode,
161
- ));
162
- $order->addItem($item);
163
- $order->addItem($itemDupe);
164
- $order->addItem($parentItem);
165
- $order->addItem($altItem);
166
- $order->addItem($bundleItem);
167
-
168
- // mock out the config helper to setup expected system configurations
169
- $this->replaceByMock(
170
- 'helper',
171
- 'pepperjam_network/config',
172
- $this->_getConfigHelper($programId, null, $itemizeOrders)
173
- );
174
-
175
- $helper = $this->getHelperMock('pepperjam_network/data', array('buildBeaconUrl'));
176
- $helper->expects($this->once())
177
- ->method('buildBeaconUrl')
178
- ->with($this->identicalTo($beaconParams))
179
- ->will($this->returnValue($beaconUrl));
180
- $this->replaceByMock('helper', 'pepperjam_network', $helper);
181
-
182
- $block = $this->getBlockMock('pepperjam_network/beacon', array('_getOrder'));
183
- $block->expects($this->any())
184
- ->method('_getOrder')
185
- ->will($this->returnValue($order));
186
-
187
- $this->assertSame($beaconUrl, $block->getBeaconUrl());
188
- }
189
- /**
190
- * Test that Pepperjam_Network_Block_Beacon::_getOrder will be invoked
191
- * by this test and expect it to return Mage_Sales_Model_Order object
192
- */
193
- public function testGetOrder()
194
- {
195
- $orderId = '00000084848';
196
- $session = $this->getModelMockBuilder('checkout/session')
197
- ->disableOriginalConstructor()
198
- ->setMethods(null)
199
- ->getMock();
200
- $session->setLastOrderId($orderId);
201
- $this->replaceByMock('singleton', 'checkout/session', $session);
202
-
203
- $order = $this->getModelMock('sales/order', array('load'));
204
- $order->expects($this->once())
205
- ->method('load')
206
- ->with($this->identicalTo($orderId))
207
- ->will($this->returnSelf());
208
- $this->replaceByMock('model', 'sales/order', $order);
209
-
210
- $beacon = $this->getBlockMock('pepperjam_network/beacon', array());
211
- EcomDev_Utils_Reflection::setRestrictedPropertyValue($beacon, '_order', null);
212
-
213
- $this->assertSame($order, EcomDev_Utils_Reflection::invokeRestrictedMethod(
214
- $beacon,
215
- '_getOrder',
216
- array()
217
- ));
218
- }
219
- /**
220
- * Test that Pepperjam_Network_Block_Beacon::showBeacon will return true
221
- * only if tracking is enabled and we have a valid order
222
- * AND either conditional pixel logic is OFF or it is ON and we have
223
- * a valid cookie.
224
- *
225
- * @dataProvider dataProvider
226
- */
227
- public function testShowBeacon($isEnabled, $isOrder, $isPixelLogicEnabled, $isValidCookie, $expectedResult)
228
- {
229
- $configHelper = $this->getHelperMock('pepperjam_network/config', array('isEnabled', 'isConditionalPixelEnabled'));
230
- $configHelper->expects($this->any())
231
- ->method('isEnabled')
232
- ->will($this->returnValue($isEnabled));
233
-
234
- $configHelper->expects($this->any())
235
- ->method('isConditionalPixelEnabled')
236
- ->will($this->returnValue($isPixelLogicEnabled));
237
- $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
238
-
239
- $dataHelper = $this->getHelperMock('pepperjam_network', array('isValidCookie'));
240
- $dataHelper->expects(($this->any()))
241
- ->method('isValidCookie')
242
- ->will($this->returnValue($isValidCookie));
243
- $this->replaceByMock('helper', 'pepperjam_network', $dataHelper);
244
-
245
- $order = (bool)$isOrder ? Mage::getModel('sales/order') : null;
246
- $beacon = $this->getBlockMock('pepperjam_network/beacon', array('_getOrder'));
247
- $beacon->expects($this->any())
248
- ->method('_getOrder')
249
- ->will($this->returnValue($order));
250
-
251
- $this->assertEquals((bool)$expectedResult, $beacon->showBeacon());
252
- }
253
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Block_BeaconTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Get a mock of the config helper to return expected system configurations.
21
+ * @param string $programId
22
+ * @param string $transactionType
23
+ * @param string $itemizeOrders
24
+ * @return Mock_Pepperjam_Network_Helper_Config
25
+ */
26
+ protected function _getConfigHelper($programId, $transactionType, $itemizeOrders)
27
+ {
28
+ $helper = $this->getHelperMock('pepperjam_network/config', array(
29
+ 'getProgramId', 'getTransactionType', 'isItemizedOrders', 'isDynamicOrders',
30
+ ));
31
+ $helper->expects($this->any())
32
+ ->method('getProgramId')
33
+ ->will($this->returnValue($programId));
34
+ $helper->expects($this->any())
35
+ ->method('getTransactionType')
36
+ ->will($this->returnValue($transactionType));
37
+ $helper->expects($this->any())
38
+ ->method('isItemizedOrders')
39
+ ->will($this->returnValue($itemizeOrders));
40
+ $helper->expects($this->any())
41
+ ->method('isDynamicOrders')
42
+ ->will($this->returnValue($itemizeOrders));
43
+ return $helper;
44
+ }
45
+ /**
46
+ * Test building the basic beacon url. Should only include order level
47
+ * information about the order in the url params.
48
+ */
49
+ public function testGetBeaconUrlBasic()
50
+ {
51
+ $orderId = '000012';
52
+ $subtotal = '10.99';
53
+ $discount = '-5.00';
54
+ $couponCode = 'COUPON';
55
+ $programId = 'PROGRAM ID';
56
+ $transactionType = 'TRANS TYPE';
57
+ $itemizeOrders = false;
58
+ $params = array(
59
+ 'PID' => $programId,
60
+ 'OID' => $orderId,
61
+ 'PROMOCODE' => $couponCode,
62
+ 'AMOUNT' => '5.99',
63
+ 'TYPE' => $transactionType
64
+ );
65
+ $beaconUrl = 'https://example.com/track';
66
+ $order = Mage::getModel('sales/order', array(
67
+ 'increment_id' => $orderId,
68
+ 'subtotal' => $subtotal,
69
+ 'coupon_code' => $couponCode,
70
+ 'discount_amount' => $discount,
71
+ ));
72
+ // mock out the config helper to setup expected system configurations
73
+ $this->replaceByMock(
74
+ 'helper',
75
+ 'pepperjam_network/config',
76
+ $this->_getConfigHelper($programId, $transactionType, $itemizeOrders)
77
+ );
78
+ $helper = $this->getHelperMock('pepperjam_network/data', array('buildBeaconUrl'));
79
+ $helper->expects($this->once())
80
+ ->method('buildBeaconUrl')
81
+ ->with($this->identicalTo($params))
82
+ ->will($this->returnValue($beaconUrl));
83
+ $this->replaceByMock('helper', 'pepperjam_network', $helper);
84
+
85
+ $block = $this->getBlockMock('pepperjam_network/beacon', array('_getOrder'));
86
+ $block->expects($this->any())
87
+ ->method('_getOrder')
88
+ ->will($this->returnValue($order));
89
+
90
+ $this->assertSame($beaconUrl, $block->getBeaconUrl());
91
+ }
92
+ /**
93
+ * Test building the itemized beacon url. Should include item level details
94
+ * in the url params for each item in the order.
95
+ */
96
+ public function testGetBeaconUrlItemized()
97
+ {
98
+ $programId = 'PROGRAM ID';
99
+ // should use itemized beacon when itemize orders is true
100
+ $itemizeOrders = true;
101
+ $orderId = '000012';
102
+ $couponCode = 'COUPON';
103
+ $itemSku = 'sku-12345';
104
+ $altSku = 'sku-54321';
105
+ $itemQty = 2;
106
+ $altQty = 3;
107
+ $itemAmt = '12.34';
108
+ $altAmt = '10.67';
109
+ $discountAmt = '5.00';
110
+ $bundleSku = 'bundle-sku-made-up-of-child-skus';
111
+ $bundleQty = 1;
112
+ // This is the expected final output from the method - gets returned from
113
+ // the pepperjam_network/data helper when called with the right params.
114
+ $beaconUrl = 'https://example.com/track?PARAM=Value';
115
+ // These are the "correct" params the helper method should be called with.
116
+ // Order of the array is significant - both to the test and the
117
+ // actual implementation.
118
+ $beaconParams = array(
119
+ 'PID' => $programId,
120
+ 'OID' => $orderId,
121
+ 'PROMOCODE' => $couponCode,
122
+ 'INT' => 'ITEMIZED',
123
+ 'ITEM1' => $itemSku,
124
+ 'QTY1' => $itemQty * 2,
125
+ 'TOTALAMOUNT1' => number_format(($itemAmt - $discountAmt) * 2, 2),
126
+ 'ITEM2' => $altSku,
127
+ 'QTY2' => $altQty,
128
+ 'TOTALAMOUNT2' => $altAmt,
129
+ 'ITEM3' => $bundleSku,
130
+ 'QTY3' => $bundleQty,
131
+ 'TOTALAMOUNT3' => '0.00',
132
+ );
133
+
134
+ $item = Mage::getModel('sales/order_item', array(
135
+ 'sku' => $itemSku, 'qty_ordered' => $itemQty, 'row_total' => $itemAmt,
136
+ 'parent_item_id' => null, 'discount_amount' => $discountAmt,
137
+ 'product_type' => 'simple',
138
+ ));
139
+ $itemDupe = Mage::getModel('sales/order_item', array(
140
+ 'sku' => $itemSku, 'qty_ordered' => $itemQty, 'row_total' => $itemAmt,
141
+ 'parent_item_id' => null, 'discount_amount' => $discountAmt,
142
+ 'product_type' => 'simple',
143
+ ));
144
+ $parentItem = Mage::getModel('sales/order_item', array(
145
+ 'sku' => $altSku, 'qty_ordered' => $altQty, 'row_total' => $altAmt,
146
+ 'parent_item_id' => null, 'discount_amount' => 0.00,
147
+ 'product_type' => 'configurable',
148
+ ));
149
+ $altItem = Mage::getModel('sales/order_item', array(
150
+ 'sku' => $altSku, 'qty_ordered' => $altQty, 'row_total' => 0.00,
151
+ 'parent_item_id' => '2', 'discount_amount' => 0.00,
152
+ 'product_type' => 'simple',
153
+ ));
154
+ $bundleItem = Mage::getModel('sales/order_item', array(
155
+ 'sku' => $bundleSku, 'qty_ordered' => $bundleQty, 'row_total' => '500.00',
156
+ 'parent_item_id' => null, 'discount_amount' => 0.00,
157
+ 'product_type' => 'bundle',
158
+ ));
159
+ $order = Mage::getModel('sales/order', array(
160
+ 'increment_id' => $orderId, 'coupon_code' => $couponCode,
161
+ ));
162
+ $order->addItem($item);
163
+ $order->addItem($itemDupe);
164
+ $order->addItem($parentItem);
165
+ $order->addItem($altItem);
166
+ $order->addItem($bundleItem);
167
+
168
+ // mock out the config helper to setup expected system configurations
169
+ $this->replaceByMock(
170
+ 'helper',
171
+ 'pepperjam_network/config',
172
+ $this->_getConfigHelper($programId, null, $itemizeOrders)
173
+ );
174
+
175
+ $helper = $this->getHelperMock('pepperjam_network/data', array('buildBeaconUrl'));
176
+ $helper->expects($this->once())
177
+ ->method('buildBeaconUrl')
178
+ ->with($this->identicalTo($beaconParams))
179
+ ->will($this->returnValue($beaconUrl));
180
+ $this->replaceByMock('helper', 'pepperjam_network', $helper);
181
+
182
+ $block = $this->getBlockMock('pepperjam_network/beacon', array('_getOrder'));
183
+ $block->expects($this->any())
184
+ ->method('_getOrder')
185
+ ->will($this->returnValue($order));
186
+
187
+ $this->assertSame($beaconUrl, $block->getBeaconUrl());
188
+ }
189
+ /**
190
+ * Test that Pepperjam_Network_Block_Beacon::_getOrder will be invoked
191
+ * by this test and expect it to return Mage_Sales_Model_Order object
192
+ */
193
+ public function testGetOrder()
194
+ {
195
+ $orderId = '00000084848';
196
+ $session = $this->getModelMockBuilder('checkout/session')
197
+ ->disableOriginalConstructor()
198
+ ->setMethods(null)
199
+ ->getMock();
200
+ $session->setLastOrderId($orderId);
201
+ $this->replaceByMock('singleton', 'checkout/session', $session);
202
+
203
+ $order = $this->getModelMock('sales/order', array('load'));
204
+ $order->expects($this->once())
205
+ ->method('load')
206
+ ->with($this->identicalTo($orderId))
207
+ ->will($this->returnSelf());
208
+ $this->replaceByMock('model', 'sales/order', $order);
209
+
210
+ $beacon = $this->getBlockMock('pepperjam_network/beacon', array());
211
+ EcomDev_Utils_Reflection::setRestrictedPropertyValue($beacon, '_order', null);
212
+
213
+ $this->assertSame($order, EcomDev_Utils_Reflection::invokeRestrictedMethod(
214
+ $beacon,
215
+ '_getOrder',
216
+ array()
217
+ ));
218
+ }
219
+ /**
220
+ * Test that Pepperjam_Network_Block_Beacon::showBeacon will return true
221
+ * only if tracking is enabled and we have a valid order
222
+ * AND either conditional pixel logic is OFF or it is ON and we have
223
+ * a valid cookie.
224
+ *
225
+ * @dataProvider dataProvider
226
+ */
227
+ public function testShowBeacon($isEnabled, $isOrder, $isPixelLogicEnabled, $isValidCookie, $expectedResult)
228
+ {
229
+ $configHelper = $this->getHelperMock('pepperjam_network/config', array('isEnabled', 'isConditionalPixelEnabled'));
230
+ $configHelper->expects($this->any())
231
+ ->method('isEnabled')
232
+ ->will($this->returnValue($isEnabled));
233
+
234
+ $configHelper->expects($this->any())
235
+ ->method('isConditionalPixelEnabled')
236
+ ->will($this->returnValue($isPixelLogicEnabled));
237
+ $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
238
+
239
+ $dataHelper = $this->getHelperMock('pepperjam_network', array('isValidCookie'));
240
+ $dataHelper->expects(($this->any()))
241
+ ->method('isValidCookie')
242
+ ->will($this->returnValue($isValidCookie));
243
+ $this->replaceByMock('helper', 'pepperjam_network', $dataHelper);
244
+
245
+ $order = (bool)$isOrder ? Mage::getModel('sales/order') : null;
246
+ $beacon = $this->getBlockMock('pepperjam_network/beacon', array('_getOrder'));
247
+ $beacon->expects($this->any())
248
+ ->method('_getOrder')
249
+ ->will($this->returnValue($order));
250
+
251
+ $this->assertEquals((bool)$expectedResult, $beacon->showBeacon());
252
+ }
253
+ }
app/code/community/Pepperjam/Network/Test/Block/providers/testShowBeacon.yaml CHANGED
@@ -1,99 +1,99 @@
1
- -
2
- - 1 # tracking enabled
3
- - 1 # order is instanceof Mage_Sales_Model_Order
4
- - 1 # conditional logic enabled
5
- - 1 # valid cookie
6
- - 1 # show beacon
7
- -
8
- - 1
9
- - 1
10
- - 1
11
- - 0
12
- - 0
13
- -
14
- - 1
15
- - 1
16
- - 0
17
- - 0
18
- - 1
19
- -
20
- - 1
21
- - 1
22
- - 0
23
- - 1
24
- - 1
25
- #
26
- -
27
- - 1
28
- - 0
29
- - 0
30
- - 0
31
- - 0
32
- -
33
- - 1
34
- - 0
35
- - 0
36
- - 1
37
- - 0
38
- -
39
- - 1
40
- - 0
41
- - 1
42
- - 0
43
- - 0
44
- -
45
- - 1
46
- - 0
47
- - 1
48
- - 1
49
- - 0
50
- #
51
- -
52
- - 0
53
- - 0
54
- - 0
55
- - 0
56
- - 0
57
- -
58
- - 0
59
- - 0
60
- - 0
61
- - 1
62
- - 0
63
- -
64
- - 0
65
- - 0
66
- - 1
67
- - 0
68
- - 0
69
- -
70
- - 0
71
- - 0
72
- - 1
73
- - 1
74
- - 0
75
- #
76
- -
77
- - 0
78
- - 1
79
- - 0
80
- - 0
81
- - 0
82
- -
83
- - 0
84
- - 1
85
- - 0
86
- - 1
87
- - 0
88
- -
89
- - 0
90
- - 1
91
- - 1
92
- - 0
93
- - 0
94
- -
95
- - 0
96
- - 1
97
- - 1
98
- - 1
99
- - 0
1
+ -
2
+ - 1 # tracking enabled
3
+ - 1 # order is instanceof Mage_Sales_Model_Order
4
+ - 1 # conditional logic enabled
5
+ - 1 # valid cookie
6
+ - 1 # show beacon
7
+ -
8
+ - 1
9
+ - 1
10
+ - 1
11
+ - 0
12
+ - 0
13
+ -
14
+ - 1
15
+ - 1
16
+ - 0
17
+ - 0
18
+ - 1
19
+ -
20
+ - 1
21
+ - 1
22
+ - 0
23
+ - 1
24
+ - 1
25
+ #
26
+ -
27
+ - 1
28
+ - 0
29
+ - 0
30
+ - 0
31
+ - 0
32
+ -
33
+ - 1
34
+ - 0
35
+ - 0
36
+ - 1
37
+ - 0
38
+ -
39
+ - 1
40
+ - 0
41
+ - 1
42
+ - 0
43
+ - 0
44
+ -
45
+ - 1
46
+ - 0
47
+ - 1
48
+ - 1
49
+ - 0
50
+ #
51
+ -
52
+ - 0
53
+ - 0
54
+ - 0
55
+ - 0
56
+ - 0
57
+ -
58
+ - 0
59
+ - 0
60
+ - 0
61
+ - 1
62
+ - 0
63
+ -
64
+ - 0
65
+ - 0
66
+ - 1
67
+ - 0
68
+ - 0
69
+ -
70
+ - 0
71
+ - 0
72
+ - 1
73
+ - 1
74
+ - 0
75
+ #
76
+ -
77
+ - 0
78
+ - 1
79
+ - 0
80
+ - 0
81
+ - 0
82
+ -
83
+ - 0
84
+ - 1
85
+ - 0
86
+ - 1
87
+ - 0
88
+ -
89
+ - 0
90
+ - 1
91
+ - 1
92
+ - 0
93
+ - 0
94
+ -
95
+ - 0
96
+ - 1
97
+ - 1
98
+ - 1
99
+ - 0
app/code/community/Pepperjam/Network/Test/Helper/DataTest.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Helper_DataTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test that Pepperjam_Network_Helper_Data::buildBeaconUrl yields the
21
- * expected, escaped url with query string when passed an array of params to append.
22
- */
23
- public function testBuildBeaconUrl()
24
- {
25
- $beaconUrl = 'https://example.com/track';
26
- $params = array('KEY1' => 'K1', 'KEY2' => 'K2');
27
- $result = $beaconUrl . '?' . http_build_query($params);
28
-
29
- $cfgHelper = $this->getHelperMock('pepperjam_network/config', array('getBeaconBaseUrl'));
30
- $cfgHelper->expects($this->once())
31
- ->method('getBeaconBaseUrl')
32
- ->will($this->returnValue($beaconUrl));
33
- $this->replaceByMock('helper', 'pepperjam_network/config', $cfgHelper);
34
-
35
- $this->assertSame($result, Mage::helper('pepperjam_network/data')->buildBeaconUrl($params));
36
- }
37
-
38
- /**
39
- * @dataProvider dataProvider
40
- */
41
- public function testIsValidCookie($cookie, $value, $expectedResult)
42
- {
43
- $dataHelper = $this->getHelperMock('pepperjam_network', array('getSourceCookieName'));
44
- $dataHelper->expects(($this->any()))
45
- ->method('getSourceCookieName')
46
- ->will($this->returnValue('ebay_enterprise_affiliate_source'));
47
- $this->replaceByMock('helper', 'pepperjam_network', $dataHelper);
48
-
49
- $_COOKIE[$cookie] = $value;
50
-
51
- $this->assertEquals((bool)$expectedResult, $dataHelper->isValidCookie());
52
- }
53
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Helper_DataTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test that Pepperjam_Network_Helper_Data::buildBeaconUrl yields the
21
+ * expected, escaped url with query string when passed an array of params to append.
22
+ */
23
+ public function testBuildBeaconUrl()
24
+ {
25
+ $beaconUrl = 'https://example.com/track';
26
+ $params = array('KEY1' => 'K1', 'KEY2' => 'K2');
27
+ $result = $beaconUrl . '?' . http_build_query($params);
28
+
29
+ $cfgHelper = $this->getHelperMock('pepperjam_network/config', array('getBeaconBaseUrl'));
30
+ $cfgHelper->expects($this->once())
31
+ ->method('getBeaconBaseUrl')
32
+ ->will($this->returnValue($beaconUrl));
33
+ $this->replaceByMock('helper', 'pepperjam_network/config', $cfgHelper);
34
+
35
+ $this->assertSame($result, Mage::helper('pepperjam_network/data')->buildBeaconUrl($params));
36
+ }
37
+
38
+ /**
39
+ * @dataProvider dataProvider
40
+ */
41
+ public function testIsValidCookie($cookie, $value, $expectedResult)
42
+ {
43
+ $dataHelper = $this->getHelperMock('pepperjam_network', array('getSourceCookieName'));
44
+ $dataHelper->expects(($this->any()))
45
+ ->method('getSourceCookieName')
46
+ ->will($this->returnValue('ebay_enterprise_affiliate_source'));
47
+ $this->replaceByMock('helper', 'pepperjam_network', $dataHelper);
48
+
49
+ $_COOKIE[$cookie] = $value;
50
+
51
+ $this->assertEquals((bool)$expectedResult, $dataHelper->isValidCookie());
52
+ }
53
+ }
app/code/community/Pepperjam/Network/Test/Helper/Map/ProductTest.php CHANGED
@@ -1,173 +1,173 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Helper_Map_ProductTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test that Pepperjam_Network_Helper_Map_Product::getCategory will
21
- * return a string of root category separated with the symbol '>' with inner
22
- * category to the the inner most category.
23
- */
24
- public function testGetCategory()
25
- {
26
-
27
- $categoryIds = array('1','2','3');
28
- $path = implode('/', $categoryIds);
29
- $categories = array('cat one', 'cat two', 'cat three');
30
- $collection = Mage::getResourceModel('catalog/category_collection');
31
-
32
- $categoryObjects = array();
33
- foreach ($categories as $index => $name) {
34
- $category = Mage::getModel('catalog/category', array(
35
- 'name' => $name, 'entity_id' => $index + 9999, 'path' => $path
36
- ));
37
- $categoryObjects[] = $category;
38
- $collection->addItem($category);
39
- }
40
-
41
- $productCategoryColl = Mage::getResourceModel('catalog/category_collection');
42
- ;
43
- $productCategoryColl->addItem($categoryObjects[2]);
44
- $product = $this->getModelMock('catalog/product', array('getCategoryCollection'));
45
- $product->expects($this->once())
46
- ->method('getCategoryCollection')
47
- ->will($this->returnValue($productCategoryColl));
48
-
49
- $params = array('item' => $product);
50
-
51
- $result = implode(' > ', $categories);
52
-
53
- $mapProduct = $this->getHelperMock('pepperjam_network/map_product', array('_getCategoriesByIds'));
54
- $mapProduct->expects($this->once())
55
- ->method('_getCategoriesByIds')
56
- ->with($this->identicalTo($categoryIds))
57
- ->will($this->returnValue($collection));
58
-
59
- $this->assertSame($result, $mapProduct->getCategory($params));
60
- }
61
- /**
62
- * Test that Pepperjam_Network_Helper_Map_Product::getImageUrl will
63
- * return an absolute URL to an image view.
64
- */
65
- public function testGetImageUrl()
66
- {
67
- $key = 'image';
68
- $image = '/k/o/some-product-image.jpg';
69
- $mediaUrl = 'http://www.example.com/' .
70
- Pepperjam_Network_Helper_Map_Product::MEDIA_PATH . $image;
71
-
72
- $product = $this->getModelMockBuilder('catalog/product')
73
- ->disableOriginalConstructor()
74
- ->setMethods(array('getDataUsingMethod'))
75
- ->getMock();
76
- $product->expects($this->once())
77
- ->method('getDataUsingMethod')
78
- ->with($this->identicalTo($key))
79
- ->will($this->returnValue($image));
80
-
81
- $params = array('item' => $product, 'key' => $key);
82
-
83
- $helperProduct = $this->getHelperMock('pepperjam_network/map_product', array(
84
- '_getAbsoluteImagePath'
85
- ));
86
-
87
- $helperProduct->expects($this->once())
88
- ->method('_getAbsoluteImagePath')
89
- ->with($this->identicalTo($image))
90
- ->will($this->returnValue($mediaUrl));
91
-
92
- $this->assertSame($mediaUrl, $helperProduct->getImageUrl($params));
93
- }
94
- /**
95
- * Test that Pepperjam_Network_Helper_Map_Product::getInStockQty will
96
- * return an integer value representing the manage stock qty of a product.
97
- */
98
- public function testGetInStockQty()
99
- {
100
- $qty = 999;
101
- $product = Mage::getModel('catalog/product');
102
- $params = array('item' => $product);
103
-
104
- $stockItem = $this->getModelMockBuilder('cataloginventory/stock_item')
105
- ->disableOriginalConstructor()
106
- ->setMethods(array('loadByProduct', 'getQty'))
107
- ->getMock();
108
- $stockItem->expects($this->once())
109
- ->method('loadByProduct')
110
- ->with($this->identicalTo($product))
111
- ->will($this->returnSelf());
112
- $stockItem->expects($this->once())
113
- ->method('getQty')
114
- ->will($this->returnValue($qty));
115
- $this->replaceByMock('model', 'cataloginventory/stock_item', $stockItem);
116
-
117
- $this->assertSame($qty, Mage::helper('pepperjam_network/map_product')->getInStockQty($params));
118
- }
119
- /**
120
- * Test that Pepperjam_Network_Helper_Map_Product::_getCategoriesByIds
121
- * will be invoked by this test passing an array of category entity ids
122
- * and will return a Mage_Catalog_Model_Resource_Category_Collection
123
- */
124
- public function testGetCategoriesByIds()
125
- {
126
- $entityIds = array(1,2,3);
127
- $collection = $this->getResourceModelMockBuilder('catalog/category_collection')
128
- ->disableOriginalConstructor()
129
- ->setMethods(array('addAttributeToSelect', 'addAttributeToFilter', 'load'))
130
- ->getMock();
131
- $collection->expects($this->once())
132
- ->method('addAttributeToSelect')
133
- ->with($this->identicalTo(array('name', 'entity_id')))
134
- ->will($this->returnSelf());
135
- $collection->expects($this->once())
136
- ->method('addAttributeToFilter')
137
- ->with($this->identicalTo(array(array('attribute' => 'entity_id', 'in' => $entityIds))))
138
- ->will($this->returnSelf());
139
- $collection->expects($this->once())
140
- ->method('load')
141
- ->will($this->returnSelf());
142
- $this->replaceByMock('resource_model', 'catalog/category_collection', $collection);
143
-
144
- $mapProduct = $this->getHelperMock('pepperjam_network/map_product', array());
145
-
146
- $this->assertSame($collection, EcomDev_Utils_Reflection::invokeRestrictedMethod(
147
- $mapProduct,
148
- '_getCategoriesByIds',
149
- array($entityIds)
150
- ));
151
- }
152
- /**
153
- * Test that Pepperjam_Network_Helper_Map_Product::getInStockYesNo will
154
- * be called by this test passing an array with key item map to a
155
- * Mage_Catalog_Model_Product object and expects it to return the string value 'yes'.
156
- */
157
- public function testGetInStockYesNo()
158
- {
159
- $result = 'yes';
160
- $isInStock = '1';
161
- $params = array('item' => Mage::getModel('catalog/product'));
162
-
163
- $stockItem = $this->getModelMock('cataloginventory/stock_item', array('loadByProduct'));
164
- $stockItem->expects($this->once())
165
- ->method('loadByProduct')
166
- ->with($this->identicalTo($params['item']))
167
- ->will($this->returnSelf());
168
- $stockItem->setIsInstock($isInStock);
169
- $this->replaceByMock('model', 'cataloginventory/stock_item', $stockItem);
170
-
171
- $this->assertSame($result, Mage::helper('pepperjam_network/map_product')->getInStockYesNo($params));
172
- }
173
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Helper_Map_ProductTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test that Pepperjam_Network_Helper_Map_Product::getCategory will
21
+ * return a string of root category separated with the symbol '>' with inner
22
+ * category to the the inner most category.
23
+ */
24
+ public function testGetCategory()
25
+ {
26
+
27
+ $categoryIds = array('1','2','3');
28
+ $path = implode('/', $categoryIds);
29
+ $categories = array('cat one', 'cat two', 'cat three');
30
+ $collection = Mage::getResourceModel('catalog/category_collection');
31
+
32
+ $categoryObjects = array();
33
+ foreach ($categories as $index => $name) {
34
+ $category = Mage::getModel('catalog/category', array(
35
+ 'name' => $name, 'entity_id' => $index + 9999, 'path' => $path
36
+ ));
37
+ $categoryObjects[] = $category;
38
+ $collection->addItem($category);
39
+ }
40
+
41
+ $productCategoryColl = Mage::getResourceModel('catalog/category_collection');
42
+ ;
43
+ $productCategoryColl->addItem($categoryObjects[2]);
44
+ $product = $this->getModelMock('catalog/product', array('getCategoryCollection'));
45
+ $product->expects($this->once())
46
+ ->method('getCategoryCollection')
47
+ ->will($this->returnValue($productCategoryColl));
48
+
49
+ $params = array('item' => $product);
50
+
51
+ $result = implode(' > ', $categories);
52
+
53
+ $mapProduct = $this->getHelperMock('pepperjam_network/map_product', array('_getCategoriesByIds'));
54
+ $mapProduct->expects($this->once())
55
+ ->method('_getCategoriesByIds')
56
+ ->with($this->identicalTo($categoryIds))
57
+ ->will($this->returnValue($collection));
58
+
59
+ $this->assertSame($result, $mapProduct->getCategory($params));
60
+ }
61
+ /**
62
+ * Test that Pepperjam_Network_Helper_Map_Product::getImageUrl will
63
+ * return an absolute URL to an image view.
64
+ */
65
+ public function testGetImageUrl()
66
+ {
67
+ $key = 'image';
68
+ $image = '/k/o/some-product-image.jpg';
69
+ $mediaUrl = 'http://www.example.com/' .
70
+ Pepperjam_Network_Helper_Map_Product::MEDIA_PATH . $image;
71
+
72
+ $product = $this->getModelMockBuilder('catalog/product')
73
+ ->disableOriginalConstructor()
74
+ ->setMethods(array('getDataUsingMethod'))
75
+ ->getMock();
76
+ $product->expects($this->once())
77
+ ->method('getDataUsingMethod')
78
+ ->with($this->identicalTo($key))
79
+ ->will($this->returnValue($image));
80
+
81
+ $params = array('item' => $product, 'key' => $key);
82
+
83
+ $helperProduct = $this->getHelperMock('pepperjam_network/map_product', array(
84
+ '_getAbsoluteImagePath'
85
+ ));
86
+
87
+ $helperProduct->expects($this->once())
88
+ ->method('_getAbsoluteImagePath')
89
+ ->with($this->identicalTo($image))
90
+ ->will($this->returnValue($mediaUrl));
91
+
92
+ $this->assertSame($mediaUrl, $helperProduct->getImageUrl($params));
93
+ }
94
+ /**
95
+ * Test that Pepperjam_Network_Helper_Map_Product::getInStockQty will
96
+ * return an integer value representing the manage stock qty of a product.
97
+ */
98
+ public function testGetInStockQty()
99
+ {
100
+ $qty = 999;
101
+ $product = Mage::getModel('catalog/product');
102
+ $params = array('item' => $product);
103
+
104
+ $stockItem = $this->getModelMockBuilder('cataloginventory/stock_item')
105
+ ->disableOriginalConstructor()
106
+ ->setMethods(array('loadByProduct', 'getQty'))
107
+ ->getMock();
108
+ $stockItem->expects($this->once())
109
+ ->method('loadByProduct')
110
+ ->with($this->identicalTo($product))
111
+ ->will($this->returnSelf());
112
+ $stockItem->expects($this->once())
113
+ ->method('getQty')
114
+ ->will($this->returnValue($qty));
115
+ $this->replaceByMock('model', 'cataloginventory/stock_item', $stockItem);
116
+
117
+ $this->assertSame($qty, Mage::helper('pepperjam_network/map_product')->getInStockQty($params));
118
+ }
119
+ /**
120
+ * Test that Pepperjam_Network_Helper_Map_Product::_getCategoriesByIds
121
+ * will be invoked by this test passing an array of category entity ids
122
+ * and will return a Mage_Catalog_Model_Resource_Category_Collection
123
+ */
124
+ public function testGetCategoriesByIds()
125
+ {
126
+ $entityIds = array(1,2,3);
127
+ $collection = $this->getResourceModelMockBuilder('catalog/category_collection')
128
+ ->disableOriginalConstructor()
129
+ ->setMethods(array('addAttributeToSelect', 'addAttributeToFilter', 'load'))
130
+ ->getMock();
131
+ $collection->expects($this->once())
132
+ ->method('addAttributeToSelect')
133
+ ->with($this->identicalTo(array('name', 'entity_id')))
134
+ ->will($this->returnSelf());
135
+ $collection->expects($this->once())
136
+ ->method('addAttributeToFilter')
137
+ ->with($this->identicalTo(array(array('attribute' => 'entity_id', 'in' => $entityIds))))
138
+ ->will($this->returnSelf());
139
+ $collection->expects($this->once())
140
+ ->method('load')
141
+ ->will($this->returnSelf());
142
+ $this->replaceByMock('resource_model', 'catalog/category_collection', $collection);
143
+
144
+ $mapProduct = $this->getHelperMock('pepperjam_network/map_product', array());
145
+
146
+ $this->assertSame($collection, EcomDev_Utils_Reflection::invokeRestrictedMethod(
147
+ $mapProduct,
148
+ '_getCategoriesByIds',
149
+ array($entityIds)
150
+ ));
151
+ }
152
+ /**
153
+ * Test that Pepperjam_Network_Helper_Map_Product::getInStockYesNo will
154
+ * be called by this test passing an array with key item map to a
155
+ * Mage_Catalog_Model_Product object and expects it to return the string value 'yes'.
156
+ */
157
+ public function testGetInStockYesNo()
158
+ {
159
+ $result = 'yes';
160
+ $isInStock = '1';
161
+ $params = array('item' => Mage::getModel('catalog/product'));
162
+
163
+ $stockItem = $this->getModelMock('cataloginventory/stock_item', array('loadByProduct'));
164
+ $stockItem->expects($this->once())
165
+ ->method('loadByProduct')
166
+ ->with($this->identicalTo($params['item']))
167
+ ->will($this->returnSelf());
168
+ $stockItem->setIsInstock($isInStock);
169
+ $this->replaceByMock('model', 'cataloginventory/stock_item', $stockItem);
170
+
171
+ $this->assertSame($result, Mage::helper('pepperjam_network/map_product')->getInStockYesNo($params));
172
+ }
173
+ }
app/code/community/Pepperjam/Network/Test/Helper/providers/testIsValidCookie.yaml CHANGED
@@ -1,12 +1,12 @@
1
- -
2
- - pepperjam_network_source
3
- - eean
4
- - 1
5
- -
6
- - pepperjam_network_source
7
- - invalid_value
8
- - 0
9
- -
10
- - invalid_cookie_name
11
- - eean
12
- - 0
1
+ -
2
+ - pepperjam_network_source
3
+ - eean
4
+ - 1
5
+ -
6
+ - pepperjam_network_source
7
+ - invalid_value
8
+ - 0
9
+ -
10
+ - invalid_cookie_name
11
+ - eean
12
+ - 0
app/code/community/Pepperjam/Network/Test/Model/Feed/AbstractTest.php CHANGED
@@ -1,291 +1,291 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Model_Feed_AbstractTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test generating a feed file
21
- */
22
- public function testGenerateFeed()
23
- {
24
- $feedData = array(array('one', 'two', 'three'));
25
- $feed = $this->getModelMock(
26
- 'pepperjam_network/feed_abstract',
27
- array('_buildFeedData', '_generateFile'),
28
- true
29
- );
30
- $feed->expects($this->once())
31
- ->method('_buildFeedData')
32
- ->will($this->returnValue($feedData));
33
- $feed->expects($this->once())
34
- ->method('_generateFile')
35
- ->with($this->identicalTo($feedData))
36
- ->will($this->returnSelf());
37
- $this->assertSame($feed, $feed->generateFeed());
38
- }
39
- /**
40
- * Test generating array of data to place into feed
41
- */
42
- public function testBuildFeedData()
43
- {
44
- $itemOneMappedData = array('item', 'one', 'data');
45
- $itemTwoMappedData = array('item', 'two', 'data');
46
- $feedData = array($itemOneMappedData, $itemTwoMappedData);
47
-
48
- $itemCollection = new Varien_Data_Collection();
49
- $itemOne = Mage::getModel('sales/order');
50
- $itemTwo = Mage::getModel('sales/order');
51
- $itemCollection->addItem($itemOne)->addItem($itemTwo);
52
-
53
- $feed = $this->getModelMock(
54
- 'pepperjam_network/feed_abstract',
55
- array('_getItems', '_applyMapping'),
56
- true
57
- );
58
- // get items will vary per feed type - itemized order, basic order or product
59
- $feed->expects($this->once())
60
- ->method('_getItems')
61
- ->will($this->returnValue($itemCollection));
62
- // should get called once for each item, returning the array of item data for the feed
63
- $feed->expects($this->exactly(2))
64
- ->method('_applyMapping')
65
- ->will($this->returnValueMap(array(
66
- array($itemOne, $itemOneMappedData),
67
- array($itemTwo, $itemTwoMappedData),
68
- )));
69
-
70
- $this->assertSame(
71
- $feedData,
72
- EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_buildFeedData')
73
- );
74
- }
75
- /**
76
- * Test applying the configured mapping to the item to get back an array of
77
- * data for each field in the feed.
78
- */
79
- public function testApplyMapping()
80
- {
81
- $orderAmt = 23.23;
82
- $store = Mage::app()->getStore();
83
- $fields = array('fieldA', 'fieldB');
84
- // callback mapping to use
85
- $mappings = array(
86
- 'fieldA' => array(
87
- 'class' => 'pepperjam_network/map_order', 'type' => 'helper',
88
- 'method' => 'getOrderAmount', 'params' => array('key' => 'value'),
89
- 'column_name' => 'OID'
90
- ),
91
- 'fieldB' => array('type' => 'disabled'),
92
- );
93
- $itemData = array($orderAmt);
94
- // The type of this object will vary depending on feed type but will likely
95
- // be a descendent of Varien_Object. It shouldn't matter much to the test
96
- // as it should just get passed through to the callbacks.
97
- $item = new Varien_Object();
98
-
99
- // All callbacks setup to use this helper
100
- $feedHelper = $this->getHelperMock(
101
- 'pepperjam_network/map_order',
102
- array('getOrderAmount')
103
- );
104
- $feedHelper->expects($this->once())
105
- ->method('getOrderAmount')
106
- ->with($this->identicalTo(array('key' => 'value', 'item' => $item, 'store' => $store)))
107
- ->will($this->returnValue($orderAmt));
108
- $this->replaceByMock('helper', 'pepperjam_network/map_order', $feedHelper);
109
-
110
- $config = $this->getHelperMock('pepperjam_network/config', array('getCallbackMappings'));
111
- $config->expects($this->any())
112
- ->method('getCallbackMappings')
113
- ->will($this->returnValue($mappings));
114
- $this->replaceByMock('helper', 'pepperjam_network/config', $config);
115
-
116
- $feed = $this->getModelMock(
117
- 'pepperjam_network/feed_abstract',
118
- array('_getFeedFields'),
119
- true,
120
- array(array('store' => $store))
121
- );
122
- // The _getFeedFields method will be defined for each type of feed and should
123
- // return array of mapped fields to include.
124
- $feed->expects($this->any())
125
- ->method('_getFeedFields')
126
- ->will($this->returnValue($fields));
127
-
128
- $this->assertSame(
129
- $itemData,
130
- EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_applyMapping', array($item))
131
- );
132
- }
133
- /**
134
- * Test that when a configured method does not exist on the specified class,
135
- * an exception is thrown.
136
- */
137
- public function testInvokeCallbackFailures()
138
- {
139
- $callbackConfig = array('class' => 'pepperjam_network', 'type' => 'helper', 'method' => 'getSomething');
140
- $feed = $this->getModelMock(
141
- 'pepperjam_network/feed_abstract',
142
- array('_getCallbackInstance'),
143
- true
144
- );
145
- // Sub an object that will certainly not have the configured method on it.
146
- $feed->expects($this->once())
147
- ->method('_getCallbackInstance')
148
- ->with($this->identicalTo($callbackConfig))
149
- ->will($this->returnValue(new StdClass));
150
-
151
- $this->setExpectedException('Pepperjam_Network_Exception_Configuration');
152
- EcomDev_Utils_Reflection::invokeRestrictedMethod(
153
- $feed,
154
- '_invokeCallback',
155
- array($callbackConfig, new Varien_Object())
156
- );
157
- }
158
- /**
159
- * Provide a sample callback configuration and whether the callback is
160
- * expected to be deemed valid.
161
- * @return array
162
- */
163
- public function provideCallbacksToValidate()
164
- {
165
- return array(
166
- array(
167
- array(),
168
- false
169
- ),
170
- array(
171
- array('type' => 'disabled'),
172
- true
173
- ),
174
- array(
175
- array('type' => 'disabled', 'class' => 'pepperjam_network'),
176
- true
177
- ),
178
- array(
179
- array('type' => 'model'),
180
- false
181
- ),
182
- array(
183
- array('type' => 'singleton', 'class' => 'pepperjam_network/feed_abstract'),
184
- false
185
- ),
186
- array(
187
- array('type' => 'helper', 'class' => 'pepperjam_network/map', 'method' => 'getOrderId'),
188
- false
189
- ),
190
- array(
191
- array('type' => 'helper', 'class' => 'pepperjam_network/map', 'method' => 'getOrderId', 'column_name' => 'OID'),
192
- true
193
- ),
194
- );
195
- }
196
- /**
197
- * Test checking for a callback configuration to be valid. When the is valid
198
- * param indicates the configuration is invalid, an exception should be
199
- * thrown. Otherwise, the method should simply reurun self.
200
- * @param array $config Array of config data to validate
201
- * @param boolean $isValid Is the config data valid
202
- * @dataProvider provideCallbacksToValidate
203
- */
204
- public function testValidateCallbackConfig($config, $isValid)
205
- {
206
- $feed = $this->getModelMock(
207
- 'pepperjam_network/feed_abstract',
208
- array(),
209
- true
210
- );
211
-
212
- if (!$isValid) {
213
- $this->setExpectedException('Pepperjam_Network_Exception_Configuration');
214
- }
215
-
216
- $result = EcomDev_Utils_Reflection::invokeRestrictedMethod(
217
- $feed,
218
- '_validateCallbackConfig',
219
- array($config)
220
- );
221
- if ($isValid) {
222
- $this->assertSame($result, $feed);
223
- }
224
- }
225
- /**
226
- * Test getting column headers based on the configured mappings for the feed.
227
- */
228
- public function testGetHeaders()
229
- {
230
- $fields = array('program_id', 'order_id');
231
- $mapping = array(
232
- 'program_id' => array('class' => 'some/class', 'method' => 'getProgramId', 'column_name' => 'PID'),
233
- 'order_id' => array('class' => 'some/class', 'method' => 'getOrderId', 'column_name' => 'OID'),
234
- );
235
-
236
- $config = $this->getHelperMock('pepperjam_network/config', array('getCallbackMappings'));
237
- $config->expects($this->any())
238
- ->method('getCallbackMappings')
239
- ->will($this->returnValue($mapping));
240
- $this->replaceByMock('helper', 'pepperjam_network/config', $config);
241
-
242
- $feed = $this->getModelMock(
243
- 'pepperjam_network/feed_abstract',
244
- array('_getFeedFields'),
245
- true
246
- );
247
- $feed->expects($this->once())
248
- ->method('_getFeedFields')
249
- ->will($this->returnValue($fields));
250
-
251
- $this->assertSame(
252
- // keys don't matter, so make sure to compare just values to values
253
- array('PID', 'OID'),
254
- array_values(EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getHeaders'))
255
- );
256
- }
257
- /**
258
- * Test generating the full path to the file. Should consist of Magento's
259
- * base dir, the configured export feed path, and the name of the file.
260
- */
261
- public function testGenerateFilePath()
262
- {
263
- $format = 'file_name.csv';
264
- $configuredPath = 'var/feed/export';
265
- $configHelper = $this->getHelperMock(
266
- 'pepperjam_network/config',
267
- array('getExportFilePath', 'getProgramId')
268
- );
269
- $configHelper->expects($this->any())
270
- ->method('getExportFilePath')
271
- ->will($this->returnValue($configuredPath));
272
- $configHelper->expects($this->any())
273
- ->method('getProgramId')
274
- ->will($this->returnValue('PROGRAM_ID'));
275
- $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
276
-
277
- $feed = $this->getModelMock(
278
- 'pepperjam_network/feed_abstract',
279
- array('_getFileName'),
280
- true
281
- );
282
- $feed->expects($this->any())
283
- ->method('_getFileName')
284
- ->will($this->returnValue($format));
285
-
286
- $this->assertSame(
287
- Mage::getBaseDir() . DS . 'var/feed/export' . DS . $format,
288
- EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_generateFilePath')
289
- );
290
- }
291
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Model_Feed_AbstractTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test generating a feed file
21
+ */
22
+ public function testGenerateFeed()
23
+ {
24
+ $feedData = array(array('one', 'two', 'three'));
25
+ $feed = $this->getModelMock(
26
+ 'pepperjam_network/feed_abstract',
27
+ array('_buildFeedData', '_generateFile'),
28
+ true
29
+ );
30
+ $feed->expects($this->once())
31
+ ->method('_buildFeedData')
32
+ ->will($this->returnValue($feedData));
33
+ $feed->expects($this->once())
34
+ ->method('_generateFile')
35
+ ->with($this->identicalTo($feedData))
36
+ ->will($this->returnSelf());
37
+ $this->assertSame($feed, $feed->generateFeed());
38
+ }
39
+ /**
40
+ * Test generating array of data to place into feed
41
+ */
42
+ public function testBuildFeedData()
43
+ {
44
+ $itemOneMappedData = array('item', 'one', 'data');
45
+ $itemTwoMappedData = array('item', 'two', 'data');
46
+ $feedData = array($itemOneMappedData, $itemTwoMappedData);
47
+
48
+ $itemCollection = new Varien_Data_Collection();
49
+ $itemOne = Mage::getModel('sales/order');
50
+ $itemTwo = Mage::getModel('sales/order');
51
+ $itemCollection->addItem($itemOne)->addItem($itemTwo);
52
+
53
+ $feed = $this->getModelMock(
54
+ 'pepperjam_network/feed_abstract',
55
+ array('_getItems', '_applyMapping'),
56
+ true
57
+ );
58
+ // get items will vary per feed type - itemized order, basic order or product
59
+ $feed->expects($this->once())
60
+ ->method('_getItems')
61
+ ->will($this->returnValue($itemCollection));
62
+ // should get called once for each item, returning the array of item data for the feed
63
+ $feed->expects($this->exactly(2))
64
+ ->method('_applyMapping')
65
+ ->will($this->returnValueMap(array(
66
+ array($itemOne, $itemOneMappedData),
67
+ array($itemTwo, $itemTwoMappedData),
68
+ )));
69
+
70
+ $this->assertSame(
71
+ $feedData,
72
+ EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_buildFeedData')
73
+ );
74
+ }
75
+ /**
76
+ * Test applying the configured mapping to the item to get back an array of
77
+ * data for each field in the feed.
78
+ */
79
+ public function testApplyMapping()
80
+ {
81
+ $orderAmt = 23.23;
82
+ $store = Mage::app()->getStore();
83
+ $fields = array('fieldA', 'fieldB');
84
+ // callback mapping to use
85
+ $mappings = array(
86
+ 'fieldA' => array(
87
+ 'class' => 'pepperjam_network/map_order', 'type' => 'helper',
88
+ 'method' => 'getOrderAmount', 'params' => array('key' => 'value'),
89
+ 'column_name' => 'OID'
90
+ ),
91
+ 'fieldB' => array('type' => 'disabled'),
92
+ );
93
+ $itemData = array($orderAmt);
94
+ // The type of this object will vary depending on feed type but will likely
95
+ // be a descendent of Varien_Object. It shouldn't matter much to the test
96
+ // as it should just get passed through to the callbacks.
97
+ $item = new Varien_Object();
98
+
99
+ // All callbacks setup to use this helper
100
+ $feedHelper = $this->getHelperMock(
101
+ 'pepperjam_network/map_order',
102
+ array('getOrderAmount')
103
+ );
104
+ $feedHelper->expects($this->once())
105
+ ->method('getOrderAmount')
106
+ ->with($this->identicalTo(array('key' => 'value', 'item' => $item, 'store' => $store)))
107
+ ->will($this->returnValue($orderAmt));
108
+ $this->replaceByMock('helper', 'pepperjam_network/map_order', $feedHelper);
109
+
110
+ $config = $this->getHelperMock('pepperjam_network/config', array('getCallbackMappings'));
111
+ $config->expects($this->any())
112
+ ->method('getCallbackMappings')
113
+ ->will($this->returnValue($mappings));
114
+ $this->replaceByMock('helper', 'pepperjam_network/config', $config);
115
+
116
+ $feed = $this->getModelMock(
117
+ 'pepperjam_network/feed_abstract',
118
+ array('_getFeedFields'),
119
+ true,
120
+ array(array('store' => $store))
121
+ );
122
+ // The _getFeedFields method will be defined for each type of feed and should
123
+ // return array of mapped fields to include.
124
+ $feed->expects($this->any())
125
+ ->method('_getFeedFields')
126
+ ->will($this->returnValue($fields));
127
+
128
+ $this->assertSame(
129
+ $itemData,
130
+ EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_applyMapping', array($item))
131
+ );
132
+ }
133
+ /**
134
+ * Test that when a configured method does not exist on the specified class,
135
+ * an exception is thrown.
136
+ */
137
+ public function testInvokeCallbackFailures()
138
+ {
139
+ $callbackConfig = array('class' => 'pepperjam_network', 'type' => 'helper', 'method' => 'getSomething');
140
+ $feed = $this->getModelMock(
141
+ 'pepperjam_network/feed_abstract',
142
+ array('_getCallbackInstance'),
143
+ true
144
+ );
145
+ // Sub an object that will certainly not have the configured method on it.
146
+ $feed->expects($this->once())
147
+ ->method('_getCallbackInstance')
148
+ ->with($this->identicalTo($callbackConfig))
149
+ ->will($this->returnValue(new StdClass));
150
+
151
+ $this->setExpectedException('Pepperjam_Network_Exception_Configuration');
152
+ EcomDev_Utils_Reflection::invokeRestrictedMethod(
153
+ $feed,
154
+ '_invokeCallback',
155
+ array($callbackConfig, new Varien_Object())
156
+ );
157
+ }
158
+ /**
159
+ * Provide a sample callback configuration and whether the callback is
160
+ * expected to be deemed valid.
161
+ * @return array
162
+ */
163
+ public function provideCallbacksToValidate()
164
+ {
165
+ return array(
166
+ array(
167
+ array(),
168
+ false
169
+ ),
170
+ array(
171
+ array('type' => 'disabled'),
172
+ true
173
+ ),
174
+ array(
175
+ array('type' => 'disabled', 'class' => 'pepperjam_network'),
176
+ true
177
+ ),
178
+ array(
179
+ array('type' => 'model'),
180
+ false
181
+ ),
182
+ array(
183
+ array('type' => 'singleton', 'class' => 'pepperjam_network/feed_abstract'),
184
+ false
185
+ ),
186
+ array(
187
+ array('type' => 'helper', 'class' => 'pepperjam_network/map', 'method' => 'getOrderId'),
188
+ false
189
+ ),
190
+ array(
191
+ array('type' => 'helper', 'class' => 'pepperjam_network/map', 'method' => 'getOrderId', 'column_name' => 'OID'),
192
+ true
193
+ ),
194
+ );
195
+ }
196
+ /**
197
+ * Test checking for a callback configuration to be valid. When the is valid
198
+ * param indicates the configuration is invalid, an exception should be
199
+ * thrown. Otherwise, the method should simply reurun self.
200
+ * @param array $config Array of config data to validate
201
+ * @param boolean $isValid Is the config data valid
202
+ * @dataProvider provideCallbacksToValidate
203
+ */
204
+ public function testValidateCallbackConfig($config, $isValid)
205
+ {
206
+ $feed = $this->getModelMock(
207
+ 'pepperjam_network/feed_abstract',
208
+ array(),
209
+ true
210
+ );
211
+
212
+ if (!$isValid) {
213
+ $this->setExpectedException('Pepperjam_Network_Exception_Configuration');
214
+ }
215
+
216
+ $result = EcomDev_Utils_Reflection::invokeRestrictedMethod(
217
+ $feed,
218
+ '_validateCallbackConfig',
219
+ array($config)
220
+ );
221
+ if ($isValid) {
222
+ $this->assertSame($result, $feed);
223
+ }
224
+ }
225
+ /**
226
+ * Test getting column headers based on the configured mappings for the feed.
227
+ */
228
+ public function testGetHeaders()
229
+ {
230
+ $fields = array('program_id', 'order_id');
231
+ $mapping = array(
232
+ 'program_id' => array('class' => 'some/class', 'method' => 'getProgramId', 'column_name' => 'PID'),
233
+ 'order_id' => array('class' => 'some/class', 'method' => 'getOrderId', 'column_name' => 'OID'),
234
+ );
235
+
236
+ $config = $this->getHelperMock('pepperjam_network/config', array('getCallbackMappings'));
237
+ $config->expects($this->any())
238
+ ->method('getCallbackMappings')
239
+ ->will($this->returnValue($mapping));
240
+ $this->replaceByMock('helper', 'pepperjam_network/config', $config);
241
+
242
+ $feed = $this->getModelMock(
243
+ 'pepperjam_network/feed_abstract',
244
+ array('_getFeedFields'),
245
+ true
246
+ );
247
+ $feed->expects($this->once())
248
+ ->method('_getFeedFields')
249
+ ->will($this->returnValue($fields));
250
+
251
+ $this->assertSame(
252
+ // keys don't matter, so make sure to compare just values to values
253
+ array('PID', 'OID'),
254
+ array_values(EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getHeaders'))
255
+ );
256
+ }
257
+ /**
258
+ * Test generating the full path to the file. Should consist of Magento's
259
+ * base dir, the configured export feed path, and the name of the file.
260
+ */
261
+ public function testGenerateFilePath()
262
+ {
263
+ $format = 'file_name.csv';
264
+ $configuredPath = 'var/feed/export';
265
+ $configHelper = $this->getHelperMock(
266
+ 'pepperjam_network/config',
267
+ array('getExportFilePath', 'getProgramId')
268
+ );
269
+ $configHelper->expects($this->any())
270
+ ->method('getExportFilePath')
271
+ ->will($this->returnValue($configuredPath));
272
+ $configHelper->expects($this->any())
273
+ ->method('getProgramId')
274
+ ->will($this->returnValue('PROGRAM_ID'));
275
+ $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
276
+
277
+ $feed = $this->getModelMock(
278
+ 'pepperjam_network/feed_abstract',
279
+ array('_getFileName'),
280
+ true
281
+ );
282
+ $feed->expects($this->any())
283
+ ->method('_getFileName')
284
+ ->will($this->returnValue($format));
285
+
286
+ $this->assertSame(
287
+ Mage::getBaseDir() . DS . 'var/feed/export' . DS . $format,
288
+ EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_generateFilePath')
289
+ );
290
+ }
291
+ }
app/code/community/Pepperjam/Network/Test/Model/Feed/Order/AbstractTest.php CHANGED
@@ -1,58 +1,58 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Model_Feed_Order_AbstractTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test generating the file name using the
21
- */
22
- public function testGetFileName()
23
- {
24
- $format = '%s_corrected_orders_%s.csv';
25
- $programId = 'PROGRAM_ID';
26
- $time = 1397829577;
27
- $formattedTime = date('YmdHis', $time);
28
- $fileName = "{$programId}_corrected_orders_{$formattedTime}.csv";
29
-
30
- // get the default store to be used as context for config getting
31
- $store = Mage::app()->getStore();
32
- // get the order feed instance with the expected store and start time injected
33
- $feed = $this->getModelMock(
34
- 'pepperjam_network/feed_order_itemized',
35
- array('_getFileNameFormat'),
36
- true,
37
- array(array('store' => $store, 'start_time' => $time))
38
- );
39
- $feed->expects($this->any())
40
- ->method('_getFileNameFormat')
41
- ->will($this->returnValue($format));
42
-
43
- $config = $this->getHelperMock('pepperjam_network/config', array('getProgramId'));
44
- // Will have different program ids per feed so store context definitely
45
- // matters when getting this value.
46
- $config->expects($this->any())
47
- ->method('getProgramId')
48
- ->with($this->identicalTo($store))
49
- ->will($this->returnValue($programId));
50
- $this->replaceByMock('helper', 'pepperjam_network/config', $config);
51
-
52
- $generated = EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getFileName');
53
- $this->assertSame(
54
- $fileName,
55
- $generated
56
- );
57
- }
58
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Model_Feed_Order_AbstractTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test generating the file name using the
21
+ */
22
+ public function testGetFileName()
23
+ {
24
+ $format = '%s_corrected_orders_%s.csv';
25
+ $programId = 'PROGRAM_ID';
26
+ $time = 1397829577;
27
+ $formattedTime = date('YmdHis', $time);
28
+ $fileName = "{$programId}_corrected_orders_{$formattedTime}.csv";
29
+
30
+ // get the default store to be used as context for config getting
31
+ $store = Mage::app()->getStore();
32
+ // get the order feed instance with the expected store and start time injected
33
+ $feed = $this->getModelMock(
34
+ 'pepperjam_network/feed_order_itemized',
35
+ array('_getFileNameFormat'),
36
+ true,
37
+ array(array('store' => $store, 'start_time' => $time))
38
+ );
39
+ $feed->expects($this->any())
40
+ ->method('_getFileNameFormat')
41
+ ->will($this->returnValue($format));
42
+
43
+ $config = $this->getHelperMock('pepperjam_network/config', array('getProgramId'));
44
+ // Will have different program ids per feed so store context definitely
45
+ // matters when getting this value.
46
+ $config->expects($this->any())
47
+ ->method('getProgramId')
48
+ ->with($this->identicalTo($store))
49
+ ->will($this->returnValue($programId));
50
+ $this->replaceByMock('helper', 'pepperjam_network/config', $config);
51
+
52
+ $generated = EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getFileName');
53
+ $this->assertSame(
54
+ $fileName,
55
+ $generated
56
+ );
57
+ }
58
+ }
app/code/community/Pepperjam/Network/Test/Model/Feed/Order/BasicTest.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Model_Feed_Order_BasicTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test getting the fields to include in the feed. Should be pulling the
21
- * comma-separated list of fields from config.xml and splitting it to produce
22
- * an array of fields.
23
- * @return array
24
- */
25
- public function testFeedFields()
26
- {
27
- $config = $this->getHelperMock('pepperjam_network/config', array('getBasicOrderFeedFields'));
28
- $config->expects($this->any())
29
- ->method('getBasicOrderFeedFields')
30
- ->will($this->returnValue('one,two,three'));
31
- $this->replaceByMock('helper', 'pepperjam_network/config', $config);
32
- $feed = Mage::getModel('pepperjam_network/feed_order_basic');
33
- $this->assertSame(
34
- array('one', 'two', 'three'),
35
- EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getFeedFields')
36
- );
37
- }
38
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Model_Feed_Order_BasicTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test getting the fields to include in the feed. Should be pulling the
21
+ * comma-separated list of fields from config.xml and splitting it to produce
22
+ * an array of fields.
23
+ * @return array
24
+ */
25
+ public function testFeedFields()
26
+ {
27
+ $config = $this->getHelperMock('pepperjam_network/config', array('getBasicOrderFeedFields'));
28
+ $config->expects($this->any())
29
+ ->method('getBasicOrderFeedFields')
30
+ ->will($this->returnValue('one,two,three'));
31
+ $this->replaceByMock('helper', 'pepperjam_network/config', $config);
32
+ $feed = Mage::getModel('pepperjam_network/feed_order_basic');
33
+ $this->assertSame(
34
+ array('one', 'two', 'three'),
35
+ EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getFeedFields')
36
+ );
37
+ }
38
+ }
app/code/community/Pepperjam/Network/Test/Model/Feed/Order/ItemizedTest.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Model_Feed_Order_ItemizedTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test getting the fields to include in the feed. Should be pulling the
21
- * comma-separated list of fields from config.xml and splitting it to produce
22
- * an array of fields.
23
- * @return array
24
- */
25
- public function testFeedFields()
26
- {
27
- $config = $this->getHelperMock('pepperjam_network/config', array('getItemizedOrderFeedFields'));
28
- $config->expects($this->any())
29
- ->method('getItemizedOrderFeedFields')
30
- ->will($this->returnValue('one,two,three'));
31
- $this->replaceByMock('helper', 'pepperjam_network/config', $config);
32
- $feed = Mage::getModel('pepperjam_network/feed_order_itemized');
33
- $this->assertSame(
34
- array('one', 'two', 'three'),
35
- EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getFeedFields')
36
- );
37
- }
38
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Model_Feed_Order_ItemizedTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test getting the fields to include in the feed. Should be pulling the
21
+ * comma-separated list of fields from config.xml and splitting it to produce
22
+ * an array of fields.
23
+ * @return array
24
+ */
25
+ public function testFeedFields()
26
+ {
27
+ $config = $this->getHelperMock('pepperjam_network/config', array('getItemizedOrderFeedFields'));
28
+ $config->expects($this->any())
29
+ ->method('getItemizedOrderFeedFields')
30
+ ->will($this->returnValue('one,two,three'));
31
+ $this->replaceByMock('helper', 'pepperjam_network/config', $config);
32
+ $feed = Mage::getModel('pepperjam_network/feed_order_itemized');
33
+ $this->assertSame(
34
+ array('one', 'two', 'three'),
35
+ EcomDev_Utils_Reflection::invokeRestrictedMethod($feed, '_getFeedFields')
36
+ );
37
+ }
38
+ }
app/code/community/Pepperjam/Network/Test/Model/Feed/ProductTest.php CHANGED
@@ -1,167 +1,167 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Model_Feed_ProductTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test that Pepperjam_Network_Model_Feed_Product::_getItems will return
21
- * a Mage_Catalog_Model_Resource_Product_Collection
22
- */
23
- public function testGetItems()
24
- {
25
- $store = Mage::getModel('core/store');
26
- $collection = $this->getResourceModelMockBuilder('catalog/product_collection')
27
- ->disableOriginalConstructor()
28
- ->setMethods(array('setStore', 'addAttributeToSelect', 'addStoreFilter', 'addFieldToFilter'))
29
- ->getMock();
30
- $collection->expects($this->once())
31
- ->method('setStore')
32
- ->with($this->identicalTo($store))
33
- ->will($this->returnSelf());
34
- $collection->expects($this->once())
35
- ->method('addAttributeToSelect')
36
- ->with($this->identicalTo(array('*')))
37
- ->will($this->returnSelf());
38
- $collection->expects($this->once())
39
- ->method('addStoreFilter')
40
- ->with($this->identicalTo($store))
41
- ->will($this->returnSelf());
42
- $collection->expects($this->once())
43
- ->method('addFieldToFilter')
44
- ->with($this->identicalTo('status'), $this->identicalTo(Mage_Catalog_Model_Product_Status::STATUS_ENABLED))
45
- ->will($this->returnSelf());
46
- $this->replaceByMock('resource_model', 'catalog/product_collection', $collection);
47
-
48
- $feedProduct = Mage::getModel('pepperjam_network/feed_product', array('store' => $store));
49
-
50
- $this->assertSame($collection, EcomDev_Utils_Reflection::invokeRestrictedMethod(
51
- $feedProduct,
52
- '_getItems',
53
- array()
54
- ));
55
- }
56
- /**
57
- * Test that Pepperjam_Network_Model_Feed_Product::_getFeedFields will
58
- * retrieve a list of field from the configuration and explode it into an array
59
- * of fields
60
- */
61
- public function testGetFeedFields()
62
- {
63
- $maps = array(
64
- 'field_1' => array('column_name' => 'field_1'),
65
- 'field_2' => array('column_name' => 'field_2'),
66
- 'field_3' => array('column_name' => 'field_3')
67
- );
68
- $fields = array('field_1' => 'key 1', 'field_2' => 'key 2', 'field_3' => 'key 3');
69
- $configHelper = $this->getHelperMock('pepperjam_network/config', array(
70
- 'getProductFeedFields', 'getCallbackMappings'
71
- ));
72
- $result = array_keys($fields);
73
-
74
- $configHelper->expects($this->once())
75
- ->method('getProductFeedFields')
76
- ->will($this->returnValue($fields));
77
- $configHelper->expects($this->once())
78
- ->method('getCallbackMappings')
79
- ->will($this->returnValue($maps));
80
- $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
81
-
82
- $feedProduct = Mage::getModel('pepperjam_network/feed_product');
83
-
84
- $this->assertSame($result, EcomDev_Utils_Reflection::invokeRestrictedMethod(
85
- $feedProduct,
86
- '_getFeedFields',
87
- array()
88
- ));
89
- }
90
- /**
91
- * Test that Pepperjam_Network_Model_Feed_Product::_getFileName will return
92
- * a string representing a feed file name
93
- */
94
- public function testFileName()
95
- {
96
- $filenameFormat = '%s_Some_Feed.csv';
97
- $programId = 'P12';
98
- $result = sprintf($filenameFormat, $programId);
99
-
100
- $store = Mage::getModel('core/store');
101
- $configHelper = $this->getHelperMock('pepperjam_network/config', array(
102
- 'getProductFeedFilenameFormat', 'getProgramId'
103
- ));
104
- $configHelper->expects($this->once())
105
- ->method('getProductFeedFilenameFormat')
106
- ->will($this->returnValue($filenameFormat));
107
- $configHelper->expects($this->once())
108
- ->method('getProgramId')
109
- ->with($this->identicalTo($store))
110
- ->will($this->returnValue($programId));
111
- $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
112
-
113
- $feedProduct = Mage::getModel('pepperjam_network/feed_product', array('store' => $store));
114
-
115
- $this->assertSame($result, EcomDev_Utils_Reflection::invokeRestrictedMethod(
116
- $feedProduct,
117
- '_getFileName',
118
- array()
119
- ));
120
- }
121
- /**
122
- * Test that Pepperjam_Network_Model_Feed_Product::_applyMapping will
123
- * be invoked with a Mage_Catalog_Model_Product object passed as its parameter
124
- * and it will generate an array of callback result from configuration
125
- */
126
- public function testApplyMapping()
127
- {
128
- $result = 'some value';
129
- $fields = array('field_1' => 'code_1');
130
- $mappings = array(
131
- 'field_1' => array(
132
- 'params' => array(),
133
- 'column_name' => 'field_1',
134
- 'type' => 'helper'
135
- ),
136
- );
137
- $callback = $mappings['field_1'];
138
- $callback['params']['key'] = $fields['field_1'];
139
-
140
- $item = Mage::getModel('catalog/product');
141
-
142
- $callbackResult = array($result);
143
-
144
- $configHelper = $this->getHelperMock('pepperjam_network/config', array(
145
- 'getCallbackMappings', 'getProductFeedFields'
146
- ));
147
- $configHelper->expects($this->any())
148
- ->method('getCallbackMappings')
149
- ->will($this->returnValue($mappings));
150
- $configHelper->expects($this->any())
151
- ->method('getProductFeedFields')
152
- ->will($this->returnValue($fields));
153
- $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
154
-
155
- $feedProduct = $this->getModelMock('pepperjam_network/feed_product', array('_invokeCallBack'));
156
- $feedProduct->expects($this->once())
157
- ->method('_invokeCallBack')
158
- ->with($this->identicalTo($callback), $this->identicalTo($item))
159
- ->will($this->returnValue($result));
160
-
161
- $this->assertSame($callbackResult, EcomDev_Utils_Reflection::invokeRestrictedMethod(
162
- $feedProduct,
163
- '_applyMapping',
164
- array($item)
165
- ));
166
- }
167
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Model_Feed_ProductTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test that Pepperjam_Network_Model_Feed_Product::_getItems will return
21
+ * a Mage_Catalog_Model_Resource_Product_Collection
22
+ */
23
+ public function testGetItems()
24
+ {
25
+ $store = Mage::getModel('core/store');
26
+ $collection = $this->getResourceModelMockBuilder('catalog/product_collection')
27
+ ->disableOriginalConstructor()
28
+ ->setMethods(array('setStore', 'addAttributeToSelect', 'addStoreFilter', 'addFieldToFilter'))
29
+ ->getMock();
30
+ $collection->expects($this->once())
31
+ ->method('setStore')
32
+ ->with($this->identicalTo($store))
33
+ ->will($this->returnSelf());
34
+ $collection->expects($this->once())
35
+ ->method('addAttributeToSelect')
36
+ ->with($this->identicalTo(array('*')))
37
+ ->will($this->returnSelf());
38
+ $collection->expects($this->once())
39
+ ->method('addStoreFilter')
40
+ ->with($this->identicalTo($store))
41
+ ->will($this->returnSelf());
42
+ $collection->expects($this->once())
43
+ ->method('addFieldToFilter')
44
+ ->with($this->identicalTo('status'), $this->identicalTo(Mage_Catalog_Model_Product_Status::STATUS_ENABLED))
45
+ ->will($this->returnSelf());
46
+ $this->replaceByMock('resource_model', 'catalog/product_collection', $collection);
47
+
48
+ $feedProduct = Mage::getModel('pepperjam_network/feed_product', array('store' => $store));
49
+
50
+ $this->assertSame($collection, EcomDev_Utils_Reflection::invokeRestrictedMethod(
51
+ $feedProduct,
52
+ '_getItems',
53
+ array()
54
+ ));
55
+ }
56
+ /**
57
+ * Test that Pepperjam_Network_Model_Feed_Product::_getFeedFields will
58
+ * retrieve a list of field from the configuration and explode it into an array
59
+ * of fields
60
+ */
61
+ public function testGetFeedFields()
62
+ {
63
+ $maps = array(
64
+ 'field_1' => array('column_name' => 'field_1'),
65
+ 'field_2' => array('column_name' => 'field_2'),
66
+ 'field_3' => array('column_name' => 'field_3')
67
+ );
68
+ $fields = array('field_1' => 'key 1', 'field_2' => 'key 2', 'field_3' => 'key 3');
69
+ $configHelper = $this->getHelperMock('pepperjam_network/config', array(
70
+ 'getProductFeedFields', 'getCallbackMappings'
71
+ ));
72
+ $result = array_keys($fields);
73
+
74
+ $configHelper->expects($this->once())
75
+ ->method('getProductFeedFields')
76
+ ->will($this->returnValue($fields));
77
+ $configHelper->expects($this->once())
78
+ ->method('getCallbackMappings')
79
+ ->will($this->returnValue($maps));
80
+ $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
81
+
82
+ $feedProduct = Mage::getModel('pepperjam_network/feed_product');
83
+
84
+ $this->assertSame($result, EcomDev_Utils_Reflection::invokeRestrictedMethod(
85
+ $feedProduct,
86
+ '_getFeedFields',
87
+ array()
88
+ ));
89
+ }
90
+ /**
91
+ * Test that Pepperjam_Network_Model_Feed_Product::_getFileName will return
92
+ * a string representing a feed file name
93
+ */
94
+ public function testFileName()
95
+ {
96
+ $filenameFormat = '%s_Some_Feed.csv';
97
+ $programId = 'P12';
98
+ $result = sprintf($filenameFormat, $programId);
99
+
100
+ $store = Mage::getModel('core/store');
101
+ $configHelper = $this->getHelperMock('pepperjam_network/config', array(
102
+ 'getProductFeedFilenameFormat', 'getProgramId'
103
+ ));
104
+ $configHelper->expects($this->once())
105
+ ->method('getProductFeedFilenameFormat')
106
+ ->will($this->returnValue($filenameFormat));
107
+ $configHelper->expects($this->once())
108
+ ->method('getProgramId')
109
+ ->with($this->identicalTo($store))
110
+ ->will($this->returnValue($programId));
111
+ $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
112
+
113
+ $feedProduct = Mage::getModel('pepperjam_network/feed_product', array('store' => $store));
114
+
115
+ $this->assertSame($result, EcomDev_Utils_Reflection::invokeRestrictedMethod(
116
+ $feedProduct,
117
+ '_getFileName',
118
+ array()
119
+ ));
120
+ }
121
+ /**
122
+ * Test that Pepperjam_Network_Model_Feed_Product::_applyMapping will
123
+ * be invoked with a Mage_Catalog_Model_Product object passed as its parameter
124
+ * and it will generate an array of callback result from configuration
125
+ */
126
+ public function testApplyMapping()
127
+ {
128
+ $result = 'some value';
129
+ $fields = array('field_1' => 'code_1');
130
+ $mappings = array(
131
+ 'field_1' => array(
132
+ 'params' => array(),
133
+ 'column_name' => 'field_1',
134
+ 'type' => 'helper'
135
+ ),
136
+ );
137
+ $callback = $mappings['field_1'];
138
+ $callback['params']['key'] = $fields['field_1'];
139
+
140
+ $item = Mage::getModel('catalog/product');
141
+
142
+ $callbackResult = array($result);
143
+
144
+ $configHelper = $this->getHelperMock('pepperjam_network/config', array(
145
+ 'getCallbackMappings', 'getProductFeedFields'
146
+ ));
147
+ $configHelper->expects($this->any())
148
+ ->method('getCallbackMappings')
149
+ ->will($this->returnValue($mappings));
150
+ $configHelper->expects($this->any())
151
+ ->method('getProductFeedFields')
152
+ ->will($this->returnValue($fields));
153
+ $this->replaceByMock('helper', 'pepperjam_network/config', $configHelper);
154
+
155
+ $feedProduct = $this->getModelMock('pepperjam_network/feed_product', array('_invokeCallBack'));
156
+ $feedProduct->expects($this->once())
157
+ ->method('_invokeCallBack')
158
+ ->with($this->identicalTo($callback), $this->identicalTo($item))
159
+ ->will($this->returnValue($result));
160
+
161
+ $this->assertSame($callbackResult, EcomDev_Utils_Reflection::invokeRestrictedMethod(
162
+ $feedProduct,
163
+ '_applyMapping',
164
+ array($item)
165
+ ));
166
+ }
167
+ }
app/code/community/Pepperjam/Network/Test/Model/ObserverTest.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- class Pepperjam_Network_Test_Model_ObserverTest extends EcomDev_PHPUnit_Test_Case
18
- {
19
- /**
20
- * Test that Pepperjam_Network_Model_Observer::createProductFeed
21
- * will be invoked and expected the method
22
- * Pepperjam_Network_Model_Observer::getWebsitesDefaultStoreviews
23
- * to be called and returned a known array of program keys map to default
24
- * website store views, then expects the method
25
- * Pepperjam_Network_Model_Product::generateFeed to be invoked per
26
- * default program id and store views
27
- */
28
- public function testCreateProductFeed()
29
- {
30
- $websitesDefaultStoreViews = array(
31
- 'P1' => Mage::getModel('core/store', array('name' => 'store view 1')),
32
- 'P2' => Mage::getModel('core/store', array('name' => 'store view 2'))
33
- );
34
- $programIds = array_keys($websitesDefaultStoreViews);
35
-
36
- $helper = $this->getHelperMock('pepperjam_network/data', array(
37
- 'getAllProgramIds', 'getStoreForProgramId'
38
- ));
39
- $helper->expects($this->once())
40
- ->method('getAllProgramIds')
41
- ->will($this->returnValue($programIds));
42
- $helper->expects($this->exactly(2))
43
- ->method('getStoreForProgramId')
44
- ->will($this->returnValueMap(array(
45
- array($programIds[0], $websitesDefaultStoreViews[$programIds[0]]),
46
- array($programIds[1], $websitesDefaultStoreViews[$programIds[1]])
47
- )));
48
- $this->replaceByMock('helper', 'pepperjam_network', $helper);
49
-
50
- $productFeed = $this->getModelMockBuilder('pepperjam_network/feed_product')
51
- ->disableOriginalConstructor()
52
- ->setMethods(array('generateFeed'))
53
- ->getMock();
54
- $productFeed->expects($this->exactly(2))
55
- ->method('generateFeed')
56
- ->will($this->returnSelf());
57
- $this->replaceByMock('model', 'pepperjam_network/feed_product', $productFeed);
58
-
59
- Mage::getModel('pepperjam_network/observer')->createProductFeed();
60
- }
61
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ class Pepperjam_Network_Test_Model_ObserverTest extends EcomDev_PHPUnit_Test_Case
18
+ {
19
+ /**
20
+ * Test that Pepperjam_Network_Model_Observer::createProductFeed
21
+ * will be invoked and expected the method
22
+ * Pepperjam_Network_Model_Observer::getWebsitesDefaultStoreviews
23
+ * to be called and returned a known array of program keys map to default
24
+ * website store views, then expects the method
25
+ * Pepperjam_Network_Model_Product::generateFeed to be invoked per
26
+ * default program id and store views
27
+ */
28
+ public function testCreateProductFeed()
29
+ {
30
+ $websitesDefaultStoreViews = array(
31
+ 'P1' => Mage::getModel('core/store', array('name' => 'store view 1')),
32
+ 'P2' => Mage::getModel('core/store', array('name' => 'store view 2'))
33
+ );
34
+ $programIds = array_keys($websitesDefaultStoreViews);
35
+
36
+ $helper = $this->getHelperMock('pepperjam_network/data', array(
37
+ 'getAllProgramIds', 'getStoreForProgramId'
38
+ ));
39
+ $helper->expects($this->once())
40
+ ->method('getAllProgramIds')
41
+ ->will($this->returnValue($programIds));
42
+ $helper->expects($this->exactly(2))
43
+ ->method('getStoreForProgramId')
44
+ ->will($this->returnValueMap(array(
45
+ array($programIds[0], $websitesDefaultStoreViews[$programIds[0]]),
46
+ array($programIds[1], $websitesDefaultStoreViews[$programIds[1]])
47
+ )));
48
+ $this->replaceByMock('helper', 'pepperjam_network', $helper);
49
+
50
+ $productFeed = $this->getModelMockBuilder('pepperjam_network/feed_product')
51
+ ->disableOriginalConstructor()
52
+ ->setMethods(array('generateFeed'))
53
+ ->getMock();
54
+ $productFeed->expects($this->exactly(2))
55
+ ->method('generateFeed')
56
+ ->will($this->returnSelf());
57
+ $this->replaceByMock('model', 'pepperjam_network/feed_product', $productFeed);
58
+
59
+ Mage::getModel('pepperjam_network/observer')->createProductFeed();
60
+ }
61
+ }
app/code/community/Pepperjam/Network/controllers/Adminhtml/PepperjamNetworkController.php CHANGED
@@ -1,100 +1,99 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
-
18
- class Pepperjam_Network_Adminhtml_PepperjamNetworkController extends Mage_Adminhtml_Controller_Action
19
- {
20
- const ATTRUBUTE_ID = 'commissioning_category';
21
- const DEFAULT_SCONFIG_FILENAME = 'cache.cfg';
22
- const PACKAGE_CHANNEL = 'community';
23
- const PACKAGE_NAME = 'Pepperjam_Network';
24
-
25
- protected $_config;
26
- protected $_sconfig;
27
-
28
- public function uninstallAction()
29
- {
30
- // Remove commissioning category
31
- $setup = new Mage_Eav_Model_Entity_Setup('pepperjam_network_setup');
32
- $setup->startSetup();
33
-
34
- $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup');
35
-
36
- Mage::log(array('uninstallAction', get_class($objCatalogEavSetup)));
37
- $attributeExists = (bool) $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, self::ATTRUBUTE_ID);
38
- if ($attributeExists) {
39
- $setup->removeAttribute(Mage_Catalog_Model_Product::ENTITY, self::ATTRUBUTE_ID);
40
- }
41
-
42
- $setup->endSetup();
43
-
44
- // Uninstall extension
45
- Mage_Connect_Command::registerCommands(); // Must run or next line will fail
46
- $installer = Mage_Connect_Command::getInstance('uninstall');
47
- $installer->setFrontendObject(Mage_Connect_Frontend::getInstance('CLI'));
48
- $installer->setSconfig($this->getSingleConfig());
49
-
50
- $installer->doUninstall('uninstall', array(), array(self::PACKAGE_CHANNEL, self::PACKAGE_NAME));
51
-
52
- // Clear cache
53
- Mage::app()->cleanCache();
54
-
55
- // Send message to admin
56
- Mage::getSingleton('core/session')->addSuccess('Package ' . self::PACKAGE_CHANNEL . '/' . self::PACKAGE_NAME . ' successfully deleted');
57
- }
58
-
59
- /**
60
- * Retrieve object of config and set it to Mage_Connect_Command
61
- *
62
- * @return Mage_Connect_Config
63
- */
64
- public function getConfig()
65
- {
66
- if (!$this->_config) {
67
- $this->_config = new Mage_Connect_Config();
68
- $ftp=$this->_config->__get('remote_config');
69
- if(!empty($ftp)){
70
- $packager = new Mage_Connect_Packager();
71
- list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp);
72
- $this->_config=$config;
73
- $this->_sconfig=$cache;
74
- }
75
- $this->_config->magento_root = Mage::getBaseDir('base');
76
- Mage_Connect_Command::setConfigObject($this->_config);
77
- }
78
- return $this->_config;
79
- }
80
-
81
- /**
82
- * Retrieve object of single config and set it to Mage_Connect_Command
83
- *
84
- * @param bool $reload
85
- * @return Mage_Connect_Singleconfig
86
- */
87
- public function getSingleConfig($reload = false)
88
- {
89
- if(!$this->_sconfig || $reload) {
90
- $this->_sconfig = new Mage_Connect_Singleconfig(
91
- $this->getConfig()->magento_root . DIRECTORY_SEPARATOR
92
- . $this->getConfig()->downloader_path . DIRECTORY_SEPARATOR
93
- . self::DEFAULT_SCONFIG_FILENAME
94
- );
95
- }
96
- Mage_Connect_Command::setSconfig($this->_sconfig);
97
- return $this->_sconfig;
98
-
99
- }
100
- }
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+
18
+ class Pepperjam_Network_Adminhtml_PepperjamNetworkController extends Mage_Adminhtml_Controller_Action
19
+ {
20
+ const ATTRUBUTE_ID = 'commissioning_category';
21
+ const DEFAULT_SCONFIG_FILENAME = 'cache.cfg';
22
+ const PACKAGE_CHANNEL = 'community';
23
+ const PACKAGE_NAME = 'Pepperjam_Network';
24
+
25
+ protected $_config;
26
+ protected $_sconfig;
27
+
28
+ public function uninstallAction()
29
+ {
30
+ // Remove commissioning category
31
+ $setup = new Mage_Eav_Model_Entity_Setup('pepperjam_network_setup');
32
+ $setup->startSetup();
33
+
34
+ $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup');
35
+
36
+ $attributeExists = (bool) $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, self::ATTRUBUTE_ID);
37
+ if ($attributeExists) {
38
+ $setup->removeAttribute(Mage_Catalog_Model_Product::ENTITY, self::ATTRUBUTE_ID);
39
+ }
40
+
41
+ $setup->endSetup();
42
+
43
+ // Uninstall extension
44
+ Mage_Connect_Command::registerCommands(); // Must run or next line will fail
45
+ $installer = Mage_Connect_Command::getInstance('uninstall');
46
+ $installer->setFrontendObject(Mage_Connect_Frontend::getInstance('CLI'));
47
+ $installer->setSconfig($this->getSingleConfig());
48
+
49
+ $installer->doUninstall('uninstall', array(), array(self::PACKAGE_CHANNEL, self::PACKAGE_NAME));
50
+
51
+ // Clear cache
52
+ Mage::app()->cleanCache();
53
+
54
+ // Send message to admin
55
+ Mage::getSingleton('core/session')->addSuccess('Package ' . self::PACKAGE_CHANNEL . '/' . self::PACKAGE_NAME . ' successfully deleted');
56
+ }
57
+
58
+ /**
59
+ * Retrieve object of config and set it to Mage_Connect_Command
60
+ *
61
+ * @return Mage_Connect_Config
62
+ */
63
+ public function getConfig()
64
+ {
65
+ if (!$this->_config) {
66
+ $this->_config = new Mage_Connect_Config();
67
+ $ftp=$this->_config->__get('remote_config');
68
+ if(!empty($ftp)){
69
+ $packager = new Mage_Connect_Packager();
70
+ list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp);
71
+ $this->_config=$config;
72
+ $this->_sconfig=$cache;
73
+ }
74
+ $this->_config->magento_root = Mage::getBaseDir('base');
75
+ Mage_Connect_Command::setConfigObject($this->_config);
76
+ }
77
+ return $this->_config;
78
+ }
79
+
80
+ /**
81
+ * Retrieve object of single config and set it to Mage_Connect_Command
82
+ *
83
+ * @param bool $reload
84
+ * @return Mage_Connect_Singleconfig
85
+ */
86
+ public function getSingleConfig($reload = false)
87
+ {
88
+ if(!$this->_sconfig || $reload) {
89
+ $this->_sconfig = new Mage_Connect_Singleconfig(
90
+ $this->getConfig()->magento_root . DIRECTORY_SEPARATOR
91
+ . $this->getConfig()->downloader_path . DIRECTORY_SEPARATOR
92
+ . self::DEFAULT_SCONFIG_FILENAME
93
+ );
94
+ }
95
+ Mage_Connect_Command::setSconfig($this->_sconfig);
96
+ return $this->_sconfig;
97
+
98
+ }
99
+ }
 
app/code/community/Pepperjam/Network/etc/adminhtml.xml CHANGED
@@ -1,37 +1,37 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- Copyright (c) 2016 Pepperjam Network.
4
-
5
- NOTICE OF LICENSE
6
-
7
- This source file is subject to the Pepperjam Network
8
- Magento Extensions End User License Agreement
9
- that is bundled with this package in the file LICENSE.md.
10
- It is also available through the world-wide-web at this URL:
11
- http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
-
13
- @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- -->
16
- <config>
17
- <acl>
18
- <resources>
19
- <admin>
20
- <children>
21
- <system>
22
- <children>
23
- <config>
24
- <children>
25
- <pepperjam translate="title">
26
- <title>Pepperjam</title>
27
- <sort_order>20</sort_order>
28
- </pepperjam>
29
- </children>
30
- </config>
31
- </children>
32
- </system>
33
- </children>
34
- </admin>
35
- </resources>
36
- </acl>
37
- </config>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Copyright (c) 2016 Pepperjam Network.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the Pepperjam Network
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+
13
+ @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ -->
16
+ <config>
17
+ <acl>
18
+ <resources>
19
+ <admin>
20
+ <children>
21
+ <system>
22
+ <children>
23
+ <config>
24
+ <children>
25
+ <pepperjam translate="title">
26
+ <title>Pepperjam</title>
27
+ <sort_order>20</sort_order>
28
+ </pepperjam>
29
+ </children>
30
+ </config>
31
+ </children>
32
+ </system>
33
+ </children>
34
+ </admin>
35
+ </resources>
36
+ </acl>
37
+ </config>
app/code/community/Pepperjam/Network/etc/config.xml CHANGED
@@ -1,1041 +1,1111 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- Copyright (c) 2016 Pepperjam Network.
4
-
5
- NOTICE OF LICENSE
6
-
7
- This source file is subject to the Pepperjam Network
8
- Magento Extensions End User License Agreement
9
- that is bundled with this package in the file LICENSE.md.
10
- It is also available through the world-wide-web at this URL:
11
- http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
-
13
- @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- -->
16
- <config>
17
- <modules>
18
- <Pepperjam_Network>
19
- <version>1.2.2.0</version>
20
- </Pepperjam_Network>
21
- </modules>
22
- <global>
23
- <models>
24
- <pepperjam_network>
25
- <class>Pepperjam_Network_Model</class>
26
- </pepperjam_network>
27
- </models>
28
- <helpers>
29
- <pepperjam_network>
30
- <class>Pepperjam_Network_Helper</class>
31
- </pepperjam_network>
32
- </helpers>
33
- <blocks>
34
- <pepperjam_network>
35
- <class>Pepperjam_Network_Block</class>
36
- </pepperjam_network>
37
- </blocks>
38
- <resources>
39
- <pepperjam_network_setup>
40
- <setup>
41
- <module>Pepperjam_Network</module>
42
- <class>Mage_Core_Model_Resource_Setup</class>
43
- </setup>
44
- </pepperjam_network_setup>
45
- </resources>
46
- </global>
47
- <crontab>
48
- <jobs>
49
- <pepperjam_network_generate_product_feed>
50
- <schedule>
51
- <cron_expr>0 3 * * *</cron_expr>
52
- </schedule>
53
- <run>
54
- <model>pepperjam_network/observer::createProductFeed</model>
55
- </run>
56
- </pepperjam_network_generate_product_feed>
57
- <pepperjam_network_generate_corrected_order_feed>
58
- <schedule>
59
- <cron_expr>0 3 * * *</cron_expr>
60
- </schedule>
61
- <run>
62
- <model>pepperjam_network/observer::createCorrectedOrdersFeed</model>
63
- </run>
64
- </pepperjam_network_generate_corrected_order_feed>
65
- </jobs>
66
- </crontab>
67
- <default>
68
- <pepperjam>
69
- <pepperjam_network>
70
- <active>0</active>
71
- <js_files>pepperjam_network/cookie.js</js_files>
72
- <!-- use comma to add more js files-->
73
- <beacon_url>https://t.pepperjamnetwork.com/track</beacon_url>
74
- <export_path>var/export/pepperjam_network/</export_path>
75
- <order_type>itemized</order_type>
76
- <program_id/>
77
- <transaction_type>1</transaction_type>
78
- <conditional_pixel_enabled>0</conditional_pixel_enabled>
79
- <source_key_name>source</source_key_name>
80
- <product_feed_enabled>1</product_feed_enabled>
81
- <order_feed_enabled>1</order_feed_enabled>
82
- <feeds>
83
- <callback_mappings>
84
- <program_id>
85
- <class>pepperjam_network/map</class>
86
- <method>getProgramId</method>
87
- <type>helper</type>
88
- <column_name>PID</column_name>
89
- </program_id>
90
- <order_id>
91
- <class>pepperjam_network/map_order</class>
92
- <method>getOrderId</method>
93
- <type>helper</type>
94
- <column_name>OID</column_name>
95
- <params>
96
- <format>%.50s</format>
97
- </params>
98
- </order_id>
99
- <item_order_id>
100
- <class>pepperjam_network/map_order</class>
101
- <method>getItemOrderId</method>
102
- <type>helper</type>
103
- <column_name>OID</column_name>
104
- <params>
105
- <format>%.50s</format>
106
- </params>
107
- </item_order_id>
108
- <item_id>
109
- <class>pepperjam_network/map_order</class>
110
- <method>getItemId</method>
111
- <type>helper</type>
112
- <column_name>ITEMID</column_name>
113
- <params>
114
- <format>%.50s</format>
115
- <key>sku</key>
116
- </params>
117
- </item_id>
118
- <item_price>
119
- <class>pepperjam_network/map_order</class>
120
- <method>getItemPrice</method>
121
- <type>helper</type>
122
- <column_name>AMOUNT</column_name>
123
- <params>
124
- <format>%.2f</format>
125
- </params>
126
- </item_price>
127
- <item_quantity>
128
- <class>pepperjam_network/map_order</class>
129
- <method>getItemQuantity</method>
130
- <type>helper</type>
131
- <column_name>QUANTITY</column_name>
132
- </item_quantity>
133
- <dynamic_program_id>
134
- <class>pepperjam_network/map</class>
135
- <method>getProgramId</method>
136
- <type>helper</type>
137
- <column_name>PROGRAM_ID</column_name>
138
- </dynamic_program_id>
139
- <dynamic_item_order_id>
140
- <class>pepperjam_network/map_order</class>
141
- <method>getItemOrderId</method>
142
- <type>helper</type>
143
- <column_name>ORDER_ID</column_name>
144
- <params>
145
- <format>%.50s</format>
146
- </params>
147
- </dynamic_item_order_id>
148
- <dynamic_item_id>
149
- <class>pepperjam_network/map_order</class>
150
- <method>getItemId</method>
151
- <type>helper</type>
152
- <column_name>ITEM_ID</column_name>
153
- <params>
154
- <format>%.50s</format>
155
- <key>sku</key>
156
- </params>
157
- </dynamic_item_id>
158
- <dynamic_item_price>
159
- <class>pepperjam_network/map_order</class>
160
- <method>getItemPrice</method>
161
- <type>helper</type>
162
- <column_name>ITEM_PRICE</column_name>
163
- <params>
164
- <format>%.2f</format>
165
- </params>
166
- </dynamic_item_price>
167
- <category>
168
- <class>pepperjam_network/map_order</class>
169
- <method>getCategory</method>
170
- <type>helper</type>
171
- <column_name>CATEGORY</column_name>
172
- </category>
173
- <new_to_file>
174
- <class>pepperjam_network/map_order</class>
175
- <method>getNewToFile</method>
176
- <type>helper</type>
177
- <column_name>NEW_TO_FILE</column_name>
178
- </new_to_file>
179
- <order_amount>
180
- <class>pepperjam_network/map_order</class>
181
- <method>getOrderAmount</method>
182
- <type>helper</type>
183
- <column_name>AMOUNT</column_name>
184
- <params>
185
- <format>%.2f</format>
186
- </params>
187
- </order_amount>
188
- <reason>
189
- <class>pepperjam_network/map</class>
190
- <method>passStatic</method>
191
- <type>helper</type>
192
- <column_name>REASON</column_name>
193
- <params>
194
- <value>8</value>
195
- </params>
196
- </reason>
197
- <transaction_type>
198
- <class>pepperjam_network/map_order</class>
199
- <method>getTransactionType</method>
200
- <type>helper</type>
201
- <column_name>TYPE</column_name>
202
- </transaction_type>
203
- <age_range>
204
- <class>pepperjam_network/map</class>
205
- <method>getDataValue</method>
206
- <type>helper</type>
207
- <column_name>age_range</column_name>
208
- <params>
209
- <format>%.32s</format>
210
- </params>
211
- </age_range>
212
- <artist>
213
- <class>pepperjam_network/map</class>
214
- <method>getDataValue</method>
215
- <type>helper</type>
216
- <column_name>artist</column_name>
217
- <params>
218
- <format>%.128s</format>
219
- </params>
220
- </artist>
221
- <aspect_ratio>
222
- <class>pepperjam_network/map</class>
223
- <method>getDataValue</method>
224
- <type>helper</type>
225
- <column_name>aspect_ratio</column_name>
226
- <params>
227
- <format>%.16s</format>
228
- </params>
229
- </aspect_ratio>
230
- <author>
231
- <class>pepperjam_network/map</class>
232
- <method>getDataValue</method>
233
- <type>helper</type>
234
- <column_name>author</column_name>
235
- <params>
236
- <format>%.128s</format>
237
- </params>
238
- </author>
239
- <battery_life>
240
- <class>pepperjam_network/map</class>
241
- <method>getDataValue</method>
242
- <type>helper</type>
243
- <column_name>battery_life</column_name>
244
- <params>
245
- <format>%.32s</format>
246
- </params>
247
- </battery_life>
248
- <binding>
249
- <class>pepperjam_network/map</class>
250
- <method>getDataValue</method>
251
- <type>helper</type>
252
- <column_name>binding</column_name>
253
- <params>
254
- <format>%.32s</format>
255
- </params>
256
- </binding>
257
- <buy_url>
258
- <class>pepperjam_network/map</class>
259
- <method>getDataValue</method>
260
- <type>helper</type>
261
- <column_name>buy_url</column_name>
262
- <params>
263
- <key>product_url</key>
264
- <format>%.2000s</format>
265
- </params>
266
- </buy_url>
267
- <category_network>
268
- <class>pepperjam_network/map_product</class>
269
- <method>getCategory</method>
270
- <type>helper</type>
271
- <column_name>category_network</column_name>
272
- <params>
273
- <format>%.256s</format>
274
- </params>
275
- </category_network>
276
- <category_program>
277
- <class>pepperjam_network/map_product</class>
278
- <method>getCategory</method>
279
- <type>helper</type>
280
- <column_name>category_program</column_name>
281
- <params>
282
- <format>%.256s</format>
283
- </params>
284
- </category_program>
285
- <color>
286
- <class>pepperjam_network/map</class>
287
- <method>getDataValue</method>
288
- <type>helper</type>
289
- <column_name>color</column_name>
290
- <params>
291
- <format>%.32s</format>
292
- </params>
293
- </color>
294
- <color_output>
295
- <class>pepperjam_network/map</class>
296
- <method>getValueYesNo</method>
297
- <type>helper</type>
298
- <column_name>color_output</column_name>
299
- <params>
300
- <format>%s</format>
301
- </params>
302
- </color_output>
303
- <condition>
304
- <class>pepperjam_network/map</class>
305
- <method>getDataValue</method>
306
- <type>helper</type>
307
- <column_name>condition</column_name>
308
- <params>
309
- <format>%.64s</format>
310
- </params>
311
- </condition>
312
- <description_long>
313
- <class>pepperjam_network/map</class>
314
- <method>getDataValue</method>
315
- <type>helper</type>
316
- <column_name>description_long</column_name>
317
- <params>
318
- <format>%.2000s</format>
319
- </params>
320
- </description_long>
321
- <description_short>
322
- <class>pepperjam_network/map</class>
323
- <method>getDataValue</method>
324
- <type>helper</type>
325
- <column_name>description_short</column_name>
326
- <params>
327
- <format>%.512s</format>
328
- </params>
329
- </description_short>
330
- <director>
331
- <class>pepperjam_network/map</class>
332
- <method>getDataValue</method>
333
- <type>helper</type>
334
- <column_name>director</column_name>
335
- <params>
336
- <format>%.128s</format>
337
- </params>
338
- </director>
339
- <discontinued>
340
- <class>pepperjam_network/map</class>
341
- <method>getValueYesNo</method>
342
- <type>helper</type>
343
- <column_name>discontinued</column_name>
344
- <params>
345
- <format>%s</format>
346
- </params>
347
- </discontinued>
348
- <display_type>
349
- <class>pepperjam_network/map</class>
350
- <method>getDataValue</method>
351
- <type>helper</type>
352
- <column_name>display_type</column_name>
353
- <params>
354
- <format>%.32s</format>
355
- </params>
356
- </display_type>
357
- <edition>
358
- <class>pepperjam_network/map</class>
359
- <method>getDataValue</method>
360
- <type>helper</type>
361
- <column_name>edition</column_name>
362
- <params>
363
- <format>%.32s</format>
364
- </params>
365
- </edition>
366
- <expiration_date>
367
- <class>pepperjam_network/map</class>
368
- <method>getDateValue</method>
369
- <type>helper</type>
370
- <column_name>expiration_date</column_name>
371
- <params>
372
- <format>Y-m-d</format>
373
- </params>
374
- </expiration_date>
375
- <features>
376
- <class>pepperjam_network/map</class>
377
- <method>getDataValue</method>
378
- <type>helper</type>
379
- <column_name>features</column_name>
380
- <params>
381
- <format>%.128s</format>
382
- </params>
383
- </features>
384
- <focus_type>
385
- <class>pepperjam_network/map</class>
386
- <method>getDataValue</method>
387
- <type>helper</type>
388
- <column_name>focus_type</column_name>
389
- <params>
390
- <format>%.128s</format>
391
- </params>
392
- </focus_type>
393
- <format>
394
- <class>pepperjam_network/map</class>
395
- <method>getDataValue</method>
396
- <type>helper</type>
397
- <column_name>format</column_name>
398
- <params>
399
- <format>%.64s</format>
400
- </params>
401
- </format>
402
- <functions>
403
- <class>pepperjam_network/map</class>
404
- <method>getDataValue</method>
405
- <type>helper</type>
406
- <column_name>functions</column_name>
407
- <params>
408
- <format>%.64s</format>
409
- </params>
410
- </functions>
411
- <genre>
412
- <class>pepperjam_network/map</class>
413
- <method>getDataValue</method>
414
- <type>helper</type>
415
- <column_name>genre</column_name>
416
- <params>
417
- <format>%.64s</format>
418
- </params>
419
- </genre>
420
- <heel_height>
421
- <class>pepperjam_network/map</class>
422
- <method>getDataValue</method>
423
- <type>helper</type>
424
- <column_name>heel_height</column_name>
425
- <params>
426
- <format>%.32s</format>
427
- </params>
428
- </heel_height>
429
- <height>
430
- <class>pepperjam_network/map</class>
431
- <method>getDataValue</method>
432
- <type>helper</type>
433
- <column_name>height</column_name>
434
- <params>
435
- <format>%.32s</format>
436
- </params>
437
- </height>
438
- <image_thumb_url>
439
- <class>pepperjam_network/map_product</class>
440
- <method>getImageUrl</method>
441
- <type>helper</type>
442
- <column_name>image_thumb_url</column_name>
443
- <params>
444
- <format>%.2000s</format>
445
- </params>
446
- </image_thumb_url>
447
- <image_url>
448
- <class>pepperjam_network/map_product</class>
449
- <method>getImageUrl</method>
450
- <type>helper</type>
451
- <column_name>image_url</column_name>
452
- <params>
453
- <format>%.2000s</format>
454
- </params>
455
- </image_url>
456
- <installation>
457
- <class>pepperjam_network/map</class>
458
- <method>getDataValue</method>
459
- <type>helper</type>
460
- <column_name>installation</column_name>
461
- <params>
462
- <format>%.64s</format>
463
- </params>
464
- </installation>
465
- <in_stock>
466
- <class>pepperjam_network/map_product</class>
467
- <method>getInStockYesNo</method>
468
- <type>helper</type>
469
- <column_name>in_stock</column_name>
470
- <params>
471
- <format>%s</format>
472
- </params>
473
- </in_stock>
474
- <isbn>
475
- <class>pepperjam_network/map</class>
476
- <method>getDataValue</method>
477
- <type>helper</type>
478
- <column_name>isbn</column_name>
479
- <params>
480
- <format>%.64s</format>
481
- </params>
482
- </isbn>
483
- <keywords>
484
- <class>pepperjam_network/map</class>
485
- <method>getDataValue</method>
486
- <type>helper</type>
487
- <column_name>keywords</column_name>
488
- <params>
489
- <format>%.256s</format>
490
- </params>
491
- </keywords>
492
- <length>
493
- <class>pepperjam_network/map</class>
494
- <method>getDataValue</method>
495
- <type>helper</type>
496
- <column_name>length</column_name>
497
- <params>
498
- <format>%.32s</format>
499
- </params>
500
- </length>
501
- <load_type>
502
- <class>pepperjam_network/map</class>
503
- <method>getDataValue</method>
504
- <type>helper</type>
505
- <column_name>load_type</column_name>
506
- <params>
507
- <format>%.32s</format>
508
- </params>
509
- </load_type>
510
- <location>
511
- <class>pepperjam_network/map</class>
512
- <method>getDataValue</method>
513
- <type>helper</type>
514
- <column_name>location</column_name>
515
- <params>
516
- <format>%.64s</format>
517
- </params>
518
- </location>
519
- <made_in>
520
- <class>pepperjam_network/map</class>
521
- <method>getDataValue</method>
522
- <type>helper</type>
523
- <column_name>made_in</column_name>
524
- <params>
525
- <format>%.64s</format>
526
- </params>
527
- </made_in>
528
- <manufacturer>
529
- <class>pepperjam_network/map</class>
530
- <method>getDataValue</method>
531
- <type>helper</type>
532
- <column_name>manufacturer</column_name>
533
- <params>
534
- <format>%.128s</format>
535
- </params>
536
- </manufacturer>
537
- <material>
538
- <class>pepperjam_network/map</class>
539
- <method>getDataValue</method>
540
- <type>helper</type>
541
- <column_name>material</column_name>
542
- <params>
543
- <format>%.128s</format>
544
- </params>
545
- </material>
546
- <megapixels>
547
- <class>pepperjam_network/map</class>
548
- <method>getDataValue</method>
549
- <type>helper</type>
550
- <column_name>megapixels</column_name>
551
- <params>
552
- <format>%01.2f</format>
553
- </params>
554
- </megapixels>
555
- <memory_capacity>
556
- <class>pepperjam_network/map</class>
557
- <method>getDataValue</method>
558
- <type>helper</type>
559
- <column_name>memory_capacity</column_name>
560
- <params>
561
- <format>%.64s</format>
562
- </params>
563
- </memory_capacity>
564
- <memory_card_slot>
565
- <class>pepperjam_network/map</class>
566
- <method>getDataValue</method>
567
- <type>helper</type>
568
- <column_name>memory_card_slot</column_name>
569
- <params>
570
- <format>%.32s</format>
571
- </params>
572
- </memory_card_slot>
573
- <memory_type>
574
- <class>pepperjam_network/map</class>
575
- <method>getDataValue</method>
576
- <type>helper</type>
577
- <column_name>memory_type</column_name>
578
- <params>
579
- <format>%.64s</format>
580
- </params>
581
- </memory_type>
582
- <model_number>
583
- <class>pepperjam_network/map</class>
584
- <method>getDataValue</method>
585
- <type>helper</type>
586
- <column_name>model_number</column_name>
587
- <params>
588
- <format>%.128s</format>
589
- </params>
590
- </model_number>
591
- <mpn>
592
- <class>pepperjam_network/map</class>
593
- <method>getDataValue</method>
594
- <type>helper</type>
595
- <column_name>mpn</column_name>
596
- <params>
597
- <format>%.128s</format>
598
- </params>
599
- </mpn>
600
- <name>
601
- <class>pepperjam_network/map</class>
602
- <method>getDataValue</method>
603
- <type>helper</type>
604
- <column_name>name</column_name>
605
- <params>
606
- <format>%.128s</format>
607
- </params>
608
- </name>
609
- <occasion>
610
- <class>pepperjam_network/map</class>
611
- <method>getDataValue</method>
612
- <type>helper</type>
613
- <column_name>occasion</column_name>
614
- <params>
615
- <format>%.128s</format>
616
- </params>
617
- </occasion>
618
- <operating_system>
619
- <class>pepperjam_network/map</class>
620
- <method>getDataValue</method>
621
- <type>helper</type>
622
- <column_name>operating_system</column_name>
623
- <params>
624
- <format>%.128s</format>
625
- </params>
626
- </operating_system>
627
- <optical_drive>
628
- <class>pepperjam_network/map</class>
629
- <method>getDataValue</method>
630
- <type>helper</type>
631
- <column_name>optical_drive</column_name>
632
- <params>
633
- <format>%.64s</format>
634
- </params>
635
- </optical_drive>
636
- <pages>
637
- <class>pepperjam_network/map</class>
638
- <method>getDataValue</method>
639
- <type>helper</type>
640
- <column_name>pages</column_name>
641
- <params>
642
- <format>%.11d</format>
643
- </params>
644
- </pages>
645
- <payment_accepted>
646
- <class>pepperjam_network/map</class>
647
- <method>getDataValue</method>
648
- <type>helper</type>
649
- <column_name>payment_accepted</column_name>
650
- <params>
651
- <format>%.128s</format>
652
- </params>
653
- </payment_accepted>
654
- <payment_notes>
655
- <class>pepperjam_network/map</class>
656
- <method>getDataValue</method>
657
- <type>helper</type>
658
- <column_name>payment_notes</column_name>
659
- <params>
660
- <format>%.256s</format>
661
- </params>
662
- </payment_notes>
663
- <platform>
664
- <class>pepperjam_network/map</class>
665
- <method>getDataValue</method>
666
- <type>helper</type>
667
- <column_name>platform</column_name>
668
- <params>
669
- <format>%.64s</format>
670
- </params>
671
- </platform>
672
- <price>
673
- <class>pepperjam_network/map</class>
674
- <method>getDataValue</method>
675
- <type>helper</type>
676
- <column_name>price</column_name>
677
- <params>
678
- <format>%01.2f</format>
679
- </params>
680
- </price>
681
- <price_retail>
682
- <class>pepperjam_network/map</class>
683
- <method>getDataValue</method>
684
- <type>helper</type>
685
- <column_name>price_retail</column_name>
686
- <params>
687
- <format>%01.2f</format>
688
- </params>
689
- </price_retail>
690
- <price_sale>
691
- <class>pepperjam_network/map</class>
692
- <method>getDataValue</method>
693
- <type>helper</type>
694
- <column_name>price_sale</column_name>
695
- <params>
696
- <format>%01.2f</format>
697
- </params>
698
- </price_sale>
699
- <price_shipping>
700
- <class>pepperjam_network/map</class>
701
- <method>getDataValue</method>
702
- <type>helper</type>
703
- <column_name>price_shipping</column_name>
704
- <params>
705
- <format>%01.2f</format>
706
- </params>
707
- </price_shipping>
708
- <processor>
709
- <class>pepperjam_network/map</class>
710
- <method>getDataValue</method>
711
- <type>helper</type>
712
- <column_name>processor</column_name>
713
- <params>
714
- <format>%.64s</format>
715
- </params>
716
- </processor>
717
- <publisher>
718
- <class>pepperjam_network/map</class>
719
- <method>getDataValue</method>
720
- <type>helper</type>
721
- <column_name>publisher</column_name>
722
- <params>
723
- <format>%.128s</format>
724
- </params>
725
- </publisher>
726
- <quantity_in_stock>
727
- <class>pepperjam_network/map_product</class>
728
- <method>getInStockQty</method>
729
- <type>helper</type>
730
- <column_name>quantity_in_stock</column_name>
731
- <params>
732
- <format>%.11d</format>
733
- </params>
734
- </quantity_in_stock>
735
- <rating>
736
- <class>pepperjam_network/map</class>
737
- <method>getDataValue</method>
738
- <type>helper</type>
739
- <column_name>rating</column_name>
740
- <params>
741
- <format>%.32s</format>
742
- </params>
743
- </rating>
744
- <recommended_usage>
745
- <class>pepperjam_network/map</class>
746
- <method>getDataValue</method>
747
- <type>helper</type>
748
- <column_name>recommended_usage</column_name>
749
- <params>
750
- <format>%.128s</format>
751
- </params>
752
- </recommended_usage>
753
- <resolution>
754
- <class>pepperjam_network/map</class>
755
- <method>getDataValue</method>
756
- <type>helper</type>
757
- <column_name>resolution</column_name>
758
- <params>
759
- <format>%.64s</format>
760
- </params>
761
- </resolution>
762
- <screen_size>
763
- <class>pepperjam_network/map</class>
764
- <method>getDataValue</method>
765
- <type>helper</type>
766
- <column_name>screen_size</column_name>
767
- <params>
768
- <format>%.32s</format>
769
- </params>
770
- </screen_size>
771
- <shipping_method>
772
- <class>pepperjam_network/map</class>
773
- <method>getDataValue</method>
774
- <type>helper</type>
775
- <column_name>shipping_method</column_name>
776
- <params>
777
- <format>%.64s</format>
778
- </params>
779
- </shipping_method>
780
- <shoe_size>
781
- <class>pepperjam_network/map</class>
782
- <method>getDataValue</method>
783
- <type>helper</type>
784
- <column_name>shoe_size</column_name>
785
- <params>
786
- <format>%.32s</format>
787
- </params>
788
- </shoe_size>
789
- <shoe_width>
790
- <class>pepperjam_network/map</class>
791
- <method>getDataValue</method>
792
- <type>helper</type>
793
- <column_name>shoe_width</column_name>
794
- <params>
795
- <format>%.32s</format>
796
- </params>
797
- </shoe_width>
798
- <size>
799
- <class>pepperjam_network/map</class>
800
- <method>getDataValue</method>
801
- <type>helper</type>
802
- <column_name>size</column_name>
803
- <params>
804
- <format>%.32s</format>
805
- </params>
806
- </size>
807
- <sku>
808
- <class>pepperjam_network/map</class>
809
- <method>getDataValue</method>
810
- <type>helper</type>
811
- <column_name>sku</column_name>
812
- <params>
813
- <format>%.128s</format>
814
- </params>
815
- </sku>
816
- <staring>
817
- <class>pepperjam_network/map</class>
818
- <method>getDataValue</method>
819
- <type>helper</type>
820
- <column_name>staring</column_name>
821
- <params>
822
- <format>%.128s</format>
823
- </params>
824
- </staring>
825
- <style>
826
- <class>pepperjam_network/map</class>
827
- <method>getDataValue</method>
828
- <type>helper</type>
829
- <column_name>style</column_name>
830
- <params>
831
- <format>%.64s</format>
832
- </params>
833
- </style>
834
- <tech_spec_url>
835
- <class>pepperjam_network/map</class>
836
- <method>getDataValue</method>
837
- <type>helper</type>
838
- <column_name>tech_spec_url</column_name>
839
- <params>
840
- <format>%.2000s</format>
841
- </params>
842
- </tech_spec_url>
843
- <tracks>
844
- <class>pepperjam_network/map</class>
845
- <method>getDataValue</method>
846
- <type>helper</type>
847
- <column_name>tracks</column_name>
848
- <params>
849
- <format>%.11d</format>
850
- </params>
851
- </tracks>
852
- <upc>
853
- <class>pepperjam_network/map</class>
854
- <method>getDataValue</method>
855
- <type>helper</type>
856
- <column_name>upc</column_name>
857
- <params>
858
- <format>%.128s</format>
859
- </params>
860
- </upc>
861
- <weight>
862
- <class>pepperjam_network/map</class>
863
- <method>getDataValue</method>
864
- <type>helper</type>
865
- <column_name>weight</column_name>
866
- <params>
867
- <format>%.32s</format>
868
- </params>
869
- </weight>
870
- <width>
871
- <class>pepperjam_network/map</class>
872
- <method>getDataValue</method>
873
- <type>helper</type>
874
- <column_name>width</column_name>
875
- <params>
876
- <format>%.32s</format>
877
- </params>
878
- </width>
879
- <wireless_interface>
880
- <class>pepperjam_network/map</class>
881
- <method>getDataValue</method>
882
- <type>helper</type>
883
- <column_name>wireless_interface</column_name>
884
- <params>
885
- <format>%.32s</format>
886
- </params>
887
- </wireless_interface>
888
- <year>
889
- <class>pepperjam_network/map</class>
890
- <method>getYearValue</method>
891
- <type>helper</type>
892
- <column_name>year</column_name>
893
- <params>
894
- <format>%.dd</format>
895
- </params>
896
- </year>
897
- <zoom>
898
- <class>pepperjam_network/map</class>
899
- <method>getDataValue</method>
900
- <type>helper</type>
901
- <column_name>zoom</column_name>
902
- <params>
903
- <format>%.32s</format>
904
- </params>
905
- </zoom>
906
- </callback_mappings>
907
- <order_dynamic>
908
- <fields>dynamic_program_id,dynamic_item_order_id,dynamic_item_id,dynamic_item_price,item_quantity,category,new_to_file</fields>
909
- <file_name_format>%s_transactions_corrected_%s.csv</file_name_format>
910
- </order_dynamic>
911
- <order_itemized>
912
- <fields>program_id,item_order_id,item_id,item_price,item_quantity,reason</fields>
913
- <file_name_format>%s_transactions_corrected_%s.csv</file_name_format>
914
- </order_itemized>
915
- <order_basic>
916
- <fields>program_id,order_amount,order_id,reason,transaction_type</fields>
917
- <file_name_format>%s_transactions_corrected_%s.csv</file_name_format>
918
- </order_basic>
919
- <product>
920
- <file_name_format>%s_product_feed.csv</file_name_format>
921
- </product>
922
- </feeds>
923
- </pepperjam_network>
924
- <pepperjam_network_product_attribute_map>
925
- <!--
926
- The purpose of this mapping is enabled the coexistence of both
927
- pre-configured product attributes mapping and configured attributes
928
- mapping for the affiliate product feed. This means that when this
929
- module is installed and no other attribute is configured for the
930
- product feed the required pre-mapped attributes will be sufficient
931
- enough to generate a valid product feed.
932
- -->
933
- <age_range/>
934
- <artist/>
935
- <aspect_ratio/>
936
- <author/>
937
- <battery_life/>
938
- <binding/>
939
- <buy_url>product_url</buy_url>
940
- <category_network/>
941
- <category_program>category</category_program>
942
- <color/>
943
- <color_output/>
944
- <condition/>
945
- <description_long>description</description_long>
946
- <description_short>short_description</description_short>
947
- <director/>
948
- <discontinued/>
949
- <display_type/>
950
- <edition/>
951
- <expiration_date/>
952
- <features/>
953
- <focus_type/>
954
- <format/>
955
- <functions/>
956
- <genre/>
957
- <heel_height/>
958
- <height/>
959
- <image_thumb_url>thumbnail</image_thumb_url>
960
- <image_url>image</image_url>
961
- <installation/>
962
- <in_stock/>
963
- <isbn/>
964
- <keywords>meta_keyword</keywords>
965
- <length/>
966
- <load_type/>
967
- <location/>
968
- <made_in/>
969
- <manufacturer>manufacturer</manufacturer>
970
- <material/>
971
- <megapixels/>
972
- <memory_capacity/>
973
- <memory_card_slot/>
974
- <memory_type/>
975
- <model_number/>
976
- <mpn/>
977
- <name>name</name>
978
- <occasion/>
979
- <operating_system/>
980
- <optical_drive/>
981
- <pages/>
982
- <payment_accepted/>
983
- <payment_notes/>
984
- <platform/>
985
- <price>price</price>
986
- <price_retail>msrp</price_retail>
987
- <price_sale>special_price</price_sale>
988
- <price_shipping/>
989
- <processor/>
990
- <publisher/>
991
- <quantity_in_stock>qty</quantity_in_stock>
992
- <rating/>
993
- <recommended_usage/>
994
- <resolution/>
995
- <screen_size/>
996
- <shipping_method/>
997
- <shoe_size/>
998
- <shoe_width/>
999
- <size/>
1000
- <sku>sku</sku>
1001
- <staring/>
1002
- <style/>
1003
- <tech_spec_url/>
1004
- <tracks/>
1005
- <upc/>
1006
- <weight/>
1007
- <width/>
1008
- <wireless_interface/>
1009
- <year/>
1010
- <zoom/>
1011
- </pepperjam_network_product_attribute_map>
1012
- </pepperjam>
1013
- </default>
1014
- <frontend>
1015
- <layout>
1016
- <updates>
1017
- <pepperjam_network>
1018
- <file>pepperjam_network.xml</file>
1019
- </pepperjam_network>
1020
- </updates>
1021
- </layout>
1022
- </frontend>
1023
- <phpunit>
1024
- <suite>
1025
- <modules>
1026
- <Pepperjam_Network/>
1027
- </modules>
1028
- </suite>
1029
- </phpunit>
1030
- <admin>
1031
- <routers>
1032
- <adminhtml>
1033
- <args>
1034
- <modules>
1035
- <pepperjam_network before="Mage_Adminhtml">Pepperjam_Network_Adminhtml</pepperjam_network>
1036
- </modules>
1037
- </args>
1038
- </adminhtml>
1039
- </routers>
1040
- </admin>
1041
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Copyright (c) 2016 Pepperjam Network.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the Pepperjam Network
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+
13
+ @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ -->
16
+ <config>
17
+ <modules>
18
+ <Pepperjam_Network>
19
+ <version>1.3.0.0</version>
20
+ </Pepperjam_Network>
21
+ </modules>
22
+ <global>
23
+ <models>
24
+ <pepperjam_network>
25
+ <class>Pepperjam_Network_Model</class>
26
+ </pepperjam_network>
27
+ </models>
28
+ <helpers>
29
+ <pepperjam_network>
30
+ <class>Pepperjam_Network_Helper</class>
31
+ </pepperjam_network>
32
+ </helpers>
33
+ <blocks>
34
+ <pepperjam_network>
35
+ <class>Pepperjam_Network_Block</class>
36
+ </pepperjam_network>
37
+ </blocks>
38
+ <resources>
39
+ <pepperjam_network_setup>
40
+ <setup>
41
+ <module>Pepperjam_Network</module>
42
+ <class>Mage_Core_Model_Resource_Setup</class>
43
+ </setup>
44
+ </pepperjam_network_setup>
45
+ </resources>
46
+ <events>
47
+ <sales_order_place_after>
48
+ <observers>
49
+ <pepperjam_network>
50
+ <type>singleton</type>
51
+ <class>Pepperjam_Network_Model_Observer</class>
52
+ <method>transferAttribution</method>
53
+ </pepperjam_network>
54
+ </observers>
55
+ </sales_order_place_after>
56
+ </events>
57
+ </global>
58
+ <crontab>
59
+ <jobs>
60
+ <pepperjam_network_generate_product_feed>
61
+ <schedule>
62
+ <cron_expr>* 3 * * *</cron_expr>
63
+ </schedule>
64
+ <run>
65
+ <model>pepperjam_network/observer::createProductFeed</model>
66
+ </run>
67
+ </pepperjam_network_generate_product_feed>
68
+ <pepperjam_network_generate_corrected_order_feed>
69
+ <schedule>
70
+ <cron_expr>0 3 * * *</cron_expr>
71
+ </schedule>
72
+ <run>
73
+ <model>pepperjam_network/observer::createCorrectedOrdersFeed</model>
74
+ </run>
75
+ </pepperjam_network_generate_corrected_order_feed>
76
+ <pepperjam_network_generate_order_feed>
77
+ <schedule>
78
+ <cron_expr>0 3 * * *</cron_expr>
79
+ </schedule>
80
+ <run>
81
+ <model>pepperjam_network/observer::createOrdersFeed</model>
82
+ </run>
83
+ </pepperjam_network_generate_order_feed>
84
+ </jobs>
85
+ </crontab>
86
+ <default>
87
+ <pepperjam>
88
+ <pepperjam_network>
89
+ <active>0</active>
90
+ <js_files>pepperjam_network/cookie.js</js_files>
91
+ <!-- use comma to add more js files-->
92
+ <beacon_url>https://t.pepperjamnetwork.com/track</beacon_url>
93
+ <export_path>var/export/pepperjam_network/</export_path>
94
+ <order_type>itemized</order_type>
95
+ <tracking_method></tracking_method>
96
+ <program_id/>
97
+ <transaction_type>1</transaction_type>
98
+ <attribution_enabled>1</attribution_enabled>
99
+ <source_key_name>source</source_key_name>
100
+ <click_id_key_name>click</click_id_key_name>
101
+ <publisher_id_key_name>publisher</publisher_id_key_name>
102
+ <product_feed_enabled>1</product_feed_enabled>
103
+ <order_correction_feed_enabled>1</order_correction_feed_enabled>
104
+ <feeds>
105
+ <callback_mappings>
106
+ <program_id>
107
+ <class>pepperjam_network/map</class>
108
+ <method>getProgramId</method>
109
+ <type>helper</type>
110
+ <column_name>PID</column_name>
111
+ </program_id>
112
+ <order_id>
113
+ <class>pepperjam_network/map_order</class>
114
+ <method>getOrderId</method>
115
+ <type>helper</type>
116
+ <column_name>OID</column_name>
117
+ <params>
118
+ <format>%.50s</format>
119
+ </params>
120
+ </order_id>
121
+ <item_order_id>
122
+ <class>pepperjam_network/map_order</class>
123
+ <method>getItemOrderId</method>
124
+ <type>helper</type>
125
+ <column_name>OID</column_name>
126
+ <params>
127
+ <format>%.50s</format>
128
+ </params>
129
+ </item_order_id>
130
+ <item_id>
131
+ <class>pepperjam_network/map_order</class>
132
+ <method>getItemId</method>
133
+ <type>helper</type>
134
+ <column_name>ITEMID</column_name>
135
+ <params>
136
+ <format>%.50s</format>
137
+ <key>sku</key>
138
+ </params>
139
+ </item_id>
140
+ <item_price>
141
+ <class>pepperjam_network/map_order</class>
142
+ <method>getItemPrice</method>
143
+ <type>helper</type>
144
+ <column_name>AMOUNT</column_name>
145
+ <params>
146
+ <format>%.2f</format>
147
+ </params>
148
+ </item_price>
149
+ <item_quantity>
150
+ <class>pepperjam_network/map_order</class>
151
+ <method>getItemQuantity</method>
152
+ <type>helper</type>
153
+ <column_name>QUANTITY</column_name>
154
+ </item_quantity>
155
+ <click_id>
156
+ <class>pepperjam_network/map_order</class>
157
+ <method>getClickId</method>
158
+ <type>helper</type>
159
+ <column_name>CLICKID</column_name>
160
+ </click_id>
161
+ <publisher_id>
162
+ <class>pepperjam_network/map_order</class>
163
+ <method>getPublisherId</method>
164
+ <type>helper</type>
165
+ <column_name>AFFILIATEID</column_name>
166
+ </publisher_id>
167
+ <order_date>
168
+ <class>pepperjam_network/map_order</class>
169
+ <method>getOrderDate</method>
170
+ <type>helper</type>
171
+ <column_name>DATETIME</column_name>
172
+ </order_date>
173
+ <dynamic_program_id>
174
+ <class>pepperjam_network/map</class>
175
+ <method>getProgramId</method>
176
+ <type>helper</type>
177
+ <column_name>PROGRAM_ID</column_name>
178
+ </dynamic_program_id>
179
+ <dynamic_item_order_id>
180
+ <class>pepperjam_network/map_order</class>
181
+ <method>getItemOrderId</method>
182
+ <type>helper</type>
183
+ <column_name>ORDER_ID</column_name>
184
+ <params>
185
+ <format>%.50s</format>
186
+ </params>
187
+ </dynamic_item_order_id>
188
+ <dynamic_item_id>
189
+ <class>pepperjam_network/map_order</class>
190
+ <method>getItemId</method>
191
+ <type>helper</type>
192
+ <column_name>ITEM_ID</column_name>
193
+ <params>
194
+ <format>%.50s</format>
195
+ <key>sku</key>
196
+ </params>
197
+ </dynamic_item_id>
198
+ <dynamic_item_price>
199
+ <class>pepperjam_network/map_order</class>
200
+ <method>getItemPrice</method>
201
+ <type>helper</type>
202
+ <column_name>ITEM_PRICE</column_name>
203
+ <params>
204
+ <format>%.2f</format>
205
+ </params>
206
+ </dynamic_item_price>
207
+ <dynamic_click_id>
208
+ <class>pepperjam_network/map_order</class>
209
+ <method>getClickId</method>
210
+ <type>helper</type>
211
+ <column_name>CLICK_ID</column_name>
212
+ </dynamic_click_id>
213
+ <dynamic_publisher_id>
214
+ <class>pepperjam_network/map_order</class>
215
+ <method>getPublisherId</method>
216
+ <type>helper</type>
217
+ <column_name>AFFILIATE_ID</column_name>
218
+ </dynamic_publisher_id>
219
+ <dynamic_order_date>
220
+ <class>pepperjam_network/map_order</class>
221
+ <method>getOrderDate</method>
222
+ <type>helper</type>
223
+ <column_name>ORDER_DATE</column_name>
224
+ </dynamic_order_date>
225
+ <category>
226
+ <class>pepperjam_network/map_order</class>
227
+ <method>getCategory</method>
228
+ <type>helper</type>
229
+ <column_name>CATEGORY</column_name>
230
+ </category>
231
+ <new_to_file>
232
+ <class>pepperjam_network/map_order</class>
233
+ <method>getNewToFile</method>
234
+ <type>helper</type>
235
+ <column_name>NEW_TO_FILE</column_name>
236
+ </new_to_file>
237
+ <order_amount>
238
+ <class>pepperjam_network/map_order</class>
239
+ <method>getOrderAmount</method>
240
+ <type>helper</type>
241
+ <column_name>AMOUNT</column_name>
242
+ <params>
243
+ <format>%.2f</format>
244
+ </params>
245
+ </order_amount>
246
+ <reason>
247
+ <class>pepperjam_network/map</class>
248
+ <method>passStatic</method>
249
+ <type>helper</type>
250
+ <column_name>REASON</column_name>
251
+ <params>
252
+ <value>8</value>
253
+ </params>
254
+ </reason>
255
+ <transaction_type>
256
+ <class>pepperjam_network/map_order</class>
257
+ <method>getTransactionType</method>
258
+ <type>helper</type>
259
+ <column_name>TYPE</column_name>
260
+ </transaction_type>
261
+ <age_range>
262
+ <class>pepperjam_network/map</class>
263
+ <method>getDataValue</method>
264
+ <type>helper</type>
265
+ <column_name>age_range</column_name>
266
+ <params>
267
+ <format>%.32s</format>
268
+ </params>
269
+ </age_range>
270
+ <artist>
271
+ <class>pepperjam_network/map</class>
272
+ <method>getDataValue</method>
273
+ <type>helper</type>
274
+ <column_name>artist</column_name>
275
+ <params>
276
+ <format>%.128s</format>
277
+ </params>
278
+ </artist>
279
+ <aspect_ratio>
280
+ <class>pepperjam_network/map</class>
281
+ <method>getDataValue</method>
282
+ <type>helper</type>
283
+ <column_name>aspect_ratio</column_name>
284
+ <params>
285
+ <format>%.16s</format>
286
+ </params>
287
+ </aspect_ratio>
288
+ <author>
289
+ <class>pepperjam_network/map</class>
290
+ <method>getDataValue</method>
291
+ <type>helper</type>
292
+ <column_name>author</column_name>
293
+ <params>
294
+ <format>%.128s</format>
295
+ </params>
296
+ </author>
297
+ <battery_life>
298
+ <class>pepperjam_network/map</class>
299
+ <method>getDataValue</method>
300
+ <type>helper</type>
301
+ <column_name>battery_life</column_name>
302
+ <params>
303
+ <format>%.32s</format>
304
+ </params>
305
+ </battery_life>
306
+ <binding>
307
+ <class>pepperjam_network/map</class>
308
+ <method>getDataValue</method>
309
+ <type>helper</type>
310
+ <column_name>binding</column_name>
311
+ <params>
312
+ <format>%.32s</format>
313
+ </params>
314
+ </binding>
315
+ <buy_url>
316
+ <class>pepperjam_network/map</class>
317
+ <method>getDataValue</method>
318
+ <type>helper</type>
319
+ <column_name>buy_url</column_name>
320
+ <params>
321
+ <key>product_url</key>
322
+ <format>%.2000s</format>
323
+ </params>
324
+ </buy_url>
325
+ <category_network>
326
+ <class>pepperjam_network/map_product</class>
327
+ <method>getCategory</method>
328
+ <type>helper</type>
329
+ <column_name>category_network</column_name>
330
+ <params>
331
+ <format>%.256s</format>
332
+ </params>
333
+ </category_network>
334
+ <category_program>
335
+ <class>pepperjam_network/map_product</class>
336
+ <method>getCategory</method>
337
+ <type>helper</type>
338
+ <column_name>category_program</column_name>
339
+ <params>
340
+ <format>%.256s</format>
341
+ </params>
342
+ </category_program>
343
+ <color>
344
+ <class>pepperjam_network/map</class>
345
+ <method>getDataValue</method>
346
+ <type>helper</type>
347
+ <column_name>color</column_name>
348
+ <params>
349
+ <format>%.32s</format>
350
+ </params>
351
+ </color>
352
+ <color_output>
353
+ <class>pepperjam_network/map</class>
354
+ <method>getValueYesNo</method>
355
+ <type>helper</type>
356
+ <column_name>color_output</column_name>
357
+ <params>
358
+ <format>%s</format>
359
+ </params>
360
+ </color_output>
361
+ <condition>
362
+ <class>pepperjam_network/map</class>
363
+ <method>getDataValue</method>
364
+ <type>helper</type>
365
+ <column_name>condition</column_name>
366
+ <params>
367
+ <format>%.64s</format>
368
+ </params>
369
+ </condition>
370
+ <description_long>
371
+ <class>pepperjam_network/map</class>
372
+ <method>getDataValue</method>
373
+ <type>helper</type>
374
+ <column_name>description_long</column_name>
375
+ <params>
376
+ <format>%.2000s</format>
377
+ </params>
378
+ </description_long>
379
+ <description_short>
380
+ <class>pepperjam_network/map</class>
381
+ <method>getDataValue</method>
382
+ <type>helper</type>
383
+ <column_name>description_short</column_name>
384
+ <params>
385
+ <format>%.512s</format>
386
+ </params>
387
+ </description_short>
388
+ <director>
389
+ <class>pepperjam_network/map</class>
390
+ <method>getDataValue</method>
391
+ <type>helper</type>
392
+ <column_name>director</column_name>
393
+ <params>
394
+ <format>%.128s</format>
395
+ </params>
396
+ </director>
397
+ <discontinued>
398
+ <class>pepperjam_network/map</class>
399
+ <method>getValueYesNo</method>
400
+ <type>helper</type>
401
+ <column_name>discontinued</column_name>
402
+ <params>
403
+ <format>%s</format>
404
+ </params>
405
+ </discontinued>
406
+ <display_type>
407
+ <class>pepperjam_network/map</class>
408
+ <method>getDataValue</method>
409
+ <type>helper</type>
410
+ <column_name>display_type</column_name>
411
+ <params>
412
+ <format>%.32s</format>
413
+ </params>
414
+ </display_type>
415
+ <edition>
416
+ <class>pepperjam_network/map</class>
417
+ <method>getDataValue</method>
418
+ <type>helper</type>
419
+ <column_name>edition</column_name>
420
+ <params>
421
+ <format>%.32s</format>
422
+ </params>
423
+ </edition>
424
+ <expiration_date>
425
+ <class>pepperjam_network/map</class>
426
+ <method>getDateValue</method>
427
+ <type>helper</type>
428
+ <column_name>expiration_date</column_name>
429
+ <params>
430
+ <format>Y-m-d</format>
431
+ </params>
432
+ </expiration_date>
433
+ <features>
434
+ <class>pepperjam_network/map</class>
435
+ <method>getDataValue</method>
436
+ <type>helper</type>
437
+ <column_name>features</column_name>
438
+ <params>
439
+ <format>%.128s</format>
440
+ </params>
441
+ </features>
442
+ <focus_type>
443
+ <class>pepperjam_network/map</class>
444
+ <method>getDataValue</method>
445
+ <type>helper</type>
446
+ <column_name>focus_type</column_name>
447
+ <params>
448
+ <format>%.128s</format>
449
+ </params>
450
+ </focus_type>
451
+ <format>
452
+ <class>pepperjam_network/map</class>
453
+ <method>getDataValue</method>
454
+ <type>helper</type>
455
+ <column_name>format</column_name>
456
+ <params>
457
+ <format>%.64s</format>
458
+ </params>
459
+ </format>
460
+ <functions>
461
+ <class>pepperjam_network/map</class>
462
+ <method>getDataValue</method>
463
+ <type>helper</type>
464
+ <column_name>functions</column_name>
465
+ <params>
466
+ <format>%.64s</format>
467
+ </params>
468
+ </functions>
469
+ <genre>
470
+ <class>pepperjam_network/map</class>
471
+ <method>getDataValue</method>
472
+ <type>helper</type>
473
+ <column_name>genre</column_name>
474
+ <params>
475
+ <format>%.64s</format>
476
+ </params>
477
+ </genre>
478
+ <heel_height>
479
+ <class>pepperjam_network/map</class>
480
+ <method>getDataValue</method>
481
+ <type>helper</type>
482
+ <column_name>heel_height</column_name>
483
+ <params>
484
+ <format>%.32s</format>
485
+ </params>
486
+ </heel_height>
487
+ <height>
488
+ <class>pepperjam_network/map</class>
489
+ <method>getDataValue</method>
490
+ <type>helper</type>
491
+ <column_name>height</column_name>
492
+ <params>
493
+ <format>%.32s</format>
494
+ </params>
495
+ </height>
496
+ <image_thumb_url>
497
+ <class>pepperjam_network/map_product</class>
498
+ <method>getImageUrl</method>
499
+ <type>helper</type>
500
+ <column_name>image_thumb_url</column_name>
501
+ <params>
502
+ <format>%.2000s</format>
503
+ </params>
504
+ </image_thumb_url>
505
+ <image_url>
506
+ <class>pepperjam_network/map_product</class>
507
+ <method>getImageUrl</method>
508
+ <type>helper</type>
509
+ <column_name>image_url</column_name>
510
+ <params>
511
+ <format>%.2000s</format>
512
+ </params>
513
+ </image_url>
514
+ <installation>
515
+ <class>pepperjam_network/map</class>
516
+ <method>getDataValue</method>
517
+ <type>helper</type>
518
+ <column_name>installation</column_name>
519
+ <params>
520
+ <format>%.64s</format>
521
+ </params>
522
+ </installation>
523
+ <in_stock>
524
+ <class>pepperjam_network/map_product</class>
525
+ <method>getInStockYesNo</method>
526
+ <type>helper</type>
527
+ <column_name>in_stock</column_name>
528
+ <params>
529
+ <format>%s</format>
530
+ </params>
531
+ </in_stock>
532
+ <isbn>
533
+ <class>pepperjam_network/map</class>
534
+ <method>getDataValue</method>
535
+ <type>helper</type>
536
+ <column_name>isbn</column_name>
537
+ <params>
538
+ <format>%.64s</format>
539
+ </params>
540
+ </isbn>
541
+ <keywords>
542
+ <class>pepperjam_network/map</class>
543
+ <method>getDataValue</method>
544
+ <type>helper</type>
545
+ <column_name>keywords</column_name>
546
+ <params>
547
+ <format>%.256s</format>
548
+ </params>
549
+ </keywords>
550
+ <length>
551
+ <class>pepperjam_network/map</class>
552
+ <method>getDataValue</method>
553
+ <type>helper</type>
554
+ <column_name>length</column_name>
555
+ <params>
556
+ <format>%.32s</format>
557
+ </params>
558
+ </length>
559
+ <load_type>
560
+ <class>pepperjam_network/map</class>
561
+ <method>getDataValue</method>
562
+ <type>helper</type>
563
+ <column_name>load_type</column_name>
564
+ <params>
565
+ <format>%.32s</format>
566
+ </params>
567
+ </load_type>
568
+ <location>
569
+ <class>pepperjam_network/map</class>
570
+ <method>getDataValue</method>
571
+ <type>helper</type>
572
+ <column_name>location</column_name>
573
+ <params>
574
+ <format>%.64s</format>
575
+ </params>
576
+ </location>
577
+ <made_in>
578
+ <class>pepperjam_network/map</class>
579
+ <method>getDataValue</method>
580
+ <type>helper</type>
581
+ <column_name>made_in</column_name>
582
+ <params>
583
+ <format>%.64s</format>
584
+ </params>
585
+ </made_in>
586
+ <manufacturer>
587
+ <class>pepperjam_network/map</class>
588
+ <method>getDataValue</method>
589
+ <type>helper</type>
590
+ <column_name>manufacturer</column_name>
591
+ <params>
592
+ <format>%.128s</format>
593
+ </params>
594
+ </manufacturer>
595
+ <material>
596
+ <class>pepperjam_network/map</class>
597
+ <method>getDataValue</method>
598
+ <type>helper</type>
599
+ <column_name>material</column_name>
600
+ <params>
601
+ <format>%.128s</format>
602
+ </params>
603
+ </material>
604
+ <megapixels>
605
+ <class>pepperjam_network/map</class>
606
+ <method>getDataValue</method>
607
+ <type>helper</type>
608
+ <column_name>megapixels</column_name>
609
+ <params>
610
+ <format>%01.2f</format>
611
+ </params>
612
+ </megapixels>
613
+ <memory_capacity>
614
+ <class>pepperjam_network/map</class>
615
+ <method>getDataValue</method>
616
+ <type>helper</type>
617
+ <column_name>memory_capacity</column_name>
618
+ <params>
619
+ <format>%.64s</format>
620
+ </params>
621
+ </memory_capacity>
622
+ <memory_card_slot>
623
+ <class>pepperjam_network/map</class>
624
+ <method>getDataValue</method>
625
+ <type>helper</type>
626
+ <column_name>memory_card_slot</column_name>
627
+ <params>
628
+ <format>%.32s</format>
629
+ </params>
630
+ </memory_card_slot>
631
+ <memory_type>
632
+ <class>pepperjam_network/map</class>
633
+ <method>getDataValue</method>
634
+ <type>helper</type>
635
+ <column_name>memory_type</column_name>
636
+ <params>
637
+ <format>%.64s</format>
638
+ </params>
639
+ </memory_type>
640
+ <model_number>
641
+ <class>pepperjam_network/map</class>
642
+ <method>getDataValue</method>
643
+ <type>helper</type>
644
+ <column_name>model_number</column_name>
645
+ <params>
646
+ <format>%.128s</format>
647
+ </params>
648
+ </model_number>
649
+ <mpn>
650
+ <class>pepperjam_network/map</class>
651
+ <method>getDataValue</method>
652
+ <type>helper</type>
653
+ <column_name>mpn</column_name>
654
+ <params>
655
+ <format>%.128s</format>
656
+ </params>
657
+ </mpn>
658
+ <name>
659
+ <class>pepperjam_network/map</class>
660
+ <method>getDataValue</method>
661
+ <type>helper</type>
662
+ <column_name>name</column_name>
663
+ <params>
664
+ <format>%.128s</format>
665
+ </params>
666
+ </name>
667
+ <occasion>
668
+ <class>pepperjam_network/map</class>
669
+ <method>getDataValue</method>
670
+ <type>helper</type>
671
+ <column_name>occasion</column_name>
672
+ <params>
673
+ <format>%.128s</format>
674
+ </params>
675
+ </occasion>
676
+ <operating_system>
677
+ <class>pepperjam_network/map</class>
678
+ <method>getDataValue</method>
679
+ <type>helper</type>
680
+ <column_name>operating_system</column_name>
681
+ <params>
682
+ <format>%.128s</format>
683
+ </params>
684
+ </operating_system>
685
+ <optical_drive>
686
+ <class>pepperjam_network/map</class>
687
+ <method>getDataValue</method>
688
+ <type>helper</type>
689
+ <column_name>optical_drive</column_name>
690
+ <params>
691
+ <format>%.64s</format>
692
+ </params>
693
+ </optical_drive>
694
+ <pages>
695
+ <class>pepperjam_network/map</class>
696
+ <method>getDataValue</method>
697
+ <type>helper</type>
698
+ <column_name>pages</column_name>
699
+ <params>
700
+ <format>%.11d</format>
701
+ </params>
702
+ </pages>
703
+ <payment_accepted>
704
+ <class>pepperjam_network/map</class>
705
+ <method>getDataValue</method>
706
+ <type>helper</type>
707
+ <column_name>payment_accepted</column_name>
708
+ <params>
709
+ <format>%.128s</format>
710
+ </params>
711
+ </payment_accepted>
712
+ <payment_notes>
713
+ <class>pepperjam_network/map</class>
714
+ <method>getDataValue</method>
715
+ <type>helper</type>
716
+ <column_name>payment_notes</column_name>
717
+ <params>
718
+ <format>%.256s</format>
719
+ </params>
720
+ </payment_notes>
721
+ <platform>
722
+ <class>pepperjam_network/map</class>
723
+ <method>getDataValue</method>
724
+ <type>helper</type>
725
+ <column_name>platform</column_name>
726
+ <params>
727
+ <format>%.64s</format>
728
+ </params>
729
+ </platform>
730
+ <price>
731
+ <class>pepperjam_network/map</class>
732
+ <method>getDataValue</method>
733
+ <type>helper</type>
734
+ <column_name>price</column_name>
735
+ <params>
736
+ <format>%01.2f</format>
737
+ </params>
738
+ </price>
739
+ <price_retail>
740
+ <class>pepperjam_network/map</class>
741
+ <method>getDataValue</method>
742
+ <type>helper</type>
743
+ <column_name>price_retail</column_name>
744
+ <params>
745
+ <format>%01.2f</format>
746
+ </params>
747
+ </price_retail>
748
+ <price_sale>
749
+ <class>pepperjam_network/map</class>
750
+ <method>getDataValue</method>
751
+ <type>helper</type>
752
+ <column_name>price_sale</column_name>
753
+ <params>
754
+ <format>%01.2f</format>
755
+ </params>
756
+ </price_sale>
757
+ <price_shipping>
758
+ <class>pepperjam_network/map</class>
759
+ <method>getDataValue</method>
760
+ <type>helper</type>
761
+ <column_name>price_shipping</column_name>
762
+ <params>
763
+ <format>%01.2f</format>
764
+ </params>
765
+ </price_shipping>
766
+ <processor>
767
+ <class>pepperjam_network/map</class>
768
+ <method>getDataValue</method>
769
+ <type>helper</type>
770
+ <column_name>processor</column_name>
771
+ <params>
772
+ <format>%.64s</format>
773
+ </params>
774
+ </processor>
775
+ <publisher>
776
+ <class>pepperjam_network/map</class>
777
+ <method>getDataValue</method>
778
+ <type>helper</type>
779
+ <column_name>publisher</column_name>
780
+ <params>
781
+ <format>%.128s</format>
782
+ </params>
783
+ </publisher>
784
+ <quantity_in_stock>
785
+ <class>pepperjam_network/map_product</class>
786
+ <method>getInStockQty</method>
787
+ <type>helper</type>
788
+ <column_name>quantity_in_stock</column_name>
789
+ <params>
790
+ <format>%.11d</format>
791
+ </params>
792
+ </quantity_in_stock>
793
+ <rating>
794
+ <class>pepperjam_network/map</class>
795
+ <method>getDataValue</method>
796
+ <type>helper</type>
797
+ <column_name>rating</column_name>
798
+ <params>
799
+ <format>%.32s</format>
800
+ </params>
801
+ </rating>
802
+ <recommended_usage>
803
+ <class>pepperjam_network/map</class>
804
+ <method>getDataValue</method>
805
+ <type>helper</type>
806
+ <column_name>recommended_usage</column_name>
807
+ <params>
808
+ <format>%.128s</format>
809
+ </params>
810
+ </recommended_usage>
811
+ <resolution>
812
+ <class>pepperjam_network/map</class>
813
+ <method>getDataValue</method>
814
+ <type>helper</type>
815
+ <column_name>resolution</column_name>
816
+ <params>
817
+ <format>%.64s</format>
818
+ </params>
819
+ </resolution>
820
+ <screen_size>
821
+ <class>pepperjam_network/map</class>
822
+ <method>getDataValue</method>
823
+ <type>helper</type>
824
+ <column_name>screen_size</column_name>
825
+ <params>
826
+ <format>%.32s</format>
827
+ </params>
828
+ </screen_size>
829
+ <shipping_method>
830
+ <class>pepperjam_network/map</class>
831
+ <method>getDataValue</method>
832
+ <type>helper</type>
833
+ <column_name>shipping_method</column_name>
834
+ <params>
835
+ <format>%.64s</format>
836
+ </params>
837
+ </shipping_method>
838
+ <shoe_size>
839
+ <class>pepperjam_network/map</class>
840
+ <method>getDataValue</method>
841
+ <type>helper</type>
842
+ <column_name>shoe_size</column_name>
843
+ <params>
844
+ <format>%.32s</format>
845
+ </params>
846
+ </shoe_size>
847
+ <shoe_width>
848
+ <class>pepperjam_network/map</class>
849
+ <method>getDataValue</method>
850
+ <type>helper</type>
851
+ <column_name>shoe_width</column_name>
852
+ <params>
853
+ <format>%.32s</format>
854
+ </params>
855
+ </shoe_width>
856
+ <size>
857
+ <class>pepperjam_network/map</class>
858
+ <method>getDataValue</method>
859
+ <type>helper</type>
860
+ <column_name>size</column_name>
861
+ <params>
862
+ <format>%.32s</format>
863
+ </params>
864
+ </size>
865
+ <sku>
866
+ <class>pepperjam_network/map</class>
867
+ <method>getDataValue</method>
868
+ <type>helper</type>
869
+ <column_name>sku</column_name>
870
+ <params>
871
+ <format>%.128s</format>
872
+ </params>
873
+ </sku>
874
+ <staring>
875
+ <class>pepperjam_network/map</class>
876
+ <method>getDataValue</method>
877
+ <type>helper</type>
878
+ <column_name>staring</column_name>
879
+ <params>
880
+ <format>%.128s</format>
881
+ </params>
882
+ </staring>
883
+ <style>
884
+ <class>pepperjam_network/map</class>
885
+ <method>getDataValue</method>
886
+ <type>helper</type>
887
+ <column_name>style</column_name>
888
+ <params>
889
+ <format>%.64s</format>
890
+ </params>
891
+ </style>
892
+ <tech_spec_url>
893
+ <class>pepperjam_network/map</class>
894
+ <method>getDataValue</method>
895
+ <type>helper</type>
896
+ <column_name>tech_spec_url</column_name>
897
+ <params>
898
+ <format>%.2000s</format>
899
+ </params>
900
+ </tech_spec_url>
901
+ <tracks>
902
+ <class>pepperjam_network/map</class>
903
+ <method>getDataValue</method>
904
+ <type>helper</type>
905
+ <column_name>tracks</column_name>
906
+ <params>
907
+ <format>%.11d</format>
908
+ </params>
909
+ </tracks>
910
+ <upc>
911
+ <class>pepperjam_network/map</class>
912
+ <method>getDataValue</method>
913
+ <type>helper</type>
914
+ <column_name>upc</column_name>
915
+ <params>
916
+ <format>%.128s</format>
917
+ </params>
918
+ </upc>
919
+ <weight>
920
+ <class>pepperjam_network/map</class>
921
+ <method>getDataValue</method>
922
+ <type>helper</type>
923
+ <column_name>weight</column_name>
924
+ <params>
925
+ <format>%.32s</format>
926
+ </params>
927
+ </weight>
928
+ <width>
929
+ <class>pepperjam_network/map</class>
930
+ <method>getDataValue</method>
931
+ <type>helper</type>
932
+ <column_name>width</column_name>
933
+ <params>
934
+ <format>%.32s</format>
935
+ </params>
936
+ </width>
937
+ <wireless_interface>
938
+ <class>pepperjam_network/map</class>
939
+ <method>getDataValue</method>
940
+ <type>helper</type>
941
+ <column_name>wireless_interface</column_name>
942
+ <params>
943
+ <format>%.32s</format>
944
+ </params>
945
+ </wireless_interface>
946
+ <year>
947
+ <class>pepperjam_network/map</class>
948
+ <method>getYearValue</method>
949
+ <type>helper</type>
950
+ <column_name>year</column_name>
951
+ <params>
952
+ <format>%.dd</format>
953
+ </params>
954
+ </year>
955
+ <zoom>
956
+ <class>pepperjam_network/map</class>
957
+ <method>getDataValue</method>
958
+ <type>helper</type>
959
+ <column_name>zoom</column_name>
960
+ <params>
961
+ <format>%.32s</format>
962
+ </params>
963
+ </zoom>
964
+ </callback_mappings>
965
+ <order_dynamic>
966
+ <fields>dynamic_program_id,dynamic_publisher_id,dynamic_click_id,dynamic_item_order_id,dynamic_item_id,dynamic_item_price,item_quantity,dynamic_order_date,category,new_to_file</fields>
967
+ </order_dynamic>
968
+ <order_itemized>
969
+ <fields>program_id,publisher_id,item_order_id,item_id,item_price,item_quantity,order_date,click_id</fields>
970
+ </order_itemized>
971
+ <order_basic>
972
+ <fields>program_id,publisher_id,order_amount,order_id,order_date,transaction_type,click_id</fields>
973
+ </order_basic>
974
+ <order_correction_dynamic>
975
+ <fields>dynamic_program_id,dynamic_item_order_id,dynamic_item_id,dynamic_item_price,item_quantity,category,new_to_file</fields>
976
+ </order_correction_dynamic>
977
+ <order_correction_itemized>
978
+ <fields>program_id,item_order_id,item_id,item_price,item_quantity,reason</fields>
979
+ </order_correction_itemized>
980
+ <order_correction_basic>
981
+ <fields>program_id,publisher_id,order_amount,order_id,reason,transaction_type</fields>
982
+ </order_correction_basic>
983
+ <order_feed>
984
+ <file_name_format>%s_transactions_%s.csv</file_name_format>
985
+ </order_feed>
986
+ <order_correction_feed>
987
+ <file_name_format>%s_transactions_corrected_%s.csv</file_name_format>
988
+ </order_correction_feed>
989
+ <product>
990
+ <file_name_format>%s_product_feed.csv</file_name_format>
991
+ </product>
992
+ </feeds>
993
+ </pepperjam_network>
994
+ <pepperjam_network_product_attribute_map>
995
+ <!--
996
+ The purpose of this mapping is enabled the coexistence of both
997
+ pre-configured product attributes mapping and configured attributes
998
+ mapping for the affiliate product feed. This means that when this
999
+ module is installed and no other attribute is configured for the
1000
+ product feed the required pre-mapped attributes will be sufficient
1001
+ enough to generate a valid product feed.
1002
+ -->
1003
+ <age_range/>
1004
+ <artist/>
1005
+ <aspect_ratio/>
1006
+ <author/>
1007
+ <battery_life/>
1008
+ <binding/>
1009
+ <buy_url>product_url</buy_url>
1010
+ <category_network/>
1011
+ <category_program>category</category_program>
1012
+ <color/>
1013
+ <color_output/>
1014
+ <condition/>
1015
+ <description_long>description</description_long>
1016
+ <description_short>short_description</description_short>
1017
+ <director/>
1018
+ <discontinued/>
1019
+ <display_type/>
1020
+ <edition/>
1021
+ <expiration_date/>
1022
+ <features/>
1023
+ <focus_type/>
1024
+ <format/>
1025
+ <functions/>
1026
+ <genre/>
1027
+ <heel_height/>
1028
+ <height/>
1029
+ <image_thumb_url>thumbnail</image_thumb_url>
1030
+ <image_url>image</image_url>
1031
+ <installation/>
1032
+ <in_stock/>
1033
+ <isbn/>
1034
+ <keywords>meta_keyword</keywords>
1035
+ <length/>
1036
+ <load_type/>
1037
+ <location/>
1038
+ <made_in/>
1039
+ <manufacturer>manufacturer</manufacturer>
1040
+ <material/>
1041
+ <megapixels/>
1042
+ <memory_capacity/>
1043
+ <memory_card_slot/>
1044
+ <memory_type/>
1045
+ <model_number/>
1046
+ <mpn/>
1047
+ <name>name</name>
1048
+ <occasion/>
1049
+ <operating_system/>
1050
+ <optical_drive/>
1051
+ <pages/>
1052
+ <payment_accepted/>
1053
+ <payment_notes/>
1054
+ <platform/>
1055
+ <price>price</price>
1056
+ <price_retail>msrp</price_retail>
1057
+ <price_sale>special_price</price_sale>
1058
+ <price_shipping/>
1059
+ <processor/>
1060
+ <publisher/>
1061
+ <quantity_in_stock>qty</quantity_in_stock>
1062
+ <rating/>
1063
+ <recommended_usage/>
1064
+ <resolution/>
1065
+ <screen_size/>
1066
+ <shipping_method/>
1067
+ <shoe_size/>
1068
+ <shoe_width/>
1069
+ <size/>
1070
+ <sku>sku</sku>
1071
+ <staring/>
1072
+ <style/>
1073
+ <tech_spec_url/>
1074
+ <tracks/>
1075
+ <upc/>
1076
+ <weight/>
1077
+ <width/>
1078
+ <wireless_interface/>
1079
+ <year/>
1080
+ <zoom/>
1081
+ </pepperjam_network_product_attribute_map>
1082
+ </pepperjam>
1083
+ </default>
1084
+ <frontend>
1085
+ <layout>
1086
+ <updates>
1087
+ <pepperjam_network>
1088
+ <file>pepperjam_network.xml</file>
1089
+ </pepperjam_network>
1090
+ </updates>
1091
+ </layout>
1092
+ </frontend>
1093
+ <phpunit>
1094
+ <suite>
1095
+ <modules>
1096
+ <Pepperjam_Network/>
1097
+ </modules>
1098
+ </suite>
1099
+ </phpunit>
1100
+ <admin>
1101
+ <routers>
1102
+ <adminhtml>
1103
+ <args>
1104
+ <modules>
1105
+ <pepperjam_network before="Mage_Adminhtml">Pepperjam_Network_Adminhtml</pepperjam_network>
1106
+ </modules>
1107
+ </args>
1108
+ </adminhtml>
1109
+ </routers>
1110
+ </admin>
1111
+ </config>
app/code/community/Pepperjam/Network/etc/system.xml CHANGED
@@ -1,950 +1,985 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- Copyright (c) 2016 Pepperjam Network.
4
-
5
- NOTICE OF LICENSE
6
-
7
- This source file is subject to the Pepperjam Network
8
- Magento Extensions End User License Agreement
9
- that is bundled with this package in the file LICENSE.md.
10
- It is also available through the world-wide-web at this URL:
11
- http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
-
13
- @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- -->
16
- <config>
17
- <tabs>
18
- <pepperjam translate="label" module="pepperjam_network">
19
- <label>Pepperjam</label>
20
- <sort_order>550</sort_order>
21
- </pepperjam>
22
- </tabs>
23
- <sections>
24
- <pepperjam translate="label" module="pepperjam_network">
25
- <class>separator-top</class>
26
- <label>Pepperjam Network</label>
27
- <tab>pepperjam</tab>
28
- <frontend_type>text</frontend_type>
29
- <sort_order>550</sort_order>
30
- <show_in_default>1</show_in_default>
31
- <show_in_website>1</show_in_website>
32
- <show_in_store>1</show_in_store>
33
- <groups>
34
- <pepperjam_network translate="label comment">
35
- <label>Settings</label>
36
- <comment><![CDATA[Your program ID and other information can be found within your Pepperjam Network advertiser account. Don’t have an account yet? <a href='https://www.pepperjamnetwork.com/register/basic' target='_pjregister'>Register</a> for one today!]]></comment>
37
- <frontend_type>text</frontend_type>
38
- <sort_order>100</sort_order>
39
- <show_in_default>1</show_in_default>
40
- <show_in_website>1</show_in_website>
41
- <show_in_store>1</show_in_store>
42
- <fields>
43
- <active translate="label">
44
- <label>Enable Conversion Tracking</label>
45
- <frontend_type>select</frontend_type>
46
- <source_model>adminhtml/system_config_source_yesno</source_model>
47
- <sort_order>1</sort_order>
48
- <show_in_default>1</show_in_default>
49
- <show_in_website>0</show_in_website>
50
- <show_in_store>0</show_in_store>
51
- </active>
52
- <program_id translate="label comment">
53
- <label>Program Id</label>
54
- <comment>Your Program Id will be provided to you by Pepperjam</comment>
55
- <frontend_type>text</frontend_type>
56
- <sort_order>10</sort_order>
57
- <show_in_default>1</show_in_default>
58
- <show_in_website>1</show_in_website>
59
- <show_in_store>0</show_in_store>
60
- </program_id>
61
- <order_type>
62
- <label>Program Tracking Type</label>
63
- <frontend_type>select</frontend_type>
64
- <source_model>pepperjam_network/system_config_source_ordertypes</source_model>
65
- <sort_order>20</sort_order>
66
- <show_in_default>1</show_in_default>
67
- <show_in_website>0</show_in_website>
68
- <show_in_store>0</show_in_store>
69
- </order_type>
70
- <transaction_type translate="label comment">
71
- <label>Transaction Type</label>
72
- <comment>Sale transactions pay publishers a percentage of the sale, lead transactions pay publishes a flat amount for an action.</comment>
73
- <frontend_type>select</frontend_type>
74
- <source_model>pepperjam_network/system_config_source_transactiontype</source_model>
75
- <depends>
76
- <order_type>basic</order_type>
77
- </depends>
78
- <sort_order>30</sort_order>
79
- <show_in_default>1</show_in_default>
80
- <show_in_website>0</show_in_website>
81
- <show_in_store>0</show_in_store>
82
- </transaction_type>
83
- <export_path translate="label comment">
84
- <label>Export Path</label>
85
- <comment>Default local path to export feeds to. These feeds will need to be made available to Pepperjam via FTP.</comment>
86
- <frontend_type>text</frontend_type>
87
- <sort_order>50</sort_order>
88
- <show_in_default>1</show_in_default>
89
- <show_in_website>0</show_in_website>
90
- <show_in_store>0</show_in_store>
91
- </export_path>
92
- <conditional_pixel_enabled translate="label">
93
- <label>Conditional Pixel</label>
94
- <frontend_type>select</frontend_type>
95
- <source_model>adminhtml/system_config_source_yesno</source_model>
96
- <sort_order>60</sort_order>
97
- <show_in_default>1</show_in_default>
98
- <show_in_website>0</show_in_website>
99
- <show_in_store>0</show_in_store>
100
- </conditional_pixel_enabled>
101
- <source_key_name translate="label comment">
102
- <label>Query String Key Name</label>
103
- <comment>Only apply the pixel if the query string includes this key.</comment>
104
- <frontend_type>text</frontend_type>
105
- <depends>
106
- <conditional_pixel_enabled>1</conditional_pixel_enabled>
107
- </depends>
108
- <sort_order>70</sort_order>
109
- <show_in_default>1</show_in_default>
110
- <show_in_website>0</show_in_website>
111
- <show_in_store>0</show_in_store>
112
- </source_key_name>
113
- <product_feed_enabled translate="label">
114
- <label>Product Feed Enabled</label>
115
- <frontend_type>select</frontend_type>
116
- <source_model>adminhtml/system_config_source_yesno</source_model>
117
- <sort_order>80</sort_order>
118
- <show_in_default>1</show_in_default>
119
- <show_in_website>0</show_in_website>
120
- <show_in_store>0</show_in_store>
121
- </product_feed_enabled>
122
- <order_feed_enabled translate="label">
123
- <label>Order Correction Feed Enabled</label>
124
- <frontend_type>select</frontend_type>
125
- <source_model>adminhtml/system_config_source_yesno</source_model>
126
- <sort_order>90</sort_order>
127
- <show_in_default>1</show_in_default>
128
- <show_in_website>0</show_in_website>
129
- <show_in_store>0</show_in_store>
130
- </order_feed_enabled>
131
- </fields>
132
- </pepperjam_network>
133
- <pepperjam_network_product_attribute_map translate="label comment">
134
- <label>Product Feed Map</label>
135
- <frontend_type>text</frontend_type>
136
- <sort_order>200</sort_order>
137
- <show_in_default>1</show_in_default>
138
- <show_in_website>1</show_in_website>
139
- <show_in_store>0</show_in_store>
140
- <fields>
141
- <age_range translate="label">
142
- <label>age_range</label>
143
- <comment>Suggested age range</comment>
144
- <frontend_type>select</frontend_type>
145
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
146
- <sort_order>1</sort_order>
147
- <show_in_default>1</show_in_default>
148
- <show_in_website>0</show_in_website>
149
- <show_in_store>0</show_in_store>
150
- </age_range>
151
- <artist translate="label">
152
- <label>artist</label>
153
- <comment>Media artist</comment>
154
- <frontend_type>select</frontend_type>
155
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
156
- <sort_order>2</sort_order>
157
- <show_in_default>1</show_in_default>
158
- <show_in_website>0</show_in_website>
159
- <show_in_store>0</show_in_store>
160
- </artist>
161
- <aspect_ratio translate="label">
162
- <label>aspect_ratio</label>
163
- <comment>Screen aspect ratio</comment>
164
- <frontend_type>select</frontend_type>
165
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
166
- <sort_order>3</sort_order>
167
- <show_in_default>1</show_in_default>
168
- <show_in_website>0</show_in_website>
169
- <show_in_store>0</show_in_store>
170
- </aspect_ratio>
171
- <author translate="label">
172
- <label>author</label>
173
- <comment>Media author</comment>
174
- <frontend_type>select</frontend_type>
175
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
176
- <sort_order>4</sort_order>
177
- <show_in_default>1</show_in_default>
178
- <show_in_website>0</show_in_website>
179
- <show_in_store>0</show_in_store>
180
- </author>
181
- <battery_life translate="label">
182
- <label>battery_life</label>
183
- <comment>Battery life</comment>
184
- <frontend_type>select</frontend_type>
185
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
186
- <sort_order>5</sort_order>
187
- <show_in_default>1</show_in_default>
188
- <show_in_website>0</show_in_website>
189
- <show_in_store>0</show_in_store>
190
- </battery_life>
191
- <binding translate="label">
192
- <label>binding</label>
193
- <comment>Book binding</comment>
194
- <frontend_type>select</frontend_type>
195
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
196
- <sort_order>6</sort_order>
197
- <show_in_default>1</show_in_default>
198
- <show_in_website>0</show_in_website>
199
- <show_in_store>0</show_in_store>
200
- </binding>
201
- <buy_url translate="label">
202
- <label>buy_url</label>
203
- <comment>Destination URL (Required)</comment>
204
- <frontend_type>select</frontend_type>
205
- <validate>required-entry</validate>
206
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
207
- <sort_order>7</sort_order>
208
- <show_in_default>1</show_in_default>
209
- <show_in_website>0</show_in_website>
210
- <show_in_store>0</show_in_store>
211
- </buy_url>
212
- <category_network translate="label">
213
- <label>category_network</label>
214
- <comment>Pepperjam Network specific category (sub categories optionally delimited by '&gt;')</comment>
215
- <frontend_type>select</frontend_type>
216
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
217
- <sort_order>8</sort_order>
218
- <show_in_default>1</show_in_default>
219
- <show_in_website>0</show_in_website>
220
- <show_in_store>0</show_in_store>
221
- </category_network>
222
- <category_program translate="label">
223
- <label>category_program</label>
224
- <comment>Merchant specific category (sub categories optionally delimited by '&gt;') (Recommended)</comment>
225
- <frontend_type>select</frontend_type>
226
- <source_model>pepperjam_network/system_config_source_categories</source_model>
227
- <sort_order>9</sort_order>
228
- <show_in_default>1</show_in_default>
229
- <show_in_website>0</show_in_website>
230
- <show_in_store>0</show_in_store>
231
- </category_program>
232
- <color translate="label">
233
- <label>color</label>
234
- <comment>Color of item</comment>
235
- <frontend_type>select</frontend_type>
236
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
237
- <sort_order>10</sort_order>
238
- <show_in_default>1</show_in_default>
239
- <show_in_website>0</show_in_website>
240
- <show_in_store>0</show_in_store>
241
- </color>
242
- <color_output translate="label">
243
- <label>color_output</label>
244
- <comment>Whether output is color or not</comment>
245
- <frontend_type>select</frontend_type>
246
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
247
- <sort_order>11</sort_order>
248
- <show_in_default>1</show_in_default>
249
- <show_in_website>0</show_in_website>
250
- <show_in_store>0</show_in_store>
251
- </color_output>
252
- <condition translate="label">
253
- <label>condition</label>
254
- <comment>Condition (Recommended)</comment>
255
- <frontend_type>select</frontend_type>
256
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
257
- <sort_order>12</sort_order>
258
- <show_in_default>1</show_in_default>
259
- <show_in_website>0</show_in_website>
260
- <show_in_store>0</show_in_store>
261
- </condition>
262
- <description_long translate="label">
263
- <label>description_long</label>
264
- <comment>Long description (Required)</comment>
265
- <frontend_type>select</frontend_type>
266
- <validate>required-entry</validate>
267
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
268
- <sort_order>13</sort_order>
269
- <show_in_default>1</show_in_default>
270
- <show_in_website>0</show_in_website>
271
- <show_in_store>0</show_in_store>
272
- </description_long>
273
- <description_short translate="label">
274
- <label>description_short</label>
275
- <comment>Short description</comment>
276
- <frontend_type>select</frontend_type>
277
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
278
- <sort_order>14</sort_order>
279
- <show_in_default>1</show_in_default>
280
- <show_in_website>0</show_in_website>
281
- <show_in_store>0</show_in_store>
282
- </description_short>
283
- <director translate="label">
284
- <label>director</label>
285
- <comment>Movie director</comment>
286
- <frontend_type>select</frontend_type>
287
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
288
- <sort_order>15</sort_order>
289
- <show_in_default>1</show_in_default>
290
- <show_in_website>0</show_in_website>
291
- <show_in_store>0</show_in_store>
292
- </director>
293
- <discontinued translate="label">
294
- <label>discontinued</label>
295
- <comment>Whether product is discontinued or not</comment>
296
- <frontend_type>select</frontend_type>
297
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
298
- <sort_order>16</sort_order>
299
- <show_in_default>1</show_in_default>
300
- <show_in_website>0</show_in_website>
301
- <show_in_store>0</show_in_store>
302
- </discontinued>
303
- <display_type translate="label">
304
- <label>display_type</label>
305
- <comment>Display type</comment>
306
- <frontend_type>select</frontend_type>
307
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
308
- <sort_order>17</sort_order>
309
- <show_in_default>1</show_in_default>
310
- <show_in_website>0</show_in_website>
311
- <show_in_store>0</show_in_store>
312
- </display_type>
313
- <edition translate="label">
314
- <label>edition</label>
315
- <comment>Media edition</comment>
316
- <frontend_type>select</frontend_type>
317
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
318
- <sort_order>18</sort_order>
319
- <show_in_default>1</show_in_default>
320
- <show_in_website>0</show_in_website>
321
- <show_in_store>0</show_in_store>
322
- </edition>
323
- <expiration_date translate="label">
324
- <label>expiration_date</label>
325
- <comment>Expiration date</comment>
326
- <frontend_type>select</frontend_type>
327
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
328
- <sort_order>19</sort_order>
329
- <show_in_default>1</show_in_default>
330
- <show_in_website>0</show_in_website>
331
- <show_in_store>0</show_in_store>
332
- </expiration_date>
333
- <features translate="label">
334
- <label>features</label>
335
- <comment>Special features</comment>
336
- <frontend_type>select</frontend_type>
337
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
338
- <sort_order>20</sort_order>
339
- <show_in_default>1</show_in_default>
340
- <show_in_website>0</show_in_website>
341
- <show_in_store>0</show_in_store>
342
- </features>
343
- <focus_type translate="label">
344
- <label>focus_type</label>
345
- <comment>Focus type</comment>
346
- <frontend_type>select</frontend_type>
347
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
348
- <sort_order>21</sort_order>
349
- <show_in_default>1</show_in_default>
350
- <show_in_website>0</show_in_website>
351
- <show_in_store>0</show_in_store>
352
- </focus_type>
353
- <format translate="label">
354
- <label>format</label>
355
- <comment>Format</comment>
356
- <frontend_type>select</frontend_type>
357
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
358
- <sort_order>22</sort_order>
359
- <show_in_default>1</show_in_default>
360
- <show_in_website>0</show_in_website>
361
- <show_in_store>0</show_in_store>
362
- </format>
363
- <functions translate="label">
364
- <label>functions</label>
365
- <comment>Functions</comment>
366
- <frontend_type>select</frontend_type>
367
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
368
- <sort_order>23</sort_order>
369
- <show_in_default>1</show_in_default>
370
- <show_in_website>0</show_in_website>
371
- <show_in_store>0</show_in_store>
372
- </functions>
373
- <genre translate="label">
374
- <label>genre</label>
375
- <comment>Genre</comment>
376
- <frontend_type>select</frontend_type>
377
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
378
- <sort_order>24</sort_order>
379
- <show_in_default>1</show_in_default>
380
- <show_in_website>0</show_in_website>
381
- <show_in_store>0</show_in_store>
382
- </genre>
383
- <heel_height translate="label">
384
- <label>heel_height</label>
385
- <comment>Heel height</comment>
386
- <frontend_type>select</frontend_type>
387
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
388
- <sort_order>25</sort_order>
389
- <show_in_default>1</show_in_default>
390
- <show_in_website>0</show_in_website>
391
- <show_in_store>0</show_in_store>
392
- </heel_height>
393
- <height translate="label">
394
- <label>height</label>
395
- <comment>Height</comment>
396
- <frontend_type>select</frontend_type>
397
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
398
- <sort_order>26</sort_order>
399
- <show_in_default>1</show_in_default>
400
- <show_in_website>0</show_in_website>
401
- <show_in_store>0</show_in_store>
402
- </height>
403
- <image_thumb_url translate="label">
404
- <label>image_thumb_url</label>
405
- <comment>Thumbnail image URL (Recommended)</comment>
406
- <frontend_type>select</frontend_type>
407
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
408
- <sort_order>27</sort_order>
409
- <show_in_default>1</show_in_default>
410
- <show_in_website>0</show_in_website>
411
- <show_in_store>0</show_in_store>
412
- </image_thumb_url>
413
- <image_url translate="label">
414
- <label>image_url</label>
415
- <comment>Standard image URL (Required)</comment>
416
- <frontend_type>select</frontend_type>
417
- <validate>required-entry</validate>
418
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
419
- <sort_order>28</sort_order>
420
- <show_in_default>1</show_in_default>
421
- <show_in_website>0</show_in_website>
422
- <show_in_store>0</show_in_store>
423
- </image_url>
424
- <installation translate="label">
425
- <label>installation</label>
426
- <comment>Installation type</comment>
427
- <frontend_type>select</frontend_type>
428
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
429
- <sort_order>29</sort_order>
430
- <show_in_default>1</show_in_default>
431
- <show_in_website>0</show_in_website>
432
- <show_in_store>0</show_in_store>
433
- </installation>
434
- <in_stock translate="label">
435
- <label>in_stock</label>
436
- <comment>Whether product is in stock or not</comment>
437
- <frontend_type>select</frontend_type>
438
- <source_model>pepperjam_network/system_config_source_stockyesno</source_model>
439
- <sort_order>30</sort_order>
440
- <show_in_default>1</show_in_default>
441
- <show_in_website>0</show_in_website>
442
- <show_in_store>0</show_in_store>
443
- </in_stock>
444
- <isbn translate="label">
445
- <label>isbn</label>
446
- <comment>Book ISBN</comment>
447
- <frontend_type>select</frontend_type>
448
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
449
- <sort_order>31</sort_order>
450
- <show_in_default>1</show_in_default>
451
- <show_in_website>0</show_in_website>
452
- <show_in_store>0</show_in_store>
453
- </isbn>
454
- <keywords translate="label">
455
- <label>keywords</label>
456
- <comment>Space separated list of keywords (Recommended)</comment>
457
- <frontend_type>select</frontend_type>
458
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
459
- <sort_order>32</sort_order>
460
- <show_in_default>1</show_in_default>
461
- <show_in_website>0</show_in_website>
462
- <show_in_store>0</show_in_store>
463
- </keywords>
464
- <length translate="label">
465
- <label>length</label>
466
- <comment>Length</comment>
467
- <frontend_type>select</frontend_type>
468
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
469
- <sort_order>33</sort_order>
470
- <show_in_default>1</show_in_default>
471
- <show_in_website>0</show_in_website>
472
- <show_in_store>0</show_in_store>
473
- </length>
474
- <load_type translate="label">
475
- <label>load_type</label>
476
- <comment>Load type</comment>
477
- <frontend_type>select</frontend_type>
478
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
479
- <sort_order>34</sort_order>
480
- <show_in_default>1</show_in_default>
481
- <show_in_website>0</show_in_website>
482
- <show_in_store>0</show_in_store>
483
- </load_type>
484
- <location translate="label">
485
- <label>location</label>
486
- <comment>Shipping location</comment>
487
- <frontend_type>select</frontend_type>
488
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
489
- <sort_order>35</sort_order>
490
- <show_in_default>1</show_in_default>
491
- <show_in_website>0</show_in_website>
492
- <show_in_store>0</show_in_store>
493
- </location>
494
- <made_in translate="label">
495
- <label>made_in</label>
496
- <comment>Manufacturing country</comment>
497
- <frontend_type>select</frontend_type>
498
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
499
- <sort_order>36</sort_order>
500
- <show_in_default>1</show_in_default>
501
- <show_in_website>0</show_in_website>
502
- <show_in_store>0</show_in_store>
503
- </made_in>
504
- <manufacturer translate="label">
505
- <label>manufacturer</label>
506
- <comment>Manufacturer or brand (Recommended)</comment>
507
- <frontend_type>select</frontend_type>
508
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
509
- <sort_order>37</sort_order>
510
- <show_in_default>1</show_in_default>
511
- <show_in_website>0</show_in_website>
512
- <show_in_store>0</show_in_store>
513
- </manufacturer>
514
- <material translate="label">
515
- <label>material</label>
516
- <comment>Construction material</comment>
517
- <frontend_type>select</frontend_type>
518
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
519
- <sort_order>38</sort_order>
520
- <show_in_default>1</show_in_default>
521
- <show_in_website>0</show_in_website>
522
- <show_in_store>0</show_in_store>
523
- </material>
524
- <megapixels translate="label">
525
- <label>megapixels</label>
526
- <comment>Megapixels</comment>
527
- <frontend_type>select</frontend_type>
528
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
529
- <sort_order>39</sort_order>
530
- <show_in_default>1</show_in_default>
531
- <show_in_website>0</show_in_website>
532
- <show_in_store>0</show_in_store>
533
- </megapixels>
534
- <memory_capacity translate="label">
535
- <label>memory_capacity</label>
536
- <comment>Memory capacity</comment>
537
- <frontend_type>select</frontend_type>
538
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
539
- <sort_order>40</sort_order>
540
- <show_in_default>1</show_in_default>
541
- <show_in_website>0</show_in_website>
542
- <show_in_store>0</show_in_store>
543
- </memory_capacity>
544
- <memory_card_slot translate="label">
545
- <label>memory_card_slot</label>
546
- <comment>Memory card slot type</comment>
547
- <frontend_type>select</frontend_type>
548
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
549
- <sort_order>41</sort_order>
550
- <show_in_default>1</show_in_default>
551
- <show_in_website>0</show_in_website>
552
- <show_in_store>0</show_in_store>
553
- </memory_card_slot>
554
- <memory_type translate="label">
555
- <label>memory_type</label>
556
- <comment>Memory type</comment>
557
- <frontend_type>select</frontend_type>
558
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
559
- <sort_order>42</sort_order>
560
- <show_in_default>1</show_in_default>
561
- <show_in_website>0</show_in_website>
562
- <show_in_store>0</show_in_store>
563
- </memory_type>
564
- <model_number translate="label">
565
- <label>model_number</label>
566
- <comment>Model number</comment>
567
- <frontend_type>select</frontend_type>
568
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
569
- <sort_order>43</sort_order>
570
- <show_in_default>1</show_in_default>
571
- <show_in_website>0</show_in_website>
572
- <show_in_store>0</show_in_store>
573
- </model_number>
574
- <mpn translate="label">
575
- <label>mpn</label>
576
- <comment>Manufacturer part number</comment>
577
- <frontend_type>select</frontend_type>
578
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
579
- <sort_order>44</sort_order>
580
- <show_in_default>1</show_in_default>
581
- <show_in_website>0</show_in_website>
582
- <show_in_store>0</show_in_store>
583
- </mpn>
584
- <name translate="label">
585
- <label>name</label>
586
- <comment>Name or title (Required)</comment>
587
- <frontend_type>select</frontend_type>
588
- <validate>required-entry</validate>
589
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
590
- <sort_order>45</sort_order>
591
- <show_in_default>1</show_in_default>
592
- <show_in_website>0</show_in_website>
593
- <show_in_store>0</show_in_store>
594
- </name>
595
- <occasion translate="label">
596
- <label>occasion</label>
597
- <comment>Recommended usage occasion</comment>
598
- <frontend_type>select</frontend_type>
599
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
600
- <sort_order>46</sort_order>
601
- <show_in_default>1</show_in_default>
602
- <show_in_website>0</show_in_website>
603
- <show_in_store>0</show_in_store>
604
- </occasion>
605
- <operating_system translate="label">
606
- <label>operating_system</label>
607
- <comment>Operating system</comment>
608
- <frontend_type>select</frontend_type>
609
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
610
- <sort_order>47</sort_order>
611
- <show_in_default>1</show_in_default>
612
- <show_in_website>0</show_in_website>
613
- <show_in_store>0</show_in_store>
614
- </operating_system>
615
- <optical_drive translate="label">
616
- <label>optical_drive</label>
617
- <comment>Optical drive type</comment>
618
- <frontend_type>select</frontend_type>
619
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
620
- <sort_order>48</sort_order>
621
- <show_in_default>1</show_in_default>
622
- <show_in_website>0</show_in_website>
623
- <show_in_store>0</show_in_store>
624
- </optical_drive>
625
- <pages translate="label">
626
- <label>pages</label>
627
- <comment>Number of pages</comment>
628
- <frontend_type>select</frontend_type>
629
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
630
- <sort_order>49</sort_order>
631
- <show_in_default>1</show_in_default>
632
- <show_in_website>0</show_in_website>
633
- <show_in_store>0</show_in_store>
634
- </pages>
635
- <payment_accepted translate="label">
636
- <label>payment_accepted</label>
637
- <comment>Accepted payment methods</comment>
638
- <frontend_type>select</frontend_type>
639
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
640
- <sort_order>50</sort_order>
641
- <show_in_default>1</show_in_default>
642
- <show_in_website>0</show_in_website>
643
- <show_in_store>0</show_in_store>
644
- </payment_accepted>
645
- <payment_notes translate="label">
646
- <label>payment_notes</label>
647
- <comment>Additional payment notes</comment>
648
- <frontend_type>select</frontend_type>
649
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
650
- <sort_order>51</sort_order>
651
- <show_in_default>1</show_in_default>
652
- <show_in_website>0</show_in_website>
653
- <show_in_store>0</show_in_store>
654
- </payment_notes>
655
- <platform translate="label">
656
- <label>platform</label>
657
- <comment>Platform</comment>
658
- <frontend_type>select</frontend_type>
659
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
660
- <sort_order>52</sort_order>
661
- <show_in_default>1</show_in_default>
662
- <show_in_website>0</show_in_website>
663
- <show_in_store>0</show_in_store>
664
- </platform>
665
- <price translate="label">
666
- <label>price</label>
667
- <comment>Selling price (Required)</comment>
668
- <frontend_type>select</frontend_type>
669
- <validate>required-entry</validate>
670
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
671
- <sort_order>53</sort_order>
672
- <show_in_default>1</show_in_default>
673
- <show_in_website>0</show_in_website>
674
- <show_in_store>0</show_in_store>
675
- </price>
676
- <price_retail translate="label">
677
- <label>price_retail</label>
678
- <comment>Manufacturer suggested retail price</comment>
679
- <frontend_type>select</frontend_type>
680
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
681
- <sort_order>54</sort_order>
682
- <show_in_default>1</show_in_default>
683
- <show_in_website>0</show_in_website>
684
- <show_in_store>0</show_in_store>
685
- </price_retail>
686
- <price_sale translate="label">
687
- <label>price_sale</label>
688
- <comment>Discount price</comment>
689
- <frontend_type>select</frontend_type>
690
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
691
- <sort_order>55</sort_order>
692
- <show_in_default>1</show_in_default>
693
- <show_in_website>0</show_in_website>
694
- <show_in_store>0</show_in_store>
695
- </price_sale>
696
- <price_shipping translate="label">
697
- <label>price_shipping</label>
698
- <comment>Shipping price</comment>
699
- <frontend_type>select</frontend_type>
700
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
701
- <sort_order>56</sort_order>
702
- <show_in_default>1</show_in_default>
703
- <show_in_website>0</show_in_website>
704
- <show_in_store>0</show_in_store>
705
- </price_shipping>
706
- <processor translate="label">
707
- <label>processor</label>
708
- <comment>Processor type</comment>
709
- <frontend_type>select</frontend_type>
710
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
711
- <sort_order>57</sort_order>
712
- <show_in_default>1</show_in_default>
713
- <show_in_website>0</show_in_website>
714
- <show_in_store>0</show_in_store>
715
- </processor>
716
- <publisher translate="label">
717
- <label>publisher</label>
718
- <comment>Publisher</comment>
719
- <frontend_type>select</frontend_type>
720
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
721
- <sort_order>58</sort_order>
722
- <show_in_default>1</show_in_default>
723
- <show_in_website>0</show_in_website>
724
- <show_in_store>0</show_in_store>
725
- </publisher>
726
- <quantity_in_stock translate="label">
727
- <label>quantity_in_stock</label>
728
- <comment>Number of items in stock</comment>
729
- <frontend_type>select</frontend_type>
730
- <source_model>pepperjam_network/system_config_source_stockquantity</source_model>
731
- <sort_order>59</sort_order>
732
- <show_in_default>1</show_in_default>
733
- <show_in_website>0</show_in_website>
734
- <show_in_store>0</show_in_store>
735
- </quantity_in_stock>
736
- <rating translate="label">
737
- <label>rating</label>
738
- <comment>Rating</comment>
739
- <frontend_type>select</frontend_type>
740
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
741
- <sort_order>60</sort_order>
742
- <show_in_default>1</show_in_default>
743
- <show_in_website>0</show_in_website>
744
- <show_in_store>0</show_in_store>
745
- </rating>
746
- <recommended_usage translate="label">
747
- <label>recommended_usage</label>
748
- <comment>Recommended usage</comment>
749
- <frontend_type>select</frontend_type>
750
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
751
- <sort_order>61</sort_order>
752
- <show_in_default>1</show_in_default>
753
- <show_in_website>0</show_in_website>
754
- <show_in_store>0</show_in_store>
755
- </recommended_usage>
756
- <resolution translate="label">
757
- <label>resolution</label>
758
- <comment>Screen resolution</comment>
759
- <frontend_type>select</frontend_type>
760
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
761
- <sort_order>62</sort_order>
762
- <show_in_default>1</show_in_default>
763
- <show_in_website>0</show_in_website>
764
- <show_in_store>0</show_in_store>
765
- </resolution>
766
- <screen_size translate="label">
767
- <label>screen_size</label>
768
- <comment>Screen size</comment>
769
- <frontend_type>select</frontend_type>
770
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
771
- <sort_order>63</sort_order>
772
- <show_in_default>1</show_in_default>
773
- <show_in_website>0</show_in_website>
774
- <show_in_store>0</show_in_store>
775
- </screen_size>
776
- <shipping_method translate="label">
777
- <label>shipping_method</label>
778
- <comment>Shipping methods</comment>
779
- <frontend_type>select</frontend_type>
780
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
781
- <sort_order>64</sort_order>
782
- <show_in_default>1</show_in_default>
783
- <show_in_website>0</show_in_website>
784
- <show_in_store>0</show_in_store>
785
- </shipping_method>
786
- <shoe_size translate="label">
787
- <label>shoe_size</label>
788
- <comment>Shoe size</comment>
789
- <frontend_type>select</frontend_type>
790
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
791
- <sort_order>65</sort_order>
792
- <show_in_default>1</show_in_default>
793
- <show_in_website>0</show_in_website>
794
- <show_in_store>0</show_in_store>
795
- </shoe_size>
796
- <shoe_width translate="label">
797
- <label>shoe_width</label>
798
- <comment>Shoe width</comment>
799
- <frontend_type>select</frontend_type>
800
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
801
- <sort_order>66</sort_order>
802
- <show_in_default>1</show_in_default>
803
- <show_in_website>0</show_in_website>
804
- <show_in_store>0</show_in_store>
805
- </shoe_width>
806
- <size translate="label">
807
- <label>size</label>
808
- <comment>Size</comment>
809
- <frontend_type>select</frontend_type>
810
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
811
- <sort_order>67</sort_order>
812
- <show_in_default>1</show_in_default>
813
- <show_in_website>0</show_in_website>
814
- <show_in_store>0</show_in_store>
815
- </size>
816
- <sku translate="label">
817
- <label>sku</label>
818
- <comment>Stock keeping unit (Recommended)</comment>
819
- <frontend_type>select</frontend_type>
820
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
821
- <sort_order>68</sort_order>
822
- <show_in_default>1</show_in_default>
823
- <show_in_website>0</show_in_website>
824
- <show_in_store>0</show_in_store>
825
- </sku>
826
- <staring translate="label">
827
- <label>staring</label>
828
- <comment>Staring actors</comment>
829
- <frontend_type>select</frontend_type>
830
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
831
- <sort_order>69</sort_order>
832
- <show_in_default>1</show_in_default>
833
- <show_in_website>0</show_in_website>
834
- <show_in_store>0</show_in_store>
835
- </staring>
836
- <style translate="label">
837
- <label>style</label>
838
- <comment>Style</comment>
839
- <frontend_type>select</frontend_type>
840
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
841
- <sort_order>70</sort_order>
842
- <show_in_default>1</show_in_default>
843
- <show_in_website>0</show_in_website>
844
- <show_in_store>0</show_in_store>
845
- </style>
846
- <tech_spec_url translate="label">
847
- <label>tech_spec_url</label>
848
- <comment>Technical specifications URL</comment>
849
- <frontend_type>select</frontend_type>
850
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
851
- <sort_order>71</sort_order>
852
- <show_in_default>1</show_in_default>
853
- <show_in_website>0</show_in_website>
854
- <show_in_store>0</show_in_store>
855
- </tech_spec_url>
856
- <tracks translate="label">
857
- <label>tracks</label>
858
- <comment>Total number of tracks</comment>
859
- <frontend_type>select</frontend_type>
860
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
861
- <sort_order>72</sort_order>
862
- <show_in_default>1</show_in_default>
863
- <show_in_website>0</show_in_website>
864
- <show_in_store>0</show_in_store>
865
- </tracks>
866
- <upc translate="label">
867
- <label>upc</label>
868
- <comment>Universal product code (Recommended)</comment>
869
- <frontend_type>select</frontend_type>
870
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
871
- <sort_order>73</sort_order>
872
- <show_in_default>1</show_in_default>
873
- <show_in_website>0</show_in_website>
874
- <show_in_store>0</show_in_store>
875
- </upc>
876
- <weight translate="label">
877
- <label>weight</label>
878
- <comment>Weight</comment>
879
- <frontend_type>select</frontend_type>
880
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
881
- <sort_order>74</sort_order>
882
- <show_in_default>1</show_in_default>
883
- <show_in_website>0</show_in_website>
884
- <show_in_store>0</show_in_store>
885
- </weight>
886
- <width translate="label">
887
- <label>width</label>
888
- <comment>Width</comment>
889
- <frontend_type>select</frontend_type>
890
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
891
- <sort_order>75</sort_order>
892
- <show_in_default>1</show_in_default>
893
- <show_in_website>0</show_in_website>
894
- <show_in_store>0</show_in_store>
895
- </width>
896
- <wireless_interface translate="label">
897
- <label>wireless_interface</label>
898
- <comment>Wireless interface</comment>
899
- <frontend_type>select</frontend_type>
900
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
901
- <sort_order>76</sort_order>
902
- <show_in_default>1</show_in_default>
903
- <show_in_website>0</show_in_website>
904
- <show_in_store>0</show_in_store>
905
- </wireless_interface>
906
- <year translate="label">
907
- <label>year</label>
908
- <comment>Year of manufacture - YYYY</comment>
909
- <frontend_type>select</frontend_type>
910
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
911
- <sort_order>77</sort_order>
912
- <show_in_default>1</show_in_default>
913
- <show_in_website>0</show_in_website>
914
- <show_in_store>0</show_in_store>
915
- </year>
916
- <zoom translate="label">
917
- <label>zoom</label>
918
- <comment>Maximum zoom</comment>
919
- <frontend_type>select</frontend_type>
920
- <source_model>pepperjam_network/system_config_source_attributes</source_model>
921
- <sort_order>78</sort_order>
922
- <show_in_default>1</show_in_default>
923
- <show_in_website>0</show_in_website>
924
- <show_in_store>0</show_in_store>
925
- </zoom>
926
- </fields>
927
- </pepperjam_network_product_attribute_map>
928
- <uninstall translate="label comment">
929
- <label>Uninstall Extension</label>
930
- <comment>If you wish to uninstall this extension, please use this Uninstall button.</comment>
931
- <sort_order>300</sort_order>
932
- <show_in_default>1</show_in_default>
933
- <show_in_website>0</show_in_website>
934
- <show_in_store>0</show_in_store>
935
- <fields>
936
- <uninstall translate="label">
937
- <label>Remove</label>
938
- <frontend_type>button</frontend_type>
939
- <frontend_model>pepperjam_network/adminhtml_system_config_form_button</frontend_model>
940
- <sort_order>100</sort_order>
941
- <show_in_default>1</show_in_default>
942
- <show_in_website>0</show_in_website>
943
- <show_in_store>0</show_in_store>
944
- </uninstall>
945
- </fields>
946
- </uninstall>
947
- </groups>
948
- </pepperjam>
949
- </sections>
950
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Copyright (c) 2016 Pepperjam Network.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the Pepperjam Network
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+
13
+ @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ -->
16
+ <config>
17
+ <tabs>
18
+ <pepperjam translate="label" module="pepperjam_network">
19
+ <label>Pepperjam</label>
20
+ <sort_order>550</sort_order>
21
+ </pepperjam>
22
+ </tabs>
23
+ <sections>
24
+ <pepperjam translate="label" module="pepperjam_network">
25
+ <class>separator-top</class>
26
+ <label>Pepperjam Network</label>
27
+ <tab>pepperjam</tab>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>550</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <groups>
34
+ <pepperjam_network translate="label comment">
35
+ <label>Settings</label>
36
+ <comment><![CDATA[Your program ID and other information can be found within your Pepperjam Network advertiser account. Don’t have an account yet? <a href='https://www.pepperjamnetwork.com/register/basic' target='_pjregister'>Register</a> for one today!]]></comment>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>100</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ <fields>
43
+ <active translate="label">
44
+ <label>Enable Conversion Tracking</label>
45
+ <frontend_type>select</frontend_type>
46
+ <source_model>adminhtml/system_config_source_yesno</source_model>
47
+ <sort_order>1</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>0</show_in_website>
50
+ <show_in_store>0</show_in_store>
51
+ </active>
52
+ <program_id translate="label comment">
53
+ <label>Program Id</label>
54
+ <comment>Your Program Id will be provided to you by Pepperjam</comment>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>10</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>0</show_in_store>
60
+ </program_id>
61
+ <order_type>
62
+ <label>Program Tracking Type</label>
63
+ <frontend_type>select</frontend_type>
64
+ <source_model>pepperjam_network/system_config_source_ordertypes</source_model>
65
+ <sort_order>20</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>0</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </order_type>
70
+ <tracking_method translate="label">
71
+ <label>Program Tracking Method</label>
72
+ <frontend_type>select</frontend_type>
73
+ <source_model>pepperjam_network/system_config_source_trackingmethods</source_model>
74
+ <sort_order>25</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>0</show_in_website>
77
+ <show_in_store>0</show_in_store>
78
+ </tracking_method>
79
+ <transaction_type translate="label comment">
80
+ <label>Transaction Type</label>
81
+ <comment>Sale transactions pay publishers a percentage of the sale, lead transactions pay publishes a flat amount for an action.</comment>
82
+ <frontend_type>select</frontend_type>
83
+ <source_model>pepperjam_network/system_config_source_transactiontype</source_model>
84
+ <depends>
85
+ <order_type>basic</order_type>
86
+ </depends>
87
+ <sort_order>30</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>0</show_in_website>
90
+ <show_in_store>0</show_in_store>
91
+ </transaction_type>
92
+ <export_path translate="label comment">
93
+ <label>Export Path</label>
94
+ <comment>Default local path to export feeds to. These feeds will need to be made available to Pepperjam via FTP.</comment>
95
+ <frontend_type>text</frontend_type>
96
+ <sort_order>50</sort_order>
97
+ <show_in_default>1</show_in_default>
98
+ <show_in_website>0</show_in_website>
99
+ <show_in_store>0</show_in_store>
100
+ </export_path>
101
+ <attribution_enabled translate="label">
102
+ <label>Attribution</label>
103
+ <frontend_type>select</frontend_type>
104
+ <source_model>adminhtml/system_config_source_yesno</source_model>
105
+ <sort_order>60</sort_order>
106
+ <show_in_default>1</show_in_default>
107
+ <show_in_website>0</show_in_website>
108
+ <show_in_store>0</show_in_store>
109
+ </attribution_enabled>
110
+ <source_key_name translate="label comment">
111
+ <label>Query String Source Key Name</label>
112
+ <comment>Only apply the pixel if the query string includes this key.</comment>
113
+ <frontend_type>text</frontend_type>
114
+ <depends>
115
+ <attribution_enabled>1</attribution_enabled>
116
+ </depends>
117
+ <sort_order>70</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>0</show_in_website>
120
+ <show_in_store>0</show_in_store>
121
+ </source_key_name>
122
+ <click_id_key_name translate="label">
123
+ <label>Query String Click ID Key Name</label>
124
+ <frontend_type>text</frontend_type>
125
+ <depends>
126
+ <attribution_enabled>1</attribution_enabled>
127
+ </depends>
128
+ <sort_order>73</sort_order>
129
+ <show_in_default>1</show_in_default>
130
+ <show_in_website>0</show_in_website>
131
+ <show_in_store>0</show_in_store>
132
+ </click_id_key_name>
133
+ <publisher_id_key_name translate="label comment">
134
+ <label>Query String Publisher ID Key Name</label>
135
+ <comment>Please ensure that these parameters are placed in all affiliate tracking links.</comment>
136
+ <frontend_type>text</frontend_type>
137
+ <depends>
138
+ <attribution_enabled>1</attribution_enabled>
139
+ </depends>
140
+ <sort_order>76</sort_order>
141
+ <show_in_default>1</show_in_default>
142
+ <show_in_website>0</show_in_website>
143
+ <show_in_store>0</show_in_store>
144
+ </publisher_id_key_name>
145
+ <order_correction_feed_enabled translate="label">
146
+ <label>Order Correction Feed Enabled</label>
147
+ <frontend_type>select</frontend_type>
148
+ <source_model>adminhtml/system_config_source_yesno</source_model>
149
+ <sort_order>79</sort_order>
150
+ <depends>
151
+ <attribution_enabled>1</attribution_enabled>
152
+ </depends>
153
+ <show_in_default>1</show_in_default>
154
+ <show_in_website>0</show_in_website>
155
+ <show_in_store>0</show_in_store>
156
+ </order_correction_feed_enabled>
157
+ <product_feed_enabled translate="label">
158
+ <label>Product Feed Enabled</label>
159
+ <frontend_type>select</frontend_type>
160
+ <source_model>adminhtml/system_config_source_yesno</source_model>
161
+ <sort_order>90</sort_order>
162
+ <show_in_default>1</show_in_default>
163
+ <show_in_website>0</show_in_website>
164
+ <show_in_store>0</show_in_store>
165
+ </product_feed_enabled>
166
+ </fields>
167
+ </pepperjam_network>
168
+ <pepperjam_network_product_attribute_map translate="label comment">
169
+ <label>Product Feed Map</label>
170
+ <frontend_type>text</frontend_type>
171
+ <sort_order>200</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>1</show_in_website>
174
+ <show_in_store>0</show_in_store>
175
+ <fields>
176
+ <age_range translate="label">
177
+ <label>age_range</label>
178
+ <comment>Suggested age range</comment>
179
+ <frontend_type>select</frontend_type>
180
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
181
+ <sort_order>1</sort_order>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>0</show_in_website>
184
+ <show_in_store>0</show_in_store>
185
+ </age_range>
186
+ <artist translate="label">
187
+ <label>artist</label>
188
+ <comment>Media artist</comment>
189
+ <frontend_type>select</frontend_type>
190
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
191
+ <sort_order>2</sort_order>
192
+ <show_in_default>1</show_in_default>
193
+ <show_in_website>0</show_in_website>
194
+ <show_in_store>0</show_in_store>
195
+ </artist>
196
+ <aspect_ratio translate="label">
197
+ <label>aspect_ratio</label>
198
+ <comment>Screen aspect ratio</comment>
199
+ <frontend_type>select</frontend_type>
200
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
201
+ <sort_order>3</sort_order>
202
+ <show_in_default>1</show_in_default>
203
+ <show_in_website>0</show_in_website>
204
+ <show_in_store>0</show_in_store>
205
+ </aspect_ratio>
206
+ <author translate="label">
207
+ <label>author</label>
208
+ <comment>Media author</comment>
209
+ <frontend_type>select</frontend_type>
210
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
211
+ <sort_order>4</sort_order>
212
+ <show_in_default>1</show_in_default>
213
+ <show_in_website>0</show_in_website>
214
+ <show_in_store>0</show_in_store>
215
+ </author>
216
+ <battery_life translate="label">
217
+ <label>battery_life</label>
218
+ <comment>Battery life</comment>
219
+ <frontend_type>select</frontend_type>
220
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
221
+ <sort_order>5</sort_order>
222
+ <show_in_default>1</show_in_default>
223
+ <show_in_website>0</show_in_website>
224
+ <show_in_store>0</show_in_store>
225
+ </battery_life>
226
+ <binding translate="label">
227
+ <label>binding</label>
228
+ <comment>Book binding</comment>
229
+ <frontend_type>select</frontend_type>
230
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
231
+ <sort_order>6</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>0</show_in_website>
234
+ <show_in_store>0</show_in_store>
235
+ </binding>
236
+ <buy_url translate="label">
237
+ <label>buy_url</label>
238
+ <comment>Destination URL (Required)</comment>
239
+ <frontend_type>select</frontend_type>
240
+ <validate>required-entry</validate>
241
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
242
+ <sort_order>7</sort_order>
243
+ <show_in_default>1</show_in_default>
244
+ <show_in_website>0</show_in_website>
245
+ <show_in_store>0</show_in_store>
246
+ </buy_url>
247
+ <category_network translate="label">
248
+ <label>category_network</label>
249
+ <comment>Pepperjam Network specific category (sub categories optionally delimited by '&gt;')</comment>
250
+ <frontend_type>select</frontend_type>
251
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
252
+ <sort_order>8</sort_order>
253
+ <show_in_default>1</show_in_default>
254
+ <show_in_website>0</show_in_website>
255
+ <show_in_store>0</show_in_store>
256
+ </category_network>
257
+ <category_program translate="label">
258
+ <label>category_program</label>
259
+ <comment>Merchant specific category (sub categories optionally delimited by '&gt;') (Recommended)</comment>
260
+ <frontend_type>select</frontend_type>
261
+ <source_model>pepperjam_network/system_config_source_categories</source_model>
262
+ <sort_order>9</sort_order>
263
+ <show_in_default>1</show_in_default>
264
+ <show_in_website>0</show_in_website>
265
+ <show_in_store>0</show_in_store>
266
+ </category_program>
267
+ <color translate="label">
268
+ <label>color</label>
269
+ <comment>Color of item</comment>
270
+ <frontend_type>select</frontend_type>
271
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
272
+ <sort_order>10</sort_order>
273
+ <show_in_default>1</show_in_default>
274
+ <show_in_website>0</show_in_website>
275
+ <show_in_store>0</show_in_store>
276
+ </color>
277
+ <color_output translate="label">
278
+ <label>color_output</label>
279
+ <comment>Whether output is color or not</comment>
280
+ <frontend_type>select</frontend_type>
281
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
282
+ <sort_order>11</sort_order>
283
+ <show_in_default>1</show_in_default>
284
+ <show_in_website>0</show_in_website>
285
+ <show_in_store>0</show_in_store>
286
+ </color_output>
287
+ <condition translate="label">
288
+ <label>condition</label>
289
+ <comment>Condition (Recommended)</comment>
290
+ <frontend_type>select</frontend_type>
291
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
292
+ <sort_order>12</sort_order>
293
+ <show_in_default>1</show_in_default>
294
+ <show_in_website>0</show_in_website>
295
+ <show_in_store>0</show_in_store>
296
+ </condition>
297
+ <description_long translate="label">
298
+ <label>description_long</label>
299
+ <comment>Long description (Required)</comment>
300
+ <frontend_type>select</frontend_type>
301
+ <validate>required-entry</validate>
302
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
303
+ <sort_order>13</sort_order>
304
+ <show_in_default>1</show_in_default>
305
+ <show_in_website>0</show_in_website>
306
+ <show_in_store>0</show_in_store>
307
+ </description_long>
308
+ <description_short translate="label">
309
+ <label>description_short</label>
310
+ <comment>Short description</comment>
311
+ <frontend_type>select</frontend_type>
312
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
313
+ <sort_order>14</sort_order>
314
+ <show_in_default>1</show_in_default>
315
+ <show_in_website>0</show_in_website>
316
+ <show_in_store>0</show_in_store>
317
+ </description_short>
318
+ <director translate="label">
319
+ <label>director</label>
320
+ <comment>Movie director</comment>
321
+ <frontend_type>select</frontend_type>
322
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
323
+ <sort_order>15</sort_order>
324
+ <show_in_default>1</show_in_default>
325
+ <show_in_website>0</show_in_website>
326
+ <show_in_store>0</show_in_store>
327
+ </director>
328
+ <discontinued translate="label">
329
+ <label>discontinued</label>
330
+ <comment>Whether product is discontinued or not</comment>
331
+ <frontend_type>select</frontend_type>
332
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
333
+ <sort_order>16</sort_order>
334
+ <show_in_default>1</show_in_default>
335
+ <show_in_website>0</show_in_website>
336
+ <show_in_store>0</show_in_store>
337
+ </discontinued>
338
+ <display_type translate="label">
339
+ <label>display_type</label>
340
+ <comment>Display type</comment>
341
+ <frontend_type>select</frontend_type>
342
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
343
+ <sort_order>17</sort_order>
344
+ <show_in_default>1</show_in_default>
345
+ <show_in_website>0</show_in_website>
346
+ <show_in_store>0</show_in_store>
347
+ </display_type>
348
+ <edition translate="label">
349
+ <label>edition</label>
350
+ <comment>Media edition</comment>
351
+ <frontend_type>select</frontend_type>
352
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
353
+ <sort_order>18</sort_order>
354
+ <show_in_default>1</show_in_default>
355
+ <show_in_website>0</show_in_website>
356
+ <show_in_store>0</show_in_store>
357
+ </edition>
358
+ <expiration_date translate="label">
359
+ <label>expiration_date</label>
360
+ <comment>Expiration date</comment>
361
+ <frontend_type>select</frontend_type>
362
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
363
+ <sort_order>19</sort_order>
364
+ <show_in_default>1</show_in_default>
365
+ <show_in_website>0</show_in_website>
366
+ <show_in_store>0</show_in_store>
367
+ </expiration_date>
368
+ <features translate="label">
369
+ <label>features</label>
370
+ <comment>Special features</comment>
371
+ <frontend_type>select</frontend_type>
372
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
373
+ <sort_order>20</sort_order>
374
+ <show_in_default>1</show_in_default>
375
+ <show_in_website>0</show_in_website>
376
+ <show_in_store>0</show_in_store>
377
+ </features>
378
+ <focus_type translate="label">
379
+ <label>focus_type</label>
380
+ <comment>Focus type</comment>
381
+ <frontend_type>select</frontend_type>
382
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
383
+ <sort_order>21</sort_order>
384
+ <show_in_default>1</show_in_default>
385
+ <show_in_website>0</show_in_website>
386
+ <show_in_store>0</show_in_store>
387
+ </focus_type>
388
+ <format translate="label">
389
+ <label>format</label>
390
+ <comment>Format</comment>
391
+ <frontend_type>select</frontend_type>
392
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
393
+ <sort_order>22</sort_order>
394
+ <show_in_default>1</show_in_default>
395
+ <show_in_website>0</show_in_website>
396
+ <show_in_store>0</show_in_store>
397
+ </format>
398
+ <functions translate="label">
399
+ <label>functions</label>
400
+ <comment>Functions</comment>
401
+ <frontend_type>select</frontend_type>
402
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
403
+ <sort_order>23</sort_order>
404
+ <show_in_default>1</show_in_default>
405
+ <show_in_website>0</show_in_website>
406
+ <show_in_store>0</show_in_store>
407
+ </functions>
408
+ <genre translate="label">
409
+ <label>genre</label>
410
+ <comment>Genre</comment>
411
+ <frontend_type>select</frontend_type>
412
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
413
+ <sort_order>24</sort_order>
414
+ <show_in_default>1</show_in_default>
415
+ <show_in_website>0</show_in_website>
416
+ <show_in_store>0</show_in_store>
417
+ </genre>
418
+ <heel_height translate="label">
419
+ <label>heel_height</label>
420
+ <comment>Heel height</comment>
421
+ <frontend_type>select</frontend_type>
422
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
423
+ <sort_order>25</sort_order>
424
+ <show_in_default>1</show_in_default>
425
+ <show_in_website>0</show_in_website>
426
+ <show_in_store>0</show_in_store>
427
+ </heel_height>
428
+ <height translate="label">
429
+ <label>height</label>
430
+ <comment>Height</comment>
431
+ <frontend_type>select</frontend_type>
432
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
433
+ <sort_order>26</sort_order>
434
+ <show_in_default>1</show_in_default>
435
+ <show_in_website>0</show_in_website>
436
+ <show_in_store>0</show_in_store>
437
+ </height>
438
+ <image_thumb_url translate="label">
439
+ <label>image_thumb_url</label>
440
+ <comment>Thumbnail image URL (Recommended)</comment>
441
+ <frontend_type>select</frontend_type>
442
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
443
+ <sort_order>27</sort_order>
444
+ <show_in_default>1</show_in_default>
445
+ <show_in_website>0</show_in_website>
446
+ <show_in_store>0</show_in_store>
447
+ </image_thumb_url>
448
+ <image_url translate="label">
449
+ <label>image_url</label>
450
+ <comment>Standard image URL (Required)</comment>
451
+ <frontend_type>select</frontend_type>
452
+ <validate>required-entry</validate>
453
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
454
+ <sort_order>28</sort_order>
455
+ <show_in_default>1</show_in_default>
456
+ <show_in_website>0</show_in_website>
457
+ <show_in_store>0</show_in_store>
458
+ </image_url>
459
+ <installation translate="label">
460
+ <label>installation</label>
461
+ <comment>Installation type</comment>
462
+ <frontend_type>select</frontend_type>
463
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
464
+ <sort_order>29</sort_order>
465
+ <show_in_default>1</show_in_default>
466
+ <show_in_website>0</show_in_website>
467
+ <show_in_store>0</show_in_store>
468
+ </installation>
469
+ <in_stock translate="label">
470
+ <label>in_stock</label>
471
+ <comment>Whether product is in stock or not</comment>
472
+ <frontend_type>select</frontend_type>
473
+ <source_model>pepperjam_network/system_config_source_stockyesno</source_model>
474
+ <sort_order>30</sort_order>
475
+ <show_in_default>1</show_in_default>
476
+ <show_in_website>0</show_in_website>
477
+ <show_in_store>0</show_in_store>
478
+ </in_stock>
479
+ <isbn translate="label">
480
+ <label>isbn</label>
481
+ <comment>Book ISBN</comment>
482
+ <frontend_type>select</frontend_type>
483
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
484
+ <sort_order>31</sort_order>
485
+ <show_in_default>1</show_in_default>
486
+ <show_in_website>0</show_in_website>
487
+ <show_in_store>0</show_in_store>
488
+ </isbn>
489
+ <keywords translate="label">
490
+ <label>keywords</label>
491
+ <comment>Space separated list of keywords (Recommended)</comment>
492
+ <frontend_type>select</frontend_type>
493
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
494
+ <sort_order>32</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>0</show_in_website>
497
+ <show_in_store>0</show_in_store>
498
+ </keywords>
499
+ <length translate="label">
500
+ <label>length</label>
501
+ <comment>Length</comment>
502
+ <frontend_type>select</frontend_type>
503
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
504
+ <sort_order>33</sort_order>
505
+ <show_in_default>1</show_in_default>
506
+ <show_in_website>0</show_in_website>
507
+ <show_in_store>0</show_in_store>
508
+ </length>
509
+ <load_type translate="label">
510
+ <label>load_type</label>
511
+ <comment>Load type</comment>
512
+ <frontend_type>select</frontend_type>
513
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
514
+ <sort_order>34</sort_order>
515
+ <show_in_default>1</show_in_default>
516
+ <show_in_website>0</show_in_website>
517
+ <show_in_store>0</show_in_store>
518
+ </load_type>
519
+ <location translate="label">
520
+ <label>location</label>
521
+ <comment>Shipping location</comment>
522
+ <frontend_type>select</frontend_type>
523
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
524
+ <sort_order>35</sort_order>
525
+ <show_in_default>1</show_in_default>
526
+ <show_in_website>0</show_in_website>
527
+ <show_in_store>0</show_in_store>
528
+ </location>
529
+ <made_in translate="label">
530
+ <label>made_in</label>
531
+ <comment>Manufacturing country</comment>
532
+ <frontend_type>select</frontend_type>
533
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
534
+ <sort_order>36</sort_order>
535
+ <show_in_default>1</show_in_default>
536
+ <show_in_website>0</show_in_website>
537
+ <show_in_store>0</show_in_store>
538
+ </made_in>
539
+ <manufacturer translate="label">
540
+ <label>manufacturer</label>
541
+ <comment>Manufacturer or brand (Recommended)</comment>
542
+ <frontend_type>select</frontend_type>
543
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
544
+ <sort_order>37</sort_order>
545
+ <show_in_default>1</show_in_default>
546
+ <show_in_website>0</show_in_website>
547
+ <show_in_store>0</show_in_store>
548
+ </manufacturer>
549
+ <material translate="label">
550
+ <label>material</label>
551
+ <comment>Construction material</comment>
552
+ <frontend_type>select</frontend_type>
553
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
554
+ <sort_order>38</sort_order>
555
+ <show_in_default>1</show_in_default>
556
+ <show_in_website>0</show_in_website>
557
+ <show_in_store>0</show_in_store>
558
+ </material>
559
+ <megapixels translate="label">
560
+ <label>megapixels</label>
561
+ <comment>Megapixels</comment>
562
+ <frontend_type>select</frontend_type>
563
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
564
+ <sort_order>39</sort_order>
565
+ <show_in_default>1</show_in_default>
566
+ <show_in_website>0</show_in_website>
567
+ <show_in_store>0</show_in_store>
568
+ </megapixels>
569
+ <memory_capacity translate="label">
570
+ <label>memory_capacity</label>
571
+ <comment>Memory capacity</comment>
572
+ <frontend_type>select</frontend_type>
573
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
574
+ <sort_order>40</sort_order>
575
+ <show_in_default>1</show_in_default>
576
+ <show_in_website>0</show_in_website>
577
+ <show_in_store>0</show_in_store>
578
+ </memory_capacity>
579
+ <memory_card_slot translate="label">
580
+ <label>memory_card_slot</label>
581
+ <comment>Memory card slot type</comment>
582
+ <frontend_type>select</frontend_type>
583
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
584
+ <sort_order>41</sort_order>
585
+ <show_in_default>1</show_in_default>
586
+ <show_in_website>0</show_in_website>
587
+ <show_in_store>0</show_in_store>
588
+ </memory_card_slot>
589
+ <memory_type translate="label">
590
+ <label>memory_type</label>
591
+ <comment>Memory type</comment>
592
+ <frontend_type>select</frontend_type>
593
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
594
+ <sort_order>42</sort_order>
595
+ <show_in_default>1</show_in_default>
596
+ <show_in_website>0</show_in_website>
597
+ <show_in_store>0</show_in_store>
598
+ </memory_type>
599
+ <model_number translate="label">
600
+ <label>model_number</label>
601
+ <comment>Model number</comment>
602
+ <frontend_type>select</frontend_type>
603
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
604
+ <sort_order>43</sort_order>
605
+ <show_in_default>1</show_in_default>
606
+ <show_in_website>0</show_in_website>
607
+ <show_in_store>0</show_in_store>
608
+ </model_number>
609
+ <mpn translate="label">
610
+ <label>mpn</label>
611
+ <comment>Manufacturer part number</comment>
612
+ <frontend_type>select</frontend_type>
613
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
614
+ <sort_order>44</sort_order>
615
+ <show_in_default>1</show_in_default>
616
+ <show_in_website>0</show_in_website>
617
+ <show_in_store>0</show_in_store>
618
+ </mpn>
619
+ <name translate="label">
620
+ <label>name</label>
621
+ <comment>Name or title (Required)</comment>
622
+ <frontend_type>select</frontend_type>
623
+ <validate>required-entry</validate>
624
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
625
+ <sort_order>45</sort_order>
626
+ <show_in_default>1</show_in_default>
627
+ <show_in_website>0</show_in_website>
628
+ <show_in_store>0</show_in_store>
629
+ </name>
630
+ <occasion translate="label">
631
+ <label>occasion</label>
632
+ <comment>Recommended usage occasion</comment>
633
+ <frontend_type>select</frontend_type>
634
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
635
+ <sort_order>46</sort_order>
636
+ <show_in_default>1</show_in_default>
637
+ <show_in_website>0</show_in_website>
638
+ <show_in_store>0</show_in_store>
639
+ </occasion>
640
+ <operating_system translate="label">
641
+ <label>operating_system</label>
642
+ <comment>Operating system</comment>
643
+ <frontend_type>select</frontend_type>
644
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
645
+ <sort_order>47</sort_order>
646
+ <show_in_default>1</show_in_default>
647
+ <show_in_website>0</show_in_website>
648
+ <show_in_store>0</show_in_store>
649
+ </operating_system>
650
+ <optical_drive translate="label">
651
+ <label>optical_drive</label>
652
+ <comment>Optical drive type</comment>
653
+ <frontend_type>select</frontend_type>
654
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
655
+ <sort_order>48</sort_order>
656
+ <show_in_default>1</show_in_default>
657
+ <show_in_website>0</show_in_website>
658
+ <show_in_store>0</show_in_store>
659
+ </optical_drive>
660
+ <pages translate="label">
661
+ <label>pages</label>
662
+ <comment>Number of pages</comment>
663
+ <frontend_type>select</frontend_type>
664
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
665
+ <sort_order>49</sort_order>
666
+ <show_in_default>1</show_in_default>
667
+ <show_in_website>0</show_in_website>
668
+ <show_in_store>0</show_in_store>
669
+ </pages>
670
+ <payment_accepted translate="label">
671
+ <label>payment_accepted</label>
672
+ <comment>Accepted payment methods</comment>
673
+ <frontend_type>select</frontend_type>
674
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
675
+ <sort_order>50</sort_order>
676
+ <show_in_default>1</show_in_default>
677
+ <show_in_website>0</show_in_website>
678
+ <show_in_store>0</show_in_store>
679
+ </payment_accepted>
680
+ <payment_notes translate="label">
681
+ <label>payment_notes</label>
682
+ <comment>Additional payment notes</comment>
683
+ <frontend_type>select</frontend_type>
684
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
685
+ <sort_order>51</sort_order>
686
+ <show_in_default>1</show_in_default>
687
+ <show_in_website>0</show_in_website>
688
+ <show_in_store>0</show_in_store>
689
+ </payment_notes>
690
+ <platform translate="label">
691
+ <label>platform</label>
692
+ <comment>Platform</comment>
693
+ <frontend_type>select</frontend_type>
694
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
695
+ <sort_order>52</sort_order>
696
+ <show_in_default>1</show_in_default>
697
+ <show_in_website>0</show_in_website>
698
+ <show_in_store>0</show_in_store>
699
+ </platform>
700
+ <price translate="label">
701
+ <label>price</label>
702
+ <comment>Selling price (Required)</comment>
703
+ <frontend_type>select</frontend_type>
704
+ <validate>required-entry</validate>
705
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
706
+ <sort_order>53</sort_order>
707
+ <show_in_default>1</show_in_default>
708
+ <show_in_website>0</show_in_website>
709
+ <show_in_store>0</show_in_store>
710
+ </price>
711
+ <price_retail translate="label">
712
+ <label>price_retail</label>
713
+ <comment>Manufacturer suggested retail price</comment>
714
+ <frontend_type>select</frontend_type>
715
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
716
+ <sort_order>54</sort_order>
717
+ <show_in_default>1</show_in_default>
718
+ <show_in_website>0</show_in_website>
719
+ <show_in_store>0</show_in_store>
720
+ </price_retail>
721
+ <price_sale translate="label">
722
+ <label>price_sale</label>
723
+ <comment>Discount price</comment>
724
+ <frontend_type>select</frontend_type>
725
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
726
+ <sort_order>55</sort_order>
727
+ <show_in_default>1</show_in_default>
728
+ <show_in_website>0</show_in_website>
729
+ <show_in_store>0</show_in_store>
730
+ </price_sale>
731
+ <price_shipping translate="label">
732
+ <label>price_shipping</label>
733
+ <comment>Shipping price</comment>
734
+ <frontend_type>select</frontend_type>
735
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
736
+ <sort_order>56</sort_order>
737
+ <show_in_default>1</show_in_default>
738
+ <show_in_website>0</show_in_website>
739
+ <show_in_store>0</show_in_store>
740
+ </price_shipping>
741
+ <processor translate="label">
742
+ <label>processor</label>
743
+ <comment>Processor type</comment>
744
+ <frontend_type>select</frontend_type>
745
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
746
+ <sort_order>57</sort_order>
747
+ <show_in_default>1</show_in_default>
748
+ <show_in_website>0</show_in_website>
749
+ <show_in_store>0</show_in_store>
750
+ </processor>
751
+ <publisher translate="label">
752
+ <label>publisher</label>
753
+ <comment>Publisher</comment>
754
+ <frontend_type>select</frontend_type>
755
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
756
+ <sort_order>58</sort_order>
757
+ <show_in_default>1</show_in_default>
758
+ <show_in_website>0</show_in_website>
759
+ <show_in_store>0</show_in_store>
760
+ </publisher>
761
+ <quantity_in_stock translate="label">
762
+ <label>quantity_in_stock</label>
763
+ <comment>Number of items in stock</comment>
764
+ <frontend_type>select</frontend_type>
765
+ <source_model>pepperjam_network/system_config_source_stockquantity</source_model>
766
+ <sort_order>59</sort_order>
767
+ <show_in_default>1</show_in_default>
768
+ <show_in_website>0</show_in_website>
769
+ <show_in_store>0</show_in_store>
770
+ </quantity_in_stock>
771
+ <rating translate="label">
772
+ <label>rating</label>
773
+ <comment>Rating</comment>
774
+ <frontend_type>select</frontend_type>
775
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
776
+ <sort_order>60</sort_order>
777
+ <show_in_default>1</show_in_default>
778
+ <show_in_website>0</show_in_website>
779
+ <show_in_store>0</show_in_store>
780
+ </rating>
781
+ <recommended_usage translate="label">
782
+ <label>recommended_usage</label>
783
+ <comment>Recommended usage</comment>
784
+ <frontend_type>select</frontend_type>
785
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
786
+ <sort_order>61</sort_order>
787
+ <show_in_default>1</show_in_default>
788
+ <show_in_website>0</show_in_website>
789
+ <show_in_store>0</show_in_store>
790
+ </recommended_usage>
791
+ <resolution translate="label">
792
+ <label>resolution</label>
793
+ <comment>Screen resolution</comment>
794
+ <frontend_type>select</frontend_type>
795
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
796
+ <sort_order>62</sort_order>
797
+ <show_in_default>1</show_in_default>
798
+ <show_in_website>0</show_in_website>
799
+ <show_in_store>0</show_in_store>
800
+ </resolution>
801
+ <screen_size translate="label">
802
+ <label>screen_size</label>
803
+ <comment>Screen size</comment>
804
+ <frontend_type>select</frontend_type>
805
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
806
+ <sort_order>63</sort_order>
807
+ <show_in_default>1</show_in_default>
808
+ <show_in_website>0</show_in_website>
809
+ <show_in_store>0</show_in_store>
810
+ </screen_size>
811
+ <shipping_method translate="label">
812
+ <label>shipping_method</label>
813
+ <comment>Shipping methods</comment>
814
+ <frontend_type>select</frontend_type>
815
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
816
+ <sort_order>64</sort_order>
817
+ <show_in_default>1</show_in_default>
818
+ <show_in_website>0</show_in_website>
819
+ <show_in_store>0</show_in_store>
820
+ </shipping_method>
821
+ <shoe_size translate="label">
822
+ <label>shoe_size</label>
823
+ <comment>Shoe size</comment>
824
+ <frontend_type>select</frontend_type>
825
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
826
+ <sort_order>65</sort_order>
827
+ <show_in_default>1</show_in_default>
828
+ <show_in_website>0</show_in_website>
829
+ <show_in_store>0</show_in_store>
830
+ </shoe_size>
831
+ <shoe_width translate="label">
832
+ <label>shoe_width</label>
833
+ <comment>Shoe width</comment>
834
+ <frontend_type>select</frontend_type>
835
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
836
+ <sort_order>66</sort_order>
837
+ <show_in_default>1</show_in_default>
838
+ <show_in_website>0</show_in_website>
839
+ <show_in_store>0</show_in_store>
840
+ </shoe_width>
841
+ <size translate="label">
842
+ <label>size</label>
843
+ <comment>Size</comment>
844
+ <frontend_type>select</frontend_type>
845
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
846
+ <sort_order>67</sort_order>
847
+ <show_in_default>1</show_in_default>
848
+ <show_in_website>0</show_in_website>
849
+ <show_in_store>0</show_in_store>
850
+ </size>
851
+ <sku translate="label">
852
+ <label>sku</label>
853
+ <comment>Stock keeping unit (Recommended)</comment>
854
+ <frontend_type>select</frontend_type>
855
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
856
+ <sort_order>68</sort_order>
857
+ <show_in_default>1</show_in_default>
858
+ <show_in_website>0</show_in_website>
859
+ <show_in_store>0</show_in_store>
860
+ </sku>
861
+ <staring translate="label">
862
+ <label>staring</label>
863
+ <comment>Staring actors</comment>
864
+ <frontend_type>select</frontend_type>
865
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
866
+ <sort_order>69</sort_order>
867
+ <show_in_default>1</show_in_default>
868
+ <show_in_website>0</show_in_website>
869
+ <show_in_store>0</show_in_store>
870
+ </staring>
871
+ <style translate="label">
872
+ <label>style</label>
873
+ <comment>Style</comment>
874
+ <frontend_type>select</frontend_type>
875
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
876
+ <sort_order>70</sort_order>
877
+ <show_in_default>1</show_in_default>
878
+ <show_in_website>0</show_in_website>
879
+ <show_in_store>0</show_in_store>
880
+ </style>
881
+ <tech_spec_url translate="label">
882
+ <label>tech_spec_url</label>
883
+ <comment>Technical specifications URL</comment>
884
+ <frontend_type>select</frontend_type>
885
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
886
+ <sort_order>71</sort_order>
887
+ <show_in_default>1</show_in_default>
888
+ <show_in_website>0</show_in_website>
889
+ <show_in_store>0</show_in_store>
890
+ </tech_spec_url>
891
+ <tracks translate="label">
892
+ <label>tracks</label>
893
+ <comment>Total number of tracks</comment>
894
+ <frontend_type>select</frontend_type>
895
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
896
+ <sort_order>72</sort_order>
897
+ <show_in_default>1</show_in_default>
898
+ <show_in_website>0</show_in_website>
899
+ <show_in_store>0</show_in_store>
900
+ </tracks>
901
+ <upc translate="label">
902
+ <label>upc</label>
903
+ <comment>Universal product code (Recommended)</comment>
904
+ <frontend_type>select</frontend_type>
905
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
906
+ <sort_order>73</sort_order>
907
+ <show_in_default>1</show_in_default>
908
+ <show_in_website>0</show_in_website>
909
+ <show_in_store>0</show_in_store>
910
+ </upc>
911
+ <weight translate="label">
912
+ <label>weight</label>
913
+ <comment>Weight</comment>
914
+ <frontend_type>select</frontend_type>
915
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
916
+ <sort_order>74</sort_order>
917
+ <show_in_default>1</show_in_default>
918
+ <show_in_website>0</show_in_website>
919
+ <show_in_store>0</show_in_store>
920
+ </weight>
921
+ <width translate="label">
922
+ <label>width</label>
923
+ <comment>Width</comment>
924
+ <frontend_type>select</frontend_type>
925
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
926
+ <sort_order>75</sort_order>
927
+ <show_in_default>1</show_in_default>
928
+ <show_in_website>0</show_in_website>
929
+ <show_in_store>0</show_in_store>
930
+ </width>
931
+ <wireless_interface translate="label">
932
+ <label>wireless_interface</label>
933
+ <comment>Wireless interface</comment>
934
+ <frontend_type>select</frontend_type>
935
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
936
+ <sort_order>76</sort_order>
937
+ <show_in_default>1</show_in_default>
938
+ <show_in_website>0</show_in_website>
939
+ <show_in_store>0</show_in_store>
940
+ </wireless_interface>
941
+ <year translate="label">
942
+ <label>year</label>
943
+ <comment>Year of manufacture - YYYY</comment>
944
+ <frontend_type>select</frontend_type>
945
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
946
+ <sort_order>77</sort_order>
947
+ <show_in_default>1</show_in_default>
948
+ <show_in_website>0</show_in_website>
949
+ <show_in_store>0</show_in_store>
950
+ </year>
951
+ <zoom translate="label">
952
+ <label>zoom</label>
953
+ <comment>Maximum zoom</comment>
954
+ <frontend_type>select</frontend_type>
955
+ <source_model>pepperjam_network/system_config_source_attributes</source_model>
956
+ <sort_order>78</sort_order>
957
+ <show_in_default>1</show_in_default>
958
+ <show_in_website>0</show_in_website>
959
+ <show_in_store>0</show_in_store>
960
+ </zoom>
961
+ </fields>
962
+ </pepperjam_network_product_attribute_map>
963
+ <uninstall translate="label comment">
964
+ <label>Uninstall Extension</label>
965
+ <comment>If you wish to uninstall this extension, please use this Uninstall button.</comment>
966
+ <sort_order>300</sort_order>
967
+ <show_in_default>1</show_in_default>
968
+ <show_in_website>0</show_in_website>
969
+ <show_in_store>0</show_in_store>
970
+ <fields>
971
+ <uninstall translate="label">
972
+ <label>Remove</label>
973
+ <frontend_type>button</frontend_type>
974
+ <frontend_model>pepperjam_network/adminhtml_system_config_form_button</frontend_model>
975
+ <sort_order>100</sort_order>
976
+ <show_in_default>1</show_in_default>
977
+ <show_in_website>0</show_in_website>
978
+ <show_in_store>0</show_in_store>
979
+ </uninstall>
980
+ </fields>
981
+ </uninstall>
982
+ </groups>
983
+ </pepperjam>
984
+ </sections>
985
+ </config>
app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/install-1.0.0.1.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- /** @var $installer Mage_Core_Model_Resource_Setup */
18
- $installer = $this;
19
-
20
- // Set the last run time of the corrected orders feed to the time when the
21
- // extension is installed. This should help to reduce the number of untracked
22
- // orders included in the initial run of the feed.
23
- $installer->setConfigData('pepperjam/pepperjam_network/feed/last_run_time', time());
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ /** @var $installer Mage_Core_Model_Resource_Setup */
18
+ $installer = $this;
19
+
20
+ // Set the last run time of the corrected orders feed to the time when the
21
+ // extension is installed. This should help to reduce the number of untracked
22
+ // orders included in the initial run of the feed.
23
+ $installer->setConfigData('pepperjam/pepperjam_network/feed/last_run_time', time());
app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-data-upgrade-1.2.1.0-1.2.2.0.php CHANGED
@@ -1,116 +1,116 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- $installer = $this;
18
- $installer->startSetup();
19
-
20
- $keys = array(
21
- '/active',
22
- '/program_id',
23
- '/order_type',
24
- '/transaction_type',
25
- '/export_path',
26
- '/conditional_pixel_enabled',
27
- '/source_key_name',
28
- '/order_correction_feed_enabled',
29
- '/product_feed_enabled',
30
- '_product_attribute_map/age_range',
31
- '_product_attribute_map/artist',
32
- '_product_attribute_map/aspect_ratio',
33
- '_product_attribute_map/author',
34
- '_product_attribute_map/battery_life',
35
- '_product_attribute_map/binding',
36
- '_product_attribute_map/buy_url',
37
- '_product_attribute_map/category_network',
38
- '_product_attribute_map/category_program',
39
- '_product_attribute_map/color',
40
- '_product_attribute_map/color_output',
41
- '_product_attribute_map/condition',
42
- '_product_attribute_map/description_long',
43
- '_product_attribute_map/description_short',
44
- '_product_attribute_map/director',
45
- '_product_attribute_map/discontinued',
46
- '_product_attribute_map/display_type',
47
- '_product_attribute_map/edition',
48
- '_product_attribute_map/expiration_date',
49
- '_product_attribute_map/features',
50
- '_product_attribute_map/focus_type',
51
- '_product_attribute_map/format',
52
- '_product_attribute_map/functions',
53
- '_product_attribute_map/genre',
54
- '_product_attribute_map/heel_height',
55
- '_product_attribute_map/height',
56
- '_product_attribute_map/image_thumb_url',
57
- '_product_attribute_map/image_url',
58
- '_product_attribute_map/installation',
59
- '_product_attribute_map/in_stock',
60
- '_product_attribute_map/isbn',
61
- '_product_attribute_map/keywords',
62
- '_product_attribute_map/length',
63
- '_product_attribute_map/load_type',
64
- '_product_attribute_map/location',
65
- '_product_attribute_map/made_in',
66
- '_product_attribute_map/manufacturer',
67
- '_product_attribute_map/material',
68
- '_product_attribute_map/megapixels',
69
- '_product_attribute_map/memory_capacity',
70
- '_product_attribute_map/memory_card_slot',
71
- '_product_attribute_map/memory_type',
72
- '_product_attribute_map/model_number',
73
- '_product_attribute_map/mpn',
74
- '_product_attribute_map/name',
75
- '_product_attribute_map/occasion',
76
- '_product_attribute_map/operating_system',
77
- '_product_attribute_map/optical_drive',
78
- '_product_attribute_map/pages',
79
- '_product_attribute_map/payment_accepted',
80
- '_product_attribute_map/payment_notes',
81
- '_product_attribute_map/platform',
82
- '_product_attribute_map/price',
83
- '_product_attribute_map/price_retail',
84
- '_product_attribute_map/price_sale',
85
- '_product_attribute_map/price_shipping',
86
- '_product_attribute_map/processor',
87
- '_product_attribute_map/publisher',
88
- '_product_attribute_map/quantity_in_stock',
89
- '_product_attribute_map/rating',
90
- '_product_attribute_map/recommended_usage',
91
- '_product_attribute_map/resolution',
92
- '_product_attribute_map/screen_size',
93
- '_product_attribute_map/shipping_method',
94
- '_product_attribute_map/shoe_size',
95
- '_product_attribute_map/shoe_width',
96
- '_product_attribute_map/size',
97
- '_product_attribute_map/sku',
98
- '_product_attribute_map/staring',
99
- '_product_attribute_map/style',
100
- '_product_attribute_map/tech_spec_url',
101
- '_product_attribute_map/tracks',
102
- '_product_attribute_map/upc',
103
- '_product_attribute_map/weight',
104
- '_product_attribute_map/width',
105
- '_product_attribute_map/wireless_interface',
106
- '_product_attribute_map/year',
107
- '_product_attribute_map/zoom',
108
- );
109
-
110
- foreach($keys AS $key) {
111
- if (!is_null(Mage::getStoreConfig('marketing_solutions/eems_affiliate' . $key))) {
112
- $installer->setConfigData('pepperjam/pepperjam_network' . $key, Mage::getStoreConfig('marketing_solutions/eems_affiliate' . $key));
113
- }
114
- }
115
-
116
- $installer->endSetup();
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ $installer = $this;
18
+ $installer->startSetup();
19
+
20
+ $keys = array(
21
+ '/active',
22
+ '/program_id',
23
+ '/order_type',
24
+ '/transaction_type',
25
+ '/export_path',
26
+ '/conditional_pixel_enabled',
27
+ '/source_key_name',
28
+ '/order_correction_feed_enabled',
29
+ '/product_feed_enabled',
30
+ '_product_attribute_map/age_range',
31
+ '_product_attribute_map/artist',
32
+ '_product_attribute_map/aspect_ratio',
33
+ '_product_attribute_map/author',
34
+ '_product_attribute_map/battery_life',
35
+ '_product_attribute_map/binding',
36
+ '_product_attribute_map/buy_url',
37
+ '_product_attribute_map/category_network',
38
+ '_product_attribute_map/category_program',
39
+ '_product_attribute_map/color',
40
+ '_product_attribute_map/color_output',
41
+ '_product_attribute_map/condition',
42
+ '_product_attribute_map/description_long',
43
+ '_product_attribute_map/description_short',
44
+ '_product_attribute_map/director',
45
+ '_product_attribute_map/discontinued',
46
+ '_product_attribute_map/display_type',
47
+ '_product_attribute_map/edition',
48
+ '_product_attribute_map/expiration_date',
49
+ '_product_attribute_map/features',
50
+ '_product_attribute_map/focus_type',
51
+ '_product_attribute_map/format',
52
+ '_product_attribute_map/functions',
53
+ '_product_attribute_map/genre',
54
+ '_product_attribute_map/heel_height',
55
+ '_product_attribute_map/height',
56
+ '_product_attribute_map/image_thumb_url',
57
+ '_product_attribute_map/image_url',
58
+ '_product_attribute_map/installation',
59
+ '_product_attribute_map/in_stock',
60
+ '_product_attribute_map/isbn',
61
+ '_product_attribute_map/keywords',
62
+ '_product_attribute_map/length',
63
+ '_product_attribute_map/load_type',
64
+ '_product_attribute_map/location',
65
+ '_product_attribute_map/made_in',
66
+ '_product_attribute_map/manufacturer',
67
+ '_product_attribute_map/material',
68
+ '_product_attribute_map/megapixels',
69
+ '_product_attribute_map/memory_capacity',
70
+ '_product_attribute_map/memory_card_slot',
71
+ '_product_attribute_map/memory_type',
72
+ '_product_attribute_map/model_number',
73
+ '_product_attribute_map/mpn',
74
+ '_product_attribute_map/name',
75
+ '_product_attribute_map/occasion',
76
+ '_product_attribute_map/operating_system',
77
+ '_product_attribute_map/optical_drive',
78
+ '_product_attribute_map/pages',
79
+ '_product_attribute_map/payment_accepted',
80
+ '_product_attribute_map/payment_notes',
81
+ '_product_attribute_map/platform',
82
+ '_product_attribute_map/price',
83
+ '_product_attribute_map/price_retail',
84
+ '_product_attribute_map/price_sale',
85
+ '_product_attribute_map/price_shipping',
86
+ '_product_attribute_map/processor',
87
+ '_product_attribute_map/publisher',
88
+ '_product_attribute_map/quantity_in_stock',
89
+ '_product_attribute_map/rating',
90
+ '_product_attribute_map/recommended_usage',
91
+ '_product_attribute_map/resolution',
92
+ '_product_attribute_map/screen_size',
93
+ '_product_attribute_map/shipping_method',
94
+ '_product_attribute_map/shoe_size',
95
+ '_product_attribute_map/shoe_width',
96
+ '_product_attribute_map/size',
97
+ '_product_attribute_map/sku',
98
+ '_product_attribute_map/staring',
99
+ '_product_attribute_map/style',
100
+ '_product_attribute_map/tech_spec_url',
101
+ '_product_attribute_map/tracks',
102
+ '_product_attribute_map/upc',
103
+ '_product_attribute_map/weight',
104
+ '_product_attribute_map/width',
105
+ '_product_attribute_map/wireless_interface',
106
+ '_product_attribute_map/year',
107
+ '_product_attribute_map/zoom',
108
+ );
109
+
110
+ foreach($keys AS $key) {
111
+ if (!is_null(Mage::getStoreConfig('marketing_solutions/eems_affiliate' . $key))) {
112
+ $installer->setConfigData('pepperjam/pepperjam_network' . $key, Mage::getStoreConfig('marketing_solutions/eems_affiliate' . $key));
113
+ }
114
+ }
115
+
116
+ $installer->endSetup();
app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-data-upgrade-1.2.2.0-1.3.0.0.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ $installer = $this;
18
+ $installer->startSetup();
19
+
20
+ $installer->setConfigData('pepperjam/pepperjam_network/order_correction_feed/last_run_time', Mage::getStoreConfig('pepperjam/pepperjam_network/feed/last_run_time'));
21
+
22
+ $installer->setConfigData('pepperjam/pepperjam_network/order_feed/last_run_time', time());
23
+ $installer->setConfigData('pepperjam/pepperjam_network/order_correction_feed/last_run_time', Mage::getStoreConfig('pepperjam/pepperjam_network/feed/last_run_time'));
24
+ $installer->deleteConfigData('pepperjam/pepperjam_network/feed/last_run_time');
25
+
26
+ $installer->endSetup();
app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-install-1.0.0.1.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- /** @var $installer Mage_Core_Model_Resource_Setup */
18
- $installer = $this;
19
-
20
- // Set the last run time of the corrected orders feed to the time when the
21
- // extension is installed. This should help to reduce the number of untracked
22
- // orders included in the initial run of the feed.
23
- $installer->setConfigData('pepperjam/pepperjam_network/feed/last_run_time', time());
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ /** @var $installer Mage_Core_Model_Resource_Setup */
18
+ $installer = $this;
19
+
20
+ // Set the last run time of the corrected orders feed to the time when the
21
+ // extension is installed. This should help to reduce the number of untracked
22
+ // orders included in the initial run of the feed.
23
+ $installer->setConfigData('pepperjam/pepperjam_network/feed/last_run_time', time());
app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-upgrade-1.0.0.1-1.2.0.0.php CHANGED
@@ -1,52 +1,52 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
-
17
- $installer = $this;
18
-
19
- $installer->startSetup();
20
-
21
- // Below based on http://stackoverflow.com/questions/9599262/magento-add-new-attribute-to-all-products
22
- // Incremented version to get this to run for existing users.
23
- $attrCode = 'commissioning_category';
24
-
25
- $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup');
26
- $attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $attrCode);
27
-
28
- if ($attrIdTest === false) {
29
- $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCode, array(
30
- 'group' => 'General',
31
- 'type' => 'int',
32
- 'backend' => '',
33
- 'frontend' => '',
34
- 'label' => 'Commissioning Category',
35
- 'note' => 'Category that will be used for Pepperjam Network sales. If not set, one of the categories assigned to this product will be chosen.',
36
- 'input' => 'select',
37
- 'class' => '',
38
- 'source' => 'pepperjam_network/product_attribute_source_commissioningCategory',
39
- 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
40
- 'visible' => true,
41
- 'required' => false,
42
- 'user_defined' => false,
43
- 'default' => null,
44
- 'visible_on_front' => false,
45
- 'unique' => false,
46
- 'is_configurable' => false,
47
- 'used_for_promo_rules' => false,
48
- 'apply_to' => 'simple,configurable,bundle,grouped',
49
- ));
50
- }
51
-
52
- $installer->endSetup();
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ $installer = $this;
18
+
19
+ $installer->startSetup();
20
+
21
+ // Below based on http://stackoverflow.com/questions/9599262/magento-add-new-attribute-to-all-products
22
+ // Incremented version to get this to run for existing users.
23
+ $attrCode = 'commissioning_category';
24
+
25
+ $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup');
26
+ $attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $attrCode);
27
+
28
+ if ($attrIdTest === false) {
29
+ $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCode, array(
30
+ 'group' => 'General',
31
+ 'type' => 'int',
32
+ 'backend' => '',
33
+ 'frontend' => '',
34
+ 'label' => 'Commissioning Category',
35
+ 'note' => 'Category that will be used for Pepperjam Network sales. If not set, one of the categories assigned to this product will be chosen.',
36
+ 'input' => 'select',
37
+ 'class' => '',
38
+ 'source' => 'pepperjam_network/product_attribute_source_commissioningCategory',
39
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
40
+ 'visible' => true,
41
+ 'required' => false,
42
+ 'user_defined' => false,
43
+ 'default' => null,
44
+ 'visible_on_front' => false,
45
+ 'unique' => false,
46
+ 'is_configurable' => false,
47
+ 'used_for_promo_rules' => false,
48
+ 'apply_to' => 'simple,configurable,bundle,grouped',
49
+ ));
50
+ }
51
+
52
+ $installer->endSetup();
app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-upgrade-1.2.99.99-1.3.0.0.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+
17
+ $installer = $this;
18
+ $installer->startSetup();
19
+
20
+ $orderTable = $installer->getTable('sales/order');
21
+
22
+ $installer->getConnection()
23
+ ->addColumn($orderTable, 'network_source', array(
24
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
25
+ 'length' => 20,
26
+ 'nullable' => TRUE,
27
+ 'unsigned' => TRUE,
28
+ 'comment' => "Pepperjam Network Source"
29
+ ));
30
+
31
+ $installer->getConnection()
32
+ ->addColumn($orderTable, 'network_click_id', array(
33
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
34
+ 'nullable' => TRUE,
35
+ 'unsigned' => TRUE,
36
+ 'comment' => "Pepperjam Network Click ID"
37
+ ));
38
+
39
+ $installer->getConnection()
40
+ ->addColumn($orderTable, 'network_publisher_id', array(
41
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
42
+ 'nullable' => TRUE,
43
+ 'unsigned' => TRUE,
44
+ 'comment' => "Pepperjam Network Publisher ID"
45
+ ));
46
+
47
+ $installer->endSetup();
app/design/adminhtml/default/default/template/pepperjam_network/system/config/button.phtml CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- *
16
- */
17
- ?>
18
-
19
- <script type="text/javascript">
20
- function uninstall() {
21
- if (confirm('Remove Pepperjam Network extension?')) {
22
- new Ajax.Request('<?php echo $this->getAjaxUninstallUrl(); ?>', {
23
- method: 'get',
24
- onSuccess: function(response) {
25
- document.location.reload(true);
26
- }
27
- });
28
- }
29
- }
30
- </script>
31
-
32
- <?php echo $this->getButtonHtml(); ?>
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ *
16
+ */
17
+ ?>
18
+
19
+ <script type="text/javascript">
20
+ function uninstall() {
21
+ if (confirm('Remove Pepperjam Network extension?')) {
22
+ new Ajax.Request('<?php echo $this->getAjaxUninstallUrl(); ?>', {
23
+ method: 'get',
24
+ onSuccess: function(response) {
25
+ document.location.reload(true);
26
+ }
27
+ });
28
+ }
29
+ }
30
+ </script>
31
+
32
+ <?php echo $this->getButtonHtml(); ?>
app/design/frontend/base/default/layout/pepperjam_network.xml CHANGED
@@ -1,35 +1,35 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- Copyright (c) 2016 Pepperjam Network.
4
-
5
- NOTICE OF LICENSE
6
-
7
- This source file is subject to the Pepperjam Network
8
- Magento Extensions End User License Agreement
9
- that is bundled with this package in the file LICENSE.md.
10
- It is also available through the world-wide-web at this URL:
11
- http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
-
13
- @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- -->
16
- <layout version="0.1.0">
17
- <default>
18
- <reference name="head">
19
- <block type="pepperjam_network/tracking" name="pepperjam_network.tracking" template="pepperjam_network/tracking.phtml"/>
20
- </reference>
21
- </default>
22
- <checkout_affiliate_success translate="label">
23
- <reference name="before_body_end">
24
- <block type="pepperjam_network/beacon" name="pepperjam_network.beacon" template="pepperjam_network/beacon.phtml"/>
25
- </reference>
26
- </checkout_affiliate_success>
27
- <checkout_multishipping_success translate="label">
28
- <label>Multishipping Checkout Success</label>
29
- <update handle="checkout_affiliate_success"/>
30
- </checkout_multishipping_success>
31
- <checkout_onepage_success translate="label">
32
- <label>Onepage Checkout Success</label>
33
- <update handle="checkout_affiliate_success"/>
34
- </checkout_onepage_success>
35
- </layout>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Copyright (c) 2016 Pepperjam Network.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the Pepperjam Network
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+
13
+ @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ -->
16
+ <layout version="0.1.0">
17
+ <default>
18
+ <reference name="head">
19
+ <block type="pepperjam_network/tracking" name="pepperjam_network.tracking" template="pepperjam_network/tracking.phtml"/>
20
+ </reference>
21
+ </default>
22
+ <checkout_affiliate_success translate="label">
23
+ <reference name="before_body_end">
24
+ <block type="pepperjam_network/beacon" name="pepperjam_network.beacon" template="pepperjam_network/beacon.phtml"/>
25
+ </reference>
26
+ </checkout_affiliate_success>
27
+ <checkout_multishipping_success translate="label">
28
+ <label>Multishipping Checkout Success</label>
29
+ <update handle="checkout_affiliate_success"/>
30
+ </checkout_multishipping_success>
31
+ <checkout_onepage_success translate="label">
32
+ <label>Onepage Checkout Success</label>
33
+ <update handle="checkout_affiliate_success"/>
34
+ </checkout_onepage_success>
35
+ </layout>
app/design/frontend/base/default/template/pepperjam_network/beacon.phtml CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
- ?>
17
-
18
- <?php if ($this->showBeacon()) :
19
- ?>
20
- <?php $beaconUrl = $this->getBeaconUrl(); ?>
21
- <script>
22
- (function (d,i) {
23
- i=d.createElement('iframe');
24
- i.width=i.height=1;
25
- i.frameBorder=0;
26
- i.src="<?php echo $beaconUrl; ?>";
27
- d.body.appendChild(i);
28
- }(document));
29
- </script>
30
- <noscript>
31
- <iframe width="1" height="1" frameBorder="0" src="<?php echo $beaconUrl; ?>"></iframe>
32
- </noscript>
33
- <?php
34
- endif;
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+ ?>
17
+
18
+ <?php if ($this->showBeacon()) :
19
+ ?>
20
+ <?php $beaconUrl = $this->getBeaconUrl(); ?>
21
+ <script>
22
+ (function (d,i) {
23
+ i=d.createElement('iframe');
24
+ i.width=i.height=1;
25
+ i.frameBorder=0;
26
+ i.src="<?php echo $beaconUrl; ?>";
27
+ d.body.appendChild(i);
28
+ }(document));
29
+ </script>
30
+ <noscript>
31
+ <iframe width="1" height="1" frameBorder="0" src="<?php echo $beaconUrl; ?>"></iframe>
32
+ </noscript>
33
+ <?php
34
+ endif;
app/design/frontend/base/default/template/pepperjam_network/tracking.phtml CHANGED
@@ -1,98 +1,104 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2016 Pepperjam Network.
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Pepperjam Network
8
- * Magento Extensions End User License Agreement
9
- * that is bundled with this package in the file LICENSE.md.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
- *
13
- * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- */
16
- ?>
17
-
18
- <?php if ($this->injectJavaScript()) :
19
- ?>
20
- <?php $keyName = $this->getQueryStringKeyName(); ?>
21
- <?php $cookieName = $this->getCookieName(); ?>
22
- <script type="text/javascript">
23
- //<![CDATA[
24
- (function (window, document, duration_in_days, key_name, cookie_name) {
25
- var milliseconds_in_days = 1000 * 60 * 60 * 24;
26
- var query = location.search.substring(1);
27
- var source = findAffiliateField(query, key_name);
28
- var cookie = getCookie(cookie_name);
29
-
30
- if (source) {
31
- // set or update the cookie with the value from the current query string
32
- setCookie(cookie_name, source, duration_in_days);
33
- }
34
-
35
- /**
36
- * @param cname name of the cookie
37
- * @param cvalue value assigned to cookie
38
- * @param exdays duration of the cookie in days
39
- */
40
- function setCookie(cname, cvalue, exdays)
41
- {
42
- var d = new Date();
43
- d.setTime(d.getTime() + (exdays * milliseconds_in_days));
44
- var expires = "expires="+d.toUTCString();
45
- document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
46
- }
47
-
48
- /**
49
- * @param cname name of the cookie
50
- * @returns object | null object with the field and value or null if not found
51
- */
52
- function getCookie(cname)
53
- {
54
- var cookies = document.cookie.split(';');
55
- for (var i = 0; i < cookies.length; i++) {
56
- var keyPair = cookies[i].split('=');
57
- if (keyPair.length < 2)
58
- continue;
59
- var field = keyPair[0].trim();
60
- var value = keyPair[1].trim();
61
-
62
- if (field === cname) {
63
- return {field: value};
64
- }
65
- }
66
-
67
- return null;
68
- }
69
-
70
- /**
71
- * @param query query string minus the '?'
72
- * @param field query string field to search for
73
- * @returns string | null value of the query string field or null if the field isn't there
74
- */
75
- function findAffiliateField(query, field)
76
- {
77
- if (!query) {
78
- return null;
79
- }
80
-
81
- var fields = query.split("&");
82
- for (var i = 0; i < fields.length; i++) {
83
- var keyPair = fields[i].split("=");
84
- if (
85
- keyPair.length == 2 &&
86
- keyPair[0] === field
87
- ) {
88
- return keyPair[1];
89
- }
90
- }
91
-
92
- return null;
93
- }
94
- }(window, document, 365, "<?php echo $keyName ?>", "<?php echo $cookieName ?>"));
95
- //]]>
96
- </script>
97
- <?php
98
- endif;
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016 Pepperjam Network.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Pepperjam Network
8
+ * Magento Extensions End User License Agreement
9
+ * that is bundled with this package in the file LICENSE.md.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+ *
13
+ * @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ * @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ */
16
+ ?>
17
+
18
+ <?php if ($this->injectJavaScript()) :
19
+ ?>
20
+ <script type="text/javascript">
21
+ //<![CDATA[
22
+ var AN = AN || {};
23
+
24
+ /**
25
+ * @param cname name of the cookie
26
+ * @param cvalue value assigned to cookie
27
+ * @param exdays duration of the cookie in days
28
+ */
29
+ AN.setCookie = function(cname, cvalue, exdays)
30
+ {
31
+ console.log(cname);
32
+
33
+ var milliseconds_in_days = 1000 * 60 * 60 * 24;
34
+ var d = new Date();
35
+ d.setTime(d.getTime() + (exdays * milliseconds_in_days));
36
+ var expires = "expires="+d.toUTCString();
37
+ document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
38
+ }
39
+
40
+ /**
41
+ * @param cname name of the cookie
42
+ * @returns object | null object with the field and value or null if not found
43
+ */
44
+ AN.getCookie = function(cname)
45
+ {
46
+ var cookies = document.cookie.split(';');
47
+ for (var i = 0; i < cookies.length; i++) {
48
+ var keyPair = cookies[i].split('=');
49
+ if (keyPair.length < 2)
50
+ continue;
51
+ var field = keyPair[0].trim();
52
+ var value = keyPair[1].trim();
53
+
54
+ if (field === cname) {
55
+ return {field: value};
56
+ }
57
+ }
58
+
59
+ return null;
60
+ }
61
+
62
+ /**
63
+ * @param query query string minus the '?'
64
+ * @param field query string field to search for
65
+ * @returns string | null value of the query string field or null if the field isn't there
66
+ */
67
+ AN.findAffiliateField = function(query, field)
68
+ {
69
+ if (!query) {
70
+ return null;
71
+ }
72
+
73
+ var fields = query.split("&");
74
+ for (var i = 0; i < fields.length; i++) {
75
+ var keyPair = fields[i].split("=");
76
+ if (
77
+ keyPair.length == 2 &&
78
+ keyPair[0] === field
79
+ ) {
80
+ return keyPair[1];
81
+ }
82
+ }
83
+
84
+ return null;
85
+ }
86
+
87
+ AN.manageCookie = function (window, document, duration_in_days, key_name, cookie_name) {
88
+ var query = location.search.substring(1);
89
+ var source = AN.findAffiliateField(query, key_name);
90
+ var cookie = AN.getCookie(cookie_name);
91
+
92
+ if (source) {
93
+ // set or update the cookie with the value from the current query string
94
+ AN.setCookie(cookie_name, source, duration_in_days);
95
+ }
96
+ }
97
+
98
+ AN.manageCookie(window, document, 365, "<?php echo $this->getSourceKeyName(); ?>", "<?php echo $this->getSourceCookieName(); ?>");
99
+ AN.manageCookie(window, document, 365, "<?php echo $this->getClickKeyName(); ?>", "<?php echo $this->getClickCookieName(); ?>");
100
+ AN.manageCookie(window, document, 365, "<?php echo $this->getPublisherKeyName(); ?>", "<?php echo $this->getPublisherCookieName(); ?>");
101
+ //]]>
102
+ </script>
103
+ <?php
104
+ endif;
app/etc/modules/Pepperjam_Network.xml CHANGED
@@ -1,23 +1,23 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- Copyright (c) 2016 Pepperjam Network.
4
-
5
- NOTICE OF LICENSE
6
-
7
- This source file is subject to the Pepperjam Network
8
- Magento Extensions End User License Agreement
9
- that is bundled with this package in the file LICENSE.md.
10
- It is also available through the world-wide-web at this URL:
11
- http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
-
13
- @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
- @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
- -->
16
- <config>
17
- <modules>
18
- <Pepperjam_Network>
19
- <active>true</active>
20
- <codePool>community</codePool>
21
- </Pepperjam_Network>
22
- </modules>
23
- </config>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Copyright (c) 2016 Pepperjam Network.
4
+
5
+ NOTICE OF LICENSE
6
+
7
+ This source file is subject to the Pepperjam Network
8
+ Magento Extensions End User License Agreement
9
+ that is bundled with this package in the file LICENSE.md.
10
+ It is also available through the world-wide-web at this URL:
11
+ http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf
12
+
13
+ @copyright Copyright (c) 2016 Pepperjam Network. (http://www.pepperjam.com/)
14
+ @license http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf Pepperjam Network Magento Extensions End User License Agreement
15
+ -->
16
+ <config>
17
+ <modules>
18
+ <Pepperjam_Network>
19
+ <active>true</active>
20
+ <codePool>community</codePool>
21
+ </Pepperjam_Network>
22
+ </modules>
23
+ </config>
package.xml CHANGED
@@ -1,20 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Pepperjam_Network</name>
4
- <version>1.2.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf">EULA</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Please use the uninstall button in the Pepperjam Network extension configuration settings. Using this uninstall method may cause issues after the extension is removed.</summary>
10
- <description>Please use the uninstall button in the Pepperjam Network extension configuration settings. Using this uninstall method may cause issues after the extension is removed.</description>
11
- <notes>1.2.2.0 Release Notes&#xD;
12
- - Rebranded to Pepperjam&#xD;
13
- - Script to import settings from EEAN if previousy installed</notes>
14
- <authors><author><name>Philip Preston</name><user>phpreston</user><email>phpreston@pepperjam.com</email></author></authors>
15
- <date>2016-05-13</date>
16
- <time>19:16:41</time>
17
- <contents><target name="mageetc"><dir name="modules"><file name="Pepperjam_Network.xml" hash="2e244fcab1dfd68c3608ac99466afa45"/></dir></target><target name="magecommunity"><dir name="Pepperjam"><dir name="Network"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="62a8ced73b44227f0969b413da4a5479"/></dir></dir></dir></dir><file name="Beacon.php" hash="0598e6e29470ffbf12dd4eff679b3428"/><file name="Tracking.php" hash="c582994ca5d25e01cec334609778ea7f"/></dir><dir name="Exception"><file name="Configuration.php" hash="4acce0de87eb9511b70882dc36b910b0"/></dir><dir name="Helper"><file name="Config.php" hash="7c28cc84f63c1652151cc0b6306b5ede"/><file name="Data.php" hash="ad1f8f72d835c039d4beccd6898e2a52"/><dir name="Map"><file name="Order.php" hash="8476e23d9212db98f38882d9dcb860ff"/><file name="Product.php" hash="8d44dd14f075b00a4670d2f20b591083"/></dir><file name="Map.php" hash="1311081a821550fa5356ae5ca37b0616"/></dir><dir name="Model"><dir name="Feed"><file name="Abstract.php" hash="f4c78960ffdd8959e885da1f586bfe13"/><dir name="Order"><file name="Abstract.php" hash="1f8782f923fba52a393916dd3071627c"/><file name="Basic.php" hash="5d1098c409547b9de75abea345cbd467"/><file name="Dynamic.php" hash="cdfa9f6e348f81bb6faf0e5f5cb4b473"/><file name="Itemized.php" hash="011eeaa826effee23f6e95e2a32e6ab0"/></dir><file name="Product.php" hash="44f252d462377f83d1d4ea117e13ba55"/></dir><file name="Observer.php" hash="274af4bb13a3f1523e8eef2b4b60e57d"/><dir name="Product"><dir name="Attribute"><dir name="Source"><file name="CommissioningCategory.php" hash="6c60e52679059aa29d7858ad495439e5"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attributes.php" hash="ef110a6e3ee71061ca1f6aa783201fbc"/><file name="Categories.php" hash="63935f863843ef830ca02c6efd31952f"/><file name="Ordertypes.php" hash="4f5c1e82f2bf7321b42f0da012040d6c"/><file name="Stockquantity.php" hash="bf8cc768ce1048ac946a811a5cedb4d4"/><file name="Stockyesno.php" hash="fcdbc994b3d583438a82e0fd299c83c0"/><file name="Transactiontype.php" hash="99df552cec7b5ac507127f1fdfe0eb66"/><file name="Visibilityyesno.php" hash="33fe96157b8e16e9dad76e0723d28f4e"/></dir></dir></dir></dir><dir name="Test"><dir name="Block"><file name="BeaconTest.php" hash="c49a47863eea22c1fc51ec0a6c195f03"/><dir name="providers"><file name="testShowBeacon.yaml" hash="5b7a80f1de1e4196a9e56f9a71cb51a2"/></dir></dir><dir name="Helper"><file name="DataTest.php" hash="851ed7302307f3083da4575e0cab158d"/><dir name="Map"><file name="ProductTest.php" hash="d46af485f05941e1f1f3eaca7a92fcfb"/></dir><dir name="providers"><file name="testIsValidCookie.yaml" hash="9dcf790f218df67a0c0061b64f8f6681"/></dir></dir><dir name="Model"><dir name="Feed"><file name="AbstractTest.php" hash="a32212b26488428cd6872667a51f7874"/><dir name="Order"><file name="AbstractTest.php" hash="f05242aba5df726445ea961a88142da3"/><file name="BasicTest.php" hash="3888bf11e5d36c79eb9bbda88a9a0c55"/><file name="ItemizedTest.php" hash="92c3536e32cac2b3e211fc241cb8e561"/></dir><file name="ProductTest.php" hash="a6342bb41e18d1c2b0fdea2ea06aec4a"/></dir><file name="ObserverTest.php" hash="c3f8efcf74e7fdf8e4672ab268519597"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="PepperjamNetworkController.php" hash="866f5a497fd8c3759c089fd2bed8653f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="bc20d11a73b42248c401a60857209f80"/><file name="config.xml" hash="bb9b6822ea0c284b1c63f3c16972e7b8"/><file name="system.xml" hash="df66d8fa946254cea981beecf04fdb10"/></dir><dir name="sql"><dir name="pepperjam_network_setup"><file name="install-1.0.0.1.php" hash="2a7f910120a6ffbaeee4e198318dfaa4"/><file name="mysql4-data-upgrade-1.2.1.0-1.2.2.0.php" hash="65d3899c574c73283102e6cb45ba4219"/><file name="mysql4-install-1.0.0.1.php" hash="2a7f910120a6ffbaeee4e198318dfaa4"/><file name="mysql4-upgrade-1.0.0.1-1.2.0.0.php" hash="042b67f05a37caf869c7565bb3403415"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="pepperjam_network"><dir name="system"><dir name="config"><file name="button.phtml" hash="38f9b840f0f6439b00d7b1bffc9f2238"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pepperjam_network.xml" hash="5a6ccf1fb9072b75ca7a76eb8483cc62"/></dir><dir name="template"><dir name="pepperjam_network"><file name="beacon.phtml" hash="a8526f5b5db78f9efbd67f9b039a1660"/><file name="tracking.phtml" hash="03410bc905590ba80f17466cd9ce5fcb"/></dir></dir></dir></dir></dir></target></contents>
 
 
18
  <compatible/>
19
- <dependencies><required><php><min>5.2.0</min><max>5.99.99</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Pepperjam_Network</name>
4
+ <version>1.3.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://assets.pepperjam.com/legal/magento-connect-extension-eula.pdf">EULA</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Please use the uninstall button in the Pepperjam Network extension configuration settings. Using this uninstall method may cause issues after the extension is removed.</summary>
10
+ <description>Please use the uninstall button in the Pepperjam Network extension configuration settings. Using this uninstall method may cause issues after the extension is removed.</description>
11
+ <notes>Changelog for 1.3.0.0&#xD;
12
+ Added attribution&#xD;
13
+ New option to report orders via feed instead of pixel&#xD;
14
+ No longer including orders in correction feed if they were not part of a network transaction&#xD;
15
+ Fixed "divide by zero" issue</notes>
16
+ <authors><author><name>Philip Preston</name><user>ppreston</user><email>ppreston@corp.pepperjam.com</email></author></authors>
17
+ <date>2017-02-17</date>
18
+ <time>16:36:54</time>
19
+ <contents><target name="mageetc"><dir name="modules"><file name="Pepperjam_Network.xml" hash="d293e24c998ef81d8daf58b0f547a45c"/></dir></target><target name="magecommunity"><dir name="Pepperjam"><dir name="Network"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="590d3760d4f9de597624879e39134a44"/></dir></dir></dir></dir><file name="Beacon.php" hash="279d4ab5cfafa329ef257a19231642c3"/><file name="Tracking.php" hash="2c9bb4839704745e1a02a8b02f13d4b1"/></dir><dir name="Exception"><file name="Configuration.php" hash="78d9d2be394b4dfae56f0e7c5eb5acdf"/></dir><dir name="Helper"><file name="Config.php" hash="23c4d37b1b1cb2ba7882bfe4fd8d6bc1"/><file name="Data.php" hash="b139c69789651d0643e7be20dfcf6fcc"/><dir name="Map"><file name="Order.php" hash="79c9da2232abf8999d75e39665207f98"/><file name="Product.php" hash="224e5b4562e9b78654fc4551f09af6a6"/></dir><file name="Map.php" hash="ecd1c2d9fe2fbcca410f19a7e29d9900"/></dir><dir name="Model"><dir name="Feed"><file name="Abstract.php" hash="0fed99b49316e68f51efdad505ba6c9c"/><dir name="Order"><file name="Abstract.php" hash="681a55f620b609d5c90dad0daec87d24"/><file name="Basic.php" hash="bb4fcd1bb581c9c36c1c69545f58123b"/><file name="Dynamic.php" hash="1f9fb44a3746e4240a5f1e15ee3b2d35"/><file name="Itemized.php" hash="4bd9d352d94dbcc951b3f1aaf18f9267"/></dir><file name="Product.php" hash="d56c526f6b58b92d84c7452a5e0a52db"/></dir><file name="Observer.php" hash="21cc57e25cc6f9510580f6d8bb720f49"/><dir name="Product"><dir name="Attribute"><dir name="Source"><file name="CommissioningCategory.php" hash="bf0ced5bdc96becfb998e2f090f0ef56"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attributes.php" hash="a7371a8d7eedabbfbc3899f44f7d4f40"/><file name="Categories.php" hash="5876e17c9c73a58a4d50672f626187c5"/><file name="Ordertypes.php" hash="d26a48ce19804ce26984539fc4852b43"/><file name="Stockquantity.php" hash="b5788bf323b0ecd3c87d40f2c5ac2d6e"/><file name="Stockyesno.php" hash="e32252148723d5afd2acd575dbad807f"/><file name="Trackingmethods.php" hash="b7364ea53b3362853764108c428871e7"/><file name="Transactiontype.php" hash="bd9ca045f793a25eb7be5690fd4f4704"/><file name="Visibilityyesno.php" hash="2c3c2e3801f2aa00f19fb18258ce9b29"/></dir></dir></dir></dir><dir name="Test"><dir name="Block"><file name="BeaconTest.php" hash="d89dcfcfa8c8b135442a96121b99b139"/><dir name="providers"><file name="testShowBeacon.yaml" hash="3a605cb51a86987f318ce4186d80e04f"/></dir></dir><dir name="Helper"><file name="DataTest.php" hash="62b321d69fdf49343e35d28fb7f14a5e"/><dir name="Map"><file name="ProductTest.php" hash="6cd1eb4410f061ce057a18c903a1ef01"/></dir><dir name="providers"><file name="testIsValidCookie.yaml" hash="1c94e7a661d72fc05724c40e509cf5ad"/></dir></dir><dir name="Model"><dir name="Feed"><file name="AbstractTest.php" hash="d43afcb5f4312cd1cacd6c4d5c8e980c"/><dir name="Order"><file name="AbstractTest.php" hash="19721d959c8fff2ecbb5c6fa093971ef"/><file name="BasicTest.php" hash="a493b77aceb70eede155c24301d06259"/><file name="ItemizedTest.php" hash="c5d108c538033c3dae8cc72b535b2cad"/></dir><file name="ProductTest.php" hash="2e7f3c395f4bc070005917c08d93c7b2"/></dir><file name="ObserverTest.php" hash="f4e6d2e60e47efcd1057d7d6808a720c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="PepperjamNetworkController.php" hash="5325aabc9051d183edc18083201ffc1a"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="0da08cc1337e4f07a74408b2dd379c26"/><file name="config.xml" hash="8a9c4d2d1ce69a936693097a07eb9bf6"/><file name="system.xml" hash="b0644ba6e6491cb7fc64ac8c70def46a"/></dir><dir name="sql"><dir name="pepperjam_network_setup"><file name="install-1.0.0.1.php" hash="c16d2390643fe92260773421af04196e"/><file name="mysql4-data-upgrade-1.2.1.0-1.2.2.0.php" hash="e32121b8893c6fe9ff598aa5e93f8bb3"/><file name="mysql4-data-upgrade-1.2.2.0-1.3.0.0.php" hash="0974aee7b5caf395a9f9cb8564b2e5af"/><file name="mysql4-install-1.0.0.1.php" hash="c16d2390643fe92260773421af04196e"/><file name="mysql4-upgrade-1.0.0.1-1.2.0.0.php" hash="2b0692625b2c15b58cf63b8cf8d51856"/><file name="mysql4-upgrade-1.2.99.99-1.3.0.0.php" hash="8d288efe53bede9195c7f881d541a49d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="pepperjam_network"><dir name="system"><dir name="config"><file name="button.phtml" hash="9ba57be66b39e53a4b2063a70195a2a2"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pepperjam_network.xml" hash="31a7ee00e5d3ca1c616eae472f54ecb7"/></dir><dir name="template"><dir name="pepperjam_network"><file name="beacon.phtml" hash="1ca76e21e7419faa6067ca0cd6027cf0"/><file name="tracking.phtml" hash="fb479dac42ccc3b82212aed980466fd5"/></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
+ <dependencies><required><php><min>5.3.0</min><max>5.6.99</max></php></required></dependencies>
22
  </package>