Version Notes
- Added a new commission group option for 'New' vs 'Existing'
- An issue with Datafeed processing time has been optimised for a more efficient processing
Download this release
Release Info
Developer | Edgelson Lua |
Extension | AffiliateWindow |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.5
- app/code/local/DigitalWindow/AwinTracking/Block/Awintracking.php +247 -229
- app/code/local/DigitalWindow/AwinTracking/Block/Cookie.php +25 -25
- app/code/local/DigitalWindow/AwinTracking/Helper/Data.php +2 -2
- app/code/local/DigitalWindow/AwinTracking/Model/Observer.php +36 -44
- app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/Cookie.php +16 -16
- app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/DefaultValue.php +13 -13
- app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/FeedName.php +14 -14
- app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/KeyParam.php +13 -13
- app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/MerchantId.php +13 -13
- app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Clock/Frequency.php +47 -47
- app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Store/Id.php +35 -35
- app/code/local/DigitalWindow/AwinTracking/etc/adminhtml.xml +25 -25
- app/code/local/DigitalWindow/AwinTracking/etc/system.xml +12 -1
- package.xml +7 -6
app/code/local/DigitalWindow/AwinTracking/Block/Awintracking.php
CHANGED
@@ -1,229 +1,247 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Block_Awintracking extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
|
5 |
-
public function getOrder() // Get order object
|
6 |
-
{
|
7 |
-
$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
|
8 |
-
return $order;
|
9 |
-
}
|
10 |
-
|
11 |
-
public function getAdvertiserId() // Get Advertiser Id
|
12 |
-
{
|
13 |
-
$merchantId = (int) Mage::getStoreConfig('AwinTracking_options/section_two/merchant_id');
|
14 |
-
return $merchantId;
|
15 |
-
}
|
16 |
-
|
17 |
-
public function getTestMode() // Get Config Test Mode Value
|
18 |
-
{
|
19 |
-
$testMode = (int) Mage::getStoreConfig('AwinTracking_options/section_one/test_mode');
|
20 |
-
return $testMode;
|
21 |
-
}
|
22 |
-
|
23 |
-
public function getCurrency() // Get Currency Code
|
24 |
-
{
|
25 |
-
$order = $this->getOrder();
|
26 |
-
$currency_code = $order->getOrderCurrency()->getCurrencyCode();
|
27 |
-
return $currency_code;
|
28 |
-
}
|
29 |
-
|
30 |
-
public function getChannel() // Get source parameter from cookie
|
31 |
-
{
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
$defaultValue
|
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 |
-
return $
|
123 |
-
}
|
124 |
-
|
125 |
-
public function
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Block_Awintracking extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
|
5 |
+
public function getOrder() // Get order object
|
6 |
+
{
|
7 |
+
$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
|
8 |
+
return $order;
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getAdvertiserId() // Get Advertiser Id
|
12 |
+
{
|
13 |
+
$merchantId = (int) Mage::getStoreConfig('AwinTracking_options/section_two/merchant_id');
|
14 |
+
return $merchantId;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function getTestMode() // Get Config Test Mode Value
|
18 |
+
{
|
19 |
+
$testMode = (int) Mage::getStoreConfig('AwinTracking_options/section_one/test_mode');
|
20 |
+
return $testMode;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getCurrency() // Get Currency Code
|
24 |
+
{
|
25 |
+
$order = $this->getOrder();
|
26 |
+
$currency_code = $order->getOrderCurrency()->getCurrencyCode();
|
27 |
+
return $currency_code;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getChannel() // Get source parameter from cookie
|
31 |
+
{
|
32 |
+
if ((int) Mage::getStoreConfig("AwinTracking_options/section_three/enable_dedupe") == 1){
|
33 |
+
$keyParam = Mage::getStoreConfig("AwinTracking_options/section_three/param_key");
|
34 |
+
if (isset($keyParam)) {
|
35 |
+
$channelParameter = filter_input(INPUT_COOKIE, $keyParam);
|
36 |
+
if (isset($channelParameter)) {
|
37 |
+
return $channelParameter;
|
38 |
+
}else{
|
39 |
+
$defaultValue = Mage::getStoreConfig("AwinTracking_options/section_three/default_value");
|
40 |
+
return $defaultValue;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
return 'aw';
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getComms() // Get config commission option
|
48 |
+
{
|
49 |
+
if ((int) Mage::getStoreConfig("AwinTracking_options/section_two/commission_group") == 1) {
|
50 |
+
$order = $this->getOrder();
|
51 |
+
$customer = 'NEW';
|
52 |
+
if($order->getCustomerId()){
|
53 |
+
$collection = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id', $order->getCustomerId());
|
54 |
+
if($collection->getSize() > 1){
|
55 |
+
$customer = 'EXISTING';
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
else {
|
60 |
+
$customer = 'DEFAULT';
|
61 |
+
}
|
62 |
+
return $customer;
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
public function getProducts() // Get all products from order object
|
67 |
+
{
|
68 |
+
$order = $this->getOrder();
|
69 |
+
$orderedProducts = $order->getAllVisibleItems();
|
70 |
+
return $orderedProducts;
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getGrandTotal() // Get grand total amount
|
74 |
+
{
|
75 |
+
$order = $this->getOrder();
|
76 |
+
$grandTotal = $order->getGrandTotal();
|
77 |
+
return $grandTotal;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function getShipping() // Get shipping amount
|
81 |
+
{
|
82 |
+
$order = $this->getOrder();
|
83 |
+
$shippingAmount = $order->getShippingAmount();
|
84 |
+
return $shippingAmount;
|
85 |
+
}
|
86 |
+
|
87 |
+
public function getSubTotal() // Get Subtotal (Subtotal = GrantTotal - Shipping - Tax)
|
88 |
+
{
|
89 |
+
$order = $this->getOrder();
|
90 |
+
$totalSubShipping = $order->getSubtotal();
|
91 |
+
return number_format($totalSubShipping, 2);
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getAwinAmount() // Get amount for awin tracking (dependant on VAT variable from backend config)
|
95 |
+
{
|
96 |
+
$order = $this->getOrder();
|
97 |
+
$includeVatInCalculation = Mage::getStoreConfig('AwinTracking_options/section_two/tax_inclusive');
|
98 |
+
$taxAmount = ($includeVatInCalculation == 0) ? $order->getTaxAmount() : 0;
|
99 |
+
$amount = ($this->getGrandTotal() - $this->getShipping()) - $taxAmount;
|
100 |
+
return number_format($amount, 2);
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getLastOrderId() // Get order Id
|
105 |
+
{
|
106 |
+
$order = $this->getOrder();
|
107 |
+
$lastOrderId = $order->getIncrementId();
|
108 |
+
return $lastOrderId;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function getVoucher() // Get voucher code
|
112 |
+
{
|
113 |
+
$order = $this->getOrder();
|
114 |
+
$voucherCode = $order->coupon_code;
|
115 |
+
return $voucherCode;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function getDiscount() // Get discount amount (whole number)
|
119 |
+
{
|
120 |
+
$order = $this->getOrder();
|
121 |
+
$discountAmount = abs($order->getDiscountAmount());
|
122 |
+
return $discountAmount;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function getDiscountPercent() // Get discount percent using discount amount
|
126 |
+
{
|
127 |
+
$order = $this->getOrder();
|
128 |
+
$discountAmount = $this->getDiscount($order);
|
129 |
+
$totalSubShipping = $this->getSubTotal($order);
|
130 |
+
$discountPercent = $discountAmount / $totalSubShipping;
|
131 |
+
return $discountPercent;
|
132 |
+
}
|
133 |
+
|
134 |
+
public function getCouponRule() // Get coupon rule (used for determining the coupon type)
|
135 |
+
{
|
136 |
+
$order = $this->getOrder();
|
137 |
+
$sessionCoupon = $this->getVoucher($order);
|
138 |
+
$couponData = Mage::getModel('salesrule/coupon')->load($sessionCoupon, 'code');
|
139 |
+
$rule = Mage::getModel('salesrule/rule')->load($couponData->getRuleId());
|
140 |
+
return $rule;
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getPLTString() // Return plt string to template
|
144 |
+
{
|
145 |
+
$productTracking = NULL;
|
146 |
+
$order = $this->getOrder();
|
147 |
+
if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/plt') == 1) { // 1 = enabled PLT | 2 = disabled PLT
|
148 |
+
$productString = ''; // Initialize variables
|
149 |
+
$category = '';
|
150 |
+
$productPrice = 0;
|
151 |
+
$orderedProducts = $this->getProducts($order); // Get products, coupon rule and action from rule
|
152 |
+
$rule = $this->getCouponRule($order);
|
153 |
+
$action = $rule->getSimpleAction();
|
154 |
+
foreach ($orderedProducts as $product) { // Implement PLT logic per order
|
155 |
+
$productPrice = $product->getPrice();
|
156 |
+
$categoryIds = $product->getProduct()->getCategoryIds();
|
157 |
+
$categoryId = end($categoryIds); // Get last category id as product category id
|
158 |
+
$categoryName = Mage::getModel('catalog/category')->load($categoryId);
|
159 |
+
$category = $categoryName->getName(); // Get product category from Id
|
160 |
+
if (isset($action)) {
|
161 |
+
$productTracking .= $this->getProductCoupon($action, $product, $rule, $category); // If coupon action exists
|
162 |
+
} else { // If coupon action does not exist
|
163 |
+
$productString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($order), $product->getItemId(), $product->getName(), $productPrice, $product->getQtyOrdered(), $product->getSku(), $category);
|
164 |
+
$productTracking .= $productString . "\n \t";
|
165 |
+
}
|
166 |
+
}
|
167 |
+
}
|
168 |
+
return $productTracking;
|
169 |
+
}
|
170 |
+
|
171 |
+
public function getProductCoupon($action, $product, $rule, $category) // Return plt string depending on coupon
|
172 |
+
{
|
173 |
+
$productPrice = $product->getPrice();
|
174 |
+
switch ($action)
|
175 |
+
{
|
176 |
+
case "by_percent": // If coupon is a single product percentage coupon
|
177 |
+
$discountPercent = $this->getDiscountPercent($order);
|
178 |
+
$productPrice = $productPrice * (1 - $discountPercent);
|
179 |
+
return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
|
180 |
+
case "by_fixed": // If coupon is a single product amount coupon
|
181 |
+
$discountAmount = $rule->getDiscountAmount(); // Get discount amount from coupon code
|
182 |
+
$productPrice = $productPrice - $discountAmount; // Calculate Product Price
|
183 |
+
return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
|
184 |
+
case "cart_fixed": // If coupon is a cart amount coupon
|
185 |
+
$total = $this->getSubTotal($order); // Get subtotal value
|
186 |
+
$percentOfTotal = $productPrice / $total; // Calculate product percentage from total
|
187 |
+
$discountForProduct = $percentOfTotal * $this->getDiscount($order); // Find product discount proportion
|
188 |
+
$productPrice = $productPrice - $discountForProduct; // Subtract discount from product price
|
189 |
+
return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
|
190 |
+
case "buy_x_get_y": // If coupon is buy x get y free coupon
|
191 |
+
$freeProductString = NULL; // Initialize productStrings
|
192 |
+
$paidProductString = NULL;
|
193 |
+
$quantity = $product->getQtyOrdered(); // Get product quantity
|
194 |
+
$productDiscountAmount = $product->getDiscountAmount(); // Get discount amount per product
|
195 |
+
$numberFreeProducts = $productDiscountAmount/$productPrice; // Calculate number of free products
|
196 |
+
$numberOfPaidProducts = $product->getQtyOrdered() - $numberOfFreeProducts; // Calculate number of paid products
|
197 |
+
if($numberOfFreeProducts != 0) // If number of free products is not 0 i.e > 0
|
198 |
+
{
|
199 |
+
$freeProductString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), 0, $numberOfFreeProducts, $product->getSku(), $category);
|
200 |
+
}
|
201 |
+
$paidProductString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, $numberOfPaidProducts, $product->getSku(), $category);
|
202 |
+
$productString = $paidProductString.$freeProductString;
|
203 |
+
return $productString;
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
public function constructPLTString($advertiserId, $orderRef, $productId, $productName, $productPrice, $productQuantity, $productSku, $productCategory) // Build return literal PLT string
|
208 |
+
{
|
209 |
+
$productString = "AW:P|" . $advertiserId . "|" . $orderRef . "|" . $productId . "|" . $productName . "|" . number_format($productPrice, 2) . "|" . intval($productQuantity) . "|" . $productSku. "|" . $this->getComms($customer) . "|" . $productCategory . "\n \t";
|
210 |
+
return $productString; // Return string constructed by parameters provided
|
211 |
+
}
|
212 |
+
|
213 |
+
public function getImagePixel() // Return image pixel to template
|
214 |
+
{
|
215 |
+
$imagePixel = NULL;
|
216 |
+
$order = $this->getOrder();
|
217 |
+
if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/activate_tracking_code') == 1) {
|
218 |
+
$imagePixel = $imagePixel = '<img border="0" height="0" src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=' . $this->getAdvertiserId() . '&amount=' . $this->getAwinAmount($order) . '&ch=' . $this->getChannel() . '&cr=' . $this->getCurrency($order) . '&parts=' . $this->getComms($customer). ':'. $this->getAwinAmount($order) . '&ref=' . $this->getLastOrderId($order) . '&testmode=' . $this->getTestMode() . '&p1=awinMagento&vc=' . $this->getVoucher($order) . '" style="display: none;" width="0">' . "\n";
|
219 |
+
return $imagePixel;
|
220 |
+
}
|
221 |
+
return $imagePixel;
|
222 |
+
}
|
223 |
+
|
224 |
+
public function getTracking() // Return javascript to template
|
225 |
+
{
|
226 |
+
$trackingCode = NULL;
|
227 |
+
$order = $this->getOrder();
|
228 |
+
if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/activate_tracking_code') == 1) {
|
229 |
+
$trackingCode = '
|
230 |
+
var AWIN = {};
|
231 |
+
AWIN.Tracking = {};
|
232 |
+
AWIN.Tracking.Sale = {};
|
233 |
+
/*** Set your transaction parameters ***/
|
234 |
+
AWIN.Tracking.Sale.amount = "' . $this->getAwinAmount($order) . '";
|
235 |
+
AWIN.Tracking.Sale.channel = "' . $this->getChannel() . '";
|
236 |
+
AWIN.Tracking.Sale.orderRef = "' . $this->getLastOrderId($order) . '";
|
237 |
+
AWIN.Tracking.Sale.parts = "' . $this->getComms($customer). ':'. $this->getAwinAmount($order) . '";
|
238 |
+
AWIN.Tracking.Sale.currency = "' . $this->getCurrency($order) . '";
|
239 |
+
AWIN.Tracking.Sale.test = "' . $this->getTestMode() . '";
|
240 |
+
AWIN.Tracking.Sale.voucher = "' . $this->getVoucher($order) . '";
|
241 |
+
AWIN.Tracking.Sale.custom = ["awinMagento"];' . "\n";
|
242 |
+
}
|
243 |
+
return $trackingCode;
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
|
app/code/local/DigitalWindow/AwinTracking/Block/Cookie.php
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Block_Cookie extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
public function setCookie()
|
5 |
-
{
|
6 |
-
$cookieDays = (int) Mage::getStoreConfig("AwinTracking_options/section_three/cookie_length");
|
7 |
-
if (!isset($cookieDays)){
|
8 |
-
$cookieDays = 30;
|
9 |
-
}
|
10 |
-
$keyParam = Mage::getStoreConfig("AwinTracking_options/section_three/param_key");
|
11 |
-
if (!isset($keyParam)){
|
12 |
-
$keyParam = 'source';
|
13 |
-
}
|
14 |
-
|
15 |
-
$param = Mage::app()->getRequest()->getParam($keyParam);
|
16 |
-
|
17 |
-
if (isset($param))
|
18 |
-
{
|
19 |
-
$date_of_expiry = time() + (24*60*60*$cookieDays);
|
20 |
-
setcookie($keyParam, $param, $date_of_expiry, "/" );
|
21 |
-
}
|
22 |
-
}
|
23 |
-
|
24 |
-
}
|
25 |
-
|
26 |
?>
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Block_Cookie extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function setCookie()
|
5 |
+
{
|
6 |
+
$cookieDays = (int) Mage::getStoreConfig("AwinTracking_options/section_three/cookie_length");
|
7 |
+
if (!isset($cookieDays)){
|
8 |
+
$cookieDays = 30;
|
9 |
+
}
|
10 |
+
$keyParam = Mage::getStoreConfig("AwinTracking_options/section_three/param_key");
|
11 |
+
if (!isset($keyParam)){
|
12 |
+
$keyParam = 'source';
|
13 |
+
}
|
14 |
+
|
15 |
+
$param = Mage::app()->getRequest()->getParam($keyParam);
|
16 |
+
|
17 |
+
if (isset($param))
|
18 |
+
{
|
19 |
+
$date_of_expiry = time() + (24*60*60*$cookieDays);
|
20 |
+
setcookie($keyParam, $param, $date_of_expiry, "/" );
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
?>
|
app/code/local/DigitalWindow/AwinTracking/Helper/Data.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Helper_Data extends Mage_Core_Helper_Data
|
3 |
{}
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Helper_Data extends Mage_Core_Helper_Data
|
3 |
{}
|
app/code/local/DigitalWindow/AwinTracking/Model/Observer.php
CHANGED
@@ -2,66 +2,57 @@
|
|
2 |
|
3 |
class DigitalWindow_AwinTracking_Model_Observer {
|
4 |
public function fireTracking(Varien_Event_Observer $observer){
|
5 |
-
|
6 |
$feedName = Mage::getStoreConfig("AwinTracking_options/section_two/feed_name");
|
7 |
$scheduledTime = Mage::getStoreConfig("AwinTracking_options/section_two/my_date");
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
}
|
12 |
-
|
13 |
-
public function schedule()
|
14 |
-
{
|
15 |
$_product = array();
|
16 |
$product_data = array();
|
17 |
$arr = array();
|
18 |
$web_id = Mage::getStoreConfig('AwinTracking_Datafeed/section_one/website');
|
19 |
$fileName = Mage::getStoreConfig('AwinTracking_Datafeed/section_one/feed_name');
|
20 |
$fileName = $fileName.'.csv';
|
21 |
-
$collection = Mage::getModel('catalog/product')->getCollection()->addWebsiteFilter($web_id)->addAttributeToSelect('
|
22 |
-
$collection->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
27 |
$product_data["pid"]=$product->getId();
|
28 |
-
$product_data['qty']
|
29 |
-
|
30 |
-
|
31 |
-
$product_data['stock_status']=1;
|
32 |
}else {
|
33 |
-
$product_data['stock_status']=0;
|
34 |
-
}
|
35 |
-
|
36 |
-
|
37 |
-
$product_data['isforsale']=1;
|
38 |
}else {
|
39 |
-
$product_data['isforsale']=0;
|
40 |
}
|
41 |
$product_data["product_name"]=$product->getName();
|
42 |
$product_data['product_description']=$product->getDescription();
|
43 |
$product_data["price"]=$product->getPrice();
|
44 |
$product_data['store_price']=$product->getFinalPrice();
|
45 |
$categoryIds = $product->getCategoryIds();
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
$product_data['product_url']=str_replace('pr_magento_exporter.php/','',$product->getProductUrl());
|
65 |
array_push($arr, $product_data);
|
66 |
}
|
67 |
$headers['product_id'] = 'product_id';
|
@@ -74,7 +65,7 @@ class DigitalWindow_AwinTracking_Model_Observer {
|
|
74 |
$headers['store_price'] = 'store_price';
|
75 |
$headers['merchant_category'] = 'merchant_category';
|
76 |
$headers['image_url'] = 'image_url';
|
77 |
-
$headers['
|
78 |
$file = fopen($fileName, 'w');
|
79 |
fputcsv($file, $headers);
|
80 |
foreach ($arr as $line)
|
@@ -84,4 +75,5 @@ class DigitalWindow_AwinTracking_Model_Observer {
|
|
84 |
fclose($file);
|
85 |
}
|
86 |
}
|
|
|
87 |
?>
|
2 |
|
3 |
class DigitalWindow_AwinTracking_Model_Observer {
|
4 |
public function fireTracking(Varien_Event_Observer $observer){
|
|
|
5 |
$feedName = Mage::getStoreConfig("AwinTracking_options/section_two/feed_name");
|
6 |
$scheduledTime = Mage::getStoreConfig("AwinTracking_options/section_two/my_date");
|
7 |
+
}
|
8 |
+
|
9 |
+
public function schedule() {
|
|
|
|
|
|
|
|
|
10 |
$_product = array();
|
11 |
$product_data = array();
|
12 |
$arr = array();
|
13 |
$web_id = Mage::getStoreConfig('AwinTracking_Datafeed/section_one/website');
|
14 |
$fileName = Mage::getStoreConfig('AwinTracking_Datafeed/section_one/feed_name');
|
15 |
$fileName = $fileName.'.csv';
|
16 |
+
$collection = Mage::getModel('catalog/product')->getCollection()->addWebsiteFilter($web_id)->addAttributeToFilter('status', 1)->addAttributeToSelect(array('name','image','url_key','price','description','url_path'));
|
17 |
+
$collection->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
|
18 |
+
->joinField('qty','cataloginventory/stock_item','qty','product_id=entity_id','{{table}}.stock_id=1','left')
|
19 |
+
->addAttributeToFilter('qty', array('gt' => 0));
|
20 |
+
|
21 |
+
foreach ($collection as $product) {
|
22 |
+
|
23 |
$product_data["pid"]=$product->getId();
|
24 |
+
$product_data['qty']=$product->getQty();
|
25 |
+
if ($product_data['qty'] > 0) {
|
26 |
+
$product_data['stock_status'] = 1;
|
|
|
27 |
}else {
|
28 |
+
$product_data['stock_status'] = 0;
|
29 |
+
}
|
30 |
+
if ($product->isSalable() == 1) {
|
31 |
+
$product_data['isforsale'] = 1;
|
|
|
32 |
}else {
|
33 |
+
$product_data['isforsale'] = 0;
|
34 |
}
|
35 |
$product_data["product_name"]=$product->getName();
|
36 |
$product_data['product_description']=$product->getDescription();
|
37 |
$product_data["price"]=$product->getPrice();
|
38 |
$product_data['store_price']=$product->getFinalPrice();
|
39 |
$categoryIds = $product->getCategoryIds();
|
40 |
+
if (count($categoryIds)) {
|
41 |
+
$firstCategoryId = $categoryIds[0];
|
42 |
+
$_category = Mage::getModel('catalog/category')->load($firstCategoryId);
|
43 |
+
$product_data['category'] = $_category->getName();
|
44 |
+
}
|
45 |
+
else {
|
46 |
+
$product_data['category'] = "no categories found";
|
47 |
+
}
|
48 |
+
try {
|
49 |
+
if($product->getImageUrl()){
|
50 |
+
$product_data['image_url'] = $product->getImageUrl();
|
51 |
+
}
|
52 |
+
}catch(Exception $e){
|
53 |
+
$product_data['image_url'] = "No Image found in Magento Catalogue.";
|
54 |
+
}
|
55 |
+
$product_data['product_url']=str_replace('pr_magento_exporter.php/','',$product->getProductUrl());
|
|
|
|
|
|
|
56 |
array_push($arr, $product_data);
|
57 |
}
|
58 |
$headers['product_id'] = 'product_id';
|
65 |
$headers['store_price'] = 'store_price';
|
66 |
$headers['merchant_category'] = 'merchant_category';
|
67 |
$headers['image_url'] = 'image_url';
|
68 |
+
$headers['product_urlo'] = 'product_url';
|
69 |
$file = fopen($fileName, 'w');
|
70 |
fputcsv($file, $headers);
|
71 |
foreach ($arr as $line)
|
75 |
fclose($file);
|
76 |
}
|
77 |
}
|
78 |
+
|
79 |
?>
|
app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/Cookie.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Model_System_Config_Backend_Cookie extends Mage_Core_Model_Config_Data
|
3 |
-
{
|
4 |
-
public function save()
|
5 |
-
{
|
6 |
-
$cookieLength = $this->getValue();
|
7 |
-
if($cookieLength <= 0 || !is_numeric($cookieLength) || is_float($cookieLength)){
|
8 |
-
Mage::throwException("Cookie length not saved, value should be positive numeric. Cookie length reverted.");
|
9 |
-
}elseif($cookieLength < 30){
|
10 |
-
Mage::getSingleton('core/session')->addNotice ('Cookie period under 30 days is not recommended.');
|
11 |
-
return parent::save();
|
12 |
-
}else{
|
13 |
-
return parent::save();
|
14 |
-
}
|
15 |
-
}
|
16 |
-
}
|
17 |
?>
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Model_System_Config_Backend_Cookie extends Mage_Core_Model_Config_Data
|
3 |
+
{
|
4 |
+
public function save()
|
5 |
+
{
|
6 |
+
$cookieLength = $this->getValue();
|
7 |
+
if($cookieLength <= 0 || !is_numeric($cookieLength) || is_float($cookieLength)){
|
8 |
+
Mage::throwException("Cookie length not saved, value should be positive numeric. Cookie length reverted.");
|
9 |
+
}elseif($cookieLength < 30){
|
10 |
+
Mage::getSingleton('core/session')->addNotice ('Cookie period under 30 days is not recommended.');
|
11 |
+
return parent::save();
|
12 |
+
}else{
|
13 |
+
return parent::save();
|
14 |
+
}
|
15 |
+
}
|
16 |
+
}
|
17 |
?>
|
app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/DefaultValue.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Model_System_Config_Backend_DefaultValue extends Mage_Core_Model_Config_Data
|
3 |
-
{
|
4 |
-
public function save()
|
5 |
-
{
|
6 |
-
$defaultValue = $this->getValue();
|
7 |
-
if(!ctype_alpha($defaultValue)){
|
8 |
-
Mage::throwException("Default value not saved, value should not be empty or contain numerics. Default value reverted.");
|
9 |
-
}else{
|
10 |
-
return parent::save();
|
11 |
-
}
|
12 |
-
}
|
13 |
-
}
|
14 |
?>
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Model_System_Config_Backend_DefaultValue extends Mage_Core_Model_Config_Data
|
3 |
+
{
|
4 |
+
public function save()
|
5 |
+
{
|
6 |
+
$defaultValue = $this->getValue();
|
7 |
+
if(!ctype_alpha($defaultValue)){
|
8 |
+
Mage::throwException("Default value not saved, value should not be empty or contain numerics. Default value reverted.");
|
9 |
+
}else{
|
10 |
+
return parent::save();
|
11 |
+
}
|
12 |
+
}
|
13 |
+
}
|
14 |
?>
|
app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/FeedName.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Model_System_Config_Backend_FeedName extends Mage_Core_Model_Config_Data
|
3 |
-
{
|
4 |
-
public function save()
|
5 |
-
{
|
6 |
-
$feedName = trim($this->getValue());
|
7 |
-
if (preg_match("[\W+]", $feedName) || empty($feedName))
|
8 |
-
{
|
9 |
-
Mage::throwException("Feed name cannot be empty or contain special characters");
|
10 |
-
}else{
|
11 |
-
return parent::save();
|
12 |
-
}
|
13 |
-
}
|
14 |
-
}
|
15 |
?>
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Model_System_Config_Backend_FeedName extends Mage_Core_Model_Config_Data
|
3 |
+
{
|
4 |
+
public function save()
|
5 |
+
{
|
6 |
+
$feedName = trim($this->getValue());
|
7 |
+
if (preg_match("[\W+]", $feedName) || empty($feedName))
|
8 |
+
{
|
9 |
+
Mage::throwException("Feed name cannot be empty or contain special characters");
|
10 |
+
}else{
|
11 |
+
return parent::save();
|
12 |
+
}
|
13 |
+
}
|
14 |
+
}
|
15 |
?>
|
app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/KeyParam.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Model_System_Config_Backend_KeyParam extends Mage_Core_Model_Config_Data
|
3 |
-
{
|
4 |
-
public function save()
|
5 |
-
{
|
6 |
-
$keyParam = $this->getValue();
|
7 |
-
if(!ctype_alpha($keyParam)){
|
8 |
-
Mage::throwException("Key parameter not saved, value should not be empty or contain numerics. Key parameter reverted.");
|
9 |
-
}else{
|
10 |
-
return parent::save();
|
11 |
-
}
|
12 |
-
}
|
13 |
-
}
|
14 |
?>
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Model_System_Config_Backend_KeyParam extends Mage_Core_Model_Config_Data
|
3 |
+
{
|
4 |
+
public function save()
|
5 |
+
{
|
6 |
+
$keyParam = $this->getValue();
|
7 |
+
if(!ctype_alpha($keyParam)){
|
8 |
+
Mage::throwException("Key parameter not saved, value should not be empty or contain numerics. Key parameter reverted.");
|
9 |
+
}else{
|
10 |
+
return parent::save();
|
11 |
+
}
|
12 |
+
}
|
13 |
+
}
|
14 |
?>
|
app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Backend/MerchantId.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Model_System_Config_Backend_MerchantId extends Mage_Core_Model_Config_Data
|
3 |
-
{
|
4 |
-
public function save()
|
5 |
-
{
|
6 |
-
$merchantId = $this->getValue();
|
7 |
-
if($merchantId <= 0 || !is_numeric($merchantId) || is_float($merchantId)){
|
8 |
-
Mage::throwException("Merchant ID not saved, value should be numeric. Mastertag not set.");
|
9 |
-
}else{
|
10 |
-
return parent::save();
|
11 |
-
}
|
12 |
-
}
|
13 |
-
}
|
14 |
?>
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Model_System_Config_Backend_MerchantId extends Mage_Core_Model_Config_Data
|
3 |
+
{
|
4 |
+
public function save()
|
5 |
+
{
|
6 |
+
$merchantId = $this->getValue();
|
7 |
+
if($merchantId <= 0 || !is_numeric($merchantId) || is_float($merchantId)){
|
8 |
+
Mage::throwException("Merchant ID not saved, value should be numeric. Mastertag not set.");
|
9 |
+
}else{
|
10 |
+
return parent::save();
|
11 |
+
}
|
12 |
+
}
|
13 |
+
}
|
14 |
?>
|
app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Clock/Frequency.php
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Model_System_Config_Clock_Frequency
|
3 |
-
{
|
4 |
-
/**
|
5 |
-
* Provide available options as a value/label array
|
6 |
-
*
|
7 |
-
* @return array
|
8 |
-
*/
|
9 |
-
/*
|
10 |
-
public function toOptionArray()
|
11 |
-
{
|
12 |
-
return array(
|
13 |
-
array('value'=>1, 'label'=>'One'),
|
14 |
-
array('value'=>2, 'label'=>'Two'),
|
15 |
-
array('value'=>3, 'label'=>'Three'),
|
16 |
-
array('value'=>4, 'label'=>'Four')
|
17 |
-
);
|
18 |
-
}*/
|
19 |
-
public function toOptionArray()
|
20 |
-
{
|
21 |
-
return array(
|
22 |
-
array('value'=> 0,'label'=> '0:00'),
|
23 |
-
array('value'=> 1,'label'=> '1:00'),
|
24 |
-
array('value'=> 2,'label'=> '2:00'),
|
25 |
-
array('value'=> 3,'label'=> '3:00'),
|
26 |
-
array('value'=> 4,'label'=> '4:00'),
|
27 |
-
array('value'=> 5,'label'=> '5:00'),
|
28 |
-
array('value'=> 6,'label'=> '6:00'),
|
29 |
-
array('value'=> 7,'label'=> '7:00'),
|
30 |
-
array('value'=> 8,'label'=> '8:00'),
|
31 |
-
array('value'=> 9,'label'=> '9:00'),
|
32 |
-
array('value'=> 10,'label'=> '10:00'),
|
33 |
-
array('value'=> 11,'label'=> '11:00'),
|
34 |
-
array('value'=> 12,'label'=> '12:00'),
|
35 |
-
array('value'=> 13,'label'=> '13:00'),
|
36 |
-
array('value'=> 14,'label'=> '14:00'),
|
37 |
-
array('value'=> 15,'label'=> '15:00'),
|
38 |
-
array('value'=> 16,'label'=> '16:00'),
|
39 |
-
array('value'=> 17,'label'=> '17:00'),
|
40 |
-
array('value'=> 18,'label'=> '18:00'),
|
41 |
-
array('value'=> 19,'label'=> '19:00'),
|
42 |
-
array('value'=> 20,'label'=> '20:00'),
|
43 |
-
array('value'=> 21,'label'=> '21:00'),
|
44 |
-
array('value'=> 22,'label'=> '22:00'),
|
45 |
-
array('value'=> 23,'label'=> '23:00')
|
46 |
-
);
|
47 |
-
}
|
48 |
}
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Model_System_Config_Clock_Frequency
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Provide available options as a value/label array
|
6 |
+
*
|
7 |
+
* @return array
|
8 |
+
*/
|
9 |
+
/*
|
10 |
+
public function toOptionArray()
|
11 |
+
{
|
12 |
+
return array(
|
13 |
+
array('value'=>1, 'label'=>'One'),
|
14 |
+
array('value'=>2, 'label'=>'Two'),
|
15 |
+
array('value'=>3, 'label'=>'Three'),
|
16 |
+
array('value'=>4, 'label'=>'Four')
|
17 |
+
);
|
18 |
+
}*/
|
19 |
+
public function toOptionArray()
|
20 |
+
{
|
21 |
+
return array(
|
22 |
+
array('value'=> 0,'label'=> '0:00'),
|
23 |
+
array('value'=> 1,'label'=> '1:00'),
|
24 |
+
array('value'=> 2,'label'=> '2:00'),
|
25 |
+
array('value'=> 3,'label'=> '3:00'),
|
26 |
+
array('value'=> 4,'label'=> '4:00'),
|
27 |
+
array('value'=> 5,'label'=> '5:00'),
|
28 |
+
array('value'=> 6,'label'=> '6:00'),
|
29 |
+
array('value'=> 7,'label'=> '7:00'),
|
30 |
+
array('value'=> 8,'label'=> '8:00'),
|
31 |
+
array('value'=> 9,'label'=> '9:00'),
|
32 |
+
array('value'=> 10,'label'=> '10:00'),
|
33 |
+
array('value'=> 11,'label'=> '11:00'),
|
34 |
+
array('value'=> 12,'label'=> '12:00'),
|
35 |
+
array('value'=> 13,'label'=> '13:00'),
|
36 |
+
array('value'=> 14,'label'=> '14:00'),
|
37 |
+
array('value'=> 15,'label'=> '15:00'),
|
38 |
+
array('value'=> 16,'label'=> '16:00'),
|
39 |
+
array('value'=> 17,'label'=> '17:00'),
|
40 |
+
array('value'=> 18,'label'=> '18:00'),
|
41 |
+
array('value'=> 19,'label'=> '19:00'),
|
42 |
+
array('value'=> 20,'label'=> '20:00'),
|
43 |
+
array('value'=> 21,'label'=> '21:00'),
|
44 |
+
array('value'=> 22,'label'=> '22:00'),
|
45 |
+
array('value'=> 23,'label'=> '23:00')
|
46 |
+
);
|
47 |
+
}
|
48 |
}
|
app/code/local/DigitalWindow/AwinTracking/Model/System/Config/Store/Id.php
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
-
<?php
|
2 |
-
class DigitalWindow_AwinTracking_Model_System_Config_Store_Id
|
3 |
-
{
|
4 |
-
/**
|
5 |
-
* Provide available options as a value/label array
|
6 |
-
*
|
7 |
-
* @return array
|
8 |
-
*/
|
9 |
-
|
10 |
-
/*
|
11 |
-
public function toOptionArray()
|
12 |
-
{
|
13 |
-
return array(
|
14 |
-
array('value'=>1, 'label'=>'One'),
|
15 |
-
array('value'=>2, 'label'=>'Two'),
|
16 |
-
array('value'=>3, 'label'=>'Three'),
|
17 |
-
array('value'=>4, 'label'=>'Four')
|
18 |
-
);
|
19 |
-
}*/
|
20 |
-
public function toOptionArray()
|
21 |
-
{
|
22 |
-
$i = 0;
|
23 |
-
$webArray = array();
|
24 |
-
$websites = Mage::app()->getWebsites();
|
25 |
-
foreach ($websites as $websiteInfo)
|
26 |
-
{
|
27 |
-
|
28 |
-
$webCode = $websiteInfo->getCode();
|
29 |
-
$webName = $websiteInfo->getName();
|
30 |
-
$webId =$websiteInfo->getId();
|
31 |
-
$webArray[$i] = array("value"=>$webId, "label"=>$webName);
|
32 |
-
$i++;
|
33 |
-
}
|
34 |
-
return $webArray;
|
35 |
-
}
|
36 |
}
|
1 |
+
<?php
|
2 |
+
class DigitalWindow_AwinTracking_Model_System_Config_Store_Id
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Provide available options as a value/label array
|
6 |
+
*
|
7 |
+
* @return array
|
8 |
+
*/
|
9 |
+
|
10 |
+
/*
|
11 |
+
public function toOptionArray()
|
12 |
+
{
|
13 |
+
return array(
|
14 |
+
array('value'=>1, 'label'=>'One'),
|
15 |
+
array('value'=>2, 'label'=>'Two'),
|
16 |
+
array('value'=>3, 'label'=>'Three'),
|
17 |
+
array('value'=>4, 'label'=>'Four')
|
18 |
+
);
|
19 |
+
}*/
|
20 |
+
public function toOptionArray()
|
21 |
+
{
|
22 |
+
$i = 0;
|
23 |
+
$webArray = array();
|
24 |
+
$websites = Mage::app()->getWebsites();
|
25 |
+
foreach ($websites as $websiteInfo)
|
26 |
+
{
|
27 |
+
|
28 |
+
$webCode = $websiteInfo->getCode();
|
29 |
+
$webName = $websiteInfo->getName();
|
30 |
+
$webId =$websiteInfo->getId();
|
31 |
+
$webArray[$i] = array("value"=>$webId, "label"=>$webName);
|
32 |
+
$i++;
|
33 |
+
}
|
34 |
+
return $webArray;
|
35 |
+
}
|
36 |
}
|
app/code/local/DigitalWindow/AwinTracking/etc/adminhtml.xml
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<acl>
|
4 |
-
<resources>
|
5 |
-
<admin>
|
6 |
-
<children>
|
7 |
-
<system>
|
8 |
-
<children>
|
9 |
-
<config>
|
10 |
-
<children>
|
11 |
-
<AwinTracking_options>
|
12 |
-
<title>Custom AWIN Section</title>
|
13 |
-
</AwinTracking_options>
|
14 |
-
<AwinTracking_Datafeed>
|
15 |
-
<title>Custom AWIN Section</title>
|
16 |
-
</AwinTracking_Datafeed>
|
17 |
-
</children>
|
18 |
-
</config>
|
19 |
-
</children>
|
20 |
-
</system>
|
21 |
-
</children>
|
22 |
-
</admin>
|
23 |
-
</resources>
|
24 |
-
</acl>
|
25 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<AwinTracking_options>
|
12 |
+
<title>Custom AWIN Section</title>
|
13 |
+
</AwinTracking_options>
|
14 |
+
<AwinTracking_Datafeed>
|
15 |
+
<title>Custom AWIN Section</title>
|
16 |
+
</AwinTracking_Datafeed>
|
17 |
+
</children>
|
18 |
+
</config>
|
19 |
+
</children>
|
20 |
+
</system>
|
21 |
+
</children>
|
22 |
+
</admin>
|
23 |
+
</resources>
|
24 |
+
</acl>
|
25 |
+
</config>
|
app/code/local/DigitalWindow/AwinTracking/etc/system.xml
CHANGED
@@ -95,7 +95,18 @@
|
|
95 |
<show_in_store>1</show_in_store>
|
96 |
<comment>This setting is established during the integration period.</comment>
|
97 |
<tooltip>Pay commission inclusive of sale tax, please disucss with your account executive.</tooltip>
|
98 |
-
</tax_inclusive>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
</fields>
|
100 |
</section_two>
|
101 |
<section_three translate="label">
|
95 |
<show_in_store>1</show_in_store>
|
96 |
<comment>This setting is established during the integration period.</comment>
|
97 |
<tooltip>Pay commission inclusive of sale tax, please disucss with your account executive.</tooltip>
|
98 |
+
</tax_inclusive>
|
99 |
+
<commission_group>
|
100 |
+
<label>Set Commission by Client</label>
|
101 |
+
<frontend_type>select</frontend_type>
|
102 |
+
<sort_order>3</sort_order>
|
103 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
104 |
+
<show_in_default>1</show_in_default>
|
105 |
+
<show_in_website>1</show_in_website>
|
106 |
+
<show_in_store>1</show_in_store>
|
107 |
+
<comment>Set 'New' vs 'Existing' Commission type</comment>
|
108 |
+
<tooltip>Pay commission based on client type, new or Existing</tooltip>
|
109 |
+
</commission_group>
|
110 |
</fields>
|
111 |
</section_two>
|
112 |
<section_three translate="label">
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AffiliateWindow</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU</license>
|
7 |
<channel>community</channel>
|
@@ -10,11 +10,12 @@
|
|
10 |
One click installation of Affiliate Window's bespoke tracking and datafeed platform.</summary>
|
11 |
<description>Affiliate Window's Official Magento Extension.
|
12 |
One click installation of Affiliate Window's bespoke tracking and datafeed platform.</description>
|
13 |
-
<notes>-
|
14 |
-
|
15 |
-
<
|
16 |
-
<
|
17 |
-
<
|
|
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AffiliateWindow</name>
|
4 |
+
<version>1.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU</license>
|
7 |
<channel>community</channel>
|
10 |
One click installation of Affiliate Window's bespoke tracking and datafeed platform.</summary>
|
11 |
<description>Affiliate Window's Official Magento Extension.
|
12 |
One click installation of Affiliate Window's bespoke tracking and datafeed platform.</description>
|
13 |
+
<notes>- Added a new commission group option for 'New' vs 'Existing'
|
14 |
+
- An issue with Datafeed processing time has been optimised for a more efficient processing</notes>
|
15 |
+
<authors><author><name>Edgelson Lua</name><user>edgelsonlua</user><email>Edgelson.lua@affiliatewindow.com</email></author><author><name>Vladimir Sofroniev</name><user>vladimirsofroniev</user><email>Vladimir.Sofroniev@affiliatewindow.com</email></author><author><name>Stephen Short</name><user>stephenshort</user><email>Stephen.Short@affiliatewindow.com</email></author><author><name>Oliver Smith</name><user>oliversmith</user><email>Oliver.Smith@affiliatewindow.com</email></author></authors>
|
16 |
+
<date>2016-09-28</date>
|
17 |
+
<time>14:41:14</time>
|
18 |
+
<contents><target name="mageetc"><dir name="modules"><file name="DigitalWindow_AwinTracking.xml" hash="3739f607424fe88e27289a0ea5019aed"/></dir></target><target name="magelocal"><dir name="DigitalWindow"><dir name="AwinTracking"><dir><dir name="Block"><file name="Awintracking.php" hash="4791087bd8efd7932053995e8de63370"/><file name="Cookie.php" hash="3ee6fc17736b5b27646719484ad25016"/><file name="Mastertag.php" hash="151472181007262eb3e48a518baf5e1f"/></dir><dir name="Helper"><file name="Data.php" hash="84da2f7b1d427572c39bb8d5ed38a79d"/></dir><dir name="Model"><file name="Observer.php" hash="2955c5b45ad3241be0cbcc75ecf93856"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cookie.php" hash="f1b3881b5018973234d0036f4cd92913"/><file name="DefaultValue.php" hash="385ad7b4cf5e53b7918738ee31453ae4"/><file name="FeedName.php" hash="c00b92aefa34a0671931ffd1813f5489"/><file name="KeyParam.php" hash="4d182ad62204dedfcd15c05b7afc97a6"/><file name="MerchantId.php" hash="efa81119ed443e5f49d5822730139540"/></dir><dir name="Clock"><file name="Frequency.php" hash="35ff5f59626f4ecc430054a2f26b0d2f"/></dir><dir name="Store"><file name="Id.php" hash="dcea2c76a764ada4cb55b18cf510a82a"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="1508d74a3fd78d13aeb1a60c256c26a4"/><file name="config.xml" hash="823155df497c3defcc15739c73a3bb6b"/><file name="system.xml" hash="65caed27d2696930bb6fd336252f5fb7"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="digitalwindow"><dir><dir name="awintracking"><file name="awintracking.phtml" hash="dad28ea230f1e1fb6f667a88faa4b51f"/><file name="dwin1.phtml" hash="9fb45f13061159776dcae4772c49dfd0"/></dir></dir></dir></dir><dir name="layout"><file name="digitalwindow_awintracking.xml" hash="fea2f002706ecedb9ea2d757412a2fbd"/></dir></dir></dir></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|