AffiliateWindow - Version 1.0.1

Version Notes

- Fixed minor issue with out-of-session de-duplication settings.
- Updated link to wiki.

Download this release

Release Info

Developer Stephen Short
Extension AffiliateWindow
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/local/DigitalWindow/AwinTracking/Block/Awintracking.php CHANGED
@@ -1,222 +1,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 getCookieSource() // Get source parameter from cookie
31
- {
32
- $keyParam = Mage::getStoreConfig("AwinTracking_options/section_three/param_key");
33
- if (isset($keyParam)) {
34
- $channelParameter = filter_input(INPUT_COOKIE, $keyParam);
35
- if (isset($channelParameter)) {
36
- return $channelParameter;
37
- }
38
- }
39
- }
40
-
41
- public function getProducts() // Get all products from order object
42
- {
43
- $order = $this->getOrder();
44
- $orderedProducts = $order->getAllVisibleItems();
45
- return $orderedProducts;
46
- }
47
-
48
- public function getGrandTotal() // Get grand total amount
49
- {
50
- $order = $this->getOrder();
51
- $grandTotal = $order->getGrandTotal();
52
- return $grandTotal;
53
- }
54
-
55
- public function getShipping() // Get shipping amount
56
- {
57
- $order = $this->getOrder();
58
- $shippingAmount = $order->getShippingAmount();
59
- return $shippingAmount;
60
- }
61
-
62
- public function getSubTotal() // Get Subtotal (Subtotal = GrantTotal - Shipping - Tax)
63
- {
64
- $order = $this->getOrder();
65
- $totalSubShipping = $order->getSubtotal();
66
- return number_format($totalSubShipping, 2);
67
- }
68
-
69
- public function getAwinAmount() // Get amount for awin tracking (dependant on VAT variable from backend config)
70
- {
71
- $order = $this->getOrder();
72
- $includeVatInCalculation = Mage::getStoreConfig('AwinTracking_options/section_two/tax_inclusive');
73
- $taxAmount = ($includeVatInCalculation == 0) ? $order->getTaxAmount() : 0;
74
- $amount = ($this->getGrandTotal() - $this->getShipping()) - $taxAmount;
75
- return number_format($amount, 2);
76
-
77
- }
78
-
79
- public function getLastOrderId() // Get order Id
80
- {
81
- $order = $this->getOrder();
82
- $lastOrderId = $order->getIncrementId();
83
- return $lastOrderId;
84
- }
85
-
86
- public function getVoucher() // Get voucher code
87
- {
88
- $order = $this->getOrder();
89
- $voucherCode = $order->coupon_code;
90
- return $voucherCode;
91
- }
92
-
93
- public function getDiscount() // Get discount amount (whole number)
94
- {
95
- $order = $this->getOrder();
96
- $discountAmount = abs($order->getDiscountAmount());
97
- return $discountAmount;
98
- }
99
-
100
- public function getDiscountPercent() // Get discount percent using discount amount
101
- {
102
- $order = $this->getOrder();
103
- $discountAmount = $this->getDiscount($order);
104
- $totalSubShipping = $this->getSubTotal($order);
105
- $discountPercent = $discountAmount / $totalSubShipping;
106
- return $discountPercent;
107
- }
108
-
109
- public function getCouponRule() // Get coupon rule (used for determining the coupon type)
110
- {
111
- $order = $this->getOrder();
112
- $sessionCoupon = $this->getVoucher($order);
113
- $couponData = Mage::getModel('salesrule/coupon')->load($sessionCoupon, 'code');
114
- $rule = Mage::getModel('salesrule/rule')->load($couponData->getRuleId());
115
- return $rule;
116
- }
117
-
118
- public function getPLTString() // Return plt string to template
119
- {
120
- $productTracking = NULL;
121
- $order = $this->getOrder();
122
- if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/plt') == 1) { // 1 = enabled PLT | 2 = disabled PLT
123
- $productString = ''; // Initialize variables
124
- $category = '';
125
- $productPrice = 0;
126
- $orderedProducts = $this->getProducts($order); // Get products, coupon rule and action from rule
127
- $rule = $this->getCouponRule($order);
128
- $action = $rule->getSimpleAction();
129
- foreach ($orderedProducts as $product) { // Implement PLT logic per order
130
- $productPrice = $product->getPrice();
131
- $categoryIds = $product->getProduct()->getCategoryIds();
132
- $categoryId = end($categoryIds); // Get last category id as product category id
133
- $categoryName = Mage::getModel('catalog/category')->load($categoryId);
134
- $category = $categoryName->getName(); // Get product category from Id
135
- if (isset($action)) {
136
- $productTracking .= $this->getProductCoupon($action, $product, $rule, $category); // If coupon action exists
137
- } else { // If coupon action does not exist
138
- $productString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($order), $product->getItemId(), $product->getName(), $productPrice, $product->getQtyOrdered(), $product->getSku(), $category);
139
- $productTracking .= $productString . "\n \t";
140
- }
141
- }
142
- }
143
- return $productTracking;
144
- }
145
-
146
- public function getProductCoupon($action, $product, $rule, $category) // Return plt string depending on coupon
147
- {
148
- $productPrice = $product->getPrice();
149
- switch ($action)
150
- {
151
- case "by_percent": // If coupon is a single product percentage coupon
152
- $discountPercent = $this->getDiscountPercent($order);
153
- $productPrice = $productPrice * (1 - $discountPercent);
154
- return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
155
- case "by_fixed": // If coupon is a single product amount coupon
156
- $discountAmount = $rule->getDiscountAmount(); // Get discount amount from coupon code
157
- $productPrice = $productPrice - $discountAmount; // Calculate Product Price
158
- return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
159
- case "cart_fixed": // If coupon is a cart amount coupon
160
- $total = $this->getSubTotal($order); // Get subtotal value
161
- $percentOfTotal = $productPrice / $total; // Calculate product percentage from total
162
- $discountForProduct = $percentOfTotal * $this->getDiscount($order); // Find product discount proportion
163
- $productPrice = $productPrice - $discountForProduct; // Subtract discount from product price
164
- return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
165
- case "buy_x_get_y": // If coupon is buy x get y free coupon
166
- $freeProductString = NULL; // Initialize productStrings
167
- $paidProductString = NULL;
168
- $quantity = $product->getQtyOrdered(); // Get product quantity
169
- $productDiscountAmount = $product->getDiscountAmount(); // Get discount amount per product
170
- $numberFreeProducts = $productDiscountAmount/$productPrice; // Calculate number of free products
171
- $numberOfPaidProducts = $product->getQtyOrdered() - $numberOfFreeProducts; // Calculate number of paid products
172
- if($numberOfFreeProducts != 0) // If number of free products is not 0 i.e > 0
173
- {
174
- $freeProductString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), 0, $numberOfFreeProducts, $product->getSku(), $category);
175
- }
176
- $paidProductString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, $numberOfPaidProducts, $product->getSku(), $category);
177
- $productString = $paidProductString.$freeProductString;
178
- return $productString;
179
- }
180
- }
181
-
182
- public function constructPLTString($advertiserId, $orderRef, $productId, $productName, $productPrice, $productQuantity, $productSku, $productCategory) // Build return literal PLT string
183
- {
184
- $productString = "AW:P|" . $advertiserId . "|" . $orderRef . "|" . $productId . "|" . $productName . "|" . number_format($productPrice, 2) . "|" . $productQuantity . "|" . $productSku. "|DEFAULT|" . $productCategory . "\n \t";
185
- return $productString; // Return string constructed by parameters provided
186
- }
187
-
188
- public function getImagePixel() // Return image pixel to template
189
- {
190
- $imagePixel = NULL;
191
- $order = $this->getOrder();
192
- if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/activate_tracking_code') == 1) {
193
- $imagePixel = $imagePixel = '<img border="0" height="0" src="https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=' . $this->getAdvertiserId() . '&amp;amount=' . $this->getAwinAmount($order) . '&amp;ch=' . $this->getCookieSource() . '&amp;cr=' . $this->getCurrency($order) . '&amp;parts=DEFAULT:' . $this->getAwinAmount($order) . '&amp;ref=' . $this->getLastOrderId($order) . '&amp;testmode=' . $this->getTestMode() . '&amp;p1=awinMagento&amp;vc=' . $this->getVoucher($order) . '" style="display: none;" width="0">' . "\n";
194
- return $imagePixel;
195
- }
196
- return $imagePixel;
197
- }
198
-
199
- public function getTracking() // Return javascript to template
200
- {
201
- $trackingCode = NULL;
202
- $order = $this->getOrder();
203
- if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/activate_tracking_code') == 1) {
204
- $trackingCode = '
205
- var AWIN = {};
206
- AWIN.Tracking = {};
207
- AWIN.Tracking.Sale = {};
208
- /*** Set your transaction parameters ***/
209
- AWIN.Tracking.Sale.amount = "' . $this->getAwinAmount($order) . '";
210
- AWIN.Tracking.Sale.channel = "' . $this->getCookieSource() . '";
211
- AWIN.Tracking.Sale.orderRef = "' . $this->getLastOrderId($order) . '";
212
- AWIN.Tracking.Sale.parts = "DEFAULT:' . $this->getAwinAmount($order) . '";
213
- AWIN.Tracking.Sale.currency = "' . $this->getCurrency($order) . '";
214
- AWIN.Tracking.Sale.test = "' . $this->getTestMode() . '";
215
- AWIN.Tracking.Sale.voucher = "' . $this->getVoucher($order) . '";
216
- AWIN.Tracking.Sale.custom = ["awinMagento"];' . "\n";
217
- }
218
- return $trackingCode;
219
- }
220
- }
221
-
222
-
 
 
 
 
 
 
 
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
+ if ((int) Mage::getStoreConfig("AwinTracking_options/section_three/enable_dedupe") == 1){
34
+ $keyParam = Mage::getStoreConfig("AwinTracking_options/section_three/param_key");
35
+ if (isset($keyParam)) {
36
+ $channelParameter = filter_input(INPUT_COOKIE, $keyParam);
37
+ if (isset($channelParameter)) {
38
+ return $channelParameter;
39
+ }else{
40
+ $defaultValue = Mage::getStoreConfig("AwinTracking_options/section_three/default_value");
41
+ return $defaultValue;
42
+ }
43
+ }
44
+ }
45
+ return 'aw';
46
+ }
47
+
48
+ public function getProducts() // Get all products from order object
49
+ {
50
+ $order = $this->getOrder();
51
+ $orderedProducts = $order->getAllVisibleItems();
52
+ return $orderedProducts;
53
+ }
54
+
55
+ public function getGrandTotal() // Get grand total amount
56
+ {
57
+ $order = $this->getOrder();
58
+ $grandTotal = $order->getGrandTotal();
59
+ return $grandTotal;
60
+ }
61
+
62
+ public function getShipping() // Get shipping amount
63
+ {
64
+ $order = $this->getOrder();
65
+ $shippingAmount = $order->getShippingAmount();
66
+ return $shippingAmount;
67
+ }
68
+
69
+ public function getSubTotal() // Get Subtotal (Subtotal = GrantTotal - Shipping - Tax)
70
+ {
71
+ $order = $this->getOrder();
72
+ $totalSubShipping = $order->getSubtotal();
73
+ return number_format($totalSubShipping, 2);
74
+ }
75
+
76
+ public function getAwinAmount() // Get amount for awin tracking (dependant on VAT variable from backend config)
77
+ {
78
+ $order = $this->getOrder();
79
+ $includeVatInCalculation = Mage::getStoreConfig('AwinTracking_options/section_two/tax_inclusive');
80
+ $taxAmount = ($includeVatInCalculation == 0) ? $order->getTaxAmount() : 0;
81
+ $amount = ($this->getGrandTotal() - $this->getShipping()) - $taxAmount;
82
+ return number_format($amount, 2);
83
+
84
+ }
85
+
86
+ public function getLastOrderId() // Get order Id
87
+ {
88
+ $order = $this->getOrder();
89
+ $lastOrderId = $order->getIncrementId();
90
+ return $lastOrderId;
91
+ }
92
+
93
+ public function getVoucher() // Get voucher code
94
+ {
95
+ $order = $this->getOrder();
96
+ $voucherCode = $order->coupon_code;
97
+ return $voucherCode;
98
+ }
99
+
100
+ public function getDiscount() // Get discount amount (whole number)
101
+ {
102
+ $order = $this->getOrder();
103
+ $discountAmount = abs($order->getDiscountAmount());
104
+ return $discountAmount;
105
+ }
106
+
107
+ public function getDiscountPercent() // Get discount percent using discount amount
108
+ {
109
+ $order = $this->getOrder();
110
+ $discountAmount = $this->getDiscount($order);
111
+ $totalSubShipping = $this->getSubTotal($order);
112
+ $discountPercent = $discountAmount / $totalSubShipping;
113
+ return $discountPercent;
114
+ }
115
+
116
+ public function getCouponRule() // Get coupon rule (used for determining the coupon type)
117
+ {
118
+ $order = $this->getOrder();
119
+ $sessionCoupon = $this->getVoucher($order);
120
+ $couponData = Mage::getModel('salesrule/coupon')->load($sessionCoupon, 'code');
121
+ $rule = Mage::getModel('salesrule/rule')->load($couponData->getRuleId());
122
+ return $rule;
123
+ }
124
+
125
+ public function getPLTString() // Return plt string to template
126
+ {
127
+ $productTracking = NULL;
128
+ $order = $this->getOrder();
129
+ if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/plt') == 1) { // 1 = enabled PLT | 2 = disabled PLT
130
+ $productString = ''; // Initialize variables
131
+ $category = '';
132
+ $productPrice = 0;
133
+ $orderedProducts = $this->getProducts($order); // Get products, coupon rule and action from rule
134
+ $rule = $this->getCouponRule($order);
135
+ $action = $rule->getSimpleAction();
136
+ foreach ($orderedProducts as $product) { // Implement PLT logic per order
137
+ $productPrice = $product->getPrice();
138
+ $categoryIds = $product->getProduct()->getCategoryIds();
139
+ $categoryId = end($categoryIds); // Get last category id as product category id
140
+ $categoryName = Mage::getModel('catalog/category')->load($categoryId);
141
+ $category = $categoryName->getName(); // Get product category from Id
142
+ if (isset($action)) {
143
+ $productTracking .= $this->getProductCoupon($action, $product, $rule, $category); // If coupon action exists
144
+ } else { // If coupon action does not exist
145
+ $productString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($order), $product->getItemId(), $product->getName(), $productPrice, $product->getQtyOrdered(), $product->getSku(), $category);
146
+ $productTracking .= $productString . "\n \t";
147
+ }
148
+ }
149
+ }
150
+ return $productTracking;
151
+ }
152
+
153
+ public function getProductCoupon($action, $product, $rule, $category) // Return plt string depending on coupon
154
+ {
155
+ $productPrice = $product->getPrice();
156
+ switch ($action)
157
+ {
158
+ case "by_percent": // If coupon is a single product percentage coupon
159
+ $discountPercent = $this->getDiscountPercent($order);
160
+ $productPrice = $productPrice * (1 - $discountPercent);
161
+ return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
162
+ case "by_fixed": // If coupon is a single product amount coupon
163
+ $discountAmount = $rule->getDiscountAmount(); // Get discount amount from coupon code
164
+ $productPrice = $productPrice - $discountAmount; // Calculate Product Price
165
+ return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
166
+ case "cart_fixed": // If coupon is a cart amount coupon
167
+ $total = $this->getSubTotal($order); // Get subtotal value
168
+ $percentOfTotal = $productPrice / $total; // Calculate product percentage from total
169
+ $discountForProduct = $percentOfTotal * $this->getDiscount($order); // Find product discount proportion
170
+ $productPrice = $productPrice - $discountForProduct; // Subtract discount from product price
171
+ return $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, round($product->getQtyOrdered()), $product->getSku(), $category);
172
+ case "buy_x_get_y": // If coupon is buy x get y free coupon
173
+ $freeProductString = NULL; // Initialize productStrings
174
+ $paidProductString = NULL;
175
+ $quantity = $product->getQtyOrdered(); // Get product quantity
176
+ $productDiscountAmount = $product->getDiscountAmount(); // Get discount amount per product
177
+ $numberFreeProducts = $productDiscountAmount/$productPrice; // Calculate number of free products
178
+ $numberOfPaidProducts = $product->getQtyOrdered() - $numberOfFreeProducts; // Calculate number of paid products
179
+ if($numberOfFreeProducts != 0) // If number of free products is not 0 i.e > 0
180
+ {
181
+ $freeProductString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), 0, $numberOfFreeProducts, $product->getSku(), $category);
182
+ }
183
+ $paidProductString = $this->constructPLTString($this->getAdvertiserId(), $this->getLastOrderId($this->getOrder()), $product->getItemId(), $product->getName(), $productPrice, $numberOfPaidProducts, $product->getSku(), $category);
184
+ $productString = $paidProductString.$freeProductString;
185
+ return $productString;
186
+ }
187
+ }
188
+
189
+ public function constructPLTString($advertiserId, $orderRef, $productId, $productName, $productPrice, $productQuantity, $productSku, $productCategory) // Build return literal PLT string
190
+ {
191
+ $productString = "AW:P|" . $advertiserId . "|" . $orderRef . "|" . $productId . "|" . $productName . "|" . number_format($productPrice, 2) . "|" . $productQuantity . "|" . $productSku. "|DEFAULT|" . $productCategory . "\n \t";
192
+ return $productString; // Return string constructed by parameters provided
193
+ }
194
+
195
+ public function getImagePixel() // Return image pixel to template
196
+ {
197
+ $imagePixel = NULL;
198
+ $order = $this->getOrder();
199
+ if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/activate_tracking_code') == 1) {
200
+ $imagePixel = $imagePixel = '<img border="0" height="0" src="https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=' . $this->getAdvertiserId() . '&amp;amount=' . $this->getAwinAmount($order) . '&amp;ch=' . $this->getChannel() . '&amp;cr=' . $this->getCurrency($order) . '&amp;parts=DEFAULT:' . $this->getAwinAmount($order) . '&amp;ref=' . $this->getLastOrderId($order) . '&amp;testmode=' . $this->getTestMode() . '&amp;p1=awinMagento&amp;vc=' . $this->getVoucher($order) . '" style="display: none;" width="0">' . "\n";
201
+ return $imagePixel;
202
+ }
203
+ return $imagePixel;
204
+ }
205
+
206
+ public function getTracking() // Return javascript to template
207
+ {
208
+ $trackingCode = NULL;
209
+ $order = $this->getOrder();
210
+ if ((int) Mage::getStoreConfig('AwinTracking_options/section_one/activate_tracking_code') == 1) {
211
+ $trackingCode = '
212
+ var AWIN = {};
213
+ AWIN.Tracking = {};
214
+ AWIN.Tracking.Sale = {};
215
+ /*** Set your transaction parameters ***/
216
+ AWIN.Tracking.Sale.amount = "' . $this->getAwinAmount($order) . '";
217
+ AWIN.Tracking.Sale.channel = "' . $this->getChannel() . '";
218
+ AWIN.Tracking.Sale.orderRef = "' . $this->getLastOrderId($order) . '";
219
+ AWIN.Tracking.Sale.parts = "DEFAULT:' . $this->getAwinAmount($order) . '";
220
+ AWIN.Tracking.Sale.currency = "' . $this->getCurrency($order) . '";
221
+ AWIN.Tracking.Sale.test = "' . $this->getTestMode() . '";
222
+ AWIN.Tracking.Sale.voucher = "' . $this->getVoucher($order) . '";
223
+ AWIN.Tracking.Sale.custom = ["awinMagento"];' . "\n";
224
+ }
225
+ return $trackingCode;
226
+ }
227
+ }
228
+
229
+
app/code/local/DigitalWindow/AwinTracking/Block/Cookie.php CHANGED
@@ -11,30 +11,16 @@
11
  if (!isset($keyParam)){
12
  $keyParam = 'source';
13
  }
14
- $defaultValue = Mage::getStoreConfig("AwinTracking_options/section_three/default_value");
15
- if (!isset($defaultValue)){
16
- $defaultValue = 'na';
17
- }
18
  $param = Mage::app()->getRequest()->getParam($keyParam);
19
 
20
- if ((int) Mage::getStoreConfig("AwinTracking_options/section_three/enable_dedupe") == 0)
21
- {
22
- $date_of_expiry = time() + (24*60*60*30);
23
- setcookie($keyParam, "aw", $date_of_expiry, "/" );
24
- }
25
- else
26
- {
27
  if (isset($param))
28
  {
29
  $date_of_expiry = time() + (24*60*60*$cookieDays);
30
  setcookie($keyParam, $param, $date_of_expiry, "/" );
31
- }
32
- else
33
- {
34
- $date_of_expiry = time() + (24*60*60*$cookieDays);
35
- setcookie($keyParam, $defaultValue, $date_of_expiry, "/" );
36
- }
37
  }
38
- }
39
  }
 
40
  ?>
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/etc/system.xml CHANGED
@@ -72,7 +72,7 @@
72
  <show_in_default>2</show_in_default>
73
  <show_in_website>2</show_in_website>
74
  <show_in_store>2</show_in_store>
75
- <comment><![CDATA[<strong>For more information about this plug-in please visit the<a href="http://affiliatewindow.com" target="_blank">Wiki</a></strong>]]></comment>
76
  <fields>
77
  <merchant_id>
78
  <backend_model>DigitalWindow_AwinTracking/System_Config_Backend_MerchantId</backend_model>
72
  <show_in_default>2</show_in_default>
73
  <show_in_website>2</show_in_website>
74
  <show_in_store>2</show_in_store>
75
+ <comment><![CDATA[<strong>For more information about this plug-in please visit the<a href="http://wiki.affiliatewindow.com/index.php/Magento_Plugin" target="_blank">Wiki</a></strong>]]></comment>
76
  <fields>
77
  <merchant_id>
78
  <backend_model>DigitalWindow_AwinTracking/System_Config_Backend_MerchantId</backend_model>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>AffiliateWindow</name>
4
- <version>1.0.0</version>
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.&#xD;
12
  One click installation of Affiliate Window's bespoke tracking and datafeed platform.</description>
13
- <notes>GM</notes>
 
14
  <authors><author><name>Stephen Short</name><user>stephenshort</user><email>Stephen.Short@affiliatewindow.com</email></author><author><name>Vladimir Sofroniev</name><user>vladimirsofroniev</user><email>Vladimir.Sofroniev@affiliatewindow.com</email></author><author><name>Edgelson Lua</name><user>edgelsonlua</user><email>Edgelson.Lua@affiliatewindow.com</email></author><author><name>Oliver Smith</name><user>oliversmith</user><email>Oliver.Smith@affiliatewindow.com</email></author></authors>
15
- <date>2016-02-02</date>
16
- <time>09:01:59</time>
17
- <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="d3f463d249baa732d7ee75b38184fa0f"/><file name="Cookie.php" hash="66736b4cc636b72a9d00dc079efd02f7"/><file name="Mastertag.php" hash="92e6ef9a8c39aead8fa661e224e678e0"/></dir><dir name="Helper"><file name="Data.php" hash="c5a3c31d029ba2826605ce4f65f1d2db"/></dir><dir name="Model"><file name="Observer.php" hash="66506dc0d1c627afd118cf9fede24e40"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cookie.php" hash="50f06b4fcfca368033664d0eb5c9b7c9"/><file name="DefaultValue.php" hash="5d50db729cddc93cf4edac2369a1d395"/><file name="FeedName.php" hash="27c58e95203d12f93f5ec999367b51f6"/><file name="KeyParam.php" hash="39d3c69129f1e959d77b604e46f6f790"/><file name="MerchantId.php" hash="26428dec0c735ecb6c8f94fd4d2aa6a6"/></dir><dir name="Clock"><file name="Frequency.php" hash="6a13b43ef6004527a37f115a3243e52a"/></dir><dir name="Store"><file name="Id.php" hash="dc04605e1dd977956e8e1c7c474aeced"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dc37b4397842f39ee0e2bd565f8f2083"/><file name="config.xml" hash="20e28c1e6f142657bf727b7d54add776"/><file name="system.xml" hash="ea626b675b41f82405e58960c96e1117"/></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="39ee017118d4da5c1f3ab23a8d3889d0"/><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>
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.1</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.&#xD;
12
  One click installation of Affiliate Window's bespoke tracking and datafeed platform.</description>
13
+ <notes>- Fixed minor issue with out-of-session de-duplication settings.&#xD;
14
+ - Updated link to wiki.</notes>
15
  <authors><author><name>Stephen Short</name><user>stephenshort</user><email>Stephen.Short@affiliatewindow.com</email></author><author><name>Vladimir Sofroniev</name><user>vladimirsofroniev</user><email>Vladimir.Sofroniev@affiliatewindow.com</email></author><author><name>Edgelson Lua</name><user>edgelsonlua</user><email>Edgelson.Lua@affiliatewindow.com</email></author><author><name>Oliver Smith</name><user>oliversmith</user><email>Oliver.Smith@affiliatewindow.com</email></author></authors>
16
+ <date>2016-03-10</date>
17
+ <time>15:51:16</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="7c11c3ebf4f2c9601b13c3dfe1385957"/><file name="Cookie.php" hash="f15ca577e469e0b020a23ade64182ae3"/><file name="Mastertag.php" hash="92e6ef9a8c39aead8fa661e224e678e0"/></dir><dir name="Helper"><file name="Data.php" hash="c5a3c31d029ba2826605ce4f65f1d2db"/></dir><dir name="Model"><file name="Observer.php" hash="66506dc0d1c627afd118cf9fede24e40"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cookie.php" hash="50f06b4fcfca368033664d0eb5c9b7c9"/><file name="DefaultValue.php" hash="5d50db729cddc93cf4edac2369a1d395"/><file name="FeedName.php" hash="27c58e95203d12f93f5ec999367b51f6"/><file name="KeyParam.php" hash="39d3c69129f1e959d77b604e46f6f790"/><file name="MerchantId.php" hash="26428dec0c735ecb6c8f94fd4d2aa6a6"/></dir><dir name="Clock"><file name="Frequency.php" hash="6a13b43ef6004527a37f115a3243e52a"/></dir><dir name="Store"><file name="Id.php" hash="dc04605e1dd977956e8e1c7c474aeced"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dc37b4397842f39ee0e2bd565f8f2083"/><file name="config.xml" hash="20e28c1e6f142657bf727b7d54add776"/><file name="system.xml" hash="71600ade309186b091e8b17a3568bfdc"/></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="39ee017118d4da5c1f3ab23a8d3889d0"/><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>