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
- app/code/community/Pepperjam/Network/Block/Adminhtml/System/Config/Form/Button.php +47 -47
- app/code/community/Pepperjam/Network/Block/Beacon.php +361 -332
- app/code/community/Pepperjam/Network/Block/Tracking.php +77 -45
- app/code/community/Pepperjam/Network/Exception/Configuration.php +20 -20
- app/code/community/Pepperjam/Network/Helper/Config.php +433 -301
- app/code/community/Pepperjam/Network/Helper/Data.php +218 -178
- app/code/community/Pepperjam/Network/Helper/Map.php +112 -112
- app/code/community/Pepperjam/Network/Helper/Map/Order.php +198 -172
- app/code/community/Pepperjam/Network/Helper/Map/Product.php +135 -135
- app/code/community/Pepperjam/Network/Model/Feed/Abstract.php +340 -335
- app/code/community/Pepperjam/Network/Model/Feed/Order/Abstract.php +189 -70
- app/code/community/Pepperjam/Network/Model/Feed/Order/Basic.php +42 -73
- app/code/community/Pepperjam/Network/Model/Feed/Order/Dynamic.php +40 -82
- app/code/community/Pepperjam/Network/Model/Feed/Order/Itemized.php +39 -80
- app/code/community/Pepperjam/Network/Model/Feed/Product.php +108 -96
- app/code/community/Pepperjam/Network/Model/Observer.php +123 -74
- app/code/community/Pepperjam/Network/Model/Product/Attribute/Source/CommissioningCategory.php +43 -43
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Attributes.php +73 -73
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Categories.php +35 -35
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Ordertypes.php +39 -39
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Stockquantity.php +35 -35
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Stockyesno.php +35 -35
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Trackingmethods.php +35 -0
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Transactiontype.php +28 -28
- app/code/community/Pepperjam/Network/Model/System/Config/Source/Visibilityyesno.php +35 -35
- app/code/community/Pepperjam/Network/Test/Block/BeaconTest.php +253 -253
- app/code/community/Pepperjam/Network/Test/Block/providers/testShowBeacon.yaml +99 -99
- app/code/community/Pepperjam/Network/Test/Helper/DataTest.php +53 -53
- app/code/community/Pepperjam/Network/Test/Helper/Map/ProductTest.php +173 -173
- app/code/community/Pepperjam/Network/Test/Helper/providers/testIsValidCookie.yaml +12 -12
- app/code/community/Pepperjam/Network/Test/Model/Feed/AbstractTest.php +291 -291
- app/code/community/Pepperjam/Network/Test/Model/Feed/Order/AbstractTest.php +58 -58
- app/code/community/Pepperjam/Network/Test/Model/Feed/Order/BasicTest.php +38 -38
- app/code/community/Pepperjam/Network/Test/Model/Feed/Order/ItemizedTest.php +38 -38
- app/code/community/Pepperjam/Network/Test/Model/Feed/ProductTest.php +167 -167
- app/code/community/Pepperjam/Network/Test/Model/ObserverTest.php +61 -61
- app/code/community/Pepperjam/Network/controllers/Adminhtml/PepperjamNetworkController.php +99 -100
- app/code/community/Pepperjam/Network/etc/adminhtml.xml +37 -37
- app/code/community/Pepperjam/Network/etc/config.xml +1111 -1041
- app/code/community/Pepperjam/Network/etc/system.xml +985 -950
- app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/install-1.0.0.1.php +23 -23
- app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-data-upgrade-1.2.1.0-1.2.2.0.php +116 -116
- app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-data-upgrade-1.2.2.0-1.3.0.0.php +26 -0
- app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-install-1.0.0.1.php +23 -23
- app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-upgrade-1.0.0.1-1.2.0.0.php +52 -52
- app/code/community/Pepperjam/Network/sql/pepperjam_network_setup/mysql4-upgrade-1.2.99.99-1.3.0.0.php +47 -0
- app/design/adminhtml/default/default/template/pepperjam_network/system/config/button.phtml +32 -32
- app/design/frontend/base/default/layout/pepperjam_network.xml +35 -35
- app/design/frontend/base/default/template/pepperjam_network/beacon.phtml +34 -34
- app/design/frontend/base/default/template/pepperjam_network/tracking.phtml +104 -98
- app/etc/modules/Pepperjam_Network.xml +23 -23
- 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 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
$
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
}
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
*
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* build
|
170 |
-
* @param Mage_Sales_Model_Order $order
|
171 |
-
* @return array
|
172 |
-
*/
|
173 |
-
protected function
|
174 |
-
{
|
175 |
-
$params =
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
*
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
$
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
$
|
225 |
-
}
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
$
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
$
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
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
|
24 |
-
{
|
25 |
-
return Mage::helper('pepperjam_network')->getSourceCookieName();
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* @return string | null
|
30 |
-
*/
|
31 |
-
public function
|
32 |
-
{
|
33 |
-
return Mage::helper('pepperjam_network/config')->getSourceKeyName();
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
*
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
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
|
27 |
-
const
|
28 |
-
const
|
29 |
-
const
|
30 |
-
const
|
31 |
-
const
|
32 |
-
const
|
33 |
-
const
|
34 |
-
const
|
35 |
-
const
|
36 |
-
const
|
37 |
-
const
|
38 |
-
const
|
39 |
-
const
|
40 |
-
const
|
41 |
-
const
|
42 |
-
const
|
43 |
-
const
|
44 |
-
|
45 |
-
const
|
46 |
-
const
|
47 |
-
|
48 |
-
const
|
49 |
-
const
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
*
|
64 |
-
* @
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
*
|
74 |
-
* @
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
*
|
84 |
-
* @
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
*
|
94 |
-
* @
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
*
|
104 |
-
* @
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
*
|
114 |
-
* @
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
*
|
124 |
-
* @
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
*
|
134 |
-
* @
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
*
|
144 |
-
* @
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
/**
|
152 |
-
*
|
153 |
-
* @param
|
154 |
-
* @return
|
155 |
-
*/
|
156 |
-
public function
|
157 |
-
{
|
158 |
-
return
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
*
|
163 |
-
* @param
|
164 |
-
* @return string
|
165 |
-
*/
|
166 |
-
public function
|
167 |
-
{
|
168 |
-
return Mage::getStoreConfig(static::
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Get the configured
|
173 |
-
* @param mixed $store
|
174 |
-
* @return
|
175 |
-
*/
|
176 |
-
public function
|
177 |
-
{
|
178 |
-
return Mage::getStoreConfig(static::
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Get the
|
183 |
-
* @param mixed $store
|
184 |
-
* @return array
|
185 |
-
*/
|
186 |
-
public function
|
187 |
-
{
|
188 |
-
return Mage::getStoreConfig(static::
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* Get the configured feed mapping for the
|
193 |
-
* @param mixed $store
|
194 |
-
* @return array
|
195 |
-
*/
|
196 |
-
public function
|
197 |
-
{
|
198 |
-
return Mage::getStoreConfig(static::
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Get the
|
203 |
-
* @param mixed
|
204 |
-
* @return
|
205 |
-
*/
|
206 |
-
public function
|
207 |
-
{
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
*
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
*
|
235 |
-
* @param
|
236 |
-
* @return
|
237 |
-
*/
|
238 |
-
public function
|
239 |
-
{
|
240 |
-
Mage::
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
*
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
*
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
*
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
*
|
295 |
-
* @
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
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 |
-
*
|
129 |
-
*
|
130 |
-
*
|
131 |
-
* @return
|
132 |
-
*/
|
133 |
-
public function
|
134 |
-
{
|
135 |
-
$
|
136 |
-
|
137 |
-
return
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
*
|
142 |
-
*
|
143 |
-
*
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
$
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
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 |
-
|
27 |
-
|
28 |
-
*
|
29 |
-
*
|
30 |
-
*
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
*
|
44 |
-
*
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
*
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
*
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
$
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
*
|
150 |
-
*
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
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 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
*
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Get
|
32 |
-
*
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
*
|
39 |
-
* @return
|
40 |
-
*/
|
41 |
-
abstract protected function
|
42 |
-
/**
|
43 |
-
*
|
44 |
-
* @return
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
*
|
141 |
-
*
|
142 |
-
*
|
143 |
-
*
|
144 |
-
*
|
145 |
-
*
|
146 |
-
*
|
147 |
-
* - "
|
148 |
-
* - "
|
149 |
-
*
|
150 |
-
*
|
151 |
-
*
|
152 |
-
*
|
153 |
-
*
|
154 |
-
*
|
155 |
-
*
|
156 |
-
*
|
157 |
-
*
|
158 |
-
*
|
159 |
-
*
|
160 |
-
*
|
161 |
-
*
|
162 |
-
*
|
163 |
-
*
|
164 |
-
*
|
165 |
-
*
|
166 |
-
*
|
167 |
-
*
|
168 |
-
*
|
169 |
-
*
|
170 |
-
*
|
171 |
-
*
|
172 |
-
*
|
173 |
-
*
|
174 |
-
*
|
175 |
-
*
|
176 |
-
*
|
177 |
-
*
|
178 |
-
*
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
$
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
return Mage::
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
//
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
$
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
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 |
-
|
24 |
-
*
|
25 |
-
*
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
*
|
31 |
-
*
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
*
|
41 |
-
*
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
*
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
$
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
)
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
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 |
-
$
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
)
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
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 |
-
$
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
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 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
return
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
}
|
87 |
-
/**
|
88 |
-
* @see
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
return
|
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 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
$
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
37 |
-
$attributeExists
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
//
|
45 |
-
Mage_Connect_Command::
|
46 |
-
$installer
|
47 |
-
$installer->
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
*
|
61 |
-
*
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
$this->_config
|
68 |
-
$ftp
|
69 |
-
|
70 |
-
$
|
71 |
-
|
72 |
-
$this->
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
*
|
83 |
-
*
|
84 |
-
* @
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
$this->getConfig()->
|
92 |
-
.
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
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.
|
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 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
<
|
62 |
-
<
|
63 |
-
</
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
<
|
78 |
-
|
79 |
-
|
80 |
-
<
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
<
|
110 |
-
<
|
111 |
-
|
112 |
-
|
113 |
-
<
|
114 |
-
|
115 |
-
|
116 |
-
</
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
<
|
123 |
-
<
|
124 |
-
|
125 |
-
</
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
<
|
132 |
-
|
133 |
-
|
134 |
-
<
|
135 |
-
<
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
<
|
142 |
-
<
|
143 |
-
<
|
144 |
-
<
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
<
|
151 |
-
<
|
152 |
-
<
|
153 |
-
<
|
154 |
-
|
155 |
-
|
156 |
-
</
|
157 |
-
|
158 |
-
|
159 |
-
<
|
160 |
-
|
161 |
-
|
162 |
-
<
|
163 |
-
<
|
164 |
-
|
165 |
-
</
|
166 |
-
</
|
167 |
-
<
|
168 |
-
<class>pepperjam_network/map_order</class>
|
169 |
-
<method>
|
170 |
-
<type>helper</type>
|
171 |
-
<column_name>
|
172 |
-
</
|
173 |
-
<
|
174 |
-
<class>pepperjam_network/
|
175 |
-
<method>
|
176 |
-
<type>helper</type>
|
177 |
-
<column_name>
|
178 |
-
</
|
179 |
-
<
|
180 |
-
<class>pepperjam_network/map_order</class>
|
181 |
-
<method>
|
182 |
-
<type>helper</type>
|
183 |
-
<column_name>
|
184 |
-
<params>
|
185 |
-
<format>%.
|
186 |
-
</params>
|
187 |
-
</
|
188 |
-
<
|
189 |
-
<class>pepperjam_network/
|
190 |
-
<method>
|
191 |
-
<type>helper</type>
|
192 |
-
<column_name>
|
193 |
-
<params>
|
194 |
-
<
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
<
|
200 |
-
<
|
201 |
-
<
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
<
|
209 |
-
|
210 |
-
</
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
<
|
215 |
-
<
|
216 |
-
<
|
217 |
-
<
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
<
|
223 |
-
<
|
224 |
-
|
225 |
-
|
226 |
-
<
|
227 |
-
|
228 |
-
</
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
<
|
233 |
-
<
|
234 |
-
<
|
235 |
-
<
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
<
|
241 |
-
<
|
242 |
-
<
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
<
|
250 |
-
<
|
251 |
-
<
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
<
|
259 |
-
<
|
260 |
-
|
261 |
-
|
262 |
-
<
|
263 |
-
|
264 |
-
|
265 |
-
</
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
<
|
272 |
-
<
|
273 |
-
|
274 |
-
</
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
<
|
281 |
-
<
|
282 |
-
|
283 |
-
</
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
<
|
290 |
-
<
|
291 |
-
|
292 |
-
</
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
<
|
299 |
-
<
|
300 |
-
|
301 |
-
</
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
<
|
308 |
-
<
|
309 |
-
|
310 |
-
</
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
<
|
317 |
-
<
|
318 |
-
|
319 |
-
</
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
<
|
327 |
-
|
328 |
-
</
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
<
|
336 |
-
|
337 |
-
</
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
<
|
345 |
-
|
346 |
-
</
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
<
|
354 |
-
|
355 |
-
</
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
<
|
363 |
-
|
364 |
-
</
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
<
|
372 |
-
|
373 |
-
</
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
<
|
381 |
-
|
382 |
-
</
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
<
|
390 |
-
|
391 |
-
</
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
<
|
399 |
-
|
400 |
-
</
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
<
|
408 |
-
|
409 |
-
</
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
<
|
417 |
-
|
418 |
-
</
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
<
|
426 |
-
|
427 |
-
</
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
<
|
435 |
-
|
436 |
-
</
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
<
|
444 |
-
|
445 |
-
</
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
<
|
453 |
-
|
454 |
-
</
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
<
|
462 |
-
|
463 |
-
</
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
<
|
471 |
-
|
472 |
-
</
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
<
|
480 |
-
|
481 |
-
</
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
<
|
489 |
-
|
490 |
-
</
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
<
|
498 |
-
|
499 |
-
</
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
<
|
507 |
-
|
508 |
-
</
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
<
|
516 |
-
|
517 |
-
</
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
<
|
525 |
-
|
526 |
-
</
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
<
|
534 |
-
|
535 |
-
</
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
<
|
543 |
-
|
544 |
-
</
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
<
|
552 |
-
|
553 |
-
</
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
<
|
561 |
-
|
562 |
-
</
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
<
|
570 |
-
|
571 |
-
</
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
<
|
579 |
-
|
580 |
-
</
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
<
|
588 |
-
|
589 |
-
</
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
<
|
597 |
-
|
598 |
-
</
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
<
|
606 |
-
|
607 |
-
</
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
<
|
615 |
-
|
616 |
-
</
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
<
|
624 |
-
|
625 |
-
</
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
<
|
633 |
-
|
634 |
-
</
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
<
|
642 |
-
|
643 |
-
</
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
<
|
651 |
-
|
652 |
-
</
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
<
|
660 |
-
|
661 |
-
</
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
<
|
669 |
-
|
670 |
-
</
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
<
|
678 |
-
|
679 |
-
</
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
<
|
687 |
-
|
688 |
-
</
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
<
|
696 |
-
|
697 |
-
</
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
<
|
705 |
-
|
706 |
-
</
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
<
|
714 |
-
|
715 |
-
</
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
<
|
723 |
-
|
724 |
-
</
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
<
|
732 |
-
|
733 |
-
</
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
<
|
741 |
-
|
742 |
-
</
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
<
|
750 |
-
|
751 |
-
</
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
<
|
759 |
-
|
760 |
-
</
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
<
|
768 |
-
|
769 |
-
</
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
<
|
777 |
-
|
778 |
-
</
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
<
|
786 |
-
|
787 |
-
</
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
<
|
795 |
-
|
796 |
-
</
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
<
|
804 |
-
|
805 |
-
</
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
<
|
813 |
-
|
814 |
-
</
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
<
|
822 |
-
|
823 |
-
</
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
<
|
831 |
-
|
832 |
-
</
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
<
|
840 |
-
|
841 |
-
</
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
<
|
849 |
-
|
850 |
-
</
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
<
|
858 |
-
|
859 |
-
</
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
<
|
867 |
-
|
868 |
-
</
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
<
|
876 |
-
|
877 |
-
</
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
<
|
885 |
-
|
886 |
-
</
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
<
|
894 |
-
|
895 |
-
</
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
<
|
903 |
-
|
904 |
-
</
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
<
|
1004 |
-
<
|
1005 |
-
<
|
1006 |
-
<
|
1007 |
-
<
|
1008 |
-
<
|
1009 |
-
<
|
1010 |
-
<
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
<
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
<
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
<
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
<
|
71 |
-
<label>
|
72 |
-
<
|
73 |
-
<
|
74 |
-
<
|
75 |
-
<
|
76 |
-
|
77 |
-
</
|
78 |
-
|
79 |
-
|
80 |
-
<
|
81 |
-
<
|
82 |
-
|
83 |
-
|
84 |
-
<
|
85 |
-
|
86 |
-
|
87 |
-
<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 |
-
</
|
92 |
-
<
|
93 |
-
<label>
|
94 |
-
<
|
95 |
-
<
|
96 |
-
<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 |
-
</
|
101 |
-
<
|
102 |
-
<label>
|
103 |
-
<
|
104 |
-
<
|
105 |
-
<
|
106 |
-
|
107 |
-
</
|
108 |
-
<
|
109 |
-
|
110 |
-
|
111 |
-
<
|
112 |
-
|
113 |
-
|
114 |
-
<
|
115 |
-
|
116 |
-
|
117 |
-
<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 |
-
</
|
122 |
-
<
|
123 |
-
<label>
|
124 |
-
<frontend_type>
|
125 |
-
<
|
126 |
-
|
127 |
-
|
128 |
-
<
|
129 |
-
<
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
<
|
143 |
-
<
|
144 |
-
|
145 |
-
|
146 |
-
<
|
147 |
-
<
|
148 |
-
<
|
149 |
-
<
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
<
|
154 |
-
<
|
155 |
-
<
|
156 |
-
|
157 |
-
|
158 |
-
<
|
159 |
-
<
|
160 |
-
|
161 |
-
|
162 |
-
<
|
163 |
-
<
|
164 |
-
<
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
<
|
178 |
-
<
|
179 |
-
<
|
180 |
-
|
181 |
-
|
182 |
-
<
|
183 |
-
<
|
184 |
-
<
|
185 |
-
|
186 |
-
|
187 |
-
<
|
188 |
-
<
|
189 |
-
<
|
190 |
-
|
191 |
-
|
192 |
-
<
|
193 |
-
<
|
194 |
-
<
|
195 |
-
|
196 |
-
|
197 |
-
<
|
198 |
-
<
|
199 |
-
<
|
200 |
-
|
201 |
-
|
202 |
-
<
|
203 |
-
<
|
204 |
-
<
|
205 |
-
|
206 |
-
|
207 |
-
<
|
208 |
-
<
|
209 |
-
<
|
210 |
-
<
|
211 |
-
|
212 |
-
|
213 |
-
<
|
214 |
-
<
|
215 |
-
|
216 |
-
|
217 |
-
<
|
218 |
-
<
|
219 |
-
<
|
220 |
-
<
|
221 |
-
|
222 |
-
|
223 |
-
<
|
224 |
-
<
|
225 |
-
|
226 |
-
|
227 |
-
<
|
228 |
-
<
|
229 |
-
<
|
230 |
-
<
|
231 |
-
|
232 |
-
|
233 |
-
<
|
234 |
-
<
|
235 |
-
|
236 |
-
|
237 |
-
<
|
238 |
-
<
|
239 |
-
<
|
240 |
-
<
|
241 |
-
|
242 |
-
|
243 |
-
<
|
244 |
-
<
|
245 |
-
<
|
246 |
-
|
247 |
-
|
248 |
-
<
|
249 |
-
<
|
250 |
-
<
|
251 |
-
|
252 |
-
|
253 |
-
<
|
254 |
-
<
|
255 |
-
<
|
256 |
-
|
257 |
-
|
258 |
-
<
|
259 |
-
<
|
260 |
-
<
|
261 |
-
|
262 |
-
|
263 |
-
<
|
264 |
-
<
|
265 |
-
<
|
266 |
-
|
267 |
-
|
268 |
-
<
|
269 |
-
<
|
270 |
-
<
|
271 |
-
<
|
272 |
-
|
273 |
-
|
274 |
-
<
|
275 |
-
<
|
276 |
-
|
277 |
-
|
278 |
-
<
|
279 |
-
<
|
280 |
-
<
|
281 |
-
<
|
282 |
-
|
283 |
-
|
284 |
-
<
|
285 |
-
<
|
286 |
-
|
287 |
-
|
288 |
-
<
|
289 |
-
<
|
290 |
-
<
|
291 |
-
<
|
292 |
-
|
293 |
-
|
294 |
-
<
|
295 |
-
<
|
296 |
-
|
297 |
-
|
298 |
-
<
|
299 |
-
<
|
300 |
-
<
|
301 |
-
<
|
302 |
-
|
303 |
-
|
304 |
-
<
|
305 |
-
<
|
306 |
-
<
|
307 |
-
|
308 |
-
|
309 |
-
<
|
310 |
-
<
|
311 |
-
<
|
312 |
-
|
313 |
-
|
314 |
-
<
|
315 |
-
<
|
316 |
-
<
|
317 |
-
|
318 |
-
|
319 |
-
<
|
320 |
-
<
|
321 |
-
<
|
322 |
-
|
323 |
-
|
324 |
-
<
|
325 |
-
<
|
326 |
-
<
|
327 |
-
|
328 |
-
|
329 |
-
<
|
330 |
-
<
|
331 |
-
<
|
332 |
-
|
333 |
-
|
334 |
-
<
|
335 |
-
<
|
336 |
-
<
|
337 |
-
|
338 |
-
|
339 |
-
<
|
340 |
-
<
|
341 |
-
<
|
342 |
-
|
343 |
-
|
344 |
-
<
|
345 |
-
<
|
346 |
-
<
|
347 |
-
|
348 |
-
|
349 |
-
<
|
350 |
-
<
|
351 |
-
<
|
352 |
-
|
353 |
-
|
354 |
-
<
|
355 |
-
<
|
356 |
-
<
|
357 |
-
|
358 |
-
|
359 |
-
<
|
360 |
-
<
|
361 |
-
<
|
362 |
-
|
363 |
-
|
364 |
-
<
|
365 |
-
<
|
366 |
-
<
|
367 |
-
|
368 |
-
|
369 |
-
<
|
370 |
-
<
|
371 |
-
<
|
372 |
-
|
373 |
-
|
374 |
-
<
|
375 |
-
<
|
376 |
-
<
|
377 |
-
|
378 |
-
|
379 |
-
<
|
380 |
-
<
|
381 |
-
<
|
382 |
-
|
383 |
-
|
384 |
-
<
|
385 |
-
<
|
386 |
-
<
|
387 |
-
|
388 |
-
|
389 |
-
<
|
390 |
-
<
|
391 |
-
<
|
392 |
-
|
393 |
-
|
394 |
-
<
|
395 |
-
<
|
396 |
-
<
|
397 |
-
|
398 |
-
|
399 |
-
<
|
400 |
-
<
|
401 |
-
<
|
402 |
-
|
403 |
-
|
404 |
-
<
|
405 |
-
<
|
406 |
-
<
|
407 |
-
|
408 |
-
|
409 |
-
<
|
410 |
-
<
|
411 |
-
<
|
412 |
-
|
413 |
-
|
414 |
-
<
|
415 |
-
<
|
416 |
-
<
|
417 |
-
|
418 |
-
|
419 |
-
<
|
420 |
-
<
|
421 |
-
<
|
422 |
-
<
|
423 |
-
|
424 |
-
|
425 |
-
<
|
426 |
-
<
|
427 |
-
|
428 |
-
|
429 |
-
<
|
430 |
-
<
|
431 |
-
<
|
432 |
-
<
|
433 |
-
|
434 |
-
|
435 |
-
<
|
436 |
-
<
|
437 |
-
|
438 |
-
|
439 |
-
<
|
440 |
-
<
|
441 |
-
<
|
442 |
-
<
|
443 |
-
|
444 |
-
|
445 |
-
<
|
446 |
-
<
|
447 |
-
|
448 |
-
|
449 |
-
<
|
450 |
-
<
|
451 |
-
<
|
452 |
-
<
|
453 |
-
|
454 |
-
|
455 |
-
<
|
456 |
-
<
|
457 |
-
<
|
458 |
-
|
459 |
-
|
460 |
-
<
|
461 |
-
<
|
462 |
-
<
|
463 |
-
|
464 |
-
|
465 |
-
<
|
466 |
-
<
|
467 |
-
<
|
468 |
-
|
469 |
-
|
470 |
-
<
|
471 |
-
<
|
472 |
-
<
|
473 |
-
|
474 |
-
|
475 |
-
<
|
476 |
-
<
|
477 |
-
<
|
478 |
-
|
479 |
-
|
480 |
-
<
|
481 |
-
<
|
482 |
-
<
|
483 |
-
|
484 |
-
|
485 |
-
<
|
486 |
-
<
|
487 |
-
<
|
488 |
-
|
489 |
-
|
490 |
-
<
|
491 |
-
<
|
492 |
-
<
|
493 |
-
|
494 |
-
|
495 |
-
<
|
496 |
-
<
|
497 |
-
<
|
498 |
-
|
499 |
-
|
500 |
-
<
|
501 |
-
<
|
502 |
-
<
|
503 |
-
|
504 |
-
|
505 |
-
<
|
506 |
-
<
|
507 |
-
<
|
508 |
-
|
509 |
-
|
510 |
-
<
|
511 |
-
<
|
512 |
-
<
|
513 |
-
|
514 |
-
|
515 |
-
<
|
516 |
-
<
|
517 |
-
<
|
518 |
-
|
519 |
-
|
520 |
-
<
|
521 |
-
<
|
522 |
-
<
|
523 |
-
|
524 |
-
|
525 |
-
<
|
526 |
-
<
|
527 |
-
<
|
528 |
-
|
529 |
-
|
530 |
-
<
|
531 |
-
<
|
532 |
-
<
|
533 |
-
|
534 |
-
|
535 |
-
<
|
536 |
-
<
|
537 |
-
<
|
538 |
-
|
539 |
-
|
540 |
-
<
|
541 |
-
<
|
542 |
-
<
|
543 |
-
|
544 |
-
|
545 |
-
<
|
546 |
-
<
|
547 |
-
<
|
548 |
-
|
549 |
-
|
550 |
-
<
|
551 |
-
<
|
552 |
-
<
|
553 |
-
|
554 |
-
|
555 |
-
<
|
556 |
-
<
|
557 |
-
<
|
558 |
-
|
559 |
-
|
560 |
-
<
|
561 |
-
<
|
562 |
-
<
|
563 |
-
|
564 |
-
|
565 |
-
<
|
566 |
-
<
|
567 |
-
<
|
568 |
-
|
569 |
-
|
570 |
-
<
|
571 |
-
<
|
572 |
-
<
|
573 |
-
|
574 |
-
|
575 |
-
<
|
576 |
-
<
|
577 |
-
<
|
578 |
-
|
579 |
-
|
580 |
-
<
|
581 |
-
<
|
582 |
-
<
|
583 |
-
|
584 |
-
|
585 |
-
<
|
586 |
-
<
|
587 |
-
<
|
588 |
-
|
589 |
-
|
590 |
-
<
|
591 |
-
<
|
592 |
-
<
|
593 |
-
<
|
594 |
-
|
595 |
-
|
596 |
-
<
|
597 |
-
<
|
598 |
-
|
599 |
-
|
600 |
-
<
|
601 |
-
<
|
602 |
-
<
|
603 |
-
<
|
604 |
-
|
605 |
-
|
606 |
-
<
|
607 |
-
<
|
608 |
-
|
609 |
-
|
610 |
-
<
|
611 |
-
<
|
612 |
-
<
|
613 |
-
<
|
614 |
-
|
615 |
-
|
616 |
-
<
|
617 |
-
<
|
618 |
-
|
619 |
-
|
620 |
-
<
|
621 |
-
<
|
622 |
-
<
|
623 |
-
<
|
624 |
-
|
625 |
-
|
626 |
-
<
|
627 |
-
<
|
628 |
-
<
|
629 |
-
|
630 |
-
|
631 |
-
<
|
632 |
-
<
|
633 |
-
<
|
634 |
-
|
635 |
-
|
636 |
-
<
|
637 |
-
<
|
638 |
-
<
|
639 |
-
|
640 |
-
|
641 |
-
<
|
642 |
-
<
|
643 |
-
<
|
644 |
-
|
645 |
-
|
646 |
-
<
|
647 |
-
<
|
648 |
-
<
|
649 |
-
|
650 |
-
|
651 |
-
<
|
652 |
-
<
|
653 |
-
<
|
654 |
-
|
655 |
-
|
656 |
-
<
|
657 |
-
<
|
658 |
-
<
|
659 |
-
|
660 |
-
|
661 |
-
<
|
662 |
-
<
|
663 |
-
<
|
664 |
-
|
665 |
-
|
666 |
-
<
|
667 |
-
<
|
668 |
-
<
|
669 |
-
|
670 |
-
|
671 |
-
<
|
672 |
-
<
|
673 |
-
<
|
674 |
-
<
|
675 |
-
|
676 |
-
|
677 |
-
<
|
678 |
-
<
|
679 |
-
|
680 |
-
|
681 |
-
<
|
682 |
-
<
|
683 |
-
<
|
684 |
-
<
|
685 |
-
|
686 |
-
|
687 |
-
<
|
688 |
-
<
|
689 |
-
|
690 |
-
|
691 |
-
<
|
692 |
-
<
|
693 |
-
<
|
694 |
-
<
|
695 |
-
|
696 |
-
|
697 |
-
<
|
698 |
-
<
|
699 |
-
|
700 |
-
|
701 |
-
<
|
702 |
-
<
|
703 |
-
<
|
704 |
-
<
|
705 |
-
|
706 |
-
|
707 |
-
<
|
708 |
-
<
|
709 |
-
<
|
710 |
-
|
711 |
-
|
712 |
-
<
|
713 |
-
<
|
714 |
-
<
|
715 |
-
|
716 |
-
|
717 |
-
<
|
718 |
-
<
|
719 |
-
<
|
720 |
-
|
721 |
-
|
722 |
-
<
|
723 |
-
<
|
724 |
-
<
|
725 |
-
|
726 |
-
|
727 |
-
<
|
728 |
-
<
|
729 |
-
<
|
730 |
-
|
731 |
-
|
732 |
-
<
|
733 |
-
<
|
734 |
-
<
|
735 |
-
|
736 |
-
|
737 |
-
<
|
738 |
-
<
|
739 |
-
<
|
740 |
-
|
741 |
-
|
742 |
-
<
|
743 |
-
<
|
744 |
-
<
|
745 |
-
|
746 |
-
|
747 |
-
<
|
748 |
-
<
|
749 |
-
<
|
750 |
-
|
751 |
-
|
752 |
-
<
|
753 |
-
<
|
754 |
-
<
|
755 |
-
|
756 |
-
|
757 |
-
<
|
758 |
-
<
|
759 |
-
<
|
760 |
-
|
761 |
-
|
762 |
-
<
|
763 |
-
<
|
764 |
-
<
|
765 |
-
|
766 |
-
|
767 |
-
<
|
768 |
-
<
|
769 |
-
<
|
770 |
-
|
771 |
-
|
772 |
-
<
|
773 |
-
<
|
774 |
-
<
|
775 |
-
|
776 |
-
|
777 |
-
<
|
778 |
-
<
|
779 |
-
<
|
780 |
-
|
781 |
-
|
782 |
-
<
|
783 |
-
<
|
784 |
-
<
|
785 |
-
|
786 |
-
|
787 |
-
<
|
788 |
-
<
|
789 |
-
<
|
790 |
-
|
791 |
-
|
792 |
-
<
|
793 |
-
<
|
794 |
-
<
|
795 |
-
|
796 |
-
|
797 |
-
<
|
798 |
-
<
|
799 |
-
<
|
800 |
-
|
801 |
-
|
802 |
-
<
|
803 |
-
<
|
804 |
-
<
|
805 |
-
|
806 |
-
|
807 |
-
<
|
808 |
-
<
|
809 |
-
<
|
810 |
-
|
811 |
-
|
812 |
-
<
|
813 |
-
<
|
814 |
-
<
|
815 |
-
|
816 |
-
|
817 |
-
<
|
818 |
-
<
|
819 |
-
<
|
820 |
-
|
821 |
-
|
822 |
-
<
|
823 |
-
<
|
824 |
-
<
|
825 |
-
|
826 |
-
|
827 |
-
<
|
828 |
-
<
|
829 |
-
<
|
830 |
-
|
831 |
-
|
832 |
-
<
|
833 |
-
<
|
834 |
-
<
|
835 |
-
|
836 |
-
|
837 |
-
<
|
838 |
-
<
|
839 |
-
<
|
840 |
-
|
841 |
-
|
842 |
-
<
|
843 |
-
<
|
844 |
-
<
|
845 |
-
|
846 |
-
|
847 |
-
<
|
848 |
-
<
|
849 |
-
<
|
850 |
-
|
851 |
-
|
852 |
-
<
|
853 |
-
<
|
854 |
-
<
|
855 |
-
|
856 |
-
|
857 |
-
<
|
858 |
-
<
|
859 |
-
<
|
860 |
-
|
861 |
-
|
862 |
-
<
|
863 |
-
<
|
864 |
-
<
|
865 |
-
|
866 |
-
|
867 |
-
<
|
868 |
-
<
|
869 |
-
<
|
870 |
-
|
871 |
-
|
872 |
-
<
|
873 |
-
<
|
874 |
-
<
|
875 |
-
|
876 |
-
|
877 |
-
<
|
878 |
-
<
|
879 |
-
<
|
880 |
-
|
881 |
-
|
882 |
-
<
|
883 |
-
<
|
884 |
-
<
|
885 |
-
|
886 |
-
|
887 |
-
<
|
888 |
-
<
|
889 |
-
<
|
890 |
-
|
891 |
-
|
892 |
-
<
|
893 |
-
<
|
894 |
-
<
|
895 |
-
|
896 |
-
|
897 |
-
<
|
898 |
-
<
|
899 |
-
<
|
900 |
-
|
901 |
-
|
902 |
-
<
|
903 |
-
<
|
904 |
-
<
|
905 |
-
|
906 |
-
|
907 |
-
<
|
908 |
-
<
|
909 |
-
<
|
910 |
-
|
911 |
-
|
912 |
-
<
|
913 |
-
<
|
914 |
-
<
|
915 |
-
|
916 |
-
|
917 |
-
<
|
918 |
-
<
|
919 |
-
<
|
920 |
-
|
921 |
-
|
922 |
-
<
|
923 |
-
<
|
924 |
-
<
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
<
|
938 |
-
<
|
939 |
-
<
|
940 |
-
|
941 |
-
|
942 |
-
<
|
943 |
-
<
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 '>')</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 '>') (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 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
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.
|
10 |
-
<description>Please use the uninstall button in the Pepperjam Network extension configuration settings.
|
11 |
-
<notes>1.
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
<
|
17 |
-
<
|
|
|
|
|
18 |
<compatible/>
|
19 |
-
<dependencies><required><php><min>5.
|
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
|
12 |
+
Added attribution
|
13 |
+
New option to report orders via feed instead of pixel
|
14 |
+
No longer including orders in correction feed if they were not part of a network transaction
|
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>
|