Version Notes
Fixed tracking link generator
Download this release
Release Info
Developer | Packpin Packpin |
Extension | Packpin_Pptrack |
Version | 1.5.6 |
Comparing to | |
See all releases |
Code changes from version 1.5.5 to 1.5.6
- app/code/community/Packpin/Pptrack/Block/Adminhtml/Dashboard.php +210 -210
- app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/Create/Tracking.php +38 -38
- app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/View/Tracking.php +64 -64
- app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Hint.php +53 -53
- app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Scripts.php +53 -53
- app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Form/Fieldset/Carrier.php +80 -80
- app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks.php +14 -14
- app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit.php +32 -32
- app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit/Form.php +53 -53
- app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Grid.php +142 -142
- app/code/community/Packpin/Pptrack/Block/Ads.php +38 -38
- app/code/community/Packpin/Pptrack/Block/Crosssell.php +21 -21
- app/code/community/Packpin/Pptrack/Block/Index.php +121 -121
- app/code/community/Packpin/Pptrack/Block/Script.php +8 -8
- app/code/community/Packpin/Pptrack/Block/Trackings.php +39 -39
- app/code/community/Packpin/Pptrack/Helper/Data.php +369 -369
- app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviews.php +13 -13
- app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviewspage.php +14 -14
- app/code/community/Packpin/Pptrack/Model/Api.php +137 -137
- app/code/community/Packpin/Pptrack/Model/Carrier.php +172 -172
- app/code/community/Packpin/Pptrack/Model/EnableNotifications.php +91 -91
- app/code/community/Packpin/Pptrack/Model/Observer.php +329 -329
- app/code/community/Packpin/Pptrack/Model/Order/Shipment.php +40 -40
- app/code/community/Packpin/Pptrack/Model/Resource/Carrier.php +9 -9
- app/code/community/Packpin/Pptrack/Model/Resource/Carrier/Collection.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Resource/Setting.php +9 -9
- app/code/community/Packpin/Pptrack/Model/Resource/Setting/Collection.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Resource/Track.php +9 -9
- app/code/community/Packpin/Pptrack/Model/Resource/Track/Collection.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail/Collection.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed/Collection.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Resource/Visit.php +9 -9
- app/code/community/Packpin/Pptrack/Model/Resource/Visit/Collection.php +7 -7
- app/code/community/Packpin/Pptrack/Model/Setting.php +28 -28
- app/code/community/Packpin/Pptrack/Model/Track.php +478 -478
- app/code/community/Packpin/Pptrack/Model/Trackdetail.php +89 -89
- app/code/community/Packpin/Pptrack/Model/Trackunsubscribed.php +31 -31
- app/code/community/Packpin/Pptrack/Model/Translate.php +38 -38
- app/code/community/Packpin/Pptrack/Model/Visit.php +24 -24
- app/code/community/Packpin/Pptrack/controllers/Adminhtml/PackpintracksController.php +117 -117
- app/code/community/Packpin/Pptrack/controllers/Adminhtml/PpnotificationsController.php +28 -28
- app/code/community/Packpin/Pptrack/controllers/IndexController.php +38 -38
- app/code/community/Packpin/Pptrack/controllers/UnsubscribeController.php +30 -30
- app/code/community/Packpin/Pptrack/data/pptrack_setup/data-upgrade-0.1.5-1.1.0.php +33 -33
- app/code/community/Packpin/Pptrack/etc/adminhtml.xml +60 -60
- app/code/community/Packpin/Pptrack/etc/api.xml +42 -42
- app/code/community/Packpin/Pptrack/etc/config.xml +317 -317
- app/code/community/Packpin/Pptrack/etc/system.xml +595 -595
- app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-install-0.1.2.php +85 -85
- app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.2-0.1.5.php +21 -21
- app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.5-1.3.0.php +31 -31
- app/design/adminhtml/default/default/layout/pptrack.xml +27 -27
- app/design/adminhtml/default/default/template/pptrack/dashboard/index.phtml +182 -182
- app/design/adminhtml/default/default/template/pptrack/dashboard/packpin.phtml +21 -21
- app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/hint.phtml +16 -16
- app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/scripts.phtml +78 -78
- app/design/frontend/base/default/layout/pptrack.xml +52 -52
- app/design/frontend/base/default/template/pptrack/ads.phtml +15 -15
- app/design/frontend/base/default/template/pptrack/ads_email.phtml +15 -15
- app/design/frontend/base/default/template/pptrack/crosssell.phtml +48 -48
- app/design/frontend/base/default/template/pptrack/crosssell_email.phtml +32 -32
- app/design/frontend/base/default/template/pptrack/email/order/shipment/track.phtml +26 -26
- app/design/frontend/base/default/template/pptrack/index.phtml +175 -175
- app/design/frontend/base/default/template/pptrack/index_new.phtml +195 -195
- app/design/frontend/base/default/template/pptrack/popup.phtml +29 -29
- app/design/frontend/base/default/template/pptrack/script.phtml +1 -1
- app/etc/modules/Packpin_Pptrack.xml +9 -9
- app/locale/de_DE/Packpin_Pptrack.csv +39 -39
- app/locale/en_US/Packpin_Pptrack.csv +39 -39
- app/locale/en_US/template/email/packpin/packpin_delivered_email.html +86 -86
- app/locale/en_US/template/email/packpin/packpin_exception_email.html +86 -86
- app/locale/en_US/template/email/packpin/packpin_failed_attempt_email.html +86 -86
- app/locale/en_US/template/email/packpin/packpin_in_transit_email.html +86 -86
- app/locale/en_US/template/email/packpin/packpin_info_received_email.html +86 -86
- app/locale/en_US/template/email/packpin/packpin_out_for_delivery_email.html +86 -86
- app/locale/es_ES/Packpin_Pptrack.csv +39 -39
- app/locale/nl_NL/Packpin_Pptrack.csv +39 -39
- app/locale/pt_PT/Packpin_Pptrack.csv +39 -39
- package.xml +5 -5
app/code/community/Packpin/Pptrack/Block/Adminhtml/Dashboard.php
CHANGED
@@ -1,211 +1,211 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Adminhtml_Dashboard extends Mage_Adminhtml_Block_Dashboard_Abstract
|
4 |
-
{
|
5 |
-
|
6 |
-
protected function _construct()
|
7 |
-
{
|
8 |
-
parent::_construct();
|
9 |
-
$this->setTemplate('pptrack/dashboard/packpin.phtml');
|
10 |
-
}
|
11 |
-
|
12 |
-
public function getTotalShipments()
|
13 |
-
{
|
14 |
-
$count = Mage::getModel('pptrack/track')
|
15 |
-
->getTotalCount();
|
16 |
-
|
17 |
-
return $count;
|
18 |
-
}
|
19 |
-
|
20 |
-
public function getTotalVisits()
|
21 |
-
{
|
22 |
-
$count = Mage::getModel('pptrack/visit')
|
23 |
-
->getTotalCount();
|
24 |
-
|
25 |
-
return number_format($count);
|
26 |
-
}
|
27 |
-
|
28 |
-
public function getPlanDetails()
|
29 |
-
{
|
30 |
-
$helper = Mage::helper('pptrack');
|
31 |
-
$res = $helper->getPlanDetails();
|
32 |
-
|
33 |
-
//map new data to current model
|
34 |
-
if ($res && $res["statusCode"] == 200) {
|
35 |
-
$info = $res["body"];
|
36 |
-
|
37 |
-
return $info;
|
38 |
-
}
|
39 |
-
|
40 |
-
return array();
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Get info for range selector
|
45 |
-
*/
|
46 |
-
public function getRangeInfo()
|
47 |
-
{
|
48 |
-
$now = date("Y-m-d");
|
49 |
-
$date = new DateTime();
|
50 |
-
$d30 = $date->modify("-30 day")->format("Y-m-d");
|
51 |
-
$date = new DateTime();
|
52 |
-
$d1 = $date->modify("-1 day")->format("Y-m-d");
|
53 |
-
$date = new DateTime();
|
54 |
-
$d7 = $date->modify("-7 day")->format("Y-m-d");
|
55 |
-
|
56 |
-
$dateStart = Mage::app()->getRequest()->getParam('date_from');
|
57 |
-
$dateEnd = Mage::app()->getRequest()->getParam('date_to');
|
58 |
-
|
59 |
-
|
60 |
-
$rangeInfo = array(
|
61 |
-
'last30days' => array(
|
62 |
-
'label' => Mage::helper('pptrack')->__('Last 30 days'),
|
63 |
-
'date_start' => $d30,
|
64 |
-
'date_end' => $now,
|
65 |
-
),
|
66 |
-
'last7days' => array(
|
67 |
-
'label' => Mage::helper('pptrack')->__('Last 7 days'),
|
68 |
-
'date_start' => $d7,
|
69 |
-
'date_end' => $now,
|
70 |
-
),
|
71 |
-
'yesterday' => array(
|
72 |
-
'label' => Mage::helper('pptrack')->__('Yesterday'),
|
73 |
-
'date_start' => $d1,
|
74 |
-
'date_end' => $d1,
|
75 |
-
),
|
76 |
-
'today' => array(
|
77 |
-
'label' => Mage::helper('pptrack')->__('Today'),
|
78 |
-
'date_start' => $now,
|
79 |
-
'date_end' => $now,
|
80 |
-
),
|
81 |
-
'custom' => array(
|
82 |
-
'label' => Mage::helper('pptrack')->__('Custom'),
|
83 |
-
'date_start' => $dateStart,
|
84 |
-
'date_end' => $dateEnd,
|
85 |
-
),
|
86 |
-
);
|
87 |
-
|
88 |
-
return $rangeInfo;
|
89 |
-
}
|
90 |
-
|
91 |
-
public function getSelectedRange()
|
92 |
-
{
|
93 |
-
$ranges = $this->getRangeInfo();
|
94 |
-
$range = Mage::app()->getRequest()->getParam('range', key($ranges));
|
95 |
-
|
96 |
-
return $range;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @return array
|
101 |
-
*/
|
102 |
-
public function getRangeStats()
|
103 |
-
{
|
104 |
-
$stats = array(
|
105 |
-
'trackings' => 0,
|
106 |
-
'emails' => '?',
|
107 |
-
'visits' => 0,
|
108 |
-
'average' => 0,
|
109 |
-
'graph' => array(),
|
110 |
-
);
|
111 |
-
|
112 |
-
$rangeInfo = $this->getRangeInfo();
|
113 |
-
$range = $this->getSelectedRange();
|
114 |
-
|
115 |
-
$start = $rangeInfo[$range]['date_start'];
|
116 |
-
$startTime = strtotime($start . ' 00:00:00');
|
117 |
-
$end = $rangeInfo[$range]['date_end'];
|
118 |
-
$endTime = strtotime($end . ' 23:59:59');
|
119 |
-
|
120 |
-
$stats['trackings'] = Mage::getModel('pptrack/track')
|
121 |
-
->getCollection()
|
122 |
-
->addFieldToFilter("created_at", array('gteq' => $startTime))
|
123 |
-
->addFieldToFilter("created_at", array('lteq' => $endTime))
|
124 |
-
->getSize();
|
125 |
-
|
126 |
-
$stats['visits'] = Mage::getModel('pptrack/visit')
|
127 |
-
->getCollection()
|
128 |
-
->addFieldToFilter("DATE(created_at)", array('gteq' => $start))
|
129 |
-
->addFieldToFilter("DATE(created_at)", array('lteq' => $end))
|
130 |
-
->getSize();
|
131 |
-
|
132 |
-
$stats['average'] = $stats['trackings'] ? $stats['visits'] / $stats['trackings'] : 0;
|
133 |
-
|
134 |
-
//email stats
|
135 |
-
$helper = Mage::helper('pptrack');
|
136 |
-
$res = $helper->getEmailCount($start, $end);
|
137 |
-
|
138 |
-
//map new data to current model
|
139 |
-
if ($res && $res["statusCode"] == 200) {
|
140 |
-
$stats['emails'] = $res["body"]['count'];
|
141 |
-
}
|
142 |
-
|
143 |
-
//graph data
|
144 |
-
$data = array();
|
145 |
-
$list1 = array();
|
146 |
-
$list2 = array();
|
147 |
-
$collection = Mage::getModel('pptrack/track')
|
148 |
-
->getCollection()
|
149 |
-
->addFieldToFilter("created_at", array('gteq' => $startTime))
|
150 |
-
->addFieldToFilter("created_at", array('lteq' => $endTime));
|
151 |
-
$collection->getSelect()
|
152 |
-
->group(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at))'))
|
153 |
-
->columns(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at)) as date, COUNT(*) as count'));
|
154 |
-
$list1Raw = $collection->getData();
|
155 |
-
|
156 |
-
$collection = Mage::getModel('pptrack/visit')
|
157 |
-
->getCollection()
|
158 |
-
->addFieldToFilter("DATE(created_at)", array('gteq' => $start))
|
159 |
-
->addFieldToFilter("DATE(created_at)", array('lteq' => $end));
|
160 |
-
$collection->getSelect()
|
161 |
-
->group(new Zend_Db_Expr('DATE(created_at)'))
|
162 |
-
->columns(new Zend_Db_Expr('DATE(created_at) as date, COUNT(*) as count'));
|
163 |
-
$list2Raw = $collection->getData();
|
164 |
-
|
165 |
-
foreach ($list1Raw as $item) {
|
166 |
-
$list1[$item['date']] = $item['count'];
|
167 |
-
}
|
168 |
-
foreach ($list2Raw as $item) {
|
169 |
-
$list2[$item['date']] = $item['count'];
|
170 |
-
}
|
171 |
-
|
172 |
-
$startObj = DateTime::createFromFormat("Y-m-d", $start);
|
173 |
-
$endObj = DateTime::createFromFormat("Y-m-d", $end);
|
174 |
-
$ct = 0;
|
175 |
-
try {
|
176 |
-
do {
|
177 |
-
$date = $startObj->format('Y-m-d');
|
178 |
-
|
179 |
-
$count = isset($list1[$date]) ? $list1[$date] : 0;
|
180 |
-
$count2 = isset($list2[$date]) ? $list2[$date] : 0;
|
181 |
-
|
182 |
-
$data[$date] = array(
|
183 |
-
'period' => $date,
|
184 |
-
'count' => $count,
|
185 |
-
'count2' => $count2,
|
186 |
-
);
|
187 |
-
|
188 |
-
|
189 |
-
$startObj->modify('1 day');
|
190 |
-
$ct++;
|
191 |
-
} while ($startObj <= $endObj && $ct < 5000);
|
192 |
-
} catch (Exception $e) {
|
193 |
-
|
194 |
-
}
|
195 |
-
|
196 |
-
$stats['graph'] = $data;
|
197 |
-
|
198 |
-
return $stats;
|
199 |
-
}
|
200 |
-
|
201 |
-
public function pluginEnabled()
|
202 |
-
{
|
203 |
-
return Mage::getStoreConfig('pp_section_setttings/settings/status');
|
204 |
-
}
|
205 |
-
|
206 |
-
public function notificationsEnabled()
|
207 |
-
{
|
208 |
-
return Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
|
209 |
-
}
|
210 |
-
|
211 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Adminhtml_Dashboard extends Mage_Adminhtml_Block_Dashboard_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _construct()
|
7 |
+
{
|
8 |
+
parent::_construct();
|
9 |
+
$this->setTemplate('pptrack/dashboard/packpin.phtml');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function getTotalShipments()
|
13 |
+
{
|
14 |
+
$count = Mage::getModel('pptrack/track')
|
15 |
+
->getTotalCount();
|
16 |
+
|
17 |
+
return $count;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getTotalVisits()
|
21 |
+
{
|
22 |
+
$count = Mage::getModel('pptrack/visit')
|
23 |
+
->getTotalCount();
|
24 |
+
|
25 |
+
return number_format($count);
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getPlanDetails()
|
29 |
+
{
|
30 |
+
$helper = Mage::helper('pptrack');
|
31 |
+
$res = $helper->getPlanDetails();
|
32 |
+
|
33 |
+
//map new data to current model
|
34 |
+
if ($res && $res["statusCode"] == 200) {
|
35 |
+
$info = $res["body"];
|
36 |
+
|
37 |
+
return $info;
|
38 |
+
}
|
39 |
+
|
40 |
+
return array();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get info for range selector
|
45 |
+
*/
|
46 |
+
public function getRangeInfo()
|
47 |
+
{
|
48 |
+
$now = date("Y-m-d");
|
49 |
+
$date = new DateTime();
|
50 |
+
$d30 = $date->modify("-30 day")->format("Y-m-d");
|
51 |
+
$date = new DateTime();
|
52 |
+
$d1 = $date->modify("-1 day")->format("Y-m-d");
|
53 |
+
$date = new DateTime();
|
54 |
+
$d7 = $date->modify("-7 day")->format("Y-m-d");
|
55 |
+
|
56 |
+
$dateStart = Mage::app()->getRequest()->getParam('date_from');
|
57 |
+
$dateEnd = Mage::app()->getRequest()->getParam('date_to');
|
58 |
+
|
59 |
+
|
60 |
+
$rangeInfo = array(
|
61 |
+
'last30days' => array(
|
62 |
+
'label' => Mage::helper('pptrack')->__('Last 30 days'),
|
63 |
+
'date_start' => $d30,
|
64 |
+
'date_end' => $now,
|
65 |
+
),
|
66 |
+
'last7days' => array(
|
67 |
+
'label' => Mage::helper('pptrack')->__('Last 7 days'),
|
68 |
+
'date_start' => $d7,
|
69 |
+
'date_end' => $now,
|
70 |
+
),
|
71 |
+
'yesterday' => array(
|
72 |
+
'label' => Mage::helper('pptrack')->__('Yesterday'),
|
73 |
+
'date_start' => $d1,
|
74 |
+
'date_end' => $d1,
|
75 |
+
),
|
76 |
+
'today' => array(
|
77 |
+
'label' => Mage::helper('pptrack')->__('Today'),
|
78 |
+
'date_start' => $now,
|
79 |
+
'date_end' => $now,
|
80 |
+
),
|
81 |
+
'custom' => array(
|
82 |
+
'label' => Mage::helper('pptrack')->__('Custom'),
|
83 |
+
'date_start' => $dateStart,
|
84 |
+
'date_end' => $dateEnd,
|
85 |
+
),
|
86 |
+
);
|
87 |
+
|
88 |
+
return $rangeInfo;
|
89 |
+
}
|
90 |
+
|
91 |
+
public function getSelectedRange()
|
92 |
+
{
|
93 |
+
$ranges = $this->getRangeInfo();
|
94 |
+
$range = Mage::app()->getRequest()->getParam('range', key($ranges));
|
95 |
+
|
96 |
+
return $range;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @return array
|
101 |
+
*/
|
102 |
+
public function getRangeStats()
|
103 |
+
{
|
104 |
+
$stats = array(
|
105 |
+
'trackings' => 0,
|
106 |
+
'emails' => '?',
|
107 |
+
'visits' => 0,
|
108 |
+
'average' => 0,
|
109 |
+
'graph' => array(),
|
110 |
+
);
|
111 |
+
|
112 |
+
$rangeInfo = $this->getRangeInfo();
|
113 |
+
$range = $this->getSelectedRange();
|
114 |
+
|
115 |
+
$start = $rangeInfo[$range]['date_start'];
|
116 |
+
$startTime = strtotime($start . ' 00:00:00');
|
117 |
+
$end = $rangeInfo[$range]['date_end'];
|
118 |
+
$endTime = strtotime($end . ' 23:59:59');
|
119 |
+
|
120 |
+
$stats['trackings'] = Mage::getModel('pptrack/track')
|
121 |
+
->getCollection()
|
122 |
+
->addFieldToFilter("created_at", array('gteq' => $startTime))
|
123 |
+
->addFieldToFilter("created_at", array('lteq' => $endTime))
|
124 |
+
->getSize();
|
125 |
+
|
126 |
+
$stats['visits'] = Mage::getModel('pptrack/visit')
|
127 |
+
->getCollection()
|
128 |
+
->addFieldToFilter("DATE(created_at)", array('gteq' => $start))
|
129 |
+
->addFieldToFilter("DATE(created_at)", array('lteq' => $end))
|
130 |
+
->getSize();
|
131 |
+
|
132 |
+
$stats['average'] = $stats['trackings'] ? $stats['visits'] / $stats['trackings'] : 0;
|
133 |
+
|
134 |
+
//email stats
|
135 |
+
$helper = Mage::helper('pptrack');
|
136 |
+
$res = $helper->getEmailCount($start, $end);
|
137 |
+
|
138 |
+
//map new data to current model
|
139 |
+
if ($res && $res["statusCode"] == 200) {
|
140 |
+
$stats['emails'] = $res["body"]['count'];
|
141 |
+
}
|
142 |
+
|
143 |
+
//graph data
|
144 |
+
$data = array();
|
145 |
+
$list1 = array();
|
146 |
+
$list2 = array();
|
147 |
+
$collection = Mage::getModel('pptrack/track')
|
148 |
+
->getCollection()
|
149 |
+
->addFieldToFilter("created_at", array('gteq' => $startTime))
|
150 |
+
->addFieldToFilter("created_at", array('lteq' => $endTime));
|
151 |
+
$collection->getSelect()
|
152 |
+
->group(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at))'))
|
153 |
+
->columns(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at)) as date, COUNT(*) as count'));
|
154 |
+
$list1Raw = $collection->getData();
|
155 |
+
|
156 |
+
$collection = Mage::getModel('pptrack/visit')
|
157 |
+
->getCollection()
|
158 |
+
->addFieldToFilter("DATE(created_at)", array('gteq' => $start))
|
159 |
+
->addFieldToFilter("DATE(created_at)", array('lteq' => $end));
|
160 |
+
$collection->getSelect()
|
161 |
+
->group(new Zend_Db_Expr('DATE(created_at)'))
|
162 |
+
->columns(new Zend_Db_Expr('DATE(created_at) as date, COUNT(*) as count'));
|
163 |
+
$list2Raw = $collection->getData();
|
164 |
+
|
165 |
+
foreach ($list1Raw as $item) {
|
166 |
+
$list1[$item['date']] = $item['count'];
|
167 |
+
}
|
168 |
+
foreach ($list2Raw as $item) {
|
169 |
+
$list2[$item['date']] = $item['count'];
|
170 |
+
}
|
171 |
+
|
172 |
+
$startObj = DateTime::createFromFormat("Y-m-d", $start);
|
173 |
+
$endObj = DateTime::createFromFormat("Y-m-d", $end);
|
174 |
+
$ct = 0;
|
175 |
+
try {
|
176 |
+
do {
|
177 |
+
$date = $startObj->format('Y-m-d');
|
178 |
+
|
179 |
+
$count = isset($list1[$date]) ? $list1[$date] : 0;
|
180 |
+
$count2 = isset($list2[$date]) ? $list2[$date] : 0;
|
181 |
+
|
182 |
+
$data[$date] = array(
|
183 |
+
'period' => $date,
|
184 |
+
'count' => $count,
|
185 |
+
'count2' => $count2,
|
186 |
+
);
|
187 |
+
|
188 |
+
|
189 |
+
$startObj->modify('1 day');
|
190 |
+
$ct++;
|
191 |
+
} while ($startObj <= $endObj && $ct < 5000);
|
192 |
+
} catch (Exception $e) {
|
193 |
+
|
194 |
+
}
|
195 |
+
|
196 |
+
$stats['graph'] = $data;
|
197 |
+
|
198 |
+
return $stats;
|
199 |
+
}
|
200 |
+
|
201 |
+
public function pluginEnabled()
|
202 |
+
{
|
203 |
+
return Mage::getStoreConfig('pp_section_setttings/settings/status');
|
204 |
+
}
|
205 |
+
|
206 |
+
public function notificationsEnabled()
|
207 |
+
{
|
208 |
+
return Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
|
209 |
+
}
|
210 |
+
|
211 |
}
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/Create/Tracking.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Tracking
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Retrieve
|
8 |
-
*
|
9 |
-
* @return unknown
|
10 |
-
*/
|
11 |
-
public function getCarriers()
|
12 |
-
{
|
13 |
-
$carriers = parent::getCarriers();
|
14 |
-
|
15 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
16 |
-
if (!$enabled)
|
17 |
-
return $carriers;
|
18 |
-
|
19 |
-
$disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
|
20 |
-
|
21 |
-
//get Packpin Additional carriers
|
22 |
-
$packpinCarriers = Mage::getModel('pptrack/carrier')
|
23 |
-
->getList();
|
24 |
-
if ($packpinCarriers) {
|
25 |
-
if ($disableDefault) {
|
26 |
-
$carriers = array();
|
27 |
-
}
|
28 |
-
else {
|
29 |
-
$carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
|
30 |
-
}
|
31 |
-
foreach ($packpinCarriers as $item) {
|
32 |
-
$carriers[$item->getPrefixedCode()] = $item->getData('name');
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
return $carriers;
|
37 |
-
}
|
38 |
-
|
39 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Tracking
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Retrieve
|
8 |
+
*
|
9 |
+
* @return unknown
|
10 |
+
*/
|
11 |
+
public function getCarriers()
|
12 |
+
{
|
13 |
+
$carriers = parent::getCarriers();
|
14 |
+
|
15 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
16 |
+
if (!$enabled)
|
17 |
+
return $carriers;
|
18 |
+
|
19 |
+
$disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
|
20 |
+
|
21 |
+
//get Packpin Additional carriers
|
22 |
+
$packpinCarriers = Mage::getModel('pptrack/carrier')
|
23 |
+
->getList();
|
24 |
+
if ($packpinCarriers) {
|
25 |
+
if ($disableDefault) {
|
26 |
+
$carriers = array();
|
27 |
+
}
|
28 |
+
else {
|
29 |
+
$carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
|
30 |
+
}
|
31 |
+
foreach ($packpinCarriers as $item) {
|
32 |
+
$carriers[$item->getPrefixedCode()] = $item->getData('name');
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
return $carriers;
|
37 |
+
}
|
38 |
+
|
39 |
}
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/View/Tracking.php
CHANGED
@@ -1,65 +1,65 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_View_Tracking
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Carrier list for static cache
|
8 |
-
*
|
9 |
-
* @var array
|
10 |
-
*/
|
11 |
-
public static $carrierList = array();
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Retrieve carriers
|
15 |
-
*
|
16 |
-
* @return array
|
17 |
-
*/
|
18 |
-
public function getCarriers()
|
19 |
-
{
|
20 |
-
if (!self::$carrierList) {
|
21 |
-
$carriers = parent::getCarriers();
|
22 |
-
|
23 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
24 |
-
if (!$enabled)
|
25 |
-
return $carriers;
|
26 |
-
|
27 |
-
$disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
|
28 |
-
|
29 |
-
//get Packpin Additional carriers
|
30 |
-
$packpinCarriers = Mage::getModel('pptrack/carrier')
|
31 |
-
->getList();
|
32 |
-
if ($packpinCarriers) {
|
33 |
-
if ($disableDefault) {
|
34 |
-
$carriers = array();
|
35 |
-
}
|
36 |
-
else {
|
37 |
-
$carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
|
38 |
-
}
|
39 |
-
foreach ($packpinCarriers as $item) {
|
40 |
-
$carriers[$item->getPrefixedCode()] = $item->getData('name');
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
self::$carrierList = $carriers;
|
45 |
-
}
|
46 |
-
|
47 |
-
return self::$carrierList;
|
48 |
-
}
|
49 |
-
|
50 |
-
public function getCarrierTitle($code)
|
51 |
-
{
|
52 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
53 |
-
if (!$enabled)
|
54 |
-
return parent::getCarrierTitle($code);
|
55 |
-
|
56 |
-
$allCarriers = $this->getCarriers();
|
57 |
-
|
58 |
-
if (isset($allCarriers[$code]))
|
59 |
-
return $allCarriers[$code];
|
60 |
-
else
|
61 |
-
return parent::getCarrierTitle($code);
|
62 |
-
|
63 |
-
}
|
64 |
-
|
65 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_View_Tracking
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Carrier list for static cache
|
8 |
+
*
|
9 |
+
* @var array
|
10 |
+
*/
|
11 |
+
public static $carrierList = array();
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Retrieve carriers
|
15 |
+
*
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function getCarriers()
|
19 |
+
{
|
20 |
+
if (!self::$carrierList) {
|
21 |
+
$carriers = parent::getCarriers();
|
22 |
+
|
23 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
24 |
+
if (!$enabled)
|
25 |
+
return $carriers;
|
26 |
+
|
27 |
+
$disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
|
28 |
+
|
29 |
+
//get Packpin Additional carriers
|
30 |
+
$packpinCarriers = Mage::getModel('pptrack/carrier')
|
31 |
+
->getList();
|
32 |
+
if ($packpinCarriers) {
|
33 |
+
if ($disableDefault) {
|
34 |
+
$carriers = array();
|
35 |
+
}
|
36 |
+
else {
|
37 |
+
$carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
|
38 |
+
}
|
39 |
+
foreach ($packpinCarriers as $item) {
|
40 |
+
$carriers[$item->getPrefixedCode()] = $item->getData('name');
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
self::$carrierList = $carriers;
|
45 |
+
}
|
46 |
+
|
47 |
+
return self::$carrierList;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getCarrierTitle($code)
|
51 |
+
{
|
52 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
53 |
+
if (!$enabled)
|
54 |
+
return parent::getCarrierTitle($code);
|
55 |
+
|
56 |
+
$allCarriers = $this->getCarriers();
|
57 |
+
|
58 |
+
if (isset($allCarriers[$code]))
|
59 |
+
return $allCarriers[$code];
|
60 |
+
else
|
61 |
+
return parent::getCarrierTitle($code);
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
}
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Hint.php
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
|
4 |
-
extends Mage_Adminhtml_Block_Abstract
|
5 |
-
implements Varien_Data_Form_Element_Renderer_Interface
|
6 |
-
{
|
7 |
-
protected $_template = 'pptrack/system/config/fieldset/hint.phtml';
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Render fieldset html
|
11 |
-
*
|
12 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
13 |
-
* @return string
|
14 |
-
*/
|
15 |
-
public function render(Varien_Data_Form_Element_Abstract $element)
|
16 |
-
{
|
17 |
-
return $this->toHtml();
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Check if user still using temporary key
|
22 |
-
*
|
23 |
-
* @return bool
|
24 |
-
*/
|
25 |
-
public function haveTempKey()
|
26 |
-
{
|
27 |
-
$key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
28 |
-
$tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
|
29 |
-
|
30 |
-
if ($tempKey && $tempKey == $key) {
|
31 |
-
return true;
|
32 |
-
}
|
33 |
-
|
34 |
-
return false;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Get days left till temp key expiration
|
39 |
-
*
|
40 |
-
* @return string
|
41 |
-
*/
|
42 |
-
public function getDaysLeft()
|
43 |
-
{
|
44 |
-
$tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
|
45 |
-
$timeDiff = $tempKeyInstalled + (86400 * 7) - time();
|
46 |
-
if ($timeDiff > 0) {
|
47 |
-
return ceil($timeDiff / 86400);
|
48 |
-
}
|
49 |
-
|
50 |
-
return 0;
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
|
4 |
+
extends Mage_Adminhtml_Block_Abstract
|
5 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
6 |
+
{
|
7 |
+
protected $_template = 'pptrack/system/config/fieldset/hint.phtml';
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Render fieldset html
|
11 |
+
*
|
12 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
13 |
+
* @return string
|
14 |
+
*/
|
15 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
16 |
+
{
|
17 |
+
return $this->toHtml();
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Check if user still using temporary key
|
22 |
+
*
|
23 |
+
* @return bool
|
24 |
+
*/
|
25 |
+
public function haveTempKey()
|
26 |
+
{
|
27 |
+
$key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
28 |
+
$tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
|
29 |
+
|
30 |
+
if ($tempKey && $tempKey == $key) {
|
31 |
+
return true;
|
32 |
+
}
|
33 |
+
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Get days left till temp key expiration
|
39 |
+
*
|
40 |
+
* @return string
|
41 |
+
*/
|
42 |
+
public function getDaysLeft()
|
43 |
+
{
|
44 |
+
$tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
|
45 |
+
$timeDiff = $tempKeyInstalled + (86400 * 7) - time();
|
46 |
+
if ($timeDiff > 0) {
|
47 |
+
return ceil($timeDiff / 86400);
|
48 |
+
}
|
49 |
+
|
50 |
+
return 0;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Scripts.php
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Scripts
|
4 |
-
extends Mage_Adminhtml_Block_Abstract
|
5 |
-
implements Varien_Data_Form_Element_Renderer_Interface
|
6 |
-
{
|
7 |
-
protected $_template = 'pptrack/system/config/fieldset/scripts.phtml';
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Render fieldset html
|
11 |
-
*
|
12 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
13 |
-
* @return string
|
14 |
-
*/
|
15 |
-
public function render(Varien_Data_Form_Element_Abstract $element)
|
16 |
-
{
|
17 |
-
return $this->toHtml();
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Check if user still using temporary key
|
22 |
-
*
|
23 |
-
* @return bool
|
24 |
-
*/
|
25 |
-
public function haveTempKey()
|
26 |
-
{
|
27 |
-
$key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
28 |
-
$tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
|
29 |
-
|
30 |
-
if ($tempKey && $tempKey == $key) {
|
31 |
-
return true;
|
32 |
-
}
|
33 |
-
|
34 |
-
return false;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Get days left till temp key expiration
|
39 |
-
*
|
40 |
-
* @return string
|
41 |
-
*/
|
42 |
-
public function getDaysLeft()
|
43 |
-
{
|
44 |
-
$tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
|
45 |
-
$timeDiff = $tempKeyInstalled + (86400 * 7) - time();
|
46 |
-
if ($timeDiff > 0) {
|
47 |
-
return ceil($timeDiff / 86400);
|
48 |
-
}
|
49 |
-
|
50 |
-
return 0;
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Scripts
|
4 |
+
extends Mage_Adminhtml_Block_Abstract
|
5 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
6 |
+
{
|
7 |
+
protected $_template = 'pptrack/system/config/fieldset/scripts.phtml';
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Render fieldset html
|
11 |
+
*
|
12 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
13 |
+
* @return string
|
14 |
+
*/
|
15 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
16 |
+
{
|
17 |
+
return $this->toHtml();
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Check if user still using temporary key
|
22 |
+
*
|
23 |
+
* @return bool
|
24 |
+
*/
|
25 |
+
public function haveTempKey()
|
26 |
+
{
|
27 |
+
$key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
28 |
+
$tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
|
29 |
+
|
30 |
+
if ($tempKey && $tempKey == $key) {
|
31 |
+
return true;
|
32 |
+
}
|
33 |
+
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Get days left till temp key expiration
|
39 |
+
*
|
40 |
+
* @return string
|
41 |
+
*/
|
42 |
+
public function getDaysLeft()
|
43 |
+
{
|
44 |
+
$tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
|
45 |
+
$timeDiff = $tempKeyInstalled + (86400 * 7) - time();
|
46 |
+
if ($timeDiff > 0) {
|
47 |
+
return ceil($timeDiff / 86400);
|
48 |
+
}
|
49 |
+
|
50 |
+
return 0;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Form/Fieldset/Carrier.php
CHANGED
@@ -1,81 +1,81 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Adminhtml_System_Config_Form_Fieldset_Carrier extends
|
4 |
-
Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
5 |
-
{
|
6 |
-
protected $_dummyElement;
|
7 |
-
protected $_fieldRenderer;
|
8 |
-
protected $_values;
|
9 |
-
protected $_dataSource;
|
10 |
-
protected $_hidden = '';
|
11 |
-
|
12 |
-
public function render(Varien_Data_Form_Element_Abstract $element)
|
13 |
-
{
|
14 |
-
$html = $this->_getHeaderHtml($element);
|
15 |
-
|
16 |
-
$carriers = Mage::getModel('pptrack/carrier')->getList(true);
|
17 |
-
|
18 |
-
//check all button
|
19 |
-
$html .= '<tr><td class="label"></td><td>';
|
20 |
-
$html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', true)});', $this->helper('pptrack')->__('Select All'));
|
21 |
-
$html .= ' ';
|
22 |
-
$html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', false)});', $this->helper('pptrack')->__('Unselect All'));
|
23 |
-
$html .= '</td></tr>';
|
24 |
-
|
25 |
-
$fields = '';
|
26 |
-
foreach ($carriers as $carrier) {
|
27 |
-
$fields .= $this->_getFieldHtml($element, $carrier);
|
28 |
-
}
|
29 |
-
$html .= $fields;
|
30 |
-
$html .= $this->_getFooterHtml($element);
|
31 |
-
|
32 |
-
return $this->_hidden . $html;
|
33 |
-
}
|
34 |
-
|
35 |
-
protected function _getFieldRenderer()
|
36 |
-
{
|
37 |
-
if (empty($this->_fieldRenderer)) {
|
38 |
-
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
39 |
-
}
|
40 |
-
return $this->_fieldRenderer;
|
41 |
-
}
|
42 |
-
|
43 |
-
protected function _getValues()
|
44 |
-
{
|
45 |
-
if (!$this->_dataSource)
|
46 |
-
$this->_dataSource = Mage::getSingleton('adminhtml/system_config_source_enabledisable')->toOptionArray();
|
47 |
-
|
48 |
-
return $this->_dataSource;
|
49 |
-
}
|
50 |
-
|
51 |
-
protected function _getFieldHtml($fieldset, $carrier)
|
52 |
-
{
|
53 |
-
$name = 'groups[carriers][fields][' . $carrier->getCode() . '][value]';
|
54 |
-
$this->_hidden .= '<input type="hidden" name="'. $name .'" value="0">';
|
55 |
-
|
56 |
-
$field = $fieldset->addField($carrier->getCode(), 'checkbox',
|
57 |
-
array(
|
58 |
-
'name' => $name,
|
59 |
-
'label' => $carrier->getName(),
|
60 |
-
'class' => 'pp_carrier',
|
61 |
-
'value' => 1,
|
62 |
-
'checked' => $carrier->getEnabled(),
|
63 |
-
// 'values' => $this->_getValues(),
|
64 |
-
'can_use_default_value' => 0,
|
65 |
-
'can_use_website_value' => 0,
|
66 |
-
))->setRenderer($this->_getFieldRenderer());
|
67 |
-
|
68 |
-
return $field->toHtml();
|
69 |
-
}
|
70 |
-
|
71 |
-
protected function _getCheckAllButton($action, $label)
|
72 |
-
{
|
73 |
-
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
|
74 |
-
->setData(array(
|
75 |
-
'label' => $label,
|
76 |
-
'onclick' => 'javascript:'. $action .'; return false;'
|
77 |
-
));
|
78 |
-
|
79 |
-
return $button->toHtml();
|
80 |
-
}
|
81 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Adminhtml_System_Config_Form_Fieldset_Carrier extends
|
4 |
+
Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
5 |
+
{
|
6 |
+
protected $_dummyElement;
|
7 |
+
protected $_fieldRenderer;
|
8 |
+
protected $_values;
|
9 |
+
protected $_dataSource;
|
10 |
+
protected $_hidden = '';
|
11 |
+
|
12 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
13 |
+
{
|
14 |
+
$html = $this->_getHeaderHtml($element);
|
15 |
+
|
16 |
+
$carriers = Mage::getModel('pptrack/carrier')->getList(true);
|
17 |
+
|
18 |
+
//check all button
|
19 |
+
$html .= '<tr><td class="label"></td><td>';
|
20 |
+
$html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', true)});', $this->helper('pptrack')->__('Select All'));
|
21 |
+
$html .= ' ';
|
22 |
+
$html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', false)});', $this->helper('pptrack')->__('Unselect All'));
|
23 |
+
$html .= '</td></tr>';
|
24 |
+
|
25 |
+
$fields = '';
|
26 |
+
foreach ($carriers as $carrier) {
|
27 |
+
$fields .= $this->_getFieldHtml($element, $carrier);
|
28 |
+
}
|
29 |
+
$html .= $fields;
|
30 |
+
$html .= $this->_getFooterHtml($element);
|
31 |
+
|
32 |
+
return $this->_hidden . $html;
|
33 |
+
}
|
34 |
+
|
35 |
+
protected function _getFieldRenderer()
|
36 |
+
{
|
37 |
+
if (empty($this->_fieldRenderer)) {
|
38 |
+
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
39 |
+
}
|
40 |
+
return $this->_fieldRenderer;
|
41 |
+
}
|
42 |
+
|
43 |
+
protected function _getValues()
|
44 |
+
{
|
45 |
+
if (!$this->_dataSource)
|
46 |
+
$this->_dataSource = Mage::getSingleton('adminhtml/system_config_source_enabledisable')->toOptionArray();
|
47 |
+
|
48 |
+
return $this->_dataSource;
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function _getFieldHtml($fieldset, $carrier)
|
52 |
+
{
|
53 |
+
$name = 'groups[carriers][fields][' . $carrier->getCode() . '][value]';
|
54 |
+
$this->_hidden .= '<input type="hidden" name="'. $name .'" value="0">';
|
55 |
+
|
56 |
+
$field = $fieldset->addField($carrier->getCode(), 'checkbox',
|
57 |
+
array(
|
58 |
+
'name' => $name,
|
59 |
+
'label' => $carrier->getName(),
|
60 |
+
'class' => 'pp_carrier',
|
61 |
+
'value' => 1,
|
62 |
+
'checked' => $carrier->getEnabled(),
|
63 |
+
// 'values' => $this->_getValues(),
|
64 |
+
'can_use_default_value' => 0,
|
65 |
+
'can_use_website_value' => 0,
|
66 |
+
))->setRenderer($this->_getFieldRenderer());
|
67 |
+
|
68 |
+
return $field->toHtml();
|
69 |
+
}
|
70 |
+
|
71 |
+
protected function _getCheckAllButton($action, $label)
|
72 |
+
{
|
73 |
+
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
|
74 |
+
->setData(array(
|
75 |
+
'label' => $label,
|
76 |
+
'onclick' => 'javascript:'. $action .'; return false;'
|
77 |
+
));
|
78 |
+
|
79 |
+
return $button->toHtml();
|
80 |
+
}
|
81 |
}
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Block_Adminhtml_Tracks extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
// The blockGroup must match the first half of how we call the block, and controller matches the second half
|
7 |
-
// ie. foo_bar/adminhtml_baz
|
8 |
-
$this->_blockGroup = 'pptrack';
|
9 |
-
$this->_controller = 'adminhtml_tracks';
|
10 |
-
$this->_headerText = $this->__('Tracked shipments');
|
11 |
-
|
12 |
-
parent::__construct();
|
13 |
-
$this->_removeButton('add');
|
14 |
-
}
|
15 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Block_Adminhtml_Tracks extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
// The blockGroup must match the first half of how we call the block, and controller matches the second half
|
7 |
+
// ie. foo_bar/adminhtml_baz
|
8 |
+
$this->_blockGroup = 'pptrack';
|
9 |
+
$this->_controller = 'adminhtml_tracks';
|
10 |
+
$this->_headerText = $this->__('Tracked shipments');
|
11 |
+
|
12 |
+
parent::__construct();
|
13 |
+
$this->_removeButton('add');
|
14 |
+
}
|
15 |
}
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit.php
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
3 |
-
{
|
4 |
-
/**
|
5 |
-
* Init class
|
6 |
-
*/
|
7 |
-
public function __construct()
|
8 |
-
{
|
9 |
-
$this->_blockGroup = 'pptrack';
|
10 |
-
$this->_controller = 'adminhtml_tracks';
|
11 |
-
|
12 |
-
parent::__construct();
|
13 |
-
|
14 |
-
$this->_updateButton('save', 'label', $this->__('Save Track'));
|
15 |
-
$this->_updateButton('delete', 'label', $this->__('Delete Track'));
|
16 |
-
$this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/*/dashboard/') . '\')');
|
17 |
-
}
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Get Header text
|
21 |
-
*
|
22 |
-
* @return string
|
23 |
-
*/
|
24 |
-
public function getHeaderText()
|
25 |
-
{
|
26 |
-
if (Mage::registry('pptrack')->getId()) {
|
27 |
-
return $this->__('Edit Track');
|
28 |
-
}
|
29 |
-
else {
|
30 |
-
return $this->__('New Track');
|
31 |
-
}
|
32 |
-
}
|
33 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Init class
|
6 |
+
*/
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
$this->_blockGroup = 'pptrack';
|
10 |
+
$this->_controller = 'adminhtml_tracks';
|
11 |
+
|
12 |
+
parent::__construct();
|
13 |
+
|
14 |
+
$this->_updateButton('save', 'label', $this->__('Save Track'));
|
15 |
+
$this->_updateButton('delete', 'label', $this->__('Delete Track'));
|
16 |
+
$this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/*/dashboard/') . '\')');
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Get Header text
|
21 |
+
*
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
public function getHeaderText()
|
25 |
+
{
|
26 |
+
if (Mage::registry('pptrack')->getId()) {
|
27 |
+
return $this->__('Edit Track');
|
28 |
+
}
|
29 |
+
else {
|
30 |
+
return $this->__('New Track');
|
31 |
+
}
|
32 |
+
}
|
33 |
}
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit/Form.php
CHANGED
@@ -1,54 +1,54 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
-
{
|
4 |
-
/**
|
5 |
-
* Init class
|
6 |
-
*/
|
7 |
-
public function __construct()
|
8 |
-
{
|
9 |
-
parent::__construct();
|
10 |
-
|
11 |
-
$this->setId('pptrack_tracks_form');
|
12 |
-
$this->setTitle($this->__('Track Information'));
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Setup form fields for inserts/updates
|
17 |
-
*
|
18 |
-
* return Mage_Adminhtml_Block_Widget_Form
|
19 |
-
*/
|
20 |
-
protected function _prepareForm()
|
21 |
-
{
|
22 |
-
$model = Mage::registry('pptrack');
|
23 |
-
|
24 |
-
$form = new Varien_Data_Form(array(
|
25 |
-
'id' => 'edit_form',
|
26 |
-
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
27 |
-
'method' => 'post'
|
28 |
-
));
|
29 |
-
|
30 |
-
$fieldset = $form->addFieldset('base_fieldset', array(
|
31 |
-
'legend' => Mage::helper('checkout')->__('Track Information'),
|
32 |
-
'class' => 'fieldset-wide',
|
33 |
-
));
|
34 |
-
|
35 |
-
if ($model->getId()) {
|
36 |
-
$fieldset->addField('id', 'hidden', array(
|
37 |
-
'name' => 'id',
|
38 |
-
));
|
39 |
-
}
|
40 |
-
|
41 |
-
$fieldset->addField('email', 'text', array(
|
42 |
-
'name' => 'email',
|
43 |
-
'label' => Mage::helper('checkout')->__('Email'),
|
44 |
-
'title' => Mage::helper('checkout')->__('Email'),
|
45 |
-
'required' => false,
|
46 |
-
));
|
47 |
-
|
48 |
-
$form->setValues($model->getData());
|
49 |
-
$form->setUseContainer(true);
|
50 |
-
$this->setForm($form);
|
51 |
-
|
52 |
-
return parent::_prepareForm();
|
53 |
-
}
|
54 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Init class
|
6 |
+
*/
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
+
$this->setId('pptrack_tracks_form');
|
12 |
+
$this->setTitle($this->__('Track Information'));
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Setup form fields for inserts/updates
|
17 |
+
*
|
18 |
+
* return Mage_Adminhtml_Block_Widget_Form
|
19 |
+
*/
|
20 |
+
protected function _prepareForm()
|
21 |
+
{
|
22 |
+
$model = Mage::registry('pptrack');
|
23 |
+
|
24 |
+
$form = new Varien_Data_Form(array(
|
25 |
+
'id' => 'edit_form',
|
26 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
27 |
+
'method' => 'post'
|
28 |
+
));
|
29 |
+
|
30 |
+
$fieldset = $form->addFieldset('base_fieldset', array(
|
31 |
+
'legend' => Mage::helper('checkout')->__('Track Information'),
|
32 |
+
'class' => 'fieldset-wide',
|
33 |
+
));
|
34 |
+
|
35 |
+
if ($model->getId()) {
|
36 |
+
$fieldset->addField('id', 'hidden', array(
|
37 |
+
'name' => 'id',
|
38 |
+
));
|
39 |
+
}
|
40 |
+
|
41 |
+
$fieldset->addField('email', 'text', array(
|
42 |
+
'name' => 'email',
|
43 |
+
'label' => Mage::helper('checkout')->__('Email'),
|
44 |
+
'title' => Mage::helper('checkout')->__('Email'),
|
45 |
+
'required' => false,
|
46 |
+
));
|
47 |
+
|
48 |
+
$form->setValues($model->getData());
|
49 |
+
$form->setUseContainer(true);
|
50 |
+
$this->setForm($form);
|
51 |
+
|
52 |
+
return parent::_prepareForm();
|
53 |
+
}
|
54 |
}
|
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Grid.php
CHANGED
@@ -1,143 +1,143 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Block_Adminhtml_Tracks_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
parent::__construct();
|
7 |
-
|
8 |
-
$this->setDefaultSort('ship_date');
|
9 |
-
$this->setId('pptrack_tracks_grid');
|
10 |
-
$this->setDefaultDir('desc');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
// $this->setUseAjax(true);
|
13 |
-
}
|
14 |
-
|
15 |
-
protected function _getCollectionClass()
|
16 |
-
{
|
17 |
-
// This is the model we are using for the grid
|
18 |
-
return 'pptrack/track_collection';
|
19 |
-
}
|
20 |
-
|
21 |
-
protected function _prepareCollection()
|
22 |
-
{
|
23 |
-
// Get and set our collection for the grid
|
24 |
-
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
25 |
-
$collection->join(
|
26 |
-
array('a' => 'sales/order_grid'),
|
27 |
-
'main_table.order_id=a.entity_id',
|
28 |
-
array('shipping_name')
|
29 |
-
);
|
30 |
-
$collection->join(
|
31 |
-
array('b' => 'sales/shipment_track'),
|
32 |
-
'main_table.shipment_id=b.entity_id',
|
33 |
-
array('parent_id', 'created_at')
|
34 |
-
);
|
35 |
-
|
36 |
-
$this->setCollection($collection);
|
37 |
-
|
38 |
-
return parent::_prepareCollection();
|
39 |
-
}
|
40 |
-
|
41 |
-
protected function _prepareColumns()
|
42 |
-
{
|
43 |
-
$helper = Mage::helper('pptrack');
|
44 |
-
|
45 |
-
// Add the columns that should appear in the grid
|
46 |
-
|
47 |
-
$this->addColumn('code',
|
48 |
-
array(
|
49 |
-
'header'=> $this->__('Tracking Code #'),
|
50 |
-
'index' => 'code'
|
51 |
-
)
|
52 |
-
);
|
53 |
-
$this->addColumn('carrier_name',
|
54 |
-
array(
|
55 |
-
'header'=> $this->__('Carrier'),
|
56 |
-
'index' => 'carrier_name'
|
57 |
-
)
|
58 |
-
);
|
59 |
-
// $this->addColumn('status',
|
60 |
-
// array(
|
61 |
-
// 'header'=> $this->__('Status'),
|
62 |
-
// 'index' => 'status',
|
63 |
-
// 'filter_index' => 'main_table.status',
|
64 |
-
// )
|
65 |
-
// );
|
66 |
-
$this->addColumn('created_at', array(
|
67 |
-
'header' => $this->__('Created at'),
|
68 |
-
'type' => 'datetime',
|
69 |
-
'index' => 'created_at',
|
70 |
-
'filter_index' => 'b.created_at'
|
71 |
-
));
|
72 |
-
$this->addColumn('order_id',
|
73 |
-
array(
|
74 |
-
'header'=> $this->__('Order #'),
|
75 |
-
'index' => 'order_id',
|
76 |
-
'filter_index' => 'main_table.order_id',
|
77 |
-
)
|
78 |
-
);
|
79 |
-
$this->addColumn('shipping_name',
|
80 |
-
array(
|
81 |
-
'header'=> $this->__('Ship to name'),
|
82 |
-
'index' => 'shipping_name'
|
83 |
-
)
|
84 |
-
);
|
85 |
-
|
86 |
-
// $this->addColumn('total_qty', array(
|
87 |
-
// 'header' => $this->__('Total Qty'),
|
88 |
-
// 'index' => 'total_qty',
|
89 |
-
// 'type' => 'number',
|
90 |
-
// ));
|
91 |
-
|
92 |
-
// $this->addColumn('action',
|
93 |
-
// array(
|
94 |
-
// 'header' => Mage::helper('pptrack')->__('Action'),
|
95 |
-
// 'width' => '50px',
|
96 |
-
// 'type' => 'action',
|
97 |
-
// 'getter' => 'getId',
|
98 |
-
// 'actions' => array(
|
99 |
-
// array(
|
100 |
-
// 'caption' => Mage::helper('pptrack')>__('View/Edit'),
|
101 |
-
// 'url' => array('base'=>'*/*/edit'),
|
102 |
-
// 'field' => 'id',
|
103 |
-
// 'data-column' => 'action',
|
104 |
-
// )
|
105 |
-
// ),
|
106 |
-
// 'filter' => false,
|
107 |
-
// 'sortable' => false,
|
108 |
-
// 'index' => 'stores',
|
109 |
-
// 'is_system' => true,
|
110 |
-
// ));
|
111 |
-
|
112 |
-
|
113 |
-
$this->addExportType('*/*/exportTracksCsv', $helper->__('CSV'));
|
114 |
-
$this->addExportType('*/*/exportTracksExcel', $helper->__('Excel XML'));
|
115 |
-
|
116 |
-
$this->setDefaultSort('created_at');
|
117 |
-
$this->setDefaultDir('desc');
|
118 |
-
|
119 |
-
return parent::_prepareColumns();
|
120 |
-
}
|
121 |
-
|
122 |
-
protected function _prepareMassaction()
|
123 |
-
{
|
124 |
-
// $this->setMassactionIdField('entity_id');
|
125 |
-
// $this->getMassactionBlock()->setFormFieldName('order_ids');
|
126 |
-
// $this->getMassactionBlock()->setUseSelectAll(false);
|
127 |
-
//
|
128 |
-
// if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
|
129 |
-
// $this->getMassactionBlock()->addItem('cancel_order', array(
|
130 |
-
// 'label'=> Mage::helper('sales')->__('Cancel'),
|
131 |
-
// 'url' => $this->getUrl('*/sales_order/massCancel'),
|
132 |
-
// ));
|
133 |
-
// }
|
134 |
-
|
135 |
-
return $this;
|
136 |
-
}
|
137 |
-
|
138 |
-
public function getRowUrl($row)
|
139 |
-
{
|
140 |
-
// This is where our row data will link to
|
141 |
-
return $this->getUrl('*/sales_shipment/view/', array('shipment_id' => $row->getParentId()));
|
142 |
-
}
|
143 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Block_Adminhtml_Tracks_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
|
8 |
+
$this->setDefaultSort('ship_date');
|
9 |
+
$this->setId('pptrack_tracks_grid');
|
10 |
+
$this->setDefaultDir('desc');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
// $this->setUseAjax(true);
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _getCollectionClass()
|
16 |
+
{
|
17 |
+
// This is the model we are using for the grid
|
18 |
+
return 'pptrack/track_collection';
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareCollection()
|
22 |
+
{
|
23 |
+
// Get and set our collection for the grid
|
24 |
+
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
25 |
+
$collection->join(
|
26 |
+
array('a' => 'sales/order_grid'),
|
27 |
+
'main_table.order_id=a.entity_id',
|
28 |
+
array('shipping_name')
|
29 |
+
);
|
30 |
+
$collection->join(
|
31 |
+
array('b' => 'sales/shipment_track'),
|
32 |
+
'main_table.shipment_id=b.entity_id',
|
33 |
+
array('parent_id', 'created_at')
|
34 |
+
);
|
35 |
+
|
36 |
+
$this->setCollection($collection);
|
37 |
+
|
38 |
+
return parent::_prepareCollection();
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function _prepareColumns()
|
42 |
+
{
|
43 |
+
$helper = Mage::helper('pptrack');
|
44 |
+
|
45 |
+
// Add the columns that should appear in the grid
|
46 |
+
|
47 |
+
$this->addColumn('code',
|
48 |
+
array(
|
49 |
+
'header'=> $this->__('Tracking Code #'),
|
50 |
+
'index' => 'code'
|
51 |
+
)
|
52 |
+
);
|
53 |
+
$this->addColumn('carrier_name',
|
54 |
+
array(
|
55 |
+
'header'=> $this->__('Carrier'),
|
56 |
+
'index' => 'carrier_name'
|
57 |
+
)
|
58 |
+
);
|
59 |
+
// $this->addColumn('status',
|
60 |
+
// array(
|
61 |
+
// 'header'=> $this->__('Status'),
|
62 |
+
// 'index' => 'status',
|
63 |
+
// 'filter_index' => 'main_table.status',
|
64 |
+
// )
|
65 |
+
// );
|
66 |
+
$this->addColumn('created_at', array(
|
67 |
+
'header' => $this->__('Created at'),
|
68 |
+
'type' => 'datetime',
|
69 |
+
'index' => 'created_at',
|
70 |
+
'filter_index' => 'b.created_at'
|
71 |
+
));
|
72 |
+
$this->addColumn('order_id',
|
73 |
+
array(
|
74 |
+
'header'=> $this->__('Order #'),
|
75 |
+
'index' => 'order_id',
|
76 |
+
'filter_index' => 'main_table.order_id',
|
77 |
+
)
|
78 |
+
);
|
79 |
+
$this->addColumn('shipping_name',
|
80 |
+
array(
|
81 |
+
'header'=> $this->__('Ship to name'),
|
82 |
+
'index' => 'shipping_name'
|
83 |
+
)
|
84 |
+
);
|
85 |
+
|
86 |
+
// $this->addColumn('total_qty', array(
|
87 |
+
// 'header' => $this->__('Total Qty'),
|
88 |
+
// 'index' => 'total_qty',
|
89 |
+
// 'type' => 'number',
|
90 |
+
// ));
|
91 |
+
|
92 |
+
// $this->addColumn('action',
|
93 |
+
// array(
|
94 |
+
// 'header' => Mage::helper('pptrack')->__('Action'),
|
95 |
+
// 'width' => '50px',
|
96 |
+
// 'type' => 'action',
|
97 |
+
// 'getter' => 'getId',
|
98 |
+
// 'actions' => array(
|
99 |
+
// array(
|
100 |
+
// 'caption' => Mage::helper('pptrack')>__('View/Edit'),
|
101 |
+
// 'url' => array('base'=>'*/*/edit'),
|
102 |
+
// 'field' => 'id',
|
103 |
+
// 'data-column' => 'action',
|
104 |
+
// )
|
105 |
+
// ),
|
106 |
+
// 'filter' => false,
|
107 |
+
// 'sortable' => false,
|
108 |
+
// 'index' => 'stores',
|
109 |
+
// 'is_system' => true,
|
110 |
+
// ));
|
111 |
+
|
112 |
+
|
113 |
+
$this->addExportType('*/*/exportTracksCsv', $helper->__('CSV'));
|
114 |
+
$this->addExportType('*/*/exportTracksExcel', $helper->__('Excel XML'));
|
115 |
+
|
116 |
+
$this->setDefaultSort('created_at');
|
117 |
+
$this->setDefaultDir('desc');
|
118 |
+
|
119 |
+
return parent::_prepareColumns();
|
120 |
+
}
|
121 |
+
|
122 |
+
protected function _prepareMassaction()
|
123 |
+
{
|
124 |
+
// $this->setMassactionIdField('entity_id');
|
125 |
+
// $this->getMassactionBlock()->setFormFieldName('order_ids');
|
126 |
+
// $this->getMassactionBlock()->setUseSelectAll(false);
|
127 |
+
//
|
128 |
+
// if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
|
129 |
+
// $this->getMassactionBlock()->addItem('cancel_order', array(
|
130 |
+
// 'label'=> Mage::helper('sales')->__('Cancel'),
|
131 |
+
// 'url' => $this->getUrl('*/sales_order/massCancel'),
|
132 |
+
// ));
|
133 |
+
// }
|
134 |
+
|
135 |
+
return $this;
|
136 |
+
}
|
137 |
+
|
138 |
+
public function getRowUrl($row)
|
139 |
+
{
|
140 |
+
// This is where our row data will link to
|
141 |
+
return $this->getUrl('*/sales_shipment/view/', array('shipment_id' => $row->getParentId()));
|
142 |
+
}
|
143 |
}
|
app/code/community/Packpin/Pptrack/Block/Ads.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Block_Ads extends Mage_Catalog_Block_Product_Abstract
|
3 |
-
{
|
4 |
-
public function getImage()
|
5 |
-
{
|
6 |
-
$image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image');
|
7 |
-
|
8 |
-
if ($image) {
|
9 |
-
return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
|
10 |
-
}
|
11 |
-
|
12 |
-
return false;
|
13 |
-
}
|
14 |
-
|
15 |
-
public function getEmailImage()
|
16 |
-
{
|
17 |
-
$image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image');
|
18 |
-
|
19 |
-
if ($image) {
|
20 |
-
return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
|
21 |
-
}
|
22 |
-
|
23 |
-
return false;
|
24 |
-
}
|
25 |
-
|
26 |
-
public function getImageUrl()
|
27 |
-
{
|
28 |
-
$url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image_url');
|
29 |
-
|
30 |
-
return $url;
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getEmailImageUrl()
|
34 |
-
{
|
35 |
-
$url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image_url');
|
36 |
-
|
37 |
-
return $url;
|
38 |
-
}
|
39 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Block_Ads extends Mage_Catalog_Block_Product_Abstract
|
3 |
+
{
|
4 |
+
public function getImage()
|
5 |
+
{
|
6 |
+
$image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image');
|
7 |
+
|
8 |
+
if ($image) {
|
9 |
+
return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
|
10 |
+
}
|
11 |
+
|
12 |
+
return false;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getEmailImage()
|
16 |
+
{
|
17 |
+
$image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image');
|
18 |
+
|
19 |
+
if ($image) {
|
20 |
+
return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
|
21 |
+
}
|
22 |
+
|
23 |
+
return false;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getImageUrl()
|
27 |
+
{
|
28 |
+
$url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image_url');
|
29 |
+
|
30 |
+
return $url;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getEmailImageUrl()
|
34 |
+
{
|
35 |
+
$url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image_url');
|
36 |
+
|
37 |
+
return $url;
|
38 |
+
}
|
39 |
}
|
app/code/community/Packpin/Pptrack/Block/Crosssell.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Block_Crosssell extends Mage_Catalog_Block_Product_Abstract
|
3 |
-
{
|
4 |
-
public function getCrossSellingItemsByOrderId($orderId, $limit)
|
5 |
-
{
|
6 |
-
$crossSellingItemsArray = array();
|
7 |
-
$orders = Mage::getModel('sales/order')->load($orderId);
|
8 |
-
$items = $orders->getAllVisibleItems();
|
9 |
-
|
10 |
-
foreach ($items as $item) {
|
11 |
-
$product = Mage::getModel('catalog/product')->load($item->getProductId());
|
12 |
-
$crossSellCollection = $product->getCrossSellProductCollection();
|
13 |
-
$crossSellCollection->getSelect()->order(new Zend_Db_Expr('RAND()'))->limit($limit);
|
14 |
-
// $crossSellCollection->setPage(1, 5);
|
15 |
-
foreach ($crossSellCollection as $crossSellItem) {
|
16 |
-
$crossSellingItemsArray[] = Mage::getModel('catalog/product')->load($crossSellItem->getId());
|
17 |
-
}
|
18 |
-
}
|
19 |
-
return $crossSellingItemsArray;
|
20 |
-
}
|
21 |
-
|
22 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Block_Crosssell extends Mage_Catalog_Block_Product_Abstract
|
3 |
+
{
|
4 |
+
public function getCrossSellingItemsByOrderId($orderId, $limit)
|
5 |
+
{
|
6 |
+
$crossSellingItemsArray = array();
|
7 |
+
$orders = Mage::getModel('sales/order')->load($orderId);
|
8 |
+
$items = $orders->getAllVisibleItems();
|
9 |
+
|
10 |
+
foreach ($items as $item) {
|
11 |
+
$product = Mage::getModel('catalog/product')->load($item->getProductId());
|
12 |
+
$crossSellCollection = $product->getCrossSellProductCollection();
|
13 |
+
$crossSellCollection->getSelect()->order(new Zend_Db_Expr('RAND()'))->limit($limit);
|
14 |
+
// $crossSellCollection->setPage(1, 5);
|
15 |
+
foreach ($crossSellCollection as $crossSellItem) {
|
16 |
+
$crossSellingItemsArray[] = Mage::getModel('catalog/product')->load($crossSellItem->getId());
|
17 |
+
}
|
18 |
+
}
|
19 |
+
return $crossSellingItemsArray;
|
20 |
+
}
|
21 |
+
|
22 |
}
|
app/code/community/Packpin/Pptrack/Block/Index.php
CHANGED
@@ -1,122 +1,122 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Index extends Mage_Core_Block_Template
|
4 |
-
{
|
5 |
-
public $newTemplate = false;
|
6 |
-
|
7 |
-
public $email = null;
|
8 |
-
public $orderNumber = null;
|
9 |
-
public $msg = null;
|
10 |
-
public $orderId = null;
|
11 |
-
|
12 |
-
// public $model = null;
|
13 |
-
public $trackModels = array();
|
14 |
-
|
15 |
-
|
16 |
-
protected function _construct()
|
17 |
-
{
|
18 |
-
parent::_construct();
|
19 |
-
|
20 |
-
$model = Mage::getModel('pptrack/track');
|
21 |
-
|
22 |
-
$hash = Mage::app()->getRequest()->getParam('h');
|
23 |
-
$adminHash = Mage::app()->getRequest()->getParam('hash');
|
24 |
-
if ($hash) {
|
25 |
-
$model->loadInfoByHash($hash);
|
26 |
-
$this->model = $model;
|
27 |
-
}
|
28 |
-
elseif ($adminHash) {
|
29 |
-
|
30 |
-
}
|
31 |
-
else {
|
32 |
-
$this->newTemplate = true;
|
33 |
-
|
34 |
-
$this->email = Mage::app()->getRequest()->getParam('email');
|
35 |
-
$this->orderNumber = Mage::app()->getRequest()->getParam('order');
|
36 |
-
//get track models
|
37 |
-
if ($this->email && $this->orderNumber) {
|
38 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($this->orderNumber);
|
39 |
-
if (!$order->getId()) {
|
40 |
-
$this->msg = Mage::helper('pptrack')->__('Order not found');
|
41 |
-
}
|
42 |
-
elseif ($order->customer_email != $this->email) {
|
43 |
-
$this->orderId = $order->getId();
|
44 |
-
|
45 |
-
$this->msg = Mage::helper('pptrack')->__('Incorrect email');
|
46 |
-
}
|
47 |
-
else {
|
48 |
-
$this->orderId = $order->getId();
|
49 |
-
$tracks = $order->getTracksCollection();
|
50 |
-
if ($tracks) {
|
51 |
-
foreach ($tracks as $track) {
|
52 |
-
$collection = Mage::getModel('pptrack/track')
|
53 |
-
->getCollection()
|
54 |
-
->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
|
55 |
-
$trackModel = $collection->getFirstItem();
|
56 |
-
|
57 |
-
if (!$trackModel->getId()) {
|
58 |
-
try {
|
59 |
-
$carrierTitle = $track->title ? trim($track->title) : null;
|
60 |
-
$carrierCode = Mage::getModel('pptrack/carrier')
|
61 |
-
->detectCarrier($track->carrier_code, $carrierTitle);
|
62 |
-
|
63 |
-
$trackingCode = $track->track_number ? trim($track->track_number) : trim($track->number);
|
64 |
-
$addressData = $order->getShippingAddress()->getData();
|
65 |
-
|
66 |
-
$trackModel->setOrderId($order->getId());
|
67 |
-
$trackModel->setShipmentId($track->getId());
|
68 |
-
$trackModel->setCode($trackingCode);
|
69 |
-
$trackModel->setCarrierCode($carrierCode);
|
70 |
-
$trackModel->setCarrierName($carrierTitle);
|
71 |
-
$trackModel->setEmail($order->customer_email);
|
72 |
-
|
73 |
-
//tracking attributes
|
74 |
-
$trackModel->setPostalCode($addressData['postcode']);
|
75 |
-
$trackModel->setDestinationCountry($addressData['country_id']);
|
76 |
-
|
77 |
-
$trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
|
78 |
-
$trackModel->save();
|
79 |
-
$trackModel->updateApi();
|
80 |
-
}
|
81 |
-
catch (Exception $e) {
|
82 |
-
continue;
|
83 |
-
}
|
84 |
-
}
|
85 |
-
$trackModel->updateApiData();
|
86 |
-
|
87 |
-
$this->trackModels[] = $trackModel;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
//log user session
|
92 |
-
try {
|
93 |
-
$trackId = $order->getId();
|
94 |
-
$ip = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : '';
|
95 |
-
$agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : null;
|
96 |
-
|
97 |
-
$userHash = md5($trackId . $ip . $agent);
|
98 |
-
|
99 |
-
$model = Mage::getModel('pptrack/visit')
|
100 |
-
->getCollection()
|
101 |
-
->addFieldToFilter('user_hash', array('eq' => $userHash))
|
102 |
-
->addFieldToFilter("DATE_ADD(created_at, INTERVAL 1 DAY)", array('gteq' => date("Y-m-d H:i:s")))
|
103 |
-
->getFirstItem();
|
104 |
-
if (!$model->getId()) {
|
105 |
-
$model->track_id = $trackId;
|
106 |
-
$model->user_hash = $userHash;
|
107 |
-
$model->user_ip = $ip;
|
108 |
-
$model->user_agent = $agent;
|
109 |
-
$model->save();
|
110 |
-
}
|
111 |
-
}
|
112 |
-
catch (Exception $e) {
|
113 |
-
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
}
|
118 |
-
}
|
119 |
-
|
120 |
-
}
|
121 |
-
|
122 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Index extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
public $newTemplate = false;
|
6 |
+
|
7 |
+
public $email = null;
|
8 |
+
public $orderNumber = null;
|
9 |
+
public $msg = null;
|
10 |
+
public $orderId = null;
|
11 |
+
|
12 |
+
// public $model = null;
|
13 |
+
public $trackModels = array();
|
14 |
+
|
15 |
+
|
16 |
+
protected function _construct()
|
17 |
+
{
|
18 |
+
parent::_construct();
|
19 |
+
|
20 |
+
$model = Mage::getModel('pptrack/track');
|
21 |
+
|
22 |
+
$hash = Mage::app()->getRequest()->getParam('h');
|
23 |
+
$adminHash = Mage::app()->getRequest()->getParam('hash');
|
24 |
+
if ($hash) {
|
25 |
+
$model->loadInfoByHash($hash);
|
26 |
+
$this->model = $model;
|
27 |
+
}
|
28 |
+
elseif ($adminHash) {
|
29 |
+
|
30 |
+
}
|
31 |
+
else {
|
32 |
+
$this->newTemplate = true;
|
33 |
+
|
34 |
+
$this->email = Mage::app()->getRequest()->getParam('email');
|
35 |
+
$this->orderNumber = Mage::app()->getRequest()->getParam('order');
|
36 |
+
//get track models
|
37 |
+
if ($this->email && $this->orderNumber) {
|
38 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->orderNumber);
|
39 |
+
if (!$order->getId()) {
|
40 |
+
$this->msg = Mage::helper('pptrack')->__('Order not found');
|
41 |
+
}
|
42 |
+
elseif ($order->customer_email != $this->email) {
|
43 |
+
$this->orderId = $order->getId();
|
44 |
+
|
45 |
+
$this->msg = Mage::helper('pptrack')->__('Incorrect email');
|
46 |
+
}
|
47 |
+
else {
|
48 |
+
$this->orderId = $order->getId();
|
49 |
+
$tracks = $order->getTracksCollection();
|
50 |
+
if ($tracks) {
|
51 |
+
foreach ($tracks as $track) {
|
52 |
+
$collection = Mage::getModel('pptrack/track')
|
53 |
+
->getCollection()
|
54 |
+
->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
|
55 |
+
$trackModel = $collection->getFirstItem();
|
56 |
+
|
57 |
+
if (!$trackModel->getId()) {
|
58 |
+
try {
|
59 |
+
$carrierTitle = $track->title ? trim($track->title) : null;
|
60 |
+
$carrierCode = Mage::getModel('pptrack/carrier')
|
61 |
+
->detectCarrier($track->carrier_code, $carrierTitle);
|
62 |
+
|
63 |
+
$trackingCode = $track->track_number ? trim($track->track_number) : trim($track->number);
|
64 |
+
$addressData = $order->getShippingAddress()->getData();
|
65 |
+
|
66 |
+
$trackModel->setOrderId($order->getId());
|
67 |
+
$trackModel->setShipmentId($track->getId());
|
68 |
+
$trackModel->setCode($trackingCode);
|
69 |
+
$trackModel->setCarrierCode($carrierCode);
|
70 |
+
$trackModel->setCarrierName($carrierTitle);
|
71 |
+
$trackModel->setEmail($order->customer_email);
|
72 |
+
|
73 |
+
//tracking attributes
|
74 |
+
$trackModel->setPostalCode($addressData['postcode']);
|
75 |
+
$trackModel->setDestinationCountry($addressData['country_id']);
|
76 |
+
|
77 |
+
$trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
|
78 |
+
$trackModel->save();
|
79 |
+
$trackModel->updateApi();
|
80 |
+
}
|
81 |
+
catch (Exception $e) {
|
82 |
+
continue;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
$trackModel->updateApiData();
|
86 |
+
|
87 |
+
$this->trackModels[] = $trackModel;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
//log user session
|
92 |
+
try {
|
93 |
+
$trackId = $order->getId();
|
94 |
+
$ip = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : '';
|
95 |
+
$agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : null;
|
96 |
+
|
97 |
+
$userHash = md5($trackId . $ip . $agent);
|
98 |
+
|
99 |
+
$model = Mage::getModel('pptrack/visit')
|
100 |
+
->getCollection()
|
101 |
+
->addFieldToFilter('user_hash', array('eq' => $userHash))
|
102 |
+
->addFieldToFilter("DATE_ADD(created_at, INTERVAL 1 DAY)", array('gteq' => date("Y-m-d H:i:s")))
|
103 |
+
->getFirstItem();
|
104 |
+
if (!$model->getId()) {
|
105 |
+
$model->track_id = $trackId;
|
106 |
+
$model->user_hash = $userHash;
|
107 |
+
$model->user_ip = $ip;
|
108 |
+
$model->user_agent = $agent;
|
109 |
+
$model->save();
|
110 |
+
}
|
111 |
+
}
|
112 |
+
catch (Exception $e) {
|
113 |
+
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
}
|
121 |
+
|
122 |
}
|
app/code/community/Packpin/Pptrack/Block/Script.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Block_Script extends Mage_Catalog_Block_Product_Abstract
|
3 |
-
{
|
4 |
-
public function getScript()
|
5 |
-
{
|
6 |
-
return Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_script');
|
7 |
-
}
|
8 |
-
|
9 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Block_Script extends Mage_Catalog_Block_Product_Abstract
|
3 |
+
{
|
4 |
+
public function getScript()
|
5 |
+
{
|
6 |
+
return Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_script');
|
7 |
+
}
|
8 |
+
|
9 |
}
|
app/code/community/Packpin/Pptrack/Block/Trackings.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Block_Trackings extends Mage_Core_Block_Template
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* @var Packpin_Pptrack_Model_Track
|
8 |
-
*/
|
9 |
-
protected $_trackModel;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Check if Packpin tracks a shipment
|
13 |
-
*
|
14 |
-
* @param Mage_Sales_Model_Order_Shipment_Track $track
|
15 |
-
* @param Mage_Sales_Model_Order $order
|
16 |
-
* @return bool
|
17 |
-
*/
|
18 |
-
public function shipmentTracked(Mage_Sales_Model_Order_Shipment_Track $track, Mage_Sales_Model_Order $order)
|
19 |
-
{
|
20 |
-
$collection = Mage::getModel('pptrack/track')
|
21 |
-
->getCollection()
|
22 |
-
->addFieldToFilter('order_id', array('eq' => $order->getId()))
|
23 |
-
->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
|
24 |
-
$this->_trackModel = $collection->getFirstItem();
|
25 |
-
|
26 |
-
if ($this->_trackModel->getId())
|
27 |
-
return true;
|
28 |
-
|
29 |
-
return false;
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @return Packpin_Pptrack_Model_Track
|
34 |
-
*/
|
35 |
-
public function getTrackModel()
|
36 |
-
{
|
37 |
-
return $this->_trackModel;
|
38 |
-
}
|
39 |
-
|
40 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Block_Trackings extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @var Packpin_Pptrack_Model_Track
|
8 |
+
*/
|
9 |
+
protected $_trackModel;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Check if Packpin tracks a shipment
|
13 |
+
*
|
14 |
+
* @param Mage_Sales_Model_Order_Shipment_Track $track
|
15 |
+
* @param Mage_Sales_Model_Order $order
|
16 |
+
* @return bool
|
17 |
+
*/
|
18 |
+
public function shipmentTracked(Mage_Sales_Model_Order_Shipment_Track $track, Mage_Sales_Model_Order $order)
|
19 |
+
{
|
20 |
+
$collection = Mage::getModel('pptrack/track')
|
21 |
+
->getCollection()
|
22 |
+
->addFieldToFilter('order_id', array('eq' => $order->getId()))
|
23 |
+
->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
|
24 |
+
$this->_trackModel = $collection->getFirstItem();
|
25 |
+
|
26 |
+
if ($this->_trackModel->getId())
|
27 |
+
return true;
|
28 |
+
|
29 |
+
return false;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @return Packpin_Pptrack_Model_Track
|
34 |
+
*/
|
35 |
+
public function getTrackModel()
|
36 |
+
{
|
37 |
+
return $this->_trackModel;
|
38 |
+
}
|
39 |
+
|
40 |
}
|
app/code/community/Packpin/Pptrack/Helper/Data.php
CHANGED
@@ -1,370 +1,370 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Helper_Data
|
5 |
-
*
|
6 |
-
* API calls helpers
|
7 |
-
* see https://packpin.com/docs for more documentation
|
8 |
-
*/
|
9 |
-
class Packpin_Pptrack_Helper_Data extends Mage_Core_Helper_Abstract
|
10 |
-
{
|
11 |
-
/**
|
12 |
-
* Backend
|
13 |
-
*/
|
14 |
-
const API_BACKEND = 'https://api.packpin.com/v2/';
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Api routes
|
18 |
-
*/
|
19 |
-
const API_PATH_CARRIERS = 'carriers';
|
20 |
-
const API_PATH_TRACKINGS = 'trackings';
|
21 |
-
const API_PATH_TRACKINGS_BATCH = 'trackings/batch';
|
22 |
-
const API_PATH_TRACKING_INFO = 'trackings/%s/%s';
|
23 |
-
const API_PATH_CONNECTORS = 'connectors';
|
24 |
-
const API_PATH_TEST = 'test/1';
|
25 |
-
const API_PATH_GENERATE_TEMP_KEY = 'genkey';
|
26 |
-
const API_PATH_PLAN_INFO = 'planinfo';
|
27 |
-
const API_PATH_EMAIL_COUNT = 'emails/count';
|
28 |
-
|
29 |
-
|
30 |
-
const API_ROLE_NAME = 'packpin_connection';
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Config paths
|
34 |
-
*/
|
35 |
-
const XML_PATH_API_KEY = 'pp_section_setttings/settings/api_key';
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Packpin API key
|
39 |
-
*
|
40 |
-
* @var string
|
41 |
-
*/
|
42 |
-
protected $_apiKey;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Last API call status code
|
46 |
-
*
|
47 |
-
* @var integer
|
48 |
-
*/
|
49 |
-
protected $_lastStatusCode;
|
50 |
-
|
51 |
-
protected function _getApiKey()
|
52 |
-
{
|
53 |
-
if ($this->_apiKey === null) {
|
54 |
-
$this->_apiKey = Mage::getStoreConfig(self::XML_PATH_API_KEY);
|
55 |
-
}
|
56 |
-
|
57 |
-
return $this->_apiKey;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Make API request
|
62 |
-
*
|
63 |
-
* @param string $route
|
64 |
-
* @param string $method
|
65 |
-
* @param array $body
|
66 |
-
*
|
67 |
-
* @return bool|array
|
68 |
-
*/
|
69 |
-
protected function _apiRequest($route, $method = 'GET', $body = array())
|
70 |
-
{
|
71 |
-
$store = Mage::app()->getStore();
|
72 |
-
$body['plugin_type'] = 'magento';
|
73 |
-
$body['plugin_version'] = $this->getExtensionVersion();
|
74 |
-
$body['plugin_shop_version'] = Mage::getVersion();
|
75 |
-
$body['plugin_user'] = Mage::getStoreConfig('trans_email/ident_general/name');
|
76 |
-
$body['plugin_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
|
77 |
-
$body['plugin_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
78 |
-
|
79 |
-
$url = self::API_BACKEND . $route;
|
80 |
-
|
81 |
-
$ch = curl_init($url);
|
82 |
-
if ($method == 'POST') {
|
83 |
-
curl_setopt($ch, CURLOPT_POST, 1);
|
84 |
-
} elseif ($method == 'PUT') {
|
85 |
-
curl_setopt($ch, CURLOPT_PUT, true);
|
86 |
-
} elseif ($method != 'PUT') {
|
87 |
-
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
88 |
-
}
|
89 |
-
//timeouts
|
90 |
-
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);
|
91 |
-
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
|
92 |
-
|
93 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
94 |
-
curl_setopt($ch, CURLOPT_HEADER, 0);
|
95 |
-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
96 |
-
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
97 |
-
$headers = array(
|
98 |
-
'packpin-api-key: ' . $this->_getApiKey(),
|
99 |
-
'Content-Type: application/json',
|
100 |
-
);
|
101 |
-
if ($body) {
|
102 |
-
$dataString = json_encode($body);
|
103 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
|
104 |
-
$headers[] = 'Content-Length: ' . strlen($dataString);
|
105 |
-
}
|
106 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
107 |
-
|
108 |
-
$response = curl_exec($ch);
|
109 |
-
$this->_lastStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
110 |
-
curl_close($ch);
|
111 |
-
unset($ch);
|
112 |
-
|
113 |
-
return $response;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Get info about single tracking object
|
118 |
-
*
|
119 |
-
* @param string $carrierCode
|
120 |
-
* @param string $trackingCode
|
121 |
-
*
|
122 |
-
* @return array
|
123 |
-
*/
|
124 |
-
public function getTrackingInfo($carrierCode, $trackingCode)
|
125 |
-
{
|
126 |
-
$info = array();
|
127 |
-
|
128 |
-
$url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
|
129 |
-
|
130 |
-
$res = $this->_apiRequest($url, 'GET');
|
131 |
-
if ($res) {
|
132 |
-
$info = json_decode($res, true);
|
133 |
-
}
|
134 |
-
|
135 |
-
return $info;
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Get list of available carriers
|
140 |
-
*
|
141 |
-
* @return array
|
142 |
-
*/
|
143 |
-
public function getCarrierList()
|
144 |
-
{
|
145 |
-
$info = array();
|
146 |
-
|
147 |
-
$url = self::API_PATH_CARRIERS;
|
148 |
-
|
149 |
-
$res = $this->_apiRequest($url, 'GET');
|
150 |
-
if ($res) {
|
151 |
-
$info = json_decode($res, true);
|
152 |
-
}
|
153 |
-
|
154 |
-
return $info;
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Add new tracking code
|
159 |
-
*
|
160 |
-
* @param string $carrierCode
|
161 |
-
* @param string $trackingCode
|
162 |
-
* @param string|null $description
|
163 |
-
* @param string|null $postalCode
|
164 |
-
* @param string|null $destinationCountry
|
165 |
-
* @param string|null $shipDate
|
166 |
-
* @param integer|null $orderId
|
167 |
-
*
|
168 |
-
* @return array
|
169 |
-
*/
|
170 |
-
public function addTrackingCode($carrierCode, $trackingCode, $description = null, $postalCode = null, $destinationCountry = null, $shipDate = null, $orderId = null)
|
171 |
-
{
|
172 |
-
$info = array();
|
173 |
-
|
174 |
-
$url = self::API_PATH_TRACKINGS;
|
175 |
-
$body = array(
|
176 |
-
'code' => $trackingCode,
|
177 |
-
'carrier' => $carrierCode,
|
178 |
-
'description' => $description,
|
179 |
-
'track_postal_code' => $postalCode,
|
180 |
-
'track_ship_date' => $shipDate,
|
181 |
-
'track_destination_country' => $destinationCountry,
|
182 |
-
'order_id' => $orderId,
|
183 |
-
);
|
184 |
-
|
185 |
-
$res = $this->_apiRequest($url, 'POST', $body);
|
186 |
-
if ($res) {
|
187 |
-
$info = json_decode($res, true);
|
188 |
-
}
|
189 |
-
|
190 |
-
return $info;
|
191 |
-
}
|
192 |
-
|
193 |
-
public function removeTrackingCode($carrierCode, $trackingCode)
|
194 |
-
{
|
195 |
-
$info = array();
|
196 |
-
|
197 |
-
$url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
|
198 |
-
|
199 |
-
$res = $this->_apiRequest($url, 'DELETE');
|
200 |
-
|
201 |
-
if ($res) {
|
202 |
-
$info = json_decode($res, true);
|
203 |
-
} else {
|
204 |
-
$info = array(
|
205 |
-
"statusCode" => $this->_lastStatusCode
|
206 |
-
);
|
207 |
-
}
|
208 |
-
|
209 |
-
return $info;
|
210 |
-
}
|
211 |
-
|
212 |
-
public function enableConnector($status = 0)
|
213 |
-
{
|
214 |
-
$info = array();
|
215 |
-
|
216 |
-
$url = self::API_PATH_CONNECTORS;
|
217 |
-
$body = array(
|
218 |
-
'path' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB),
|
219 |
-
'enabled' => $status,
|
220 |
-
);
|
221 |
-
|
222 |
-
$res = $this->_apiRequest($url, 'POST', $body);
|
223 |
-
|
224 |
-
if ($res) {
|
225 |
-
$info = json_decode($res, true);
|
226 |
-
}
|
227 |
-
|
228 |
-
if (!$info && preg_match('#SOAP-ERROR#ui', $res, $m)) {
|
229 |
-
$info = array(
|
230 |
-
'statusCode' => 400,
|
231 |
-
'body' => array(
|
232 |
-
'reason' => 'Could not connect to Magento shop API'
|
233 |
-
),
|
234 |
-
);
|
235 |
-
}
|
236 |
-
|
237 |
-
return $info;
|
238 |
-
}
|
239 |
-
|
240 |
-
public function testApiKey()
|
241 |
-
{
|
242 |
-
$info = array();
|
243 |
-
|
244 |
-
$url = self::API_PATH_TEST;
|
245 |
-
$res = $this->_apiRequest($url, 'GET');
|
246 |
-
if ($res) {
|
247 |
-
$info = json_decode($res, true);
|
248 |
-
}
|
249 |
-
|
250 |
-
return $info;
|
251 |
-
}
|
252 |
-
|
253 |
-
public function createSoapUserAndRole($apiKey)
|
254 |
-
{
|
255 |
-
|
256 |
-
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
|
257 |
-
try {
|
258 |
-
$connection->beginTransaction();
|
259 |
-
|
260 |
-
$user = Mage::getModel('api/user')->loadByUsername("packpin");
|
261 |
-
$user->setUsername('packpin')->setFirstname('packpin')->setLastname('packpin')->setEmail('info@packpin.com')->setApiKey($apiKey)->setApiKeyConfirmation($apiKey)->setIsActive(1)->save();
|
262 |
-
|
263 |
-
$role = Mage::getModel('api/roles')->load(self::API_ROLE_NAME, "role_name");
|
264 |
-
if (!$role->getId()) {
|
265 |
-
$res = Mage::getModel('api/role')->setParentId('0')->setTreeLevel('1')->setSortOrder('0')->setRoleName(self::API_ROLE_NAME)->setRoleType('G')->save();
|
266 |
-
$rules = Mage::getModel('api/rules')->setRoleId($res->getRoleId())->setResources(array("pptrack", "pptrack/info", "pptrack/test"));
|
267 |
-
//for newer magento versions
|
268 |
-
$rrModel = Mage::getModel('api/resource_rules');
|
269 |
-
if ($rrModel) {
|
270 |
-
$rrModel->saveRel($rules);
|
271 |
-
}
|
272 |
-
//Mage 1.5
|
273 |
-
else {
|
274 |
-
$rules->saveRel();
|
275 |
-
}
|
276 |
-
|
277 |
-
$role = $res;
|
278 |
-
}
|
279 |
-
|
280 |
-
$user->setRoleIds(array($role->getId()))
|
281 |
-
->setRoleUserId($user->getUserId())
|
282 |
-
->saveRelations();
|
283 |
-
|
284 |
-
|
285 |
-
////Stupid hack. Should be fixed properly in the future
|
286 |
-
$transactionLevel = $connection->getTransactionLevel();
|
287 |
-
for ($i = 1; $i <= $transactionLevel; $i++) {
|
288 |
-
$connection->commit();
|
289 |
-
}
|
290 |
-
|
291 |
-
} catch (Exception $e) {
|
292 |
-
$connection->rollback();
|
293 |
-
}
|
294 |
-
|
295 |
-
return true;
|
296 |
-
}
|
297 |
-
|
298 |
-
public function getExtensionVersion()
|
299 |
-
{
|
300 |
-
return (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version;
|
301 |
-
}
|
302 |
-
|
303 |
-
/**
|
304 |
-
* Generates temporary API key for fresh plugin install
|
305 |
-
*
|
306 |
-
* @return string
|
307 |
-
*/
|
308 |
-
public function generateTempKey()
|
309 |
-
{
|
310 |
-
$url = self::API_PATH_GENERATE_TEMP_KEY;
|
311 |
-
$body = array(
|
312 |
-
'name' => Mage::getStoreConfig('trans_email/ident_general/name'),
|
313 |
-
'email' => Mage::getStoreConfig('trans_email/ident_general/email'),
|
314 |
-
);
|
315 |
-
|
316 |
-
$res = $this->_apiRequest($url, 'POST', $body);
|
317 |
-
if ($res) {
|
318 |
-
$info = json_decode($res, true);
|
319 |
-
if (isset($info['body']['key']))
|
320 |
-
return $info['body']['key'];
|
321 |
-
}
|
322 |
-
|
323 |
-
return false;
|
324 |
-
}
|
325 |
-
|
326 |
-
/**
|
327 |
-
* Get details about current plan
|
328 |
-
*
|
329 |
-
* @return array
|
330 |
-
*/
|
331 |
-
public function getPlanDetails()
|
332 |
-
{
|
333 |
-
$info = array();
|
334 |
-
$url = self::API_PATH_PLAN_INFO;
|
335 |
-
|
336 |
-
$res = $this->_apiRequest($url, 'GET');
|
337 |
-
if ($res) {
|
338 |
-
$info = json_decode($res, true);
|
339 |
-
}
|
340 |
-
|
341 |
-
return $info;
|
342 |
-
}
|
343 |
-
|
344 |
-
/**
|
345 |
-
* Get email sent count for period
|
346 |
-
*
|
347 |
-
* @param string $start
|
348 |
-
* @param string $end
|
349 |
-
*
|
350 |
-
* @return array
|
351 |
-
*/
|
352 |
-
public function getEmailCount($start, $end)
|
353 |
-
{
|
354 |
-
$info = array();
|
355 |
-
$url = self::API_PATH_EMAIL_COUNT;
|
356 |
-
$body = array(
|
357 |
-
'start' => $start,
|
358 |
-
'end' => $end,
|
359 |
-
);
|
360 |
-
|
361 |
-
$res = $this->_apiRequest($url, 'POST', $body);
|
362 |
-
if ($res) {
|
363 |
-
$info = json_decode($res, true);
|
364 |
-
}
|
365 |
-
|
366 |
-
return $info;
|
367 |
-
}
|
368 |
-
|
369 |
-
}
|
370 |
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Helper_Data
|
5 |
+
*
|
6 |
+
* API calls helpers
|
7 |
+
* see https://packpin.com/docs for more documentation
|
8 |
+
*/
|
9 |
+
class Packpin_Pptrack_Helper_Data extends Mage_Core_Helper_Abstract
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Backend
|
13 |
+
*/
|
14 |
+
const API_BACKEND = 'https://api.packpin.com/v2/';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Api routes
|
18 |
+
*/
|
19 |
+
const API_PATH_CARRIERS = 'carriers';
|
20 |
+
const API_PATH_TRACKINGS = 'trackings';
|
21 |
+
const API_PATH_TRACKINGS_BATCH = 'trackings/batch';
|
22 |
+
const API_PATH_TRACKING_INFO = 'trackings/%s/%s';
|
23 |
+
const API_PATH_CONNECTORS = 'connectors';
|
24 |
+
const API_PATH_TEST = 'test/1';
|
25 |
+
const API_PATH_GENERATE_TEMP_KEY = 'genkey';
|
26 |
+
const API_PATH_PLAN_INFO = 'planinfo';
|
27 |
+
const API_PATH_EMAIL_COUNT = 'emails/count';
|
28 |
+
|
29 |
+
|
30 |
+
const API_ROLE_NAME = 'packpin_connection';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Config paths
|
34 |
+
*/
|
35 |
+
const XML_PATH_API_KEY = 'pp_section_setttings/settings/api_key';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Packpin API key
|
39 |
+
*
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
protected $_apiKey;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Last API call status code
|
46 |
+
*
|
47 |
+
* @var integer
|
48 |
+
*/
|
49 |
+
protected $_lastStatusCode;
|
50 |
+
|
51 |
+
protected function _getApiKey()
|
52 |
+
{
|
53 |
+
if ($this->_apiKey === null) {
|
54 |
+
$this->_apiKey = Mage::getStoreConfig(self::XML_PATH_API_KEY);
|
55 |
+
}
|
56 |
+
|
57 |
+
return $this->_apiKey;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Make API request
|
62 |
+
*
|
63 |
+
* @param string $route
|
64 |
+
* @param string $method
|
65 |
+
* @param array $body
|
66 |
+
*
|
67 |
+
* @return bool|array
|
68 |
+
*/
|
69 |
+
protected function _apiRequest($route, $method = 'GET', $body = array())
|
70 |
+
{
|
71 |
+
$store = Mage::app()->getStore();
|
72 |
+
$body['plugin_type'] = 'magento';
|
73 |
+
$body['plugin_version'] = $this->getExtensionVersion();
|
74 |
+
$body['plugin_shop_version'] = Mage::getVersion();
|
75 |
+
$body['plugin_user'] = Mage::getStoreConfig('trans_email/ident_general/name');
|
76 |
+
$body['plugin_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
|
77 |
+
$body['plugin_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
78 |
+
|
79 |
+
$url = self::API_BACKEND . $route;
|
80 |
+
|
81 |
+
$ch = curl_init($url);
|
82 |
+
if ($method == 'POST') {
|
83 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
84 |
+
} elseif ($method == 'PUT') {
|
85 |
+
curl_setopt($ch, CURLOPT_PUT, true);
|
86 |
+
} elseif ($method != 'PUT') {
|
87 |
+
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
88 |
+
}
|
89 |
+
//timeouts
|
90 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);
|
91 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
|
92 |
+
|
93 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
94 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
95 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
96 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
97 |
+
$headers = array(
|
98 |
+
'packpin-api-key: ' . $this->_getApiKey(),
|
99 |
+
'Content-Type: application/json',
|
100 |
+
);
|
101 |
+
if ($body) {
|
102 |
+
$dataString = json_encode($body);
|
103 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
|
104 |
+
$headers[] = 'Content-Length: ' . strlen($dataString);
|
105 |
+
}
|
106 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
107 |
+
|
108 |
+
$response = curl_exec($ch);
|
109 |
+
$this->_lastStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
110 |
+
curl_close($ch);
|
111 |
+
unset($ch);
|
112 |
+
|
113 |
+
return $response;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Get info about single tracking object
|
118 |
+
*
|
119 |
+
* @param string $carrierCode
|
120 |
+
* @param string $trackingCode
|
121 |
+
*
|
122 |
+
* @return array
|
123 |
+
*/
|
124 |
+
public function getTrackingInfo($carrierCode, $trackingCode)
|
125 |
+
{
|
126 |
+
$info = array();
|
127 |
+
|
128 |
+
$url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
|
129 |
+
|
130 |
+
$res = $this->_apiRequest($url, 'GET');
|
131 |
+
if ($res) {
|
132 |
+
$info = json_decode($res, true);
|
133 |
+
}
|
134 |
+
|
135 |
+
return $info;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Get list of available carriers
|
140 |
+
*
|
141 |
+
* @return array
|
142 |
+
*/
|
143 |
+
public function getCarrierList()
|
144 |
+
{
|
145 |
+
$info = array();
|
146 |
+
|
147 |
+
$url = self::API_PATH_CARRIERS;
|
148 |
+
|
149 |
+
$res = $this->_apiRequest($url, 'GET');
|
150 |
+
if ($res) {
|
151 |
+
$info = json_decode($res, true);
|
152 |
+
}
|
153 |
+
|
154 |
+
return $info;
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Add new tracking code
|
159 |
+
*
|
160 |
+
* @param string $carrierCode
|
161 |
+
* @param string $trackingCode
|
162 |
+
* @param string|null $description
|
163 |
+
* @param string|null $postalCode
|
164 |
+
* @param string|null $destinationCountry
|
165 |
+
* @param string|null $shipDate
|
166 |
+
* @param integer|null $orderId
|
167 |
+
*
|
168 |
+
* @return array
|
169 |
+
*/
|
170 |
+
public function addTrackingCode($carrierCode, $trackingCode, $description = null, $postalCode = null, $destinationCountry = null, $shipDate = null, $orderId = null)
|
171 |
+
{
|
172 |
+
$info = array();
|
173 |
+
|
174 |
+
$url = self::API_PATH_TRACKINGS;
|
175 |
+
$body = array(
|
176 |
+
'code' => $trackingCode,
|
177 |
+
'carrier' => $carrierCode,
|
178 |
+
'description' => $description,
|
179 |
+
'track_postal_code' => $postalCode,
|
180 |
+
'track_ship_date' => $shipDate,
|
181 |
+
'track_destination_country' => $destinationCountry,
|
182 |
+
'order_id' => $orderId,
|
183 |
+
);
|
184 |
+
|
185 |
+
$res = $this->_apiRequest($url, 'POST', $body);
|
186 |
+
if ($res) {
|
187 |
+
$info = json_decode($res, true);
|
188 |
+
}
|
189 |
+
|
190 |
+
return $info;
|
191 |
+
}
|
192 |
+
|
193 |
+
public function removeTrackingCode($carrierCode, $trackingCode)
|
194 |
+
{
|
195 |
+
$info = array();
|
196 |
+
|
197 |
+
$url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
|
198 |
+
|
199 |
+
$res = $this->_apiRequest($url, 'DELETE');
|
200 |
+
|
201 |
+
if ($res) {
|
202 |
+
$info = json_decode($res, true);
|
203 |
+
} else {
|
204 |
+
$info = array(
|
205 |
+
"statusCode" => $this->_lastStatusCode
|
206 |
+
);
|
207 |
+
}
|
208 |
+
|
209 |
+
return $info;
|
210 |
+
}
|
211 |
+
|
212 |
+
public function enableConnector($status = 0)
|
213 |
+
{
|
214 |
+
$info = array();
|
215 |
+
|
216 |
+
$url = self::API_PATH_CONNECTORS;
|
217 |
+
$body = array(
|
218 |
+
'path' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB),
|
219 |
+
'enabled' => $status,
|
220 |
+
);
|
221 |
+
|
222 |
+
$res = $this->_apiRequest($url, 'POST', $body);
|
223 |
+
|
224 |
+
if ($res) {
|
225 |
+
$info = json_decode($res, true);
|
226 |
+
}
|
227 |
+
|
228 |
+
if (!$info && preg_match('#SOAP-ERROR#ui', $res, $m)) {
|
229 |
+
$info = array(
|
230 |
+
'statusCode' => 400,
|
231 |
+
'body' => array(
|
232 |
+
'reason' => 'Could not connect to Magento shop API'
|
233 |
+
),
|
234 |
+
);
|
235 |
+
}
|
236 |
+
|
237 |
+
return $info;
|
238 |
+
}
|
239 |
+
|
240 |
+
public function testApiKey()
|
241 |
+
{
|
242 |
+
$info = array();
|
243 |
+
|
244 |
+
$url = self::API_PATH_TEST;
|
245 |
+
$res = $this->_apiRequest($url, 'GET');
|
246 |
+
if ($res) {
|
247 |
+
$info = json_decode($res, true);
|
248 |
+
}
|
249 |
+
|
250 |
+
return $info;
|
251 |
+
}
|
252 |
+
|
253 |
+
public function createSoapUserAndRole($apiKey)
|
254 |
+
{
|
255 |
+
|
256 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
|
257 |
+
try {
|
258 |
+
$connection->beginTransaction();
|
259 |
+
|
260 |
+
$user = Mage::getModel('api/user')->loadByUsername("packpin");
|
261 |
+
$user->setUsername('packpin')->setFirstname('packpin')->setLastname('packpin')->setEmail('info@packpin.com')->setApiKey($apiKey)->setApiKeyConfirmation($apiKey)->setIsActive(1)->save();
|
262 |
+
|
263 |
+
$role = Mage::getModel('api/roles')->load(self::API_ROLE_NAME, "role_name");
|
264 |
+
if (!$role->getId()) {
|
265 |
+
$res = Mage::getModel('api/role')->setParentId('0')->setTreeLevel('1')->setSortOrder('0')->setRoleName(self::API_ROLE_NAME)->setRoleType('G')->save();
|
266 |
+
$rules = Mage::getModel('api/rules')->setRoleId($res->getRoleId())->setResources(array("pptrack", "pptrack/info", "pptrack/test"));
|
267 |
+
//for newer magento versions
|
268 |
+
$rrModel = Mage::getModel('api/resource_rules');
|
269 |
+
if ($rrModel) {
|
270 |
+
$rrModel->saveRel($rules);
|
271 |
+
}
|
272 |
+
//Mage 1.5
|
273 |
+
else {
|
274 |
+
$rules->saveRel();
|
275 |
+
}
|
276 |
+
|
277 |
+
$role = $res;
|
278 |
+
}
|
279 |
+
|
280 |
+
$user->setRoleIds(array($role->getId()))
|
281 |
+
->setRoleUserId($user->getUserId())
|
282 |
+
->saveRelations();
|
283 |
+
|
284 |
+
|
285 |
+
////Stupid hack. Should be fixed properly in the future
|
286 |
+
$transactionLevel = $connection->getTransactionLevel();
|
287 |
+
for ($i = 1; $i <= $transactionLevel; $i++) {
|
288 |
+
$connection->commit();
|
289 |
+
}
|
290 |
+
|
291 |
+
} catch (Exception $e) {
|
292 |
+
$connection->rollback();
|
293 |
+
}
|
294 |
+
|
295 |
+
return true;
|
296 |
+
}
|
297 |
+
|
298 |
+
public function getExtensionVersion()
|
299 |
+
{
|
300 |
+
return (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version;
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* Generates temporary API key for fresh plugin install
|
305 |
+
*
|
306 |
+
* @return string
|
307 |
+
*/
|
308 |
+
public function generateTempKey()
|
309 |
+
{
|
310 |
+
$url = self::API_PATH_GENERATE_TEMP_KEY;
|
311 |
+
$body = array(
|
312 |
+
'name' => Mage::getStoreConfig('trans_email/ident_general/name'),
|
313 |
+
'email' => Mage::getStoreConfig('trans_email/ident_general/email'),
|
314 |
+
);
|
315 |
+
|
316 |
+
$res = $this->_apiRequest($url, 'POST', $body);
|
317 |
+
if ($res) {
|
318 |
+
$info = json_decode($res, true);
|
319 |
+
if (isset($info['body']['key']))
|
320 |
+
return $info['body']['key'];
|
321 |
+
}
|
322 |
+
|
323 |
+
return false;
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Get details about current plan
|
328 |
+
*
|
329 |
+
* @return array
|
330 |
+
*/
|
331 |
+
public function getPlanDetails()
|
332 |
+
{
|
333 |
+
$info = array();
|
334 |
+
$url = self::API_PATH_PLAN_INFO;
|
335 |
+
|
336 |
+
$res = $this->_apiRequest($url, 'GET');
|
337 |
+
if ($res) {
|
338 |
+
$info = json_decode($res, true);
|
339 |
+
}
|
340 |
+
|
341 |
+
return $info;
|
342 |
+
}
|
343 |
+
|
344 |
+
/**
|
345 |
+
* Get email sent count for period
|
346 |
+
*
|
347 |
+
* @param string $start
|
348 |
+
* @param string $end
|
349 |
+
*
|
350 |
+
* @return array
|
351 |
+
*/
|
352 |
+
public function getEmailCount($start, $end)
|
353 |
+
{
|
354 |
+
$info = array();
|
355 |
+
$url = self::API_PATH_EMAIL_COUNT;
|
356 |
+
$body = array(
|
357 |
+
'start' => $start,
|
358 |
+
'end' => $end,
|
359 |
+
);
|
360 |
+
|
361 |
+
$res = $this->_apiRequest($url, 'POST', $body);
|
362 |
+
if ($res) {
|
363 |
+
$info = json_decode($res, true);
|
364 |
+
}
|
365 |
+
|
366 |
+
return $info;
|
367 |
+
}
|
368 |
+
|
369 |
+
}
|
370 |
|
app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviews.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews
|
4 |
-
{
|
5 |
-
public function toOptionArray()
|
6 |
-
{
|
7 |
-
$options = array(
|
8 |
-
array('value' => 'products', 'label' => 'Assigned cross-sell products'),
|
9 |
-
array('value' => 'ads', 'label' => 'Ads banner'),
|
10 |
-
);
|
11 |
-
|
12 |
-
return $options;
|
13 |
-
}
|
14 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
$options = array(
|
8 |
+
array('value' => 'products', 'label' => 'Assigned cross-sell products'),
|
9 |
+
array('value' => 'ads', 'label' => 'Ads banner'),
|
10 |
+
);
|
11 |
+
|
12 |
+
return $options;
|
13 |
+
}
|
14 |
}
|
app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviewspage.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage
|
4 |
-
{
|
5 |
-
public function toOptionArray()
|
6 |
-
{
|
7 |
-
$options = array(
|
8 |
-
array('value' => 'products', 'label' => 'Assigned cross-sell products'),
|
9 |
-
array('value' => 'ads', 'label' => 'Ads banner'),
|
10 |
-
array('value' => 'script', 'label' => 'Custom script'),
|
11 |
-
);
|
12 |
-
|
13 |
-
return $options;
|
14 |
-
}
|
15 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
$options = array(
|
8 |
+
array('value' => 'products', 'label' => 'Assigned cross-sell products'),
|
9 |
+
array('value' => 'ads', 'label' => 'Ads banner'),
|
10 |
+
array('value' => 'script', 'label' => 'Custom script'),
|
11 |
+
);
|
12 |
+
|
13 |
+
return $options;
|
14 |
+
}
|
15 |
}
|
app/code/community/Packpin/Pptrack/Model/Api.php
CHANGED
@@ -1,138 +1,138 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Api extends Mage_Api_Model_Resource_Abstract
|
4 |
-
{
|
5 |
-
|
6 |
-
const ERROR_EXTENSION_DISABLED = 'extension_disabled';
|
7 |
-
const ERROR_NOTIFICATIONS_DISABLED = 'notifications_disabled';
|
8 |
-
const ERROR_NO_TEMPLATE = 'no_template';
|
9 |
-
|
10 |
-
const DEFAULT_LOCALE = 'en_US';
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Get email info
|
14 |
-
*
|
15 |
-
* @param string $carrierCode
|
16 |
-
* @param string $trackingCode
|
17 |
-
*
|
18 |
-
* @return array
|
19 |
-
*/
|
20 |
-
public function info($carrierCode, $trackingCode, $status)
|
21 |
-
{
|
22 |
-
//extension disabled
|
23 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
24 |
-
if (!$enabled)
|
25 |
-
return array(
|
26 |
-
'error' => self::ERROR_EXTENSION_DISABLED
|
27 |
-
);
|
28 |
-
|
29 |
-
//notifications disabled
|
30 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
|
31 |
-
if (!$enabled)
|
32 |
-
return false;
|
33 |
-
|
34 |
-
$trackModel = Mage::getModel('pptrack/track')
|
35 |
-
->loadByCarrierAndCode($carrierCode, $trackingCode);
|
36 |
-
|
37 |
-
//maybe changed to custom by some API's (for older versions)
|
38 |
-
if (!$trackModel->getId()) {
|
39 |
-
$trackModel = Mage::getModel('pptrack/track')
|
40 |
-
->loadByCarrierAndCode('custom', $trackingCode);
|
41 |
-
}
|
42 |
-
|
43 |
-
if ($trackModel->getId()) {
|
44 |
-
$order = Mage::getModel('sales/order')->load($trackModel->getOrderId());
|
45 |
-
$store = $order->getStore();
|
46 |
-
$storeId = $store->getId();
|
47 |
-
|
48 |
-
$templateSettings = Mage::getStoreConfig('pp_section_notification_emails/' . $status, $storeId);
|
49 |
-
if (!$templateSettings || (!$templateSettings['enabled_owner'] && !$templateSettings['enabled_client']))
|
50 |
-
return self::ERROR_NOTIFICATIONS_DISABLED;
|
51 |
-
|
52 |
-
$data = array();
|
53 |
-
|
54 |
-
//sender data
|
55 |
-
$data['sender_name'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/name');
|
56 |
-
$data['sender_email'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/email');
|
57 |
-
|
58 |
-
//shop data
|
59 |
-
if ($templateSettings['enabled_owner']) {
|
60 |
-
$data['owner_name'] = Mage::getStoreConfig('trans_email/ident_general/name');
|
61 |
-
$data['owner_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
|
62 |
-
}
|
63 |
-
|
64 |
-
//client data
|
65 |
-
//check if client unsubscribed
|
66 |
-
try {
|
67 |
-
$unsubscribed = Mage::getModel('pptrack/trackunsubscribed')
|
68 |
-
->load($trackModel->getId(), 'track_id');
|
69 |
-
}
|
70 |
-
catch (Exception $e) {
|
71 |
-
$unsubscribed = Mage::getModel('pptrack/trackunsubscribed');
|
72 |
-
}
|
73 |
-
|
74 |
-
if (!$unsubscribed->getId() && $templateSettings['enabled_client']) {
|
75 |
-
$data['client_name'] = $order->getCustomerName();
|
76 |
-
$data['client_email'] = $order->getCustomerEmail();
|
77 |
-
}
|
78 |
-
|
79 |
-
//email template data
|
80 |
-
$templateId = $templateSettings['template'];
|
81 |
-
|
82 |
-
Mage::getDesign()->setStore($store);
|
83 |
-
$emailTemplate = Mage::getModel('core/email_template');
|
84 |
-
$emailTemplate->emulateDesign($storeId);
|
85 |
-
if (is_numeric($templateId)) {
|
86 |
-
$emailTemplate->load($templateId);
|
87 |
-
} else {
|
88 |
-
$templateId = 'packpin_'. $status .'_email';
|
89 |
-
|
90 |
-
// $storeId = $order->getStore()->getId();
|
91 |
-
// $localeCode = Mage::getStoreConfig('general/locale/code', $storeId);
|
92 |
-
$localeCode = self::DEFAULT_LOCALE;
|
93 |
-
|
94 |
-
$emailTemplate->loadDefault($templateId, $localeCode);
|
95 |
-
}
|
96 |
-
|
97 |
-
$crossSell = '';
|
98 |
-
$banner = '';
|
99 |
-
if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email')) {
|
100 |
-
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_type'), array('ads'))) {
|
101 |
-
$banner = Mage::app()->getLayout()->createBlock('pptrack/ads')->setTemplate('pptrack/ads_email.phtml')->toHtml();
|
102 |
-
}
|
103 |
-
else {
|
104 |
-
$crossSell = Mage::app()->getLayout()->createBlock('pptrack/crosssell')->setData(array('orderId' => $trackModel->getOrderId()))->setTemplate('pptrack/crosssell_email.phtml')->toHtml();
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
$variables = array(
|
109 |
-
'email' => $order->getCustomerEmail(),
|
110 |
-
'track' => $trackModel,
|
111 |
-
'crossSell' => $crossSell,
|
112 |
-
'banner' => $banner,
|
113 |
-
);
|
114 |
-
|
115 |
-
$processedTemplate = $emailTemplate->getProcessedTemplate($variables);
|
116 |
-
if (!$processedTemplate)
|
117 |
-
return array(
|
118 |
-
'error' => self::ERROR_NO_TEMPLATE
|
119 |
-
);
|
120 |
-
|
121 |
-
|
122 |
-
$data['email_subject'] = $emailTemplate->getProcessedTemplateSubject($variables);
|
123 |
-
$data['email_body'] = $processedTemplate;
|
124 |
-
|
125 |
-
return $data;
|
126 |
-
}
|
127 |
-
|
128 |
-
return false;
|
129 |
-
}
|
130 |
-
|
131 |
-
public function test()
|
132 |
-
{
|
133 |
-
return array(
|
134 |
-
'status' => 1
|
135 |
-
);
|
136 |
-
}
|
137 |
-
|
138 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Api extends Mage_Api_Model_Resource_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
const ERROR_EXTENSION_DISABLED = 'extension_disabled';
|
7 |
+
const ERROR_NOTIFICATIONS_DISABLED = 'notifications_disabled';
|
8 |
+
const ERROR_NO_TEMPLATE = 'no_template';
|
9 |
+
|
10 |
+
const DEFAULT_LOCALE = 'en_US';
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Get email info
|
14 |
+
*
|
15 |
+
* @param string $carrierCode
|
16 |
+
* @param string $trackingCode
|
17 |
+
*
|
18 |
+
* @return array
|
19 |
+
*/
|
20 |
+
public function info($carrierCode, $trackingCode, $status)
|
21 |
+
{
|
22 |
+
//extension disabled
|
23 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
24 |
+
if (!$enabled)
|
25 |
+
return array(
|
26 |
+
'error' => self::ERROR_EXTENSION_DISABLED
|
27 |
+
);
|
28 |
+
|
29 |
+
//notifications disabled
|
30 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
|
31 |
+
if (!$enabled)
|
32 |
+
return false;
|
33 |
+
|
34 |
+
$trackModel = Mage::getModel('pptrack/track')
|
35 |
+
->loadByCarrierAndCode($carrierCode, $trackingCode);
|
36 |
+
|
37 |
+
//maybe changed to custom by some API's (for older versions)
|
38 |
+
if (!$trackModel->getId()) {
|
39 |
+
$trackModel = Mage::getModel('pptrack/track')
|
40 |
+
->loadByCarrierAndCode('custom', $trackingCode);
|
41 |
+
}
|
42 |
+
|
43 |
+
if ($trackModel->getId()) {
|
44 |
+
$order = Mage::getModel('sales/order')->load($trackModel->getOrderId());
|
45 |
+
$store = $order->getStore();
|
46 |
+
$storeId = $store->getId();
|
47 |
+
|
48 |
+
$templateSettings = Mage::getStoreConfig('pp_section_notification_emails/' . $status, $storeId);
|
49 |
+
if (!$templateSettings || (!$templateSettings['enabled_owner'] && !$templateSettings['enabled_client']))
|
50 |
+
return self::ERROR_NOTIFICATIONS_DISABLED;
|
51 |
+
|
52 |
+
$data = array();
|
53 |
+
|
54 |
+
//sender data
|
55 |
+
$data['sender_name'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/name');
|
56 |
+
$data['sender_email'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/email');
|
57 |
+
|
58 |
+
//shop data
|
59 |
+
if ($templateSettings['enabled_owner']) {
|
60 |
+
$data['owner_name'] = Mage::getStoreConfig('trans_email/ident_general/name');
|
61 |
+
$data['owner_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
|
62 |
+
}
|
63 |
+
|
64 |
+
//client data
|
65 |
+
//check if client unsubscribed
|
66 |
+
try {
|
67 |
+
$unsubscribed = Mage::getModel('pptrack/trackunsubscribed')
|
68 |
+
->load($trackModel->getId(), 'track_id');
|
69 |
+
}
|
70 |
+
catch (Exception $e) {
|
71 |
+
$unsubscribed = Mage::getModel('pptrack/trackunsubscribed');
|
72 |
+
}
|
73 |
+
|
74 |
+
if (!$unsubscribed->getId() && $templateSettings['enabled_client']) {
|
75 |
+
$data['client_name'] = $order->getCustomerName();
|
76 |
+
$data['client_email'] = $order->getCustomerEmail();
|
77 |
+
}
|
78 |
+
|
79 |
+
//email template data
|
80 |
+
$templateId = $templateSettings['template'];
|
81 |
+
|
82 |
+
Mage::getDesign()->setStore($store);
|
83 |
+
$emailTemplate = Mage::getModel('core/email_template');
|
84 |
+
$emailTemplate->emulateDesign($storeId);
|
85 |
+
if (is_numeric($templateId)) {
|
86 |
+
$emailTemplate->load($templateId);
|
87 |
+
} else {
|
88 |
+
$templateId = 'packpin_'. $status .'_email';
|
89 |
+
|
90 |
+
// $storeId = $order->getStore()->getId();
|
91 |
+
// $localeCode = Mage::getStoreConfig('general/locale/code', $storeId);
|
92 |
+
$localeCode = self::DEFAULT_LOCALE;
|
93 |
+
|
94 |
+
$emailTemplate->loadDefault($templateId, $localeCode);
|
95 |
+
}
|
96 |
+
|
97 |
+
$crossSell = '';
|
98 |
+
$banner = '';
|
99 |
+
if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email')) {
|
100 |
+
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_type'), array('ads'))) {
|
101 |
+
$banner = Mage::app()->getLayout()->createBlock('pptrack/ads')->setTemplate('pptrack/ads_email.phtml')->toHtml();
|
102 |
+
}
|
103 |
+
else {
|
104 |
+
$crossSell = Mage::app()->getLayout()->createBlock('pptrack/crosssell')->setData(array('orderId' => $trackModel->getOrderId()))->setTemplate('pptrack/crosssell_email.phtml')->toHtml();
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
$variables = array(
|
109 |
+
'email' => $order->getCustomerEmail(),
|
110 |
+
'track' => $trackModel,
|
111 |
+
'crossSell' => $crossSell,
|
112 |
+
'banner' => $banner,
|
113 |
+
);
|
114 |
+
|
115 |
+
$processedTemplate = $emailTemplate->getProcessedTemplate($variables);
|
116 |
+
if (!$processedTemplate)
|
117 |
+
return array(
|
118 |
+
'error' => self::ERROR_NO_TEMPLATE
|
119 |
+
);
|
120 |
+
|
121 |
+
|
122 |
+
$data['email_subject'] = $emailTemplate->getProcessedTemplateSubject($variables);
|
123 |
+
$data['email_body'] = $processedTemplate;
|
124 |
+
|
125 |
+
return $data;
|
126 |
+
}
|
127 |
+
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
|
131 |
+
public function test()
|
132 |
+
{
|
133 |
+
return array(
|
134 |
+
'status' => 1
|
135 |
+
);
|
136 |
+
}
|
137 |
+
|
138 |
}
|
app/code/community/Packpin/Pptrack/Model/Carrier.php
CHANGED
@@ -1,172 +1,172 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Carrier
|
5 |
-
*
|
6 |
-
* Model for pp_carriers table
|
7 |
-
*/
|
8 |
-
class Packpin_Pptrack_Model_Carrier extends Mage_Core_Model_Abstract
|
9 |
-
{
|
10 |
-
/**
|
11 |
-
* Update once per day
|
12 |
-
*/
|
13 |
-
const API_UPDATE_INTERVAL = 86400;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Append carrier code with prefix to prevent conflicts
|
17 |
-
*/
|
18 |
-
const CODE_PREFIX = 'pp_';
|
19 |
-
|
20 |
-
const URL_ICONS = 'https://button.packpin.com/assets/images/carriers_v2/';
|
21 |
-
|
22 |
-
public $assocList = array();
|
23 |
-
|
24 |
-
protected function _construct()
|
25 |
-
{
|
26 |
-
$this->_init('pptrack/carrier');
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Get carrier list if needed - update from API
|
31 |
-
* @param bool $fetchAll
|
32 |
-
* @return array
|
33 |
-
*/
|
34 |
-
public function getList($fetchAll = false)
|
35 |
-
{
|
36 |
-
$collection = Mage::getModel('pptrack/carrier')
|
37 |
-
->getCollection();
|
38 |
-
|
39 |
-
if (!$fetchAll)
|
40 |
-
$collection->addFieldToFilter('enabled', array('eq' => 1));
|
41 |
-
|
42 |
-
$carriers = $collection->getItems();
|
43 |
-
|
44 |
-
//check last updated
|
45 |
-
$config = Mage::getStoreConfig('pp_section_setttings/settings');
|
46 |
-
$updated = isset($config['last_carrier_update']) ? $config['last_carrier_update'] : null;
|
47 |
-
|
48 |
-
//try to get info from API
|
49 |
-
if (!$carriers || !$updated || $updated + self::API_UPDATE_INTERVAL < time()) {
|
50 |
-
$helper = Mage::helper('pptrack');
|
51 |
-
$res = $helper->getCarrierList();
|
52 |
-
if ($res && $res["statusCode"] == 200) {
|
53 |
-
$list = $res["body"];
|
54 |
-
|
55 |
-
if (is_array($list)) {
|
56 |
-
$newList = array();
|
57 |
-
|
58 |
-
//prepare old list data for updates
|
59 |
-
$oldList = array();
|
60 |
-
foreach ($carriers as $item) {
|
61 |
-
$oldList[$item->code] = $item;
|
62 |
-
}
|
63 |
-
|
64 |
-
foreach ($list as $item) {
|
65 |
-
$model = Mage::getModel('pptrack/carrier')
|
66 |
-
->load($item['code'], 'code');
|
67 |
-
|
68 |
-
if ($model->getId()) {
|
69 |
-
if (isset($oldList[$item['code']]))
|
70 |
-
unset($oldList[$item['code']]);
|
71 |
-
}
|
72 |
-
else {
|
73 |
-
$model->enabled = 1;
|
74 |
-
}
|
75 |
-
|
76 |
-
$model->code = $item['code'];
|
77 |
-
$model->name = $item['name'];
|
78 |
-
$model->phone = $item['phone'];
|
79 |
-
$model->homepage = $item['homepage'];
|
80 |
-
|
81 |
-
$model->save();
|
82 |
-
|
83 |
-
if ($fetchAll || $model->enabled)
|
84 |
-
$newList[] = $model;
|
85 |
-
}
|
86 |
-
|
87 |
-
//remove old no longer supported carriers.. should never happen o_0
|
88 |
-
foreach ($oldList as $model) {
|
89 |
-
$model->delete();
|
90 |
-
}
|
91 |
-
|
92 |
-
//update config
|
93 |
-
Mage::getModel('core/config')->saveConfig('pp_section_setttings/settings/last_carrier_update', time());
|
94 |
-
|
95 |
-
$carriers = $newList;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
}
|
99 |
-
|
100 |
-
return $carriers;
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Get list of carriers with carrier code as key
|
105 |
-
*
|
106 |
-
* @param bool $fetchAll
|
107 |
-
* @return array
|
108 |
-
*/
|
109 |
-
public function getAssocList($fetchAll = false)
|
110 |
-
{
|
111 |
-
if (!$this->assocList) {
|
112 |
-
$this->assocList = array();
|
113 |
-
$list = $this->getList($fetchAll);
|
114 |
-
|
115 |
-
foreach ($list as $item) {
|
116 |
-
$this->assocList[$item->getCode()] = $item->getData('name');
|
117 |
-
}
|
118 |
-
}
|
119 |
-
|
120 |
-
return $this->assocList;
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Get carrier code with prefix
|
125 |
-
*
|
126 |
-
* @return string
|
127 |
-
*/
|
128 |
-
public function getPrefixedCode()
|
129 |
-
{
|
130 |
-
return self::CODE_PREFIX . $this->getCode();
|
131 |
-
}
|
132 |
-
|
133 |
-
public function getIconUrl()
|
134 |
-
{
|
135 |
-
return self::URL_ICONS . $this->getCode() . '.png';
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Get carrier code from pp_carriers string on detect from custom carrier title
|
140 |
-
*
|
141 |
-
* @param string $carrierCode
|
142 |
-
* @param string|null $carrierTitle
|
143 |
-
* @return bool|string
|
144 |
-
*/
|
145 |
-
public function detectCarrier($carrierCode, $carrierTitle = null)
|
146 |
-
{
|
147 |
-
$carrierList = $this->getAssocList();
|
148 |
-
|
149 |
-
$carrierCode = str_replace(Packpin_Pptrack_Model_Carrier::CODE_PREFIX, '', $carrierCode);
|
150 |
-
|
151 |
-
if (isset($carrierList[$carrierCode])) {
|
152 |
-
return $carrierCode;
|
153 |
-
}
|
154 |
-
|
155 |
-
//try to identify by custom carrier code
|
156 |
-
$regStr = implode('|', array_keys($carrierList));
|
157 |
-
if (preg_match("#$regStr#ui", $carrierCode, $m)) {
|
158 |
-
return $m[0];
|
159 |
-
}
|
160 |
-
|
161 |
-
//try to identify by carrier title
|
162 |
-
if ($carrierTitle) {
|
163 |
-
foreach ($carrierList as $code => $title) {
|
164 |
-
if (stripos($carrierTitle, $title) !== false) {
|
165 |
-
return $code;
|
166 |
-
}
|
167 |
-
}
|
168 |
-
}
|
169 |
-
|
170 |
-
return false;
|
171 |
-
}
|
172 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Carrier
|
5 |
+
*
|
6 |
+
* Model for pp_carriers table
|
7 |
+
*/
|
8 |
+
class Packpin_Pptrack_Model_Carrier extends Mage_Core_Model_Abstract
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Update once per day
|
12 |
+
*/
|
13 |
+
const API_UPDATE_INTERVAL = 86400;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Append carrier code with prefix to prevent conflicts
|
17 |
+
*/
|
18 |
+
const CODE_PREFIX = 'pp_';
|
19 |
+
|
20 |
+
const URL_ICONS = 'https://button.packpin.com/assets/images/carriers_v2/';
|
21 |
+
|
22 |
+
public $assocList = array();
|
23 |
+
|
24 |
+
protected function _construct()
|
25 |
+
{
|
26 |
+
$this->_init('pptrack/carrier');
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Get carrier list if needed - update from API
|
31 |
+
* @param bool $fetchAll
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
public function getList($fetchAll = false)
|
35 |
+
{
|
36 |
+
$collection = Mage::getModel('pptrack/carrier')
|
37 |
+
->getCollection();
|
38 |
+
|
39 |
+
if (!$fetchAll)
|
40 |
+
$collection->addFieldToFilter('enabled', array('eq' => 1));
|
41 |
+
|
42 |
+
$carriers = $collection->getItems();
|
43 |
+
|
44 |
+
//check last updated
|
45 |
+
$config = Mage::getStoreConfig('pp_section_setttings/settings');
|
46 |
+
$updated = isset($config['last_carrier_update']) ? $config['last_carrier_update'] : null;
|
47 |
+
|
48 |
+
//try to get info from API
|
49 |
+
if (!$carriers || !$updated || $updated + self::API_UPDATE_INTERVAL < time()) {
|
50 |
+
$helper = Mage::helper('pptrack');
|
51 |
+
$res = $helper->getCarrierList();
|
52 |
+
if ($res && $res["statusCode"] == 200) {
|
53 |
+
$list = $res["body"];
|
54 |
+
|
55 |
+
if (is_array($list)) {
|
56 |
+
$newList = array();
|
57 |
+
|
58 |
+
//prepare old list data for updates
|
59 |
+
$oldList = array();
|
60 |
+
foreach ($carriers as $item) {
|
61 |
+
$oldList[$item->code] = $item;
|
62 |
+
}
|
63 |
+
|
64 |
+
foreach ($list as $item) {
|
65 |
+
$model = Mage::getModel('pptrack/carrier')
|
66 |
+
->load($item['code'], 'code');
|
67 |
+
|
68 |
+
if ($model->getId()) {
|
69 |
+
if (isset($oldList[$item['code']]))
|
70 |
+
unset($oldList[$item['code']]);
|
71 |
+
}
|
72 |
+
else {
|
73 |
+
$model->enabled = 1;
|
74 |
+
}
|
75 |
+
|
76 |
+
$model->code = $item['code'];
|
77 |
+
$model->name = $item['name'];
|
78 |
+
$model->phone = $item['phone'];
|
79 |
+
$model->homepage = $item['homepage'];
|
80 |
+
|
81 |
+
$model->save();
|
82 |
+
|
83 |
+
if ($fetchAll || $model->enabled)
|
84 |
+
$newList[] = $model;
|
85 |
+
}
|
86 |
+
|
87 |
+
//remove old no longer supported carriers.. should never happen o_0
|
88 |
+
foreach ($oldList as $model) {
|
89 |
+
$model->delete();
|
90 |
+
}
|
91 |
+
|
92 |
+
//update config
|
93 |
+
Mage::getModel('core/config')->saveConfig('pp_section_setttings/settings/last_carrier_update', time());
|
94 |
+
|
95 |
+
$carriers = $newList;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
return $carriers;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Get list of carriers with carrier code as key
|
105 |
+
*
|
106 |
+
* @param bool $fetchAll
|
107 |
+
* @return array
|
108 |
+
*/
|
109 |
+
public function getAssocList($fetchAll = false)
|
110 |
+
{
|
111 |
+
if (!$this->assocList) {
|
112 |
+
$this->assocList = array();
|
113 |
+
$list = $this->getList($fetchAll);
|
114 |
+
|
115 |
+
foreach ($list as $item) {
|
116 |
+
$this->assocList[$item->getCode()] = $item->getData('name');
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
return $this->assocList;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Get carrier code with prefix
|
125 |
+
*
|
126 |
+
* @return string
|
127 |
+
*/
|
128 |
+
public function getPrefixedCode()
|
129 |
+
{
|
130 |
+
return self::CODE_PREFIX . $this->getCode();
|
131 |
+
}
|
132 |
+
|
133 |
+
public function getIconUrl()
|
134 |
+
{
|
135 |
+
return self::URL_ICONS . $this->getCode() . '.png';
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Get carrier code from pp_carriers string on detect from custom carrier title
|
140 |
+
*
|
141 |
+
* @param string $carrierCode
|
142 |
+
* @param string|null $carrierTitle
|
143 |
+
* @return bool|string
|
144 |
+
*/
|
145 |
+
public function detectCarrier($carrierCode, $carrierTitle = null)
|
146 |
+
{
|
147 |
+
$carrierList = $this->getAssocList();
|
148 |
+
|
149 |
+
$carrierCode = str_replace(Packpin_Pptrack_Model_Carrier::CODE_PREFIX, '', $carrierCode);
|
150 |
+
|
151 |
+
if (isset($carrierList[$carrierCode])) {
|
152 |
+
return $carrierCode;
|
153 |
+
}
|
154 |
+
|
155 |
+
//try to identify by custom carrier code
|
156 |
+
$regStr = implode('|', array_keys($carrierList));
|
157 |
+
if (preg_match("#$regStr#ui", $carrierCode, $m)) {
|
158 |
+
return $m[0];
|
159 |
+
}
|
160 |
+
|
161 |
+
//try to identify by carrier title
|
162 |
+
if ($carrierTitle) {
|
163 |
+
foreach ($carrierList as $code => $title) {
|
164 |
+
if (stripos($carrierTitle, $title) !== false) {
|
165 |
+
return $code;
|
166 |
+
}
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
return false;
|
171 |
+
}
|
172 |
+
}
|
app/code/community/Packpin/Pptrack/Model/EnableNotifications.php
CHANGED
@@ -1,92 +1,92 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Validation
|
5 |
-
*/
|
6 |
-
class Packpin_Pptrack_Model_Enablenotifications extends Mage_Core_Model_Config_Data
|
7 |
-
{
|
8 |
-
|
9 |
-
public function save()
|
10 |
-
{
|
11 |
-
|
12 |
-
|
13 |
-
$helper = Mage::helper('pptrack');
|
14 |
-
|
15 |
-
$apiKey = $this->_data['groups']['settings']['fields']['api_key']['value'];
|
16 |
-
$pluginStatus = $this->_data['groups']['settings']['fields']['status']['value'];
|
17 |
-
$notificationStatus = $this->_data['groups']['settings']['fields']['pp_enable_notifications']['value'];
|
18 |
-
|
19 |
-
$oldApiKey = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
20 |
-
$oldPluginStatus = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
21 |
-
|
22 |
-
// Change API key config so we can get proper API key instantly
|
23 |
-
Mage::app()->getStore()->setConfig('pp_section_setttings/settings/api_key', $apiKey);
|
24 |
-
|
25 |
-
// Check if API key is missing
|
26 |
-
if(!$apiKey) {
|
27 |
-
Mage::throwException(Mage::helper('pptrack')->__('You have to enter API key before saving config!'));
|
28 |
-
}
|
29 |
-
|
30 |
-
//Check if status set to disabled and API key changed
|
31 |
-
if(!$pluginStatus AND $oldApiKey !== $apiKey) {
|
32 |
-
$info = $helper->testApiKey();
|
33 |
-
|
34 |
-
if(!$info OR $info['statusCode'] == 400) {
|
35 |
-
if ($info['body']['reason']) {
|
36 |
-
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
|
37 |
-
} else {
|
38 |
-
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
|
39 |
-
}
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
// Check if plugin status set to Enable and API key changed then do API key check
|
44 |
-
if(($pluginStatus AND $oldApiKey !== $apiKey) OR ($pluginStatus AND !$oldPluginStatus)) {
|
45 |
-
$info = $helper->testApiKey();
|
46 |
-
|
47 |
-
if(!$info OR $info['statusCode'] == 400) {
|
48 |
-
if($info['body']['reason']) {
|
49 |
-
Mage::throwException(Mage::helper('pptrack')->__($info['body']['reason']));
|
50 |
-
}
|
51 |
-
else {
|
52 |
-
Mage::throwException(Mage::helper('pptrack')->__('Error sending data to API'));
|
53 |
-
}
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
// Check if plugin or notification status disabled then do API call to disable notifications connector
|
58 |
-
if(!$pluginStatus OR !$notificationStatus) {
|
59 |
-
$info = $helper->enableConnector('0');
|
60 |
-
|
61 |
-
if(!$info OR $info['statusCode'] == 400 AND Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications') == 1) {
|
62 |
-
if($info['body']['reason']) {
|
63 |
-
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
|
64 |
-
}
|
65 |
-
else {
|
66 |
-
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
|
67 |
-
}
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
// If API key exists and both plugin and notifications status set to enable call API to enable connector
|
72 |
-
if($apiKey AND $pluginStatus AND $notificationStatus) {
|
73 |
-
|
74 |
-
if($helper->createSoapUserAndRole($apiKey)) {
|
75 |
-
$info = $helper->enableConnector($notificationStatus);
|
76 |
-
|
77 |
-
if(!$info OR $info['statusCode'] == 400) {
|
78 |
-
$helpLocal = '<br>Please note that we will not be able to reach your shop(for notification emails) if you are testing on local enviroment. <br><br>If you need help with setup or have any questions, use chat window on the right or email <a href="mailto:support@packpin.com">support@packpin.com</a>';
|
79 |
-
|
80 |
-
if(isset($info['body']['reason']) && !empty($info['body']['reason'])) {
|
81 |
-
Mage::throwException('Could not enable notifications: '.$info['body']['reason'] . $helpLocal);
|
82 |
-
}
|
83 |
-
else {
|
84 |
-
Mage::throwException('Could not enable notifications: Could not connect to API' . $helpLocal);
|
85 |
-
}
|
86 |
-
}
|
87 |
-
}
|
88 |
-
}
|
89 |
-
return parent::save();
|
90 |
-
|
91 |
-
}
|
92 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Validation
|
5 |
+
*/
|
6 |
+
class Packpin_Pptrack_Model_Enablenotifications extends Mage_Core_Model_Config_Data
|
7 |
+
{
|
8 |
+
|
9 |
+
public function save()
|
10 |
+
{
|
11 |
+
|
12 |
+
|
13 |
+
$helper = Mage::helper('pptrack');
|
14 |
+
|
15 |
+
$apiKey = $this->_data['groups']['settings']['fields']['api_key']['value'];
|
16 |
+
$pluginStatus = $this->_data['groups']['settings']['fields']['status']['value'];
|
17 |
+
$notificationStatus = $this->_data['groups']['settings']['fields']['pp_enable_notifications']['value'];
|
18 |
+
|
19 |
+
$oldApiKey = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
20 |
+
$oldPluginStatus = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
21 |
+
|
22 |
+
// Change API key config so we can get proper API key instantly
|
23 |
+
Mage::app()->getStore()->setConfig('pp_section_setttings/settings/api_key', $apiKey);
|
24 |
+
|
25 |
+
// Check if API key is missing
|
26 |
+
if(!$apiKey) {
|
27 |
+
Mage::throwException(Mage::helper('pptrack')->__('You have to enter API key before saving config!'));
|
28 |
+
}
|
29 |
+
|
30 |
+
//Check if status set to disabled and API key changed
|
31 |
+
if(!$pluginStatus AND $oldApiKey !== $apiKey) {
|
32 |
+
$info = $helper->testApiKey();
|
33 |
+
|
34 |
+
if(!$info OR $info['statusCode'] == 400) {
|
35 |
+
if ($info['body']['reason']) {
|
36 |
+
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
|
37 |
+
} else {
|
38 |
+
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
// Check if plugin status set to Enable and API key changed then do API key check
|
44 |
+
if(($pluginStatus AND $oldApiKey !== $apiKey) OR ($pluginStatus AND !$oldPluginStatus)) {
|
45 |
+
$info = $helper->testApiKey();
|
46 |
+
|
47 |
+
if(!$info OR $info['statusCode'] == 400) {
|
48 |
+
if($info['body']['reason']) {
|
49 |
+
Mage::throwException(Mage::helper('pptrack')->__($info['body']['reason']));
|
50 |
+
}
|
51 |
+
else {
|
52 |
+
Mage::throwException(Mage::helper('pptrack')->__('Error sending data to API'));
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
// Check if plugin or notification status disabled then do API call to disable notifications connector
|
58 |
+
if(!$pluginStatus OR !$notificationStatus) {
|
59 |
+
$info = $helper->enableConnector('0');
|
60 |
+
|
61 |
+
if(!$info OR $info['statusCode'] == 400 AND Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications') == 1) {
|
62 |
+
if($info['body']['reason']) {
|
63 |
+
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
|
64 |
+
}
|
65 |
+
else {
|
66 |
+
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
// If API key exists and both plugin and notifications status set to enable call API to enable connector
|
72 |
+
if($apiKey AND $pluginStatus AND $notificationStatus) {
|
73 |
+
|
74 |
+
if($helper->createSoapUserAndRole($apiKey)) {
|
75 |
+
$info = $helper->enableConnector($notificationStatus);
|
76 |
+
|
77 |
+
if(!$info OR $info['statusCode'] == 400) {
|
78 |
+
$helpLocal = '<br>Please note that we will not be able to reach your shop(for notification emails) if you are testing on local enviroment. <br><br>If you need help with setup or have any questions, use chat window on the right or email <a href="mailto:support@packpin.com">support@packpin.com</a>';
|
79 |
+
|
80 |
+
if(isset($info['body']['reason']) && !empty($info['body']['reason'])) {
|
81 |
+
Mage::throwException('Could not enable notifications: '.$info['body']['reason'] . $helpLocal);
|
82 |
+
}
|
83 |
+
else {
|
84 |
+
Mage::throwException('Could not enable notifications: Could not connect to API' . $helpLocal);
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
return parent::save();
|
90 |
+
|
91 |
+
}
|
92 |
}
|
app/code/community/Packpin/Pptrack/Model/Observer.php
CHANGED
@@ -1,330 +1,330 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Observer
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* For static cache
|
8 |
-
*
|
9 |
-
* @var array
|
10 |
-
*/
|
11 |
-
protected $_config = array();
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Event fired before Tracking popup view (in admin shipments)
|
15 |
-
*
|
16 |
-
* @param Varien_Event_Observer $observer
|
17 |
-
* @return bool|void
|
18 |
-
*/
|
19 |
-
public function trackingPopupPreDispatch(Varien_Event_Observer $observer)
|
20 |
-
{
|
21 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
22 |
-
if (!$enabled)
|
23 |
-
return false;
|
24 |
-
|
25 |
-
$shippingTrackModel = null;
|
26 |
-
$shippingList = null;
|
27 |
-
|
28 |
-
$hash = Mage::app()->getRequest()->getParam('hash');
|
29 |
-
$shippingInfoModel = Mage::getModel('shipping/info')->loadByHash($hash);
|
30 |
-
$shippingTrackId = $shippingInfoModel->getTrackId();
|
31 |
-
if ($shippingTrackId) {
|
32 |
-
$shippingTrackModel = Mage::getModel('sales/order_shipment_track')->load($shippingTrackId);
|
33 |
-
}
|
34 |
-
else {
|
35 |
-
$trackingInfo = $shippingInfoModel->getTrackingInfo();
|
36 |
-
if ($trackingInfo) {
|
37 |
-
$shippingList = current($trackingInfo);
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
//for multiple shipment popup
|
42 |
-
if ($shippingList) {
|
43 |
-
$orderId = $shippingInfoModel->getOrderId();
|
44 |
-
if (!$orderId) {
|
45 |
-
$shipId = $shippingInfoModel->getShipId();
|
46 |
-
if ($shipId) {
|
47 |
-
$shipModel = Mage::getModel('sales/order_shipment')->load($shipId);
|
48 |
-
|
49 |
-
$orderId = $shipModel->getOrderId();
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
$models = array();
|
54 |
-
foreach ($shippingList as $item) {
|
55 |
-
$trackModel = Mage::getModel('pptrack/track')
|
56 |
-
->loadByOrder($orderId, $item['number']);
|
57 |
-
if ($trackModel->getId()) {
|
58 |
-
$models[] = $trackModel;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
if ($models) {
|
63 |
-
Mage::register('models', $models);
|
64 |
-
|
65 |
-
//redirect to our controller :)
|
66 |
-
$request = Mage::app()->getRequest();
|
67 |
-
$request->initForward()
|
68 |
-
->setControllerName('index')
|
69 |
-
->setModuleName('pptrack')
|
70 |
-
->setActionName('popup')
|
71 |
-
->setDispatched(false);
|
72 |
-
|
73 |
-
return false;
|
74 |
-
}
|
75 |
-
}
|
76 |
-
//for single shipment popup
|
77 |
-
elseif ($shippingTrackModel->getId()) {
|
78 |
-
$trackData = $shippingTrackModel->getData();
|
79 |
-
$trackModel = Mage::getModel('pptrack/track')
|
80 |
-
->loadByOrder($trackData['order_id'], $this->_getTrackingCode($trackData));
|
81 |
-
if ($trackModel->getId()) {
|
82 |
-
Mage::register('model', $trackModel);
|
83 |
-
|
84 |
-
//redirect to our controller :)
|
85 |
-
$request = Mage::app()->getRequest();
|
86 |
-
$request->initForward()
|
87 |
-
->setControllerName('index')
|
88 |
-
->setModuleName('pptrack')
|
89 |
-
->setActionName('popup')
|
90 |
-
->setDispatched(false);
|
91 |
-
|
92 |
-
return false;
|
93 |
-
}
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
* Observe Event after new tracking has been added to shipment
|
99 |
-
*
|
100 |
-
* @param Varien_Event_Observer $observer
|
101 |
-
* @return bool|void
|
102 |
-
*/
|
103 |
-
public function afterShipmentSaved(Varien_Event_Observer $observer)
|
104 |
-
{
|
105 |
-
//plugin disabled
|
106 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
107 |
-
if (!$enabled)
|
108 |
-
return false;
|
109 |
-
|
110 |
-
$track = $observer->getEvent()->getTrack();
|
111 |
-
$shipment = $track->getShipment();
|
112 |
-
$order = $shipment->getOrder();
|
113 |
-
|
114 |
-
|
115 |
-
$trackData = $track->getData();
|
116 |
-
$orderData = $order->getData();
|
117 |
-
$addressData = $order->getShippingAddress()->getData();
|
118 |
-
|
119 |
-
//detect carrier
|
120 |
-
$carrierTitle = isset($trackData['title']) ? trim($trackData['title']) : null;
|
121 |
-
$carrierCode = Mage::getModel('pptrack/carrier')
|
122 |
-
->detectCarrier($trackData['carrier_code'], $carrierTitle);
|
123 |
-
if (!$carrierCode)
|
124 |
-
return false;
|
125 |
-
|
126 |
-
$trackingCode = $this->_getTrackingCode($trackData);
|
127 |
-
$email = trim($orderData['customer_email']) ? $orderData['customer_email'] : null;
|
128 |
-
$phone = trim($addressData['telephone']) ? $addressData['telephone'] : null;
|
129 |
-
|
130 |
-
$collection = Mage::getModel('pptrack/track')
|
131 |
-
->getCollection()
|
132 |
-
->addFieldToFilter('code', array('eq' => $trackingCode))
|
133 |
-
->addFieldToFilter('order_id', array('eq' => $order->getId()));
|
134 |
-
$trackModel = $collection->getFirstItem();
|
135 |
-
$trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING);
|
136 |
-
|
137 |
-
if (!$trackModel->getId()) {
|
138 |
-
//tracking attributes
|
139 |
-
$trackModel->setPostalCode($addressData['postcode']);
|
140 |
-
$trackModel->setDestinationCountry($addressData['country_id']);
|
141 |
-
// $trackModel->setShipDate(date("Y-m-d"));
|
142 |
-
|
143 |
-
$trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
|
144 |
-
}
|
145 |
-
|
146 |
-
$trackModel->setOrderId($order->getId());
|
147 |
-
$trackModel->setShipmentId($track->getId());
|
148 |
-
$trackModel->setCode($trackingCode);
|
149 |
-
$trackModel->setCarrierCode($carrierCode);
|
150 |
-
$trackModel->setCarrierName($trackData['title']);
|
151 |
-
$trackModel->setPhone($phone);
|
152 |
-
$trackModel->setEmail($email);
|
153 |
-
|
154 |
-
$trackModel->save();
|
155 |
-
|
156 |
-
//send email?
|
157 |
-
try {
|
158 |
-
$send = Mage::getStoreConfig('pp_section_setttings/advanced/trigger_shipped_email');
|
159 |
-
if ($email && $send) {
|
160 |
-
$cache = Mage::app()->getCache();
|
161 |
-
$key = md5($email . $trackingCode);
|
162 |
-
$lifetime = 60 * 60 * 24;
|
163 |
-
$res = $cache->load($key);
|
164 |
-
if (!$res) {
|
165 |
-
$shipment->sendEmail(true, '');
|
166 |
-
$shipment->setEmailSent(true);
|
167 |
-
|
168 |
-
|
169 |
-
$cache->save('sent', $key, array('packpin_cache_emails'), $lifetime);
|
170 |
-
}
|
171 |
-
}
|
172 |
-
}
|
173 |
-
catch (Exception $e) {
|
174 |
-
|
175 |
-
}
|
176 |
-
|
177 |
-
$trackModel->updateApi();
|
178 |
-
}
|
179 |
-
|
180 |
-
/**
|
181 |
-
* Observe Event after new tracking has been removed from shipment
|
182 |
-
*
|
183 |
-
* @param Varien_Event_Observer $observer
|
184 |
-
* @return bool|void
|
185 |
-
*/
|
186 |
-
public function afterShipmentRemoved(Varien_Event_Observer $observer)
|
187 |
-
{
|
188 |
-
//plugin disabled
|
189 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
190 |
-
if (!$enabled)
|
191 |
-
return false;
|
192 |
-
|
193 |
-
$track = $observer->getEvent()->getTrack();
|
194 |
-
$order = $track->getShipment()->getOrder();
|
195 |
-
|
196 |
-
$trackData = $track->getData();
|
197 |
-
$trackingCode = $this->_getTrackingCode($trackData);
|
198 |
-
|
199 |
-
$collection = Mage::getModel('pptrack/track')
|
200 |
-
->getCollection()
|
201 |
-
->addFieldToFilter('code', array('eq' => $trackingCode))
|
202 |
-
->addFieldToFilter('order_id', array('eq' => $order->getId()));
|
203 |
-
$trackModel = $collection->getFirstItem();
|
204 |
-
|
205 |
-
if ($trackModel->getId()) {
|
206 |
-
$trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING);
|
207 |
-
$trackModel->save();
|
208 |
-
|
209 |
-
$trackModel->updateApi();
|
210 |
-
}
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* Get tracking code from Magento track data
|
215 |
-
* Up to ver 1.6.2.0 `number` field is used
|
216 |
-
* Later it's track_number
|
217 |
-
*
|
218 |
-
* @param array $trackData
|
219 |
-
*
|
220 |
-
* @return string
|
221 |
-
*/
|
222 |
-
protected function _getTrackingCode($trackData)
|
223 |
-
{
|
224 |
-
$trackingCode = trim($trackData['track_number']) ? trim($trackData['track_number']) : trim($trackData['number']);
|
225 |
-
|
226 |
-
return $trackingCode;
|
227 |
-
}
|
228 |
-
|
229 |
-
/**
|
230 |
-
* @param Mage_Sales_Model_Order $order
|
231 |
-
*
|
232 |
-
* @return mixed
|
233 |
-
*/
|
234 |
-
protected function _getConfig(Mage_Sales_Model_Order $order) {
|
235 |
-
$websiteId = $order->getStore()->getWebsiteId();
|
236 |
-
|
237 |
-
if (!isset($this->_config[$websiteId])) {
|
238 |
-
$config = Mage::app()->getWebsite($websiteId)->getConfig('pp_section_setttings');
|
239 |
-
|
240 |
-
$this->_config[$websiteId] = (object)((array)$config['settings']);
|
241 |
-
}
|
242 |
-
|
243 |
-
return $this->_config[$websiteId];
|
244 |
-
}
|
245 |
-
|
246 |
-
/**
|
247 |
-
* Run cron and check if we have trackings that were not sent to API
|
248 |
-
*/
|
249 |
-
public function cron()
|
250 |
-
{
|
251 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
252 |
-
if (!$enabled)
|
253 |
-
return false;
|
254 |
-
|
255 |
-
set_time_limit(0);
|
256 |
-
|
257 |
-
$list = Mage::getModel('pptrack/track')
|
258 |
-
->getCollection()
|
259 |
-
->addFieldToFilter('submitted', array('neq' => Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT))
|
260 |
-
->load();
|
261 |
-
|
262 |
-
if ($list) {
|
263 |
-
foreach ($list as $trackModel) {
|
264 |
-
$trackModel->updateApi();
|
265 |
-
}
|
266 |
-
}
|
267 |
-
}
|
268 |
-
|
269 |
-
/**
|
270 |
-
* Triggered after carriers are saved in admin configuration
|
271 |
-
*/
|
272 |
-
public function saveCarriers(Varien_Event_Observer $observer)
|
273 |
-
{
|
274 |
-
$carriers = Mage::getModel('pptrack/carrier')->getList(true);
|
275 |
-
foreach ($carriers as $carrier) {
|
276 |
-
$configValue = (int) Mage::getStoreConfig('pp_section_carriers/carriers/' . $carrier->getCode());
|
277 |
-
|
278 |
-
if ($carrier->enabled != $configValue) {
|
279 |
-
$carrier->setEnabled($configValue);
|
280 |
-
$carrier->save();
|
281 |
-
}
|
282 |
-
}
|
283 |
-
}
|
284 |
-
|
285 |
-
public function coreBlockAbstractPrepareLayoutAfter(Varien_Event_Observer $observer)
|
286 |
-
{
|
287 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
288 |
-
if (!$enabled)
|
289 |
-
return false;
|
290 |
-
|
291 |
-
try {
|
292 |
-
if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
|
293 |
-
{
|
294 |
-
$block = $observer->getBlock();
|
295 |
-
if ($block->getNameInLayout() === 'dashboard')
|
296 |
-
{
|
297 |
-
$block->getChild('sales')->setUseAsDashboardHook(true);
|
298 |
-
}
|
299 |
-
}
|
300 |
-
}
|
301 |
-
catch (Exception $e) {
|
302 |
-
|
303 |
-
}
|
304 |
-
}
|
305 |
-
|
306 |
-
public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
|
307 |
-
{
|
308 |
-
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
309 |
-
if (!$enabled)
|
310 |
-
return false;
|
311 |
-
|
312 |
-
try {
|
313 |
-
if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
|
314 |
-
{
|
315 |
-
if ($observer->getBlock()->getUseAsDashboardHook())
|
316 |
-
{
|
317 |
-
$html = $observer->getTransport()->getHtml();
|
318 |
-
$myBlock = $observer->getBlock()->getLayout()
|
319 |
-
->createBlock('pptrack_adminhtml/dashboard');
|
320 |
-
$html .= $myBlock->toHtml();
|
321 |
-
$observer->getTransport()->setHtml($html);
|
322 |
-
}
|
323 |
-
}
|
324 |
-
}
|
325 |
-
catch (Exception $e) {
|
326 |
-
|
327 |
-
}
|
328 |
-
}
|
329 |
-
|
330 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Observer
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* For static cache
|
8 |
+
*
|
9 |
+
* @var array
|
10 |
+
*/
|
11 |
+
protected $_config = array();
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Event fired before Tracking popup view (in admin shipments)
|
15 |
+
*
|
16 |
+
* @param Varien_Event_Observer $observer
|
17 |
+
* @return bool|void
|
18 |
+
*/
|
19 |
+
public function trackingPopupPreDispatch(Varien_Event_Observer $observer)
|
20 |
+
{
|
21 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
22 |
+
if (!$enabled)
|
23 |
+
return false;
|
24 |
+
|
25 |
+
$shippingTrackModel = null;
|
26 |
+
$shippingList = null;
|
27 |
+
|
28 |
+
$hash = Mage::app()->getRequest()->getParam('hash');
|
29 |
+
$shippingInfoModel = Mage::getModel('shipping/info')->loadByHash($hash);
|
30 |
+
$shippingTrackId = $shippingInfoModel->getTrackId();
|
31 |
+
if ($shippingTrackId) {
|
32 |
+
$shippingTrackModel = Mage::getModel('sales/order_shipment_track')->load($shippingTrackId);
|
33 |
+
}
|
34 |
+
else {
|
35 |
+
$trackingInfo = $shippingInfoModel->getTrackingInfo();
|
36 |
+
if ($trackingInfo) {
|
37 |
+
$shippingList = current($trackingInfo);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
//for multiple shipment popup
|
42 |
+
if ($shippingList) {
|
43 |
+
$orderId = $shippingInfoModel->getOrderId();
|
44 |
+
if (!$orderId) {
|
45 |
+
$shipId = $shippingInfoModel->getShipId();
|
46 |
+
if ($shipId) {
|
47 |
+
$shipModel = Mage::getModel('sales/order_shipment')->load($shipId);
|
48 |
+
|
49 |
+
$orderId = $shipModel->getOrderId();
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
$models = array();
|
54 |
+
foreach ($shippingList as $item) {
|
55 |
+
$trackModel = Mage::getModel('pptrack/track')
|
56 |
+
->loadByOrder($orderId, $item['number']);
|
57 |
+
if ($trackModel->getId()) {
|
58 |
+
$models[] = $trackModel;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
if ($models) {
|
63 |
+
Mage::register('models', $models);
|
64 |
+
|
65 |
+
//redirect to our controller :)
|
66 |
+
$request = Mage::app()->getRequest();
|
67 |
+
$request->initForward()
|
68 |
+
->setControllerName('index')
|
69 |
+
->setModuleName('pptrack')
|
70 |
+
->setActionName('popup')
|
71 |
+
->setDispatched(false);
|
72 |
+
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
//for single shipment popup
|
77 |
+
elseif ($shippingTrackModel->getId()) {
|
78 |
+
$trackData = $shippingTrackModel->getData();
|
79 |
+
$trackModel = Mage::getModel('pptrack/track')
|
80 |
+
->loadByOrder($trackData['order_id'], $this->_getTrackingCode($trackData));
|
81 |
+
if ($trackModel->getId()) {
|
82 |
+
Mage::register('model', $trackModel);
|
83 |
+
|
84 |
+
//redirect to our controller :)
|
85 |
+
$request = Mage::app()->getRequest();
|
86 |
+
$request->initForward()
|
87 |
+
->setControllerName('index')
|
88 |
+
->setModuleName('pptrack')
|
89 |
+
->setActionName('popup')
|
90 |
+
->setDispatched(false);
|
91 |
+
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Observe Event after new tracking has been added to shipment
|
99 |
+
*
|
100 |
+
* @param Varien_Event_Observer $observer
|
101 |
+
* @return bool|void
|
102 |
+
*/
|
103 |
+
public function afterShipmentSaved(Varien_Event_Observer $observer)
|
104 |
+
{
|
105 |
+
//plugin disabled
|
106 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
107 |
+
if (!$enabled)
|
108 |
+
return false;
|
109 |
+
|
110 |
+
$track = $observer->getEvent()->getTrack();
|
111 |
+
$shipment = $track->getShipment();
|
112 |
+
$order = $shipment->getOrder();
|
113 |
+
|
114 |
+
|
115 |
+
$trackData = $track->getData();
|
116 |
+
$orderData = $order->getData();
|
117 |
+
$addressData = $order->getShippingAddress()->getData();
|
118 |
+
|
119 |
+
//detect carrier
|
120 |
+
$carrierTitle = isset($trackData['title']) ? trim($trackData['title']) : null;
|
121 |
+
$carrierCode = Mage::getModel('pptrack/carrier')
|
122 |
+
->detectCarrier($trackData['carrier_code'], $carrierTitle);
|
123 |
+
if (!$carrierCode)
|
124 |
+
return false;
|
125 |
+
|
126 |
+
$trackingCode = $this->_getTrackingCode($trackData);
|
127 |
+
$email = trim($orderData['customer_email']) ? $orderData['customer_email'] : null;
|
128 |
+
$phone = trim($addressData['telephone']) ? $addressData['telephone'] : null;
|
129 |
+
|
130 |
+
$collection = Mage::getModel('pptrack/track')
|
131 |
+
->getCollection()
|
132 |
+
->addFieldToFilter('code', array('eq' => $trackingCode))
|
133 |
+
->addFieldToFilter('order_id', array('eq' => $order->getId()));
|
134 |
+
$trackModel = $collection->getFirstItem();
|
135 |
+
$trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING);
|
136 |
+
|
137 |
+
if (!$trackModel->getId()) {
|
138 |
+
//tracking attributes
|
139 |
+
$trackModel->setPostalCode($addressData['postcode']);
|
140 |
+
$trackModel->setDestinationCountry($addressData['country_id']);
|
141 |
+
// $trackModel->setShipDate(date("Y-m-d"));
|
142 |
+
|
143 |
+
$trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
|
144 |
+
}
|
145 |
+
|
146 |
+
$trackModel->setOrderId($order->getId());
|
147 |
+
$trackModel->setShipmentId($track->getId());
|
148 |
+
$trackModel->setCode($trackingCode);
|
149 |
+
$trackModel->setCarrierCode($carrierCode);
|
150 |
+
$trackModel->setCarrierName($trackData['title']);
|
151 |
+
$trackModel->setPhone($phone);
|
152 |
+
$trackModel->setEmail($email);
|
153 |
+
|
154 |
+
$trackModel->save();
|
155 |
+
|
156 |
+
//send email?
|
157 |
+
try {
|
158 |
+
$send = Mage::getStoreConfig('pp_section_setttings/advanced/trigger_shipped_email');
|
159 |
+
if ($email && $send) {
|
160 |
+
$cache = Mage::app()->getCache();
|
161 |
+
$key = md5($email . $trackingCode);
|
162 |
+
$lifetime = 60 * 60 * 24;
|
163 |
+
$res = $cache->load($key);
|
164 |
+
if (!$res) {
|
165 |
+
$shipment->sendEmail(true, '');
|
166 |
+
$shipment->setEmailSent(true);
|
167 |
+
|
168 |
+
|
169 |
+
$cache->save('sent', $key, array('packpin_cache_emails'), $lifetime);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
catch (Exception $e) {
|
174 |
+
|
175 |
+
}
|
176 |
+
|
177 |
+
$trackModel->updateApi();
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Observe Event after new tracking has been removed from shipment
|
182 |
+
*
|
183 |
+
* @param Varien_Event_Observer $observer
|
184 |
+
* @return bool|void
|
185 |
+
*/
|
186 |
+
public function afterShipmentRemoved(Varien_Event_Observer $observer)
|
187 |
+
{
|
188 |
+
//plugin disabled
|
189 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
190 |
+
if (!$enabled)
|
191 |
+
return false;
|
192 |
+
|
193 |
+
$track = $observer->getEvent()->getTrack();
|
194 |
+
$order = $track->getShipment()->getOrder();
|
195 |
+
|
196 |
+
$trackData = $track->getData();
|
197 |
+
$trackingCode = $this->_getTrackingCode($trackData);
|
198 |
+
|
199 |
+
$collection = Mage::getModel('pptrack/track')
|
200 |
+
->getCollection()
|
201 |
+
->addFieldToFilter('code', array('eq' => $trackingCode))
|
202 |
+
->addFieldToFilter('order_id', array('eq' => $order->getId()));
|
203 |
+
$trackModel = $collection->getFirstItem();
|
204 |
+
|
205 |
+
if ($trackModel->getId()) {
|
206 |
+
$trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING);
|
207 |
+
$trackModel->save();
|
208 |
+
|
209 |
+
$trackModel->updateApi();
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Get tracking code from Magento track data
|
215 |
+
* Up to ver 1.6.2.0 `number` field is used
|
216 |
+
* Later it's track_number
|
217 |
+
*
|
218 |
+
* @param array $trackData
|
219 |
+
*
|
220 |
+
* @return string
|
221 |
+
*/
|
222 |
+
protected function _getTrackingCode($trackData)
|
223 |
+
{
|
224 |
+
$trackingCode = trim($trackData['track_number']) ? trim($trackData['track_number']) : trim($trackData['number']);
|
225 |
+
|
226 |
+
return $trackingCode;
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* @param Mage_Sales_Model_Order $order
|
231 |
+
*
|
232 |
+
* @return mixed
|
233 |
+
*/
|
234 |
+
protected function _getConfig(Mage_Sales_Model_Order $order) {
|
235 |
+
$websiteId = $order->getStore()->getWebsiteId();
|
236 |
+
|
237 |
+
if (!isset($this->_config[$websiteId])) {
|
238 |
+
$config = Mage::app()->getWebsite($websiteId)->getConfig('pp_section_setttings');
|
239 |
+
|
240 |
+
$this->_config[$websiteId] = (object)((array)$config['settings']);
|
241 |
+
}
|
242 |
+
|
243 |
+
return $this->_config[$websiteId];
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Run cron and check if we have trackings that were not sent to API
|
248 |
+
*/
|
249 |
+
public function cron()
|
250 |
+
{
|
251 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
252 |
+
if (!$enabled)
|
253 |
+
return false;
|
254 |
+
|
255 |
+
set_time_limit(0);
|
256 |
+
|
257 |
+
$list = Mage::getModel('pptrack/track')
|
258 |
+
->getCollection()
|
259 |
+
->addFieldToFilter('submitted', array('neq' => Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT))
|
260 |
+
->load();
|
261 |
+
|
262 |
+
if ($list) {
|
263 |
+
foreach ($list as $trackModel) {
|
264 |
+
$trackModel->updateApi();
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Triggered after carriers are saved in admin configuration
|
271 |
+
*/
|
272 |
+
public function saveCarriers(Varien_Event_Observer $observer)
|
273 |
+
{
|
274 |
+
$carriers = Mage::getModel('pptrack/carrier')->getList(true);
|
275 |
+
foreach ($carriers as $carrier) {
|
276 |
+
$configValue = (int) Mage::getStoreConfig('pp_section_carriers/carriers/' . $carrier->getCode());
|
277 |
+
|
278 |
+
if ($carrier->enabled != $configValue) {
|
279 |
+
$carrier->setEnabled($configValue);
|
280 |
+
$carrier->save();
|
281 |
+
}
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
285 |
+
public function coreBlockAbstractPrepareLayoutAfter(Varien_Event_Observer $observer)
|
286 |
+
{
|
287 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
288 |
+
if (!$enabled)
|
289 |
+
return false;
|
290 |
+
|
291 |
+
try {
|
292 |
+
if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
|
293 |
+
{
|
294 |
+
$block = $observer->getBlock();
|
295 |
+
if ($block->getNameInLayout() === 'dashboard')
|
296 |
+
{
|
297 |
+
$block->getChild('sales')->setUseAsDashboardHook(true);
|
298 |
+
}
|
299 |
+
}
|
300 |
+
}
|
301 |
+
catch (Exception $e) {
|
302 |
+
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
|
307 |
+
{
|
308 |
+
$enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
|
309 |
+
if (!$enabled)
|
310 |
+
return false;
|
311 |
+
|
312 |
+
try {
|
313 |
+
if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
|
314 |
+
{
|
315 |
+
if ($observer->getBlock()->getUseAsDashboardHook())
|
316 |
+
{
|
317 |
+
$html = $observer->getTransport()->getHtml();
|
318 |
+
$myBlock = $observer->getBlock()->getLayout()
|
319 |
+
->createBlock('pptrack_adminhtml/dashboard');
|
320 |
+
$html .= $myBlock->toHtml();
|
321 |
+
$observer->getTransport()->setHtml($html);
|
322 |
+
}
|
323 |
+
}
|
324 |
+
}
|
325 |
+
catch (Exception $e) {
|
326 |
+
|
327 |
+
}
|
328 |
+
}
|
329 |
+
|
330 |
}
|
app/code/community/Packpin/Pptrack/Model/Order/Shipment.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Order_Shipment extends Mage_Sales_Model_Order_Shipment {
|
4 |
-
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Get all track and override tracking title to add tracking back link
|
8 |
-
*
|
9 |
-
* @return array
|
10 |
-
*/
|
11 |
-
/*
|
12 |
-
public function getAllTracks()
|
13 |
-
{
|
14 |
-
$tracks = parent::getAllTracks();
|
15 |
-
|
16 |
-
$config = Mage::getStoreConfig('pp_section_setttings/settings');
|
17 |
-
if (!$config['status'])
|
18 |
-
return $tracks;
|
19 |
-
|
20 |
-
//check if function called from email template
|
21 |
-
//@FIXME maybe there is a better way to override this stuff o_0
|
22 |
-
$callers = debug_backtrace();
|
23 |
-
$args = $callers[1]['args'];
|
24 |
-
if (count($args) && strstr($args[0], 'template/email/order/shipment/track.phtml')) {
|
25 |
-
//override names
|
26 |
-
$newItems = array();
|
27 |
-
foreach ($tracks as $num => $item) {
|
28 |
-
$newTitle = $item->getTitle() . ' (Whata fuck)';
|
29 |
-
$item->title = $newTitle;
|
30 |
-
$newItems[] = $item;
|
31 |
-
}
|
32 |
-
|
33 |
-
$tracks = $newItems;
|
34 |
-
}
|
35 |
-
|
36 |
-
return $tracks;
|
37 |
-
}
|
38 |
-
*/
|
39 |
-
|
40 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Order_Shipment extends Mage_Sales_Model_Order_Shipment {
|
4 |
+
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Get all track and override tracking title to add tracking back link
|
8 |
+
*
|
9 |
+
* @return array
|
10 |
+
*/
|
11 |
+
/*
|
12 |
+
public function getAllTracks()
|
13 |
+
{
|
14 |
+
$tracks = parent::getAllTracks();
|
15 |
+
|
16 |
+
$config = Mage::getStoreConfig('pp_section_setttings/settings');
|
17 |
+
if (!$config['status'])
|
18 |
+
return $tracks;
|
19 |
+
|
20 |
+
//check if function called from email template
|
21 |
+
//@FIXME maybe there is a better way to override this stuff o_0
|
22 |
+
$callers = debug_backtrace();
|
23 |
+
$args = $callers[1]['args'];
|
24 |
+
if (count($args) && strstr($args[0], 'template/email/order/shipment/track.phtml')) {
|
25 |
+
//override names
|
26 |
+
$newItems = array();
|
27 |
+
foreach ($tracks as $num => $item) {
|
28 |
+
$newTitle = $item->getTitle() . ' (Whata fuck)';
|
29 |
+
$item->title = $newTitle;
|
30 |
+
$newItems[] = $item;
|
31 |
+
}
|
32 |
+
|
33 |
+
$tracks = $newItems;
|
34 |
+
}
|
35 |
+
|
36 |
+
return $tracks;
|
37 |
+
}
|
38 |
+
*/
|
39 |
+
|
40 |
+
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Carrier.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Carrier extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct()
|
6 |
-
{
|
7 |
-
$this->_init('pptrack/carrier', 'id');
|
8 |
-
}
|
9 |
-
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Carrier extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('pptrack/carrier', 'id');
|
8 |
+
}
|
9 |
+
|
10 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Carrier/Collection.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Carrier_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/carrier');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Carrier_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/carrier');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Setting.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Setting extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct()
|
6 |
-
{
|
7 |
-
$this->_init('pptrack/setting', 'id');
|
8 |
-
}
|
9 |
-
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Setting extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('pptrack/setting', 'id');
|
8 |
+
}
|
9 |
+
|
10 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Setting/Collection.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Setting_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/setting');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Setting_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/setting');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Track.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Track extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct()
|
6 |
-
{
|
7 |
-
$this->_init('pptrack/track', 'id');
|
8 |
-
}
|
9 |
-
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Track extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('pptrack/track', 'id');
|
8 |
+
}
|
9 |
+
|
10 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Track/Collection.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Track_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/track');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Track_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/track');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Trackdetail extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/trackdetail', 'id');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Trackdetail extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/trackdetail', 'id');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail/Collection.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Trackdetail_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/trackdetail');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Trackdetail_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/trackdetail');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Trackunsubscribed extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/trackunsubscribed', 'id');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Trackunsubscribed extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/trackunsubscribed', 'id');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed/Collection.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Trackunsubscribed_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/trackunsubscribed');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Trackunsubscribed_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/trackunsubscribed');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Visit.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Visit extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct()
|
6 |
-
{
|
7 |
-
$this->_init('pptrack/visit', 'id');
|
8 |
-
}
|
9 |
-
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Visit extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('pptrack/visit', 'id');
|
8 |
+
}
|
9 |
+
|
10 |
}
|
app/code/community/Packpin/Pptrack/Model/Resource/Visit/Collection.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_Model_Resource_Visit_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
protected function _construct() {
|
6 |
-
$this->_init('pptrack/visit');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_Model_Resource_Visit_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct() {
|
6 |
+
$this->_init('pptrack/visit');
|
7 |
+
}
|
8 |
}
|
app/code/community/Packpin/Pptrack/Model/Setting.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Setting
|
5 |
-
*
|
6 |
-
* Model for pp_settings table
|
7 |
-
*/
|
8 |
-
class Packpin_Pptrack_Model_Setting extends Mage_Core_Model_Abstract
|
9 |
-
{
|
10 |
-
const SETTING_CARRIER_UPDATED = 'carrier_updated';
|
11 |
-
|
12 |
-
protected function _construct()
|
13 |
-
{
|
14 |
-
$this->_init('pptrack/setting');
|
15 |
-
}
|
16 |
-
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Get setting value
|
20 |
-
*
|
21 |
-
* @param string $setting
|
22 |
-
*/
|
23 |
-
public function loadModelBySetting($setting)
|
24 |
-
{
|
25 |
-
$this->load($setting, 'setting');
|
26 |
-
}
|
27 |
-
|
28 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Setting
|
5 |
+
*
|
6 |
+
* Model for pp_settings table
|
7 |
+
*/
|
8 |
+
class Packpin_Pptrack_Model_Setting extends Mage_Core_Model_Abstract
|
9 |
+
{
|
10 |
+
const SETTING_CARRIER_UPDATED = 'carrier_updated';
|
11 |
+
|
12 |
+
protected function _construct()
|
13 |
+
{
|
14 |
+
$this->_init('pptrack/setting');
|
15 |
+
}
|
16 |
+
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Get setting value
|
20 |
+
*
|
21 |
+
* @param string $setting
|
22 |
+
*/
|
23 |
+
public function loadModelBySetting($setting)
|
24 |
+
{
|
25 |
+
$this->load($setting, 'setting');
|
26 |
+
}
|
27 |
+
|
28 |
+
}
|
app/code/community/Packpin/Pptrack/Model/Track.php
CHANGED
@@ -1,478 +1,478 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Track
|
5 |
-
*
|
6 |
-
* Model for pp_tracks table
|
7 |
-
*/
|
8 |
-
class Packpin_Pptrack_Model_Track extends Mage_Core_Model_Abstract
|
9 |
-
{
|
10 |
-
protected function _construct()
|
11 |
-
{
|
12 |
-
$this->_init('pptrack/track');
|
13 |
-
}
|
14 |
-
|
15 |
-
const STATUS_PENDING = 'pending';
|
16 |
-
const STATUS_DELIVERED = 'delivered';
|
17 |
-
const STATUS_OUT_FOR_DELIVERY = 'out_for_delivery';
|
18 |
-
const STATUS_IN_TRANSIT = 'in_transit';
|
19 |
-
const STATUS_INFO_RECEIVED = 'info_received';
|
20 |
-
const STATUS_DISPATCHED_TO_OVERSEAS = 'to_overseas';
|
21 |
-
const STATUS_FAILED_ATTEMPT = 'failed_attempt';
|
22 |
-
const STATUS_EXCEPTION = 'exception';
|
23 |
-
const STATUS_NO_INFO = 'no_info';
|
24 |
-
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Model created but not sent to API
|
28 |
-
*/
|
29 |
-
const TYPE_SUBMITTED_PENDING = 0;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Model data sent
|
33 |
-
*/
|
34 |
-
const TYPE_SUBMITTED_SENT = 1;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Model pending to be removed
|
38 |
-
*/
|
39 |
-
const TYPE_SUBMITTED_REMOVE_PENDING = 2;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Data fields we can map with API data
|
43 |
-
*
|
44 |
-
* @var array
|
45 |
-
*/
|
46 |
-
public static $mapCols = array(
|
47 |
-
'status',
|
48 |
-
);
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Tracking details
|
52 |
-
*
|
53 |
-
* @var null|array
|
54 |
-
*/
|
55 |
-
protected $_details;
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Shipping Info
|
59 |
-
*
|
60 |
-
* @var null|array
|
61 |
-
*/
|
62 |
-
protected $_shippingInfo;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Carrier model
|
66 |
-
*
|
67 |
-
* @var
|
68 |
-
*/
|
69 |
-
protected $_carrier;
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Get list of statuses with order number
|
73 |
-
*
|
74 |
-
* @return array
|
75 |
-
*/
|
76 |
-
public static function getOrderedStatusList()
|
77 |
-
{
|
78 |
-
return array(
|
79 |
-
self::STATUS_PENDING => 10,
|
80 |
-
self::STATUS_NO_INFO => 10,
|
81 |
-
self::STATUS_INFO_RECEIVED => 10,
|
82 |
-
self::STATUS_IN_TRANSIT => 30,
|
83 |
-
self::STATUS_DISPATCHED_TO_OVERSEAS => 30,
|
84 |
-
self::STATUS_FAILED_ATTEMPT => 30,
|
85 |
-
self::STATUS_EXCEPTION => 30,
|
86 |
-
self::STATUS_OUT_FOR_DELIVERY => 50,
|
87 |
-
self::STATUS_DELIVERED => 60,
|
88 |
-
);
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Update unix times
|
93 |
-
*
|
94 |
-
* @return mixed
|
95 |
-
*/
|
96 |
-
protected function _beforeSave()
|
97 |
-
{
|
98 |
-
//new model
|
99 |
-
if (!$this->getId()) {
|
100 |
-
$this->hash = $this->_generateHash();
|
101 |
-
$this->created_at = time();
|
102 |
-
}
|
103 |
-
$this->updated_at = time();
|
104 |
-
|
105 |
-
return parent::_beforeSave();
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Generate UUID (v4) for usage in track details url backlink
|
110 |
-
*
|
111 |
-
* @return string
|
112 |
-
*/
|
113 |
-
protected function _generateHash()
|
114 |
-
{
|
115 |
-
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
116 |
-
|
117 |
-
// 32 bits for "time_low"
|
118 |
-
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
|
119 |
-
|
120 |
-
// 16 bits for "time_mid"
|
121 |
-
mt_rand(0, 0xffff),
|
122 |
-
|
123 |
-
// 16 bits for "time_hi_and_version",
|
124 |
-
// four most significant bits holds version number 4
|
125 |
-
mt_rand(0, 0x0fff) | 0x4000,
|
126 |
-
|
127 |
-
// 16 bits, 8 bits for "clk_seq_hi_res",
|
128 |
-
// 8 bits for "clk_seq_low",
|
129 |
-
// two most significant bits holds zero and one for variant DCE1.1
|
130 |
-
mt_rand(0, 0x3fff) | 0x8000,
|
131 |
-
|
132 |
-
// 48 bits for "node"
|
133 |
-
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
|
134 |
-
);
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Updates model info from API
|
139 |
-
*/
|
140 |
-
protected function _fetchData()
|
141 |
-
{
|
142 |
-
$helper = Mage::helper('pptrack');
|
143 |
-
$res = $helper->getTrackingInfo($this->getCarrierCode(), $this->getCode());
|
144 |
-
|
145 |
-
//map new data to current model
|
146 |
-
if ($res && $res["statusCode"] == 200) {
|
147 |
-
$info = $res["body"];
|
148 |
-
|
149 |
-
$this->updateInfo($info);
|
150 |
-
|
151 |
-
//Track details info
|
152 |
-
if (isset($info['track_details']) && $info['track_details']) {
|
153 |
-
//remove old details
|
154 |
-
$list = $this->getDetails();
|
155 |
-
foreach ($list as $model) {
|
156 |
-
$model->delete();
|
157 |
-
}
|
158 |
-
$this->_details = array();
|
159 |
-
|
160 |
-
foreach ($info['track_details'] as $detailInfo) {
|
161 |
-
$model = Mage::getModel('pptrack/trackdetail');
|
162 |
-
$model->track_id = $this->getId();
|
163 |
-
$model->updateInfo($detailInfo);
|
164 |
-
$this->_details[] = $model;
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
}
|
169 |
-
}
|
170 |
-
|
171 |
-
public function updateApiData()
|
172 |
-
{
|
173 |
-
$this->_fetchData();
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Update Track info
|
178 |
-
*
|
179 |
-
* @param array $data
|
180 |
-
*/
|
181 |
-
public function updateInfo($data)
|
182 |
-
{
|
183 |
-
foreach (self::$mapCols as $field) {
|
184 |
-
if (isset($data[$field]))
|
185 |
-
$this->$field = $data[$field];
|
186 |
-
}
|
187 |
-
|
188 |
-
$this->save();
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* Get Tracking info by order and tracking code
|
193 |
-
*
|
194 |
-
* @param int $orderId
|
195 |
-
* @param string $code
|
196 |
-
* @param bool $fetchData Fetch new data from API
|
197 |
-
* @return $this
|
198 |
-
*/
|
199 |
-
public function loadByOrder($orderId, $code, $fetchData = true)
|
200 |
-
{
|
201 |
-
$collection = Mage::getModel('pptrack/track')
|
202 |
-
->getCollection()
|
203 |
-
->addFieldToFilter('code', array('eq' => $code))
|
204 |
-
->addFieldToFilter('order_id', array('eq' => $orderId));
|
205 |
-
$trackModel = $collection->getFirstItem();
|
206 |
-
$this->setData($trackModel->getData());
|
207 |
-
|
208 |
-
if ($this->getId() && $fetchData) {
|
209 |
-
$this->_fetchData();
|
210 |
-
}
|
211 |
-
|
212 |
-
return $this;
|
213 |
-
}
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Get Tracking info by carrier and tracking code
|
217 |
-
*
|
218 |
-
* @param string $carrier
|
219 |
-
* @param string $code
|
220 |
-
* @return $this
|
221 |
-
*/
|
222 |
-
public function loadByCarrierAndCode($carrier, $code)
|
223 |
-
{
|
224 |
-
$collection = Mage::getModel('pptrack/track')
|
225 |
-
->getCollection()
|
226 |
-
->addFieldToFilter('code', array('eq' => $code))
|
227 |
-
->addFieldToFilter('carrier_code', array('eq' => $carrier));
|
228 |
-
$trackModel = $collection->getFirstItem();
|
229 |
-
$this->setData($trackModel->getData());
|
230 |
-
|
231 |
-
return $this;
|
232 |
-
}
|
233 |
-
|
234 |
-
/**
|
235 |
-
* Get Tracking info by hash string
|
236 |
-
*
|
237 |
-
* @param string $hash
|
238 |
-
* @param bool $fetchData Fetch new data from API
|
239 |
-
*/
|
240 |
-
public function loadInfoByHash($hash, $fetchData = true)
|
241 |
-
{
|
242 |
-
$this->load($hash, 'hash');
|
243 |
-
|
244 |
-
if ($this->getId() && $fetchData) {
|
245 |
-
$this->_fetchData();
|
246 |
-
}
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Get track details
|
251 |
-
*
|
252 |
-
* @return array
|
253 |
-
*/
|
254 |
-
public function getDetails()
|
255 |
-
{
|
256 |
-
if ($this->_details === null) {
|
257 |
-
if ($this->isEmpty()) {
|
258 |
-
return array();
|
259 |
-
}
|
260 |
-
|
261 |
-
$this->_details = Mage::getModel('pptrack/trackdetail')
|
262 |
-
->getCollection()
|
263 |
-
->addFieldToFilter('track_id', array('eq' => $this->getId()))
|
264 |
-
->getItems();
|
265 |
-
}
|
266 |
-
|
267 |
-
return $this->_details;
|
268 |
-
}
|
269 |
-
|
270 |
-
/**
|
271 |
-
* Get shipping information
|
272 |
-
*
|
273 |
-
* @return array
|
274 |
-
*/
|
275 |
-
public function getShippingInfo()
|
276 |
-
{
|
277 |
-
if($this->_shippingInfo === null) {
|
278 |
-
if ($this->isEmpty()) {
|
279 |
-
return array();
|
280 |
-
}
|
281 |
-
|
282 |
-
$order = Mage::getModel('sales/order')->load($this->getOrderId());
|
283 |
-
if ($order->getId()) {
|
284 |
-
$address = $order->getShippingAddress();
|
285 |
-
if ($address->getId()) {
|
286 |
-
$shippingInfo = $address->getData();
|
287 |
-
|
288 |
-
$this->_shippingInfo = $shippingInfo;
|
289 |
-
}
|
290 |
-
}
|
291 |
-
}
|
292 |
-
return $this->_shippingInfo;
|
293 |
-
}
|
294 |
-
|
295 |
-
/**
|
296 |
-
* Get Track details url
|
297 |
-
*/
|
298 |
-
public function getDetailsUrl()
|
299 |
-
{
|
300 |
-
|
301 |
-
|
302 |
-
$orders = Mage::getModel('sales/order')->getCollection()
|
303 |
-
->setOrder('created_at','DESC')
|
304 |
-
->addFieldToFilter('id', array('eq' => $this->order_id))
|
305 |
-
->setPageSize(1)
|
306 |
-
->setCurPage(1);
|
307 |
-
$order = $orders->getFirstItem();
|
308 |
-
|
309 |
-
$url = Mage::getUrl('pptrack') . '?email=' . $order->customer_email . '&order=' . $order->getIncrementId();
|
310 |
-
|
311 |
-
return $url;
|
312 |
-
}
|
313 |
-
|
314 |
-
public function getUnsubscribeLink()
|
315 |
-
{
|
316 |
-
$url = Mage::getUrl('pptrack/unsubscribe') . '?h=' . $this->hash;
|
317 |
-
|
318 |
-
return $url;
|
319 |
-
}
|
320 |
-
|
321 |
-
/**
|
322 |
-
* Try to sync this model with API
|
323 |
-
*/
|
324 |
-
public function updateApi()
|
325 |
-
{
|
326 |
-
$helper = Mage::helper('pptrack');
|
327 |
-
|
328 |
-
$submitted = $this->getSubmitted();
|
329 |
-
|
330 |
-
if ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING) {
|
331 |
-
$res = $helper->addTrackingCode(
|
332 |
-
$this->getCarrierCode(),
|
333 |
-
$this->getCode(),
|
334 |
-
$this->getCarrierName(),
|
335 |
-
$this->getPostalCode(),
|
336 |
-
$this->getDestinationCountry(),
|
337 |
-
$this->getShipDate(),
|
338 |
-
$this->getOrderId()
|
339 |
-
);
|
340 |
-
|
341 |
-
//400 statuscode goes for "tracking already in the list"
|
342 |
-
if ($res && in_array($res["statusCode"], array(201, 400))) {
|
343 |
-
$this->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT);
|
344 |
-
|
345 |
-
$this->save();
|
346 |
-
}
|
347 |
-
}
|
348 |
-
elseif ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING) {
|
349 |
-
$res = $helper->removeTrackingCode(
|
350 |
-
$this->getCarrierCode(),
|
351 |
-
$this->getCode()
|
352 |
-
);
|
353 |
-
|
354 |
-
//404 goes for already removed
|
355 |
-
if ($res && in_array($res["statusCode"], array(200, 204, 404))) {
|
356 |
-
$this->delete();
|
357 |
-
}
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
/**
|
362 |
-
* Get given status css class compared to current status
|
363 |
-
*
|
364 |
-
* @param $status
|
365 |
-
* @return string
|
366 |
-
*/
|
367 |
-
public function getStatusClass($status)
|
368 |
-
{
|
369 |
-
$list = self::getOrderedStatusList();
|
370 |
-
|
371 |
-
if (!isset($list[$status]) || !isset($list[$this->getStatus()]))
|
372 |
-
return '';
|
373 |
-
|
374 |
-
if ($list[$status] < $list[$this->getStatus()])
|
375 |
-
return 'done';
|
376 |
-
elseif ($list[$status] == $list[$this->getStatus()])
|
377 |
-
return 'active';
|
378 |
-
|
379 |
-
return '';
|
380 |
-
}
|
381 |
-
|
382 |
-
/**
|
383 |
-
* @return mixed
|
384 |
-
*/
|
385 |
-
public function getOrderNumber()
|
386 |
-
{
|
387 |
-
$order = Mage::getModel('sales/order')->load($this->getOrderId());
|
388 |
-
|
389 |
-
return $order->getIncrementId();
|
390 |
-
}
|
391 |
-
|
392 |
-
/**
|
393 |
-
* Get carrier model
|
394 |
-
*
|
395 |
-
* @return array
|
396 |
-
*/
|
397 |
-
public function getCarrier()
|
398 |
-
{
|
399 |
-
if ($this->_carrier === null) {
|
400 |
-
$this->_carrier = Mage::getModel('pptrack/carrier')
|
401 |
-
->load($this->getCarrierCode(), 'code');
|
402 |
-
}
|
403 |
-
|
404 |
-
return $this->_carrier;
|
405 |
-
}
|
406 |
-
|
407 |
-
/**
|
408 |
-
* @return string
|
409 |
-
*/
|
410 |
-
public function getCarrierIcon()
|
411 |
-
{
|
412 |
-
$carrier = $this->getCarrier();
|
413 |
-
if ($carrier && $carrier->getId()) {
|
414 |
-
return $carrier->getIconUrl();
|
415 |
-
}
|
416 |
-
|
417 |
-
return '';
|
418 |
-
}
|
419 |
-
|
420 |
-
/**
|
421 |
-
* @return string
|
422 |
-
*/
|
423 |
-
public function getCarrierName()
|
424 |
-
{
|
425 |
-
$carrier = $this->getCarrier();
|
426 |
-
if ($carrier && $carrier->getId()) {
|
427 |
-
return $carrier->getName();
|
428 |
-
}
|
429 |
-
|
430 |
-
return '';
|
431 |
-
}
|
432 |
-
|
433 |
-
/**
|
434 |
-
* @return string
|
435 |
-
*/
|
436 |
-
public function getCarrierPhone()
|
437 |
-
{
|
438 |
-
$carrier = $this->getCarrier();
|
439 |
-
if ($carrier && $carrier->getId()) {
|
440 |
-
return $carrier->getPhone();
|
441 |
-
}
|
442 |
-
|
443 |
-
return '';
|
444 |
-
}
|
445 |
-
|
446 |
-
/**
|
447 |
-
* @return string
|
448 |
-
*/
|
449 |
-
public function getCarrierHomepage()
|
450 |
-
{
|
451 |
-
$carrier = $this->getCarrier();
|
452 |
-
if ($carrier && $carrier->getId()) {
|
453 |
-
return $carrier->getHomepage();
|
454 |
-
}
|
455 |
-
|
456 |
-
return '';
|
457 |
-
}
|
458 |
-
|
459 |
-
/**
|
460 |
-
* @return string
|
461 |
-
*/
|
462 |
-
public function getShippingDate()
|
463 |
-
{
|
464 |
-
$time = $this->getCreatedAt();
|
465 |
-
|
466 |
-
$dateFormatted = Mage::helper('core')->formatTime(date("Y-m-d H:i:s", $time), 'medium', true);
|
467 |
-
return $dateFormatted;
|
468 |
-
}
|
469 |
-
|
470 |
-
public function getTotalCount()
|
471 |
-
{
|
472 |
-
$count = $this->getCollection()
|
473 |
-
->getSize();
|
474 |
-
|
475 |
-
return $count;
|
476 |
-
}
|
477 |
-
|
478 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Track
|
5 |
+
*
|
6 |
+
* Model for pp_tracks table
|
7 |
+
*/
|
8 |
+
class Packpin_Pptrack_Model_Track extends Mage_Core_Model_Abstract
|
9 |
+
{
|
10 |
+
protected function _construct()
|
11 |
+
{
|
12 |
+
$this->_init('pptrack/track');
|
13 |
+
}
|
14 |
+
|
15 |
+
const STATUS_PENDING = 'pending';
|
16 |
+
const STATUS_DELIVERED = 'delivered';
|
17 |
+
const STATUS_OUT_FOR_DELIVERY = 'out_for_delivery';
|
18 |
+
const STATUS_IN_TRANSIT = 'in_transit';
|
19 |
+
const STATUS_INFO_RECEIVED = 'info_received';
|
20 |
+
const STATUS_DISPATCHED_TO_OVERSEAS = 'to_overseas';
|
21 |
+
const STATUS_FAILED_ATTEMPT = 'failed_attempt';
|
22 |
+
const STATUS_EXCEPTION = 'exception';
|
23 |
+
const STATUS_NO_INFO = 'no_info';
|
24 |
+
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Model created but not sent to API
|
28 |
+
*/
|
29 |
+
const TYPE_SUBMITTED_PENDING = 0;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Model data sent
|
33 |
+
*/
|
34 |
+
const TYPE_SUBMITTED_SENT = 1;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Model pending to be removed
|
38 |
+
*/
|
39 |
+
const TYPE_SUBMITTED_REMOVE_PENDING = 2;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Data fields we can map with API data
|
43 |
+
*
|
44 |
+
* @var array
|
45 |
+
*/
|
46 |
+
public static $mapCols = array(
|
47 |
+
'status',
|
48 |
+
);
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Tracking details
|
52 |
+
*
|
53 |
+
* @var null|array
|
54 |
+
*/
|
55 |
+
protected $_details;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Shipping Info
|
59 |
+
*
|
60 |
+
* @var null|array
|
61 |
+
*/
|
62 |
+
protected $_shippingInfo;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Carrier model
|
66 |
+
*
|
67 |
+
* @var
|
68 |
+
*/
|
69 |
+
protected $_carrier;
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Get list of statuses with order number
|
73 |
+
*
|
74 |
+
* @return array
|
75 |
+
*/
|
76 |
+
public static function getOrderedStatusList()
|
77 |
+
{
|
78 |
+
return array(
|
79 |
+
self::STATUS_PENDING => 10,
|
80 |
+
self::STATUS_NO_INFO => 10,
|
81 |
+
self::STATUS_INFO_RECEIVED => 10,
|
82 |
+
self::STATUS_IN_TRANSIT => 30,
|
83 |
+
self::STATUS_DISPATCHED_TO_OVERSEAS => 30,
|
84 |
+
self::STATUS_FAILED_ATTEMPT => 30,
|
85 |
+
self::STATUS_EXCEPTION => 30,
|
86 |
+
self::STATUS_OUT_FOR_DELIVERY => 50,
|
87 |
+
self::STATUS_DELIVERED => 60,
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Update unix times
|
93 |
+
*
|
94 |
+
* @return mixed
|
95 |
+
*/
|
96 |
+
protected function _beforeSave()
|
97 |
+
{
|
98 |
+
//new model
|
99 |
+
if (!$this->getId()) {
|
100 |
+
$this->hash = $this->_generateHash();
|
101 |
+
$this->created_at = time();
|
102 |
+
}
|
103 |
+
$this->updated_at = time();
|
104 |
+
|
105 |
+
return parent::_beforeSave();
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Generate UUID (v4) for usage in track details url backlink
|
110 |
+
*
|
111 |
+
* @return string
|
112 |
+
*/
|
113 |
+
protected function _generateHash()
|
114 |
+
{
|
115 |
+
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
116 |
+
|
117 |
+
// 32 bits for "time_low"
|
118 |
+
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
|
119 |
+
|
120 |
+
// 16 bits for "time_mid"
|
121 |
+
mt_rand(0, 0xffff),
|
122 |
+
|
123 |
+
// 16 bits for "time_hi_and_version",
|
124 |
+
// four most significant bits holds version number 4
|
125 |
+
mt_rand(0, 0x0fff) | 0x4000,
|
126 |
+
|
127 |
+
// 16 bits, 8 bits for "clk_seq_hi_res",
|
128 |
+
// 8 bits for "clk_seq_low",
|
129 |
+
// two most significant bits holds zero and one for variant DCE1.1
|
130 |
+
mt_rand(0, 0x3fff) | 0x8000,
|
131 |
+
|
132 |
+
// 48 bits for "node"
|
133 |
+
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
|
134 |
+
);
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Updates model info from API
|
139 |
+
*/
|
140 |
+
protected function _fetchData()
|
141 |
+
{
|
142 |
+
$helper = Mage::helper('pptrack');
|
143 |
+
$res = $helper->getTrackingInfo($this->getCarrierCode(), $this->getCode());
|
144 |
+
|
145 |
+
//map new data to current model
|
146 |
+
if ($res && $res["statusCode"] == 200) {
|
147 |
+
$info = $res["body"];
|
148 |
+
|
149 |
+
$this->updateInfo($info);
|
150 |
+
|
151 |
+
//Track details info
|
152 |
+
if (isset($info['track_details']) && $info['track_details']) {
|
153 |
+
//remove old details
|
154 |
+
$list = $this->getDetails();
|
155 |
+
foreach ($list as $model) {
|
156 |
+
$model->delete();
|
157 |
+
}
|
158 |
+
$this->_details = array();
|
159 |
+
|
160 |
+
foreach ($info['track_details'] as $detailInfo) {
|
161 |
+
$model = Mage::getModel('pptrack/trackdetail');
|
162 |
+
$model->track_id = $this->getId();
|
163 |
+
$model->updateInfo($detailInfo);
|
164 |
+
$this->_details[] = $model;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
public function updateApiData()
|
172 |
+
{
|
173 |
+
$this->_fetchData();
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Update Track info
|
178 |
+
*
|
179 |
+
* @param array $data
|
180 |
+
*/
|
181 |
+
public function updateInfo($data)
|
182 |
+
{
|
183 |
+
foreach (self::$mapCols as $field) {
|
184 |
+
if (isset($data[$field]))
|
185 |
+
$this->$field = $data[$field];
|
186 |
+
}
|
187 |
+
|
188 |
+
$this->save();
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Get Tracking info by order and tracking code
|
193 |
+
*
|
194 |
+
* @param int $orderId
|
195 |
+
* @param string $code
|
196 |
+
* @param bool $fetchData Fetch new data from API
|
197 |
+
* @return $this
|
198 |
+
*/
|
199 |
+
public function loadByOrder($orderId, $code, $fetchData = true)
|
200 |
+
{
|
201 |
+
$collection = Mage::getModel('pptrack/track')
|
202 |
+
->getCollection()
|
203 |
+
->addFieldToFilter('code', array('eq' => $code))
|
204 |
+
->addFieldToFilter('order_id', array('eq' => $orderId));
|
205 |
+
$trackModel = $collection->getFirstItem();
|
206 |
+
$this->setData($trackModel->getData());
|
207 |
+
|
208 |
+
if ($this->getId() && $fetchData) {
|
209 |
+
$this->_fetchData();
|
210 |
+
}
|
211 |
+
|
212 |
+
return $this;
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Get Tracking info by carrier and tracking code
|
217 |
+
*
|
218 |
+
* @param string $carrier
|
219 |
+
* @param string $code
|
220 |
+
* @return $this
|
221 |
+
*/
|
222 |
+
public function loadByCarrierAndCode($carrier, $code)
|
223 |
+
{
|
224 |
+
$collection = Mage::getModel('pptrack/track')
|
225 |
+
->getCollection()
|
226 |
+
->addFieldToFilter('code', array('eq' => $code))
|
227 |
+
->addFieldToFilter('carrier_code', array('eq' => $carrier));
|
228 |
+
$trackModel = $collection->getFirstItem();
|
229 |
+
$this->setData($trackModel->getData());
|
230 |
+
|
231 |
+
return $this;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Get Tracking info by hash string
|
236 |
+
*
|
237 |
+
* @param string $hash
|
238 |
+
* @param bool $fetchData Fetch new data from API
|
239 |
+
*/
|
240 |
+
public function loadInfoByHash($hash, $fetchData = true)
|
241 |
+
{
|
242 |
+
$this->load($hash, 'hash');
|
243 |
+
|
244 |
+
if ($this->getId() && $fetchData) {
|
245 |
+
$this->_fetchData();
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Get track details
|
251 |
+
*
|
252 |
+
* @return array
|
253 |
+
*/
|
254 |
+
public function getDetails()
|
255 |
+
{
|
256 |
+
if ($this->_details === null) {
|
257 |
+
if ($this->isEmpty()) {
|
258 |
+
return array();
|
259 |
+
}
|
260 |
+
|
261 |
+
$this->_details = Mage::getModel('pptrack/trackdetail')
|
262 |
+
->getCollection()
|
263 |
+
->addFieldToFilter('track_id', array('eq' => $this->getId()))
|
264 |
+
->getItems();
|
265 |
+
}
|
266 |
+
|
267 |
+
return $this->_details;
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Get shipping information
|
272 |
+
*
|
273 |
+
* @return array
|
274 |
+
*/
|
275 |
+
public function getShippingInfo()
|
276 |
+
{
|
277 |
+
if($this->_shippingInfo === null) {
|
278 |
+
if ($this->isEmpty()) {
|
279 |
+
return array();
|
280 |
+
}
|
281 |
+
|
282 |
+
$order = Mage::getModel('sales/order')->load($this->getOrderId());
|
283 |
+
if ($order->getId()) {
|
284 |
+
$address = $order->getShippingAddress();
|
285 |
+
if ($address->getId()) {
|
286 |
+
$shippingInfo = $address->getData();
|
287 |
+
|
288 |
+
$this->_shippingInfo = $shippingInfo;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
}
|
292 |
+
return $this->_shippingInfo;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Get Track details url
|
297 |
+
*/
|
298 |
+
public function getDetailsUrl()
|
299 |
+
{
|
300 |
+
$order = Mage::getModel('sales/order')->load($this->order_id);
|
301 |
+
|
302 |
+
// $orders = Mage::getModel('sales/order')->getCollection()
|
303 |
+
// ->setOrder('created_at','DESC')
|
304 |
+
// ->addFieldToFilter('id', array('eq' => $this->order_id))
|
305 |
+
// ->setPageSize(1)
|
306 |
+
// ->setCurPage(1);
|
307 |
+
// $order = $orders->getFirstItem();
|
308 |
+
|
309 |
+
$url = Mage::getUrl('pptrack') . '?email=' . $order->customer_email . '&order=' . $order->getIncrementId();
|
310 |
+
|
311 |
+
return $url;
|
312 |
+
}
|
313 |
+
|
314 |
+
public function getUnsubscribeLink()
|
315 |
+
{
|
316 |
+
$url = Mage::getUrl('pptrack/unsubscribe') . '?h=' . $this->hash;
|
317 |
+
|
318 |
+
return $url;
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Try to sync this model with API
|
323 |
+
*/
|
324 |
+
public function updateApi()
|
325 |
+
{
|
326 |
+
$helper = Mage::helper('pptrack');
|
327 |
+
|
328 |
+
$submitted = $this->getSubmitted();
|
329 |
+
|
330 |
+
if ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING) {
|
331 |
+
$res = $helper->addTrackingCode(
|
332 |
+
$this->getCarrierCode(),
|
333 |
+
$this->getCode(),
|
334 |
+
$this->getCarrierName(),
|
335 |
+
$this->getPostalCode(),
|
336 |
+
$this->getDestinationCountry(),
|
337 |
+
$this->getShipDate(),
|
338 |
+
$this->getOrderId()
|
339 |
+
);
|
340 |
+
|
341 |
+
//400 statuscode goes for "tracking already in the list"
|
342 |
+
if ($res && in_array($res["statusCode"], array(201, 400))) {
|
343 |
+
$this->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT);
|
344 |
+
|
345 |
+
$this->save();
|
346 |
+
}
|
347 |
+
}
|
348 |
+
elseif ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING) {
|
349 |
+
$res = $helper->removeTrackingCode(
|
350 |
+
$this->getCarrierCode(),
|
351 |
+
$this->getCode()
|
352 |
+
);
|
353 |
+
|
354 |
+
//404 goes for already removed
|
355 |
+
if ($res && in_array($res["statusCode"], array(200, 204, 404))) {
|
356 |
+
$this->delete();
|
357 |
+
}
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Get given status css class compared to current status
|
363 |
+
*
|
364 |
+
* @param $status
|
365 |
+
* @return string
|
366 |
+
*/
|
367 |
+
public function getStatusClass($status)
|
368 |
+
{
|
369 |
+
$list = self::getOrderedStatusList();
|
370 |
+
|
371 |
+
if (!isset($list[$status]) || !isset($list[$this->getStatus()]))
|
372 |
+
return '';
|
373 |
+
|
374 |
+
if ($list[$status] < $list[$this->getStatus()])
|
375 |
+
return 'done';
|
376 |
+
elseif ($list[$status] == $list[$this->getStatus()])
|
377 |
+
return 'active';
|
378 |
+
|
379 |
+
return '';
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* @return mixed
|
384 |
+
*/
|
385 |
+
public function getOrderNumber()
|
386 |
+
{
|
387 |
+
$order = Mage::getModel('sales/order')->load($this->getOrderId());
|
388 |
+
|
389 |
+
return $order->getIncrementId();
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* Get carrier model
|
394 |
+
*
|
395 |
+
* @return array
|
396 |
+
*/
|
397 |
+
public function getCarrier()
|
398 |
+
{
|
399 |
+
if ($this->_carrier === null) {
|
400 |
+
$this->_carrier = Mage::getModel('pptrack/carrier')
|
401 |
+
->load($this->getCarrierCode(), 'code');
|
402 |
+
}
|
403 |
+
|
404 |
+
return $this->_carrier;
|
405 |
+
}
|
406 |
+
|
407 |
+
/**
|
408 |
+
* @return string
|
409 |
+
*/
|
410 |
+
public function getCarrierIcon()
|
411 |
+
{
|
412 |
+
$carrier = $this->getCarrier();
|
413 |
+
if ($carrier && $carrier->getId()) {
|
414 |
+
return $carrier->getIconUrl();
|
415 |
+
}
|
416 |
+
|
417 |
+
return '';
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* @return string
|
422 |
+
*/
|
423 |
+
public function getCarrierName()
|
424 |
+
{
|
425 |
+
$carrier = $this->getCarrier();
|
426 |
+
if ($carrier && $carrier->getId()) {
|
427 |
+
return $carrier->getName();
|
428 |
+
}
|
429 |
+
|
430 |
+
return '';
|
431 |
+
}
|
432 |
+
|
433 |
+
/**
|
434 |
+
* @return string
|
435 |
+
*/
|
436 |
+
public function getCarrierPhone()
|
437 |
+
{
|
438 |
+
$carrier = $this->getCarrier();
|
439 |
+
if ($carrier && $carrier->getId()) {
|
440 |
+
return $carrier->getPhone();
|
441 |
+
}
|
442 |
+
|
443 |
+
return '';
|
444 |
+
}
|
445 |
+
|
446 |
+
/**
|
447 |
+
* @return string
|
448 |
+
*/
|
449 |
+
public function getCarrierHomepage()
|
450 |
+
{
|
451 |
+
$carrier = $this->getCarrier();
|
452 |
+
if ($carrier && $carrier->getId()) {
|
453 |
+
return $carrier->getHomepage();
|
454 |
+
}
|
455 |
+
|
456 |
+
return '';
|
457 |
+
}
|
458 |
+
|
459 |
+
/**
|
460 |
+
* @return string
|
461 |
+
*/
|
462 |
+
public function getShippingDate()
|
463 |
+
{
|
464 |
+
$time = $this->getCreatedAt();
|
465 |
+
|
466 |
+
$dateFormatted = Mage::helper('core')->formatTime(date("Y-m-d H:i:s", $time), 'medium', true);
|
467 |
+
return $dateFormatted;
|
468 |
+
}
|
469 |
+
|
470 |
+
public function getTotalCount()
|
471 |
+
{
|
472 |
+
$count = $this->getCollection()
|
473 |
+
->getSize();
|
474 |
+
|
475 |
+
return $count;
|
476 |
+
}
|
477 |
+
|
478 |
+
}
|
app/code/community/Packpin/Pptrack/Model/Trackdetail.php
CHANGED
@@ -1,90 +1,90 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Trackdetail
|
5 |
-
*
|
6 |
-
* Model for pp_track_details table
|
7 |
-
*/
|
8 |
-
class Packpin_Pptrack_Model_Trackdetail extends Mage_Core_Model_Abstract
|
9 |
-
{
|
10 |
-
protected function _construct()
|
11 |
-
{
|
12 |
-
$this->_init('pptrack/trackdetail');
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Data fields we can map with API data
|
17 |
-
*
|
18 |
-
* @var array
|
19 |
-
*/
|
20 |
-
public static $mapCols = array(
|
21 |
-
'carrier',
|
22 |
-
'status',
|
23 |
-
'status_string',
|
24 |
-
'event_date',
|
25 |
-
'event_time',
|
26 |
-
'address',
|
27 |
-
'country',
|
28 |
-
);
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Update Track detail info
|
32 |
-
*
|
33 |
-
* @param array $data
|
34 |
-
*/
|
35 |
-
public function updateInfo($data)
|
36 |
-
{
|
37 |
-
foreach (self::$mapCols as $field) {
|
38 |
-
if (isset($data[$field])) {
|
39 |
-
if ($field == 'address') {
|
40 |
-
$params = array(
|
41 |
-
'address',
|
42 |
-
'state',
|
43 |
-
'zip',
|
44 |
-
);
|
45 |
-
$address = '';
|
46 |
-
foreach ($params as $param) {
|
47 |
-
if (isset($data[$param]) && $data[$param]) {
|
48 |
-
if ($address)
|
49 |
-
$address .= ', ';
|
50 |
-
$address .= ' ' . $data[$param];
|
51 |
-
}
|
52 |
-
}
|
53 |
-
$this->$field = $address;
|
54 |
-
}
|
55 |
-
else {
|
56 |
-
$this->$field = $data[$field];
|
57 |
-
}
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
$this->save();
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Get event location string
|
66 |
-
*
|
67 |
-
* @return mixed|string
|
68 |
-
*/
|
69 |
-
public function getLocation()
|
70 |
-
{
|
71 |
-
// if ($this->address)
|
72 |
-
// return $this->address;
|
73 |
-
|
74 |
-
$params = array(
|
75 |
-
'address',
|
76 |
-
'country',
|
77 |
-
);
|
78 |
-
$address = '';
|
79 |
-
foreach ($params as $param) {
|
80 |
-
if ($this->$param) {
|
81 |
-
if ($address)
|
82 |
-
$address .= ', ';
|
83 |
-
$address .= ' ' . $this->$param;
|
84 |
-
}
|
85 |
-
}
|
86 |
-
return $address;
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Trackdetail
|
5 |
+
*
|
6 |
+
* Model for pp_track_details table
|
7 |
+
*/
|
8 |
+
class Packpin_Pptrack_Model_Trackdetail extends Mage_Core_Model_Abstract
|
9 |
+
{
|
10 |
+
protected function _construct()
|
11 |
+
{
|
12 |
+
$this->_init('pptrack/trackdetail');
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Data fields we can map with API data
|
17 |
+
*
|
18 |
+
* @var array
|
19 |
+
*/
|
20 |
+
public static $mapCols = array(
|
21 |
+
'carrier',
|
22 |
+
'status',
|
23 |
+
'status_string',
|
24 |
+
'event_date',
|
25 |
+
'event_time',
|
26 |
+
'address',
|
27 |
+
'country',
|
28 |
+
);
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Update Track detail info
|
32 |
+
*
|
33 |
+
* @param array $data
|
34 |
+
*/
|
35 |
+
public function updateInfo($data)
|
36 |
+
{
|
37 |
+
foreach (self::$mapCols as $field) {
|
38 |
+
if (isset($data[$field])) {
|
39 |
+
if ($field == 'address') {
|
40 |
+
$params = array(
|
41 |
+
'address',
|
42 |
+
'state',
|
43 |
+
'zip',
|
44 |
+
);
|
45 |
+
$address = '';
|
46 |
+
foreach ($params as $param) {
|
47 |
+
if (isset($data[$param]) && $data[$param]) {
|
48 |
+
if ($address)
|
49 |
+
$address .= ', ';
|
50 |
+
$address .= ' ' . $data[$param];
|
51 |
+
}
|
52 |
+
}
|
53 |
+
$this->$field = $address;
|
54 |
+
}
|
55 |
+
else {
|
56 |
+
$this->$field = $data[$field];
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
$this->save();
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Get event location string
|
66 |
+
*
|
67 |
+
* @return mixed|string
|
68 |
+
*/
|
69 |
+
public function getLocation()
|
70 |
+
{
|
71 |
+
// if ($this->address)
|
72 |
+
// return $this->address;
|
73 |
+
|
74 |
+
$params = array(
|
75 |
+
'address',
|
76 |
+
'country',
|
77 |
+
);
|
78 |
+
$address = '';
|
79 |
+
foreach ($params as $param) {
|
80 |
+
if ($this->$param) {
|
81 |
+
if ($address)
|
82 |
+
$address .= ', ';
|
83 |
+
$address .= ' ' . $this->$param;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
return $address;
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
}
|
app/code/community/Packpin/Pptrack/Model/Trackunsubscribed.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Trackunsubscribed
|
5 |
-
*
|
6 |
-
* Model for pp_tracks_unsubscribed table
|
7 |
-
*/
|
8 |
-
class Packpin_Pptrack_Model_Trackunsubscribed extends Mage_Core_Model_Abstract
|
9 |
-
{
|
10 |
-
|
11 |
-
protected function _construct()
|
12 |
-
{
|
13 |
-
$this->_init('pptrack/trackunsubscribed');
|
14 |
-
}
|
15 |
-
|
16 |
-
public function unsubscribeTrack($trackId)
|
17 |
-
{
|
18 |
-
$this->load($trackId, 'track_id');
|
19 |
-
|
20 |
-
if ($this->getId()) {
|
21 |
-
return false;
|
22 |
-
}
|
23 |
-
else {
|
24 |
-
$this->setTrackId($trackId);
|
25 |
-
$this->save();
|
26 |
-
|
27 |
-
return true;
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Trackunsubscribed
|
5 |
+
*
|
6 |
+
* Model for pp_tracks_unsubscribed table
|
7 |
+
*/
|
8 |
+
class Packpin_Pptrack_Model_Trackunsubscribed extends Mage_Core_Model_Abstract
|
9 |
+
{
|
10 |
+
|
11 |
+
protected function _construct()
|
12 |
+
{
|
13 |
+
$this->_init('pptrack/trackunsubscribed');
|
14 |
+
}
|
15 |
+
|
16 |
+
public function unsubscribeTrack($trackId)
|
17 |
+
{
|
18 |
+
$this->load($trackId, 'track_id');
|
19 |
+
|
20 |
+
if ($this->getId()) {
|
21 |
+
return false;
|
22 |
+
}
|
23 |
+
else {
|
24 |
+
$this->setTrackId($trackId);
|
25 |
+
$this->save();
|
26 |
+
|
27 |
+
return true;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
}
|
app/code/community/Packpin/Pptrack/Model/Translate.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Translate
|
5 |
-
* Temporary override email processing to include back link to shop
|
6 |
-
*
|
7 |
-
* Used for dirty shipment back link injection
|
8 |
-
* Hope temporary o_0
|
9 |
-
*/
|
10 |
-
class Packpin_Pptrack_Model_Translate extends Mage_Core_Model_Translate
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* Retrieve translated template file
|
14 |
-
*
|
15 |
-
* @param string $file
|
16 |
-
* @param string $type
|
17 |
-
* @param string $localeCode
|
18 |
-
* @return string
|
19 |
-
*/
|
20 |
-
public function getTemplateFile($file, $type, $localeCode=null)
|
21 |
-
{
|
22 |
-
$fileContent = parent::getTemplateFile($file, $type, $localeCode);
|
23 |
-
|
24 |
-
$config = Mage::getStoreConfig('pp_section_setttings/settings');
|
25 |
-
if (!$config['status'])
|
26 |
-
return $fileContent;
|
27 |
-
|
28 |
-
if (in_array($file, array('sales/shipment_new.html', 'sales/shipment_new_guest.html'))) {
|
29 |
-
$newBlock = '{{block type=\'pptrack/trackings\' area=\'frontend\' template=\'pptrack/email/order/shipment/track.phtml\' shipment=$shipment order=$order}}';
|
30 |
-
|
31 |
-
//replace trackings table if found
|
32 |
-
if (preg_match('#{{[^}]+track\.phtml[^}]+}}#ui', $fileContent, $m)) {
|
33 |
-
$fileContent = preg_replace('#{{[^}]+track\.phtml[^}]+}}#ui', $newBlock, $fileContent);
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
return $fileContent;
|
38 |
-
}
|
39 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Translate
|
5 |
+
* Temporary override email processing to include back link to shop
|
6 |
+
*
|
7 |
+
* Used for dirty shipment back link injection
|
8 |
+
* Hope temporary o_0
|
9 |
+
*/
|
10 |
+
class Packpin_Pptrack_Model_Translate extends Mage_Core_Model_Translate
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Retrieve translated template file
|
14 |
+
*
|
15 |
+
* @param string $file
|
16 |
+
* @param string $type
|
17 |
+
* @param string $localeCode
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
public function getTemplateFile($file, $type, $localeCode=null)
|
21 |
+
{
|
22 |
+
$fileContent = parent::getTemplateFile($file, $type, $localeCode);
|
23 |
+
|
24 |
+
$config = Mage::getStoreConfig('pp_section_setttings/settings');
|
25 |
+
if (!$config['status'])
|
26 |
+
return $fileContent;
|
27 |
+
|
28 |
+
if (in_array($file, array('sales/shipment_new.html', 'sales/shipment_new_guest.html'))) {
|
29 |
+
$newBlock = '{{block type=\'pptrack/trackings\' area=\'frontend\' template=\'pptrack/email/order/shipment/track.phtml\' shipment=$shipment order=$order}}';
|
30 |
+
|
31 |
+
//replace trackings table if found
|
32 |
+
if (preg_match('#{{[^}]+track\.phtml[^}]+}}#ui', $fileContent, $m)) {
|
33 |
+
$fileContent = preg_replace('#{{[^}]+track\.phtml[^}]+}}#ui', $newBlock, $fileContent);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
return $fileContent;
|
38 |
+
}
|
39 |
}
|
app/code/community/Packpin/Pptrack/Model/Visit.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class Packpin_Pptrack_Model_Visit
|
5 |
-
*
|
6 |
-
* Model for pp_visits table
|
7 |
-
*/
|
8 |
-
class Packpin_Pptrack_Model_Visit extends Mage_Core_Model_Abstract
|
9 |
-
{
|
10 |
-
|
11 |
-
protected function _construct()
|
12 |
-
{
|
13 |
-
$this->_init('pptrack/visit');
|
14 |
-
}
|
15 |
-
|
16 |
-
public function getTotalCount()
|
17 |
-
{
|
18 |
-
$count = $this->getCollection()
|
19 |
-
->getSize();
|
20 |
-
|
21 |
-
return $count;
|
22 |
-
}
|
23 |
-
|
24 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Packpin_Pptrack_Model_Visit
|
5 |
+
*
|
6 |
+
* Model for pp_visits table
|
7 |
+
*/
|
8 |
+
class Packpin_Pptrack_Model_Visit extends Mage_Core_Model_Abstract
|
9 |
+
{
|
10 |
+
|
11 |
+
protected function _construct()
|
12 |
+
{
|
13 |
+
$this->_init('pptrack/visit');
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getTotalCount()
|
17 |
+
{
|
18 |
+
$count = $this->getCollection()
|
19 |
+
->getSize();
|
20 |
+
|
21 |
+
return $count;
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
app/code/community/Packpin/Pptrack/controllers/Adminhtml/PackpintracksController.php
CHANGED
@@ -1,118 +1,118 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Adminhtml_PackpintracksController extends Mage_Adminhtml_Controller_Action
|
3 |
-
{
|
4 |
-
protected function _initAction()
|
5 |
-
{
|
6 |
-
$this->loadLayout()
|
7 |
-
->_setActiveMenu('dashboard/pptrack');
|
8 |
-
|
9 |
-
return $this;
|
10 |
-
}
|
11 |
-
|
12 |
-
public function dashboardAction()
|
13 |
-
{
|
14 |
-
$this->_initAction()
|
15 |
-
->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
|
16 |
-
->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
|
17 |
-
->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
|
18 |
-
->renderLayout();
|
19 |
-
}
|
20 |
-
|
21 |
-
public function indexAction()
|
22 |
-
{
|
23 |
-
$this->_initAction()
|
24 |
-
->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
|
25 |
-
->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
|
26 |
-
->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
|
27 |
-
->renderLayout();
|
28 |
-
}
|
29 |
-
|
30 |
-
public function newAction()
|
31 |
-
{
|
32 |
-
// We just forward the new action to a blank edit form
|
33 |
-
$this->_forward('edit');
|
34 |
-
}
|
35 |
-
|
36 |
-
public function editAction()
|
37 |
-
{
|
38 |
-
$this->_initAction();
|
39 |
-
|
40 |
-
// Get id if available
|
41 |
-
$id = $this->getRequest()->getParam('id');
|
42 |
-
$model = Mage::getModel('pptrack/track');
|
43 |
-
|
44 |
-
if ($id) {
|
45 |
-
// Load record
|
46 |
-
$model->load($id);
|
47 |
-
|
48 |
-
// Check if record is loaded
|
49 |
-
if (!$model->getId()) {
|
50 |
-
Mage::getSingleton('adminhtml/session')->addError($this->__('This Track no longer exists.'));
|
51 |
-
$this->_redirect('*/*/');
|
52 |
-
|
53 |
-
return;
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
$this->_title($model->getId() ? $model->getName() : $this->__('New Track'));
|
58 |
-
|
59 |
-
$data = Mage::getSingleton('adminhtml/session')->getTracksData(true);
|
60 |
-
if (!empty($data)) {
|
61 |
-
$model->setData($data);
|
62 |
-
}
|
63 |
-
|
64 |
-
Mage::register('pptrack', $model);
|
65 |
-
|
66 |
-
$this->_initAction()
|
67 |
-
->_addBreadcrumb($id ? $this->__('Edit Track') : $this->__('New Track'), $id ? $this->__('Edit Track') : $this->__('New Track'))
|
68 |
-
->_addContent($this->getLayout()->createBlock('pptrack/adminhtml_tracks_edit')->setData('action', $this->getUrl('*/*/save')))
|
69 |
-
->renderLayout();
|
70 |
-
}
|
71 |
-
|
72 |
-
public function saveAction()
|
73 |
-
{
|
74 |
-
if ($postData = $this->getRequest()->getPost()) {
|
75 |
-
$model = Mage::getSingleton('pptrack/Track');
|
76 |
-
$model->setData($postData);
|
77 |
-
|
78 |
-
try {
|
79 |
-
$model->save();
|
80 |
-
|
81 |
-
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Track has been saved.'));
|
82 |
-
$this->_redirect('*/*/');
|
83 |
-
|
84 |
-
return;
|
85 |
-
}
|
86 |
-
catch (Mage_Core_Exception $e) {
|
87 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
88 |
-
}
|
89 |
-
catch (Exception $e) {
|
90 |
-
Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while saving this track.'));
|
91 |
-
}
|
92 |
-
|
93 |
-
Mage::getSingleton('adminhtml/session')->setBazData($postData);
|
94 |
-
$this->_redirectReferer();
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
public function messageAction()
|
99 |
-
{
|
100 |
-
$data = Mage::getModel('pptrack/Track')->load($this->getRequest()->getParam('id'));
|
101 |
-
echo $data->getContent();
|
102 |
-
}
|
103 |
-
|
104 |
-
public function exportTracksCsvAction()
|
105 |
-
{
|
106 |
-
$fileName = 'tracks.csv';
|
107 |
-
$grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
|
108 |
-
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
|
109 |
-
}
|
110 |
-
|
111 |
-
public function exportTracksExcelAction()
|
112 |
-
{
|
113 |
-
$fileName = 'tracks.xml';
|
114 |
-
$grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
|
115 |
-
$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
|
116 |
-
}
|
117 |
-
|
118 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Adminhtml_PackpintracksController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
protected function _initAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout()
|
7 |
+
->_setActiveMenu('dashboard/pptrack');
|
8 |
+
|
9 |
+
return $this;
|
10 |
+
}
|
11 |
+
|
12 |
+
public function dashboardAction()
|
13 |
+
{
|
14 |
+
$this->_initAction()
|
15 |
+
->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
|
16 |
+
->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
|
17 |
+
->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
|
18 |
+
->renderLayout();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function indexAction()
|
22 |
+
{
|
23 |
+
$this->_initAction()
|
24 |
+
->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
|
25 |
+
->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
|
26 |
+
->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
|
27 |
+
->renderLayout();
|
28 |
+
}
|
29 |
+
|
30 |
+
public function newAction()
|
31 |
+
{
|
32 |
+
// We just forward the new action to a blank edit form
|
33 |
+
$this->_forward('edit');
|
34 |
+
}
|
35 |
+
|
36 |
+
public function editAction()
|
37 |
+
{
|
38 |
+
$this->_initAction();
|
39 |
+
|
40 |
+
// Get id if available
|
41 |
+
$id = $this->getRequest()->getParam('id');
|
42 |
+
$model = Mage::getModel('pptrack/track');
|
43 |
+
|
44 |
+
if ($id) {
|
45 |
+
// Load record
|
46 |
+
$model->load($id);
|
47 |
+
|
48 |
+
// Check if record is loaded
|
49 |
+
if (!$model->getId()) {
|
50 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('This Track no longer exists.'));
|
51 |
+
$this->_redirect('*/*/');
|
52 |
+
|
53 |
+
return;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
$this->_title($model->getId() ? $model->getName() : $this->__('New Track'));
|
58 |
+
|
59 |
+
$data = Mage::getSingleton('adminhtml/session')->getTracksData(true);
|
60 |
+
if (!empty($data)) {
|
61 |
+
$model->setData($data);
|
62 |
+
}
|
63 |
+
|
64 |
+
Mage::register('pptrack', $model);
|
65 |
+
|
66 |
+
$this->_initAction()
|
67 |
+
->_addBreadcrumb($id ? $this->__('Edit Track') : $this->__('New Track'), $id ? $this->__('Edit Track') : $this->__('New Track'))
|
68 |
+
->_addContent($this->getLayout()->createBlock('pptrack/adminhtml_tracks_edit')->setData('action', $this->getUrl('*/*/save')))
|
69 |
+
->renderLayout();
|
70 |
+
}
|
71 |
+
|
72 |
+
public function saveAction()
|
73 |
+
{
|
74 |
+
if ($postData = $this->getRequest()->getPost()) {
|
75 |
+
$model = Mage::getSingleton('pptrack/Track');
|
76 |
+
$model->setData($postData);
|
77 |
+
|
78 |
+
try {
|
79 |
+
$model->save();
|
80 |
+
|
81 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Track has been saved.'));
|
82 |
+
$this->_redirect('*/*/');
|
83 |
+
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
catch (Mage_Core_Exception $e) {
|
87 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
88 |
+
}
|
89 |
+
catch (Exception $e) {
|
90 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while saving this track.'));
|
91 |
+
}
|
92 |
+
|
93 |
+
Mage::getSingleton('adminhtml/session')->setBazData($postData);
|
94 |
+
$this->_redirectReferer();
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
public function messageAction()
|
99 |
+
{
|
100 |
+
$data = Mage::getModel('pptrack/Track')->load($this->getRequest()->getParam('id'));
|
101 |
+
echo $data->getContent();
|
102 |
+
}
|
103 |
+
|
104 |
+
public function exportTracksCsvAction()
|
105 |
+
{
|
106 |
+
$fileName = 'tracks.csv';
|
107 |
+
$grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
|
108 |
+
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
|
109 |
+
}
|
110 |
+
|
111 |
+
public function exportTracksExcelAction()
|
112 |
+
{
|
113 |
+
$fileName = 'tracks.xml';
|
114 |
+
$grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
|
115 |
+
$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
|
116 |
+
}
|
117 |
+
|
118 |
}
|
app/code/community/Packpin/Pptrack/controllers/Adminhtml/PpnotificationsController.php
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
<?php
|
2 |
-
class Packpin_Pptrack_Adminhtml_PpnotificationsController extends Mage_Adminhtml_Controller_Action
|
3 |
-
{
|
4 |
-
protected function _initAction()
|
5 |
-
{
|
6 |
-
$this->loadLayout()
|
7 |
-
->_setActiveMenu('packpin/pptrack');
|
8 |
-
|
9 |
-
return $this;
|
10 |
-
}
|
11 |
-
|
12 |
-
public function indexAction()
|
13 |
-
{
|
14 |
-
$this->_initAction()
|
15 |
-
->_title(Mage::helper('pptrack')->__("Packpin Notifications"))
|
16 |
-
->renderLayout();
|
17 |
-
}
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Notification setting page
|
21 |
-
*/
|
22 |
-
public function settingsAction()
|
23 |
-
{
|
24 |
-
$this->_initAction()
|
25 |
-
->_title(Mage::helper('pptrack')->__("Packpin Notification Settings"))
|
26 |
-
->renderLayout();
|
27 |
-
}
|
28 |
-
|
29 |
}
|
1 |
+
<?php
|
2 |
+
class Packpin_Pptrack_Adminhtml_PpnotificationsController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
protected function _initAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout()
|
7 |
+
->_setActiveMenu('packpin/pptrack');
|
8 |
+
|
9 |
+
return $this;
|
10 |
+
}
|
11 |
+
|
12 |
+
public function indexAction()
|
13 |
+
{
|
14 |
+
$this->_initAction()
|
15 |
+
->_title(Mage::helper('pptrack')->__("Packpin Notifications"))
|
16 |
+
->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Notification setting page
|
21 |
+
*/
|
22 |
+
public function settingsAction()
|
23 |
+
{
|
24 |
+
$this->_initAction()
|
25 |
+
->_title(Mage::helper('pptrack')->__("Packpin Notification Settings"))
|
26 |
+
->renderLayout();
|
27 |
+
}
|
28 |
+
|
29 |
}
|
app/code/community/Packpin/Pptrack/controllers/IndexController.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_IndexController extends Mage_Core_Controller_Front_Action
|
4 |
-
{
|
5 |
-
public function indexAction()
|
6 |
-
{
|
7 |
-
if (isset($_REQUEST['PPTRACK_DEBUG'])) {
|
8 |
-
restore_error_handler();
|
9 |
-
error_reporting(E_ALL);
|
10 |
-
ini_set("display_errors", "on");
|
11 |
-
}
|
12 |
-
|
13 |
-
|
14 |
-
$this->loadLayout();
|
15 |
-
$this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
|
16 |
-
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
17 |
-
$breadcrumbs->addCrumb("home", array(
|
18 |
-
"label" => $this->__("Home"),
|
19 |
-
"title" => $this->__("Home"),
|
20 |
-
"link" => Mage::getBaseUrl()
|
21 |
-
));
|
22 |
-
|
23 |
-
$breadcrumbs->addCrumb("shipment status", array(
|
24 |
-
"label" => Mage::helper('pptrack')->__("Shipment status"),
|
25 |
-
"title" => Mage::helper('pptrack')->__("Shipment status")
|
26 |
-
));
|
27 |
-
|
28 |
-
|
29 |
-
$this->renderLayout();
|
30 |
-
|
31 |
-
}
|
32 |
-
|
33 |
-
public function popupAction()
|
34 |
-
{
|
35 |
-
$this->loadLayout();
|
36 |
-
$this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
|
37 |
-
$this->renderLayout();
|
38 |
-
}
|
39 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_IndexController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
public function indexAction()
|
6 |
+
{
|
7 |
+
if (isset($_REQUEST['PPTRACK_DEBUG'])) {
|
8 |
+
restore_error_handler();
|
9 |
+
error_reporting(E_ALL);
|
10 |
+
ini_set("display_errors", "on");
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
$this->loadLayout();
|
15 |
+
$this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
|
16 |
+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
17 |
+
$breadcrumbs->addCrumb("home", array(
|
18 |
+
"label" => $this->__("Home"),
|
19 |
+
"title" => $this->__("Home"),
|
20 |
+
"link" => Mage::getBaseUrl()
|
21 |
+
));
|
22 |
+
|
23 |
+
$breadcrumbs->addCrumb("shipment status", array(
|
24 |
+
"label" => Mage::helper('pptrack')->__("Shipment status"),
|
25 |
+
"title" => Mage::helper('pptrack')->__("Shipment status")
|
26 |
+
));
|
27 |
+
|
28 |
+
|
29 |
+
$this->renderLayout();
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
public function popupAction()
|
34 |
+
{
|
35 |
+
$this->loadLayout();
|
36 |
+
$this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
|
37 |
+
$this->renderLayout();
|
38 |
+
}
|
39 |
}
|
app/code/community/Packpin/Pptrack/controllers/UnsubscribeController.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Packpin_Pptrack_UnsubscribeController extends Mage_Core_Controller_Front_Action
|
4 |
-
{
|
5 |
-
public function indexAction(){
|
6 |
-
|
7 |
-
$model = Mage::getModel('pptrack/track');
|
8 |
-
$hash = Mage::app()->getRequest()->getParam('h');
|
9 |
-
if ($hash) {
|
10 |
-
$model->loadInfoByHash($hash);
|
11 |
-
|
12 |
-
if($model->getId()) {
|
13 |
-
$unsubscribedModel = Mage::getModel('pptrack/trackunsubscribed');
|
14 |
-
$res = $unsubscribedModel->unsubscribeTrack($model->getId());
|
15 |
-
if($res) {
|
16 |
-
Mage::getSingleton('core/session')->addSuccess(Mage::helper('pptrack')->__('You have successfully unsubscribed from package status updates'));
|
17 |
-
}
|
18 |
-
else {
|
19 |
-
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Subscription not found or already unsubscribed!'));
|
20 |
-
}
|
21 |
-
}
|
22 |
-
else {
|
23 |
-
Mage::getSingleton('core/session')->addError(Mage::helper('pptrack')->__('Tracking info not found!'));
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
$this->loadLayout();
|
28 |
-
$this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Unsubscribe"));
|
29 |
-
$this->renderLayout();
|
30 |
-
}
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Packpin_Pptrack_UnsubscribeController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
public function indexAction(){
|
6 |
+
|
7 |
+
$model = Mage::getModel('pptrack/track');
|
8 |
+
$hash = Mage::app()->getRequest()->getParam('h');
|
9 |
+
if ($hash) {
|
10 |
+
$model->loadInfoByHash($hash);
|
11 |
+
|
12 |
+
if($model->getId()) {
|
13 |
+
$unsubscribedModel = Mage::getModel('pptrack/trackunsubscribed');
|
14 |
+
$res = $unsubscribedModel->unsubscribeTrack($model->getId());
|
15 |
+
if($res) {
|
16 |
+
Mage::getSingleton('core/session')->addSuccess(Mage::helper('pptrack')->__('You have successfully unsubscribed from package status updates'));
|
17 |
+
}
|
18 |
+
else {
|
19 |
+
Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Subscription not found or already unsubscribed!'));
|
20 |
+
}
|
21 |
+
}
|
22 |
+
else {
|
23 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('pptrack')->__('Tracking info not found!'));
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
$this->loadLayout();
|
28 |
+
$this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Unsubscribe"));
|
29 |
+
$this->renderLayout();
|
30 |
+
}
|
31 |
}
|
app/code/community/Packpin/Pptrack/data/pptrack_setup/data-upgrade-0.1.5-1.1.0.php
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$installer = $this;
|
4 |
-
|
5 |
-
$installer->startSetup();
|
6 |
-
|
7 |
-
//generate temp API key
|
8 |
-
$helper = Mage::helper('pptrack');
|
9 |
-
$key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
10 |
-
|
11 |
-
if (!$key) {
|
12 |
-
try {
|
13 |
-
$newKey = $helper->generateTempKey();
|
14 |
-
|
15 |
-
if ($newKey) {
|
16 |
-
$this->setConfigData('pp_section_setttings/settings/api_key', $newKey);
|
17 |
-
$this->setConfigData('pp_section_setttings/settings/temp_api_key', $newKey);
|
18 |
-
$this->setConfigData('pp_section_setttings/settings/temp_key_installed', time());
|
19 |
-
}
|
20 |
-
else {
|
21 |
-
$this->setConfigData('pp_section_setttings/settings/status', 0);
|
22 |
-
}
|
23 |
-
} catch (Exception $e) {
|
24 |
-
$this->setConfigData('pp_section_setttings/settings/status', 0);
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
$installer->endSetup();
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
//generate temp API key
|
8 |
+
$helper = Mage::helper('pptrack');
|
9 |
+
$key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
|
10 |
+
|
11 |
+
if (!$key) {
|
12 |
+
try {
|
13 |
+
$newKey = $helper->generateTempKey();
|
14 |
+
|
15 |
+
if ($newKey) {
|
16 |
+
$this->setConfigData('pp_section_setttings/settings/api_key', $newKey);
|
17 |
+
$this->setConfigData('pp_section_setttings/settings/temp_api_key', $newKey);
|
18 |
+
$this->setConfigData('pp_section_setttings/settings/temp_key_installed', time());
|
19 |
+
}
|
20 |
+
else {
|
21 |
+
$this->setConfigData('pp_section_setttings/settings/status', 0);
|
22 |
+
}
|
23 |
+
} catch (Exception $e) {
|
24 |
+
$this->setConfigData('pp_section_setttings/settings/status', 0);
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
$installer->endSetup();
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
|
app/code/community/Packpin/Pptrack/etc/adminhtml.xml
CHANGED
@@ -1,61 +1,61 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<layout>
|
4 |
-
<updates>
|
5 |
-
<pptrack>
|
6 |
-
<file>pptrack.xml</file>
|
7 |
-
</pptrack>
|
8 |
-
</updates>
|
9 |
-
</layout>
|
10 |
-
<menu>
|
11 |
-
<dashboard>
|
12 |
-
<children>
|
13 |
-
<packpin_pptrack translate="title" module="pptrack">
|
14 |
-
<title>Packpin Dashboard</title>
|
15 |
-
<sort_order>903</sort_order>
|
16 |
-
<!--depends>
|
17 |
-
<module>Packpin_Pptrack</module>
|
18 |
-
</depends-->
|
19 |
-
<action>adminhtml/packpintracks/dashboard</action>
|
20 |
-
</packpin_pptrack>
|
21 |
-
</children>
|
22 |
-
</dashboard>
|
23 |
-
</menu>
|
24 |
-
<acl>
|
25 |
-
<resources>
|
26 |
-
<admin>
|
27 |
-
<children>
|
28 |
-
<dashboard>
|
29 |
-
<children>
|
30 |
-
<packpin_pptrack translate="title" module="pptrack">
|
31 |
-
<title>Packpim Dashboard</title>
|
32 |
-
<sort_order>903</sort_order>
|
33 |
-
<action>adminhtml/packpintracks/dashboard</action>
|
34 |
-
</packpin_pptrack>
|
35 |
-
</children>
|
36 |
-
</dashboard>
|
37 |
-
<system>
|
38 |
-
<children>
|
39 |
-
<config>
|
40 |
-
<children>
|
41 |
-
<pp_section_setttings translate="title" module="pptrack">
|
42 |
-
<title>Packpin General Settings Section</title>
|
43 |
-
<sort_order>51001</sort_order>
|
44 |
-
</pp_section_setttings>
|
45 |
-
<pp_section_notification_emails translate="title" module="pptrack">
|
46 |
-
<title>Packpin Notification Emails</title>
|
47 |
-
<sort_order>51002</sort_order>
|
48 |
-
</pp_section_notification_emails>
|
49 |
-
<pp_section_carriers translate="title" module="pptrack">
|
50 |
-
<title>Packpin Carrier Settings</title>
|
51 |
-
<sort_order>51003</sort_order>
|
52 |
-
</pp_section_carriers>
|
53 |
-
</children>
|
54 |
-
</config>
|
55 |
-
</children>
|
56 |
-
</system>
|
57 |
-
</children>
|
58 |
-
</admin>
|
59 |
-
</resources>
|
60 |
-
</acl>
|
61 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<layout>
|
4 |
+
<updates>
|
5 |
+
<pptrack>
|
6 |
+
<file>pptrack.xml</file>
|
7 |
+
</pptrack>
|
8 |
+
</updates>
|
9 |
+
</layout>
|
10 |
+
<menu>
|
11 |
+
<dashboard>
|
12 |
+
<children>
|
13 |
+
<packpin_pptrack translate="title" module="pptrack">
|
14 |
+
<title>Packpin Dashboard</title>
|
15 |
+
<sort_order>903</sort_order>
|
16 |
+
<!--depends>
|
17 |
+
<module>Packpin_Pptrack</module>
|
18 |
+
</depends-->
|
19 |
+
<action>adminhtml/packpintracks/dashboard</action>
|
20 |
+
</packpin_pptrack>
|
21 |
+
</children>
|
22 |
+
</dashboard>
|
23 |
+
</menu>
|
24 |
+
<acl>
|
25 |
+
<resources>
|
26 |
+
<admin>
|
27 |
+
<children>
|
28 |
+
<dashboard>
|
29 |
+
<children>
|
30 |
+
<packpin_pptrack translate="title" module="pptrack">
|
31 |
+
<title>Packpim Dashboard</title>
|
32 |
+
<sort_order>903</sort_order>
|
33 |
+
<action>adminhtml/packpintracks/dashboard</action>
|
34 |
+
</packpin_pptrack>
|
35 |
+
</children>
|
36 |
+
</dashboard>
|
37 |
+
<system>
|
38 |
+
<children>
|
39 |
+
<config>
|
40 |
+
<children>
|
41 |
+
<pp_section_setttings translate="title" module="pptrack">
|
42 |
+
<title>Packpin General Settings Section</title>
|
43 |
+
<sort_order>51001</sort_order>
|
44 |
+
</pp_section_setttings>
|
45 |
+
<pp_section_notification_emails translate="title" module="pptrack">
|
46 |
+
<title>Packpin Notification Emails</title>
|
47 |
+
<sort_order>51002</sort_order>
|
48 |
+
</pp_section_notification_emails>
|
49 |
+
<pp_section_carriers translate="title" module="pptrack">
|
50 |
+
<title>Packpin Carrier Settings</title>
|
51 |
+
<sort_order>51003</sort_order>
|
52 |
+
</pp_section_carriers>
|
53 |
+
</children>
|
54 |
+
</config>
|
55 |
+
</children>
|
56 |
+
</system>
|
57 |
+
</children>
|
58 |
+
</admin>
|
59 |
+
</resources>
|
60 |
+
</acl>
|
61 |
</config>
|
app/code/community/Packpin/Pptrack/etc/api.xml
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<config>
|
2 |
-
<api>
|
3 |
-
<resources>
|
4 |
-
<pptrack translate="title" module="pptrack">
|
5 |
-
<title>Packpin Email Resource</title>
|
6 |
-
<model>pptrack/api</model>
|
7 |
-
<methods>
|
8 |
-
<info translate="title" module="pptrack">
|
9 |
-
<title>Retrieve notification email info</title>
|
10 |
-
</info>
|
11 |
-
<test translate="title" module="pptrack">
|
12 |
-
<title>Test Packpin API connection</title>
|
13 |
-
</test>
|
14 |
-
</methods>
|
15 |
-
<faults module="pptrack">
|
16 |
-
<data_invalid>
|
17 |
-
<code>100</code >
|
18 |
-
<message>Invalid tracking data. Details in error message.</message>
|
19 |
-
</data_invalid>
|
20 |
-
<not_exists>
|
21 |
-
<code>102</code >
|
22 |
-
<message>Tracking code does not exist.</message>
|
23 |
-
</not_exists>
|
24 |
-
</faults>
|
25 |
-
</pptrack>
|
26 |
-
</resources>
|
27 |
-
<acl>
|
28 |
-
<resources>
|
29 |
-
<pptrack translate="title" module="pptrack">
|
30 |
-
<title>Packpin notifications</title>
|
31 |
-
<info translate="title" module="pptrack">
|
32 |
-
<title>Get Email Template Info</title>
|
33 |
-
<acl>pptrack/info</acl>
|
34 |
-
</info>
|
35 |
-
<test translate="title" module="pptrack">
|
36 |
-
<title>Test Packpin API connection</title>
|
37 |
-
<acl>pptrack/test</acl>
|
38 |
-
</test>
|
39 |
-
</pptrack>
|
40 |
-
</resources>
|
41 |
-
</acl>
|
42 |
-
</api>
|
43 |
</config>
|
1 |
+
<config>
|
2 |
+
<api>
|
3 |
+
<resources>
|
4 |
+
<pptrack translate="title" module="pptrack">
|
5 |
+
<title>Packpin Email Resource</title>
|
6 |
+
<model>pptrack/api</model>
|
7 |
+
<methods>
|
8 |
+
<info translate="title" module="pptrack">
|
9 |
+
<title>Retrieve notification email info</title>
|
10 |
+
</info>
|
11 |
+
<test translate="title" module="pptrack">
|
12 |
+
<title>Test Packpin API connection</title>
|
13 |
+
</test>
|
14 |
+
</methods>
|
15 |
+
<faults module="pptrack">
|
16 |
+
<data_invalid>
|
17 |
+
<code>100</code >
|
18 |
+
<message>Invalid tracking data. Details in error message.</message>
|
19 |
+
</data_invalid>
|
20 |
+
<not_exists>
|
21 |
+
<code>102</code >
|
22 |
+
<message>Tracking code does not exist.</message>
|
23 |
+
</not_exists>
|
24 |
+
</faults>
|
25 |
+
</pptrack>
|
26 |
+
</resources>
|
27 |
+
<acl>
|
28 |
+
<resources>
|
29 |
+
<pptrack translate="title" module="pptrack">
|
30 |
+
<title>Packpin notifications</title>
|
31 |
+
<info translate="title" module="pptrack">
|
32 |
+
<title>Get Email Template Info</title>
|
33 |
+
<acl>pptrack/info</acl>
|
34 |
+
</info>
|
35 |
+
<test translate="title" module="pptrack">
|
36 |
+
<title>Test Packpin API connection</title>
|
37 |
+
<acl>pptrack/test</acl>
|
38 |
+
</test>
|
39 |
+
</pptrack>
|
40 |
+
</resources>
|
41 |
+
</acl>
|
42 |
+
</api>
|
43 |
</config>
|
app/code/community/Packpin/Pptrack/etc/config.xml
CHANGED
@@ -1,318 +1,318 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Packpin_Pptrack>
|
5 |
-
<version>1.5.
|
6 |
-
</Packpin_Pptrack>
|
7 |
-
</modules>
|
8 |
-
<frontend>
|
9 |
-
<routers>
|
10 |
-
<pptrack>
|
11 |
-
<use>standard</use>
|
12 |
-
<args>
|
13 |
-
<module>Packpin_Pptrack</module>
|
14 |
-
<frontName>pptrack</frontName>
|
15 |
-
</args>
|
16 |
-
</pptrack>
|
17 |
-
</routers>
|
18 |
-
<layout>
|
19 |
-
<updates>
|
20 |
-
<pptrack>
|
21 |
-
<file>pptrack.xml</file>
|
22 |
-
</pptrack>
|
23 |
-
<pptrack_unsubscribe>
|
24 |
-
<file>pptrackunsubscribe.xml</file>
|
25 |
-
</pptrack_unsubscribe>
|
26 |
-
</updates>
|
27 |
-
</layout>
|
28 |
-
<translate>
|
29 |
-
<modules>
|
30 |
-
<Packpin_Pptrack>
|
31 |
-
<files>
|
32 |
-
<default>Packpin_Pptrack.csv</default>
|
33 |
-
</files>
|
34 |
-
</Packpin_Pptrack>
|
35 |
-
</modules>
|
36 |
-
</translate>
|
37 |
-
</frontend>
|
38 |
-
<global>
|
39 |
-
<models>
|
40 |
-
<packpinpptrackvalidation>
|
41 |
-
<class>Packpin_Pptrack_Model</class>
|
42 |
-
</packpinpptrackvalidation>
|
43 |
-
<pptrack>
|
44 |
-
<class>Packpin_Pptrack_Model</class>
|
45 |
-
<resourceModel>pptrack_resource</resourceModel>
|
46 |
-
</pptrack>
|
47 |
-
<pptrackcron>
|
48 |
-
<class>Packpin_Pptrack_Model</class>
|
49 |
-
<resourceModel>pptrack_resource</resourceModel>
|
50 |
-
</pptrackcron>
|
51 |
-
<pptrack_resource>
|
52 |
-
<class>Packpin_Pptrack_Model_Resource</class>
|
53 |
-
<entities>
|
54 |
-
<track>
|
55 |
-
<table>pp_tracks</table>
|
56 |
-
</track>
|
57 |
-
<trackunsubscribed>
|
58 |
-
<table>pp_tracks_unsubscribed</table>
|
59 |
-
</trackunsubscribed>
|
60 |
-
<trackdetail>
|
61 |
-
<table>pp_track_details</table>
|
62 |
-
</trackdetail>
|
63 |
-
<carrier>
|
64 |
-
<table>pp_carriers</table>
|
65 |
-
</carrier>
|
66 |
-
<setting>
|
67 |
-
<table>pp_settings</table>
|
68 |
-
</setting>
|
69 |
-
<notification_setting>
|
70 |
-
<table>pp_notification_settings</table>
|
71 |
-
</notification_setting>
|
72 |
-
<notification_template>
|
73 |
-
<table>pp_notification_templates</table>
|
74 |
-
</notification_template>
|
75 |
-
<visit>
|
76 |
-
<table>pp_visits</table>
|
77 |
-
</visit>
|
78 |
-
</entities>
|
79 |
-
</pptrack_resource>
|
80 |
-
<status>
|
81 |
-
<class>Packpin_Track_Model</class>
|
82 |
-
</status>
|
83 |
-
<cron_job>
|
84 |
-
<class>Packpin_Track_Model</class>
|
85 |
-
</cron_job>
|
86 |
-
<notification>
|
87 |
-
<class>Packpin_Track_Model</class>
|
88 |
-
</notification>
|
89 |
-
<sales>
|
90 |
-
<rewrite>
|
91 |
-
<order_shipment>Packpin_Pptrack_Model_Order_Shipment</order_shipment>
|
92 |
-
</rewrite>
|
93 |
-
</sales>
|
94 |
-
<core>
|
95 |
-
<rewrite>
|
96 |
-
<translate>Packpin_Pptrack_Model_Translate</translate>
|
97 |
-
</rewrite>
|
98 |
-
</core>
|
99 |
-
</models>
|
100 |
-
<helpers>
|
101 |
-
<pptrack>
|
102 |
-
<class>Packpin_Pptrack_Helper</class>
|
103 |
-
</pptrack>
|
104 |
-
</helpers>
|
105 |
-
<blocks>
|
106 |
-
<pptrack>
|
107 |
-
<class>Packpin_Pptrack_Block</class>
|
108 |
-
<trackings>
|
109 |
-
<class>Packpin_Pptrack_Block_Trackings</class>
|
110 |
-
</trackings>
|
111 |
-
</pptrack>
|
112 |
-
<pptrack_adminhtml>
|
113 |
-
<class>Packpin_Pptrack_Block_Adminhtml</class>
|
114 |
-
</pptrack_adminhtml>
|
115 |
-
<adminhtml>
|
116 |
-
<rewrite>
|
117 |
-
<sales_order_shipment_view_tracking>Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking</sales_order_shipment_view_tracking>
|
118 |
-
<sales_order_shipment_create_tracking>Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking</sales_order_shipment_create_tracking>
|
119 |
-
</rewrite>
|
120 |
-
</adminhtml>
|
121 |
-
</blocks>
|
122 |
-
<resources>
|
123 |
-
<pptrack_setup>
|
124 |
-
<setup>
|
125 |
-
<module>Packpin_Pptrack</module>
|
126 |
-
</setup>
|
127 |
-
<connection>
|
128 |
-
<use>core_setup</use>
|
129 |
-
</connection>
|
130 |
-
</pptrack_setup>
|
131 |
-
<pptrack_write>
|
132 |
-
<connection>
|
133 |
-
<use>core_write</use>
|
134 |
-
</connection>
|
135 |
-
</pptrack_write>
|
136 |
-
<pptrack_read>
|
137 |
-
<connection>
|
138 |
-
<use>core_read</use>
|
139 |
-
</connection>
|
140 |
-
</pptrack_read>
|
141 |
-
</resources>
|
142 |
-
<events>
|
143 |
-
<sales_order_shipment_track_save_after>
|
144 |
-
<observers>
|
145 |
-
<pp_track_save>
|
146 |
-
<type>singleton</type>
|
147 |
-
<class>pptrack/observer</class>
|
148 |
-
<method>afterShipmentSaved</method>
|
149 |
-
</pp_track_save>
|
150 |
-
</observers>
|
151 |
-
</sales_order_shipment_track_save_after>
|
152 |
-
<sales_order_shipment_track_delete_after>
|
153 |
-
<observers>
|
154 |
-
<pp_track_delete>
|
155 |
-
<type>singleton</type>
|
156 |
-
<class>pptrack/observer</class>
|
157 |
-
<method>afterShipmentRemoved</method>
|
158 |
-
</pp_track_delete>
|
159 |
-
</observers>
|
160 |
-
</sales_order_shipment_track_delete_after>
|
161 |
-
<controller_action_predispatch_shipping_tracking_popup>
|
162 |
-
<observers>
|
163 |
-
<pp_tracking_popup_predispatch>
|
164 |
-
<type>singleton</type>
|
165 |
-
<class>pptrack/observer</class>
|
166 |
-
<method>trackingPopupPreDispatch</method>
|
167 |
-
</pp_tracking_popup_predispatch>
|
168 |
-
</observers>
|
169 |
-
</controller_action_predispatch_shipping_tracking_popup>
|
170 |
-
<admin_system_config_changed_section_pp_section_carriers>
|
171 |
-
<observers>
|
172 |
-
<module_name>
|
173 |
-
<type>singleton</type>
|
174 |
-
<class>pptrack/observer</class>
|
175 |
-
<method>saveCarriers</method>
|
176 |
-
</module_name>
|
177 |
-
</observers>
|
178 |
-
</admin_system_config_changed_section_pp_section_carriers>
|
179 |
-
</events>
|
180 |
-
<template>
|
181 |
-
<email>
|
182 |
-
<packpin_delivered_email>
|
183 |
-
<label>Packpin Delivered Notification Email</label>
|
184 |
-
<file>packpin/packpin_delivered_email.html</file>
|
185 |
-
<type>html</type>
|
186 |
-
</packpin_delivered_email>
|
187 |
-
<packpin_exception_email>
|
188 |
-
<label>Packpin Exception Notification Email</label>
|
189 |
-
<file>packpin/packpin_exception_email.html</file>
|
190 |
-
<type>html</type>
|
191 |
-
</packpin_exception_email>
|
192 |
-
<packpin_failed_attempt_email>
|
193 |
-
<label>Packpin Failed Attempt Notification Email</label>
|
194 |
-
<file>packpin/packpin_failed_attempt_email.html</file>
|
195 |
-
<type>html</type>
|
196 |
-
</packpin_failed_attempt_email>
|
197 |
-
<packpin_in_transit_email>
|
198 |
-
<label>Packpin in Transit Notification Email</label>
|
199 |
-
<file>packpin/packpin_in_transit_email.html</file>
|
200 |
-
<type>html</type>
|
201 |
-
</packpin_in_transit_email>
|
202 |
-
<packpin_info_received_email>
|
203 |
-
<label>Packpin Info Received Notification Email</label>
|
204 |
-
<file>packpin/packpin_info_received_email.html</file>
|
205 |
-
<type>html</type>
|
206 |
-
</packpin_info_received_email>
|
207 |
-
<packpin_out_for_delivery_email>
|
208 |
-
<label>Packpin Out for Delivery Notification Email</label>
|
209 |
-
<file>packpin/packpin_out_for_delivery_email.html</file>
|
210 |
-
<type>html</type>
|
211 |
-
</packpin_out_for_delivery_email>
|
212 |
-
</email>
|
213 |
-
</template>
|
214 |
-
</global>
|
215 |
-
<crontab>
|
216 |
-
<jobs>
|
217 |
-
<pptrack_check_tracks>
|
218 |
-
<schedule>
|
219 |
-
<cron_expr>1 */2 * * *</cron_expr>
|
220 |
-
</schedule>
|
221 |
-
<run>
|
222 |
-
<model>pptrack/observer::cron</model>
|
223 |
-
</run>
|
224 |
-
</pptrack_check_tracks>
|
225 |
-
</jobs>
|
226 |
-
</crontab>
|
227 |
-
<admin>
|
228 |
-
<routers>
|
229 |
-
<adminhtml>
|
230 |
-
<args>
|
231 |
-
<modules>
|
232 |
-
<Packpin_Pptrack before="Mage_Adminhtml">Packpin_Pptrack_Adminhtml</Packpin_Pptrack>
|
233 |
-
</modules>
|
234 |
-
</args>
|
235 |
-
</adminhtml>
|
236 |
-
</routers>
|
237 |
-
</admin>
|
238 |
-
<adminhtml>
|
239 |
-
<translate>
|
240 |
-
<modules>
|
241 |
-
<Packpin_Pptrack>
|
242 |
-
<files>
|
243 |
-
<default>Packpin_Pptrack.csv</default>
|
244 |
-
</files>
|
245 |
-
</Packpin_Pptrack>
|
246 |
-
</modules>
|
247 |
-
</translate>
|
248 |
-
<layout>
|
249 |
-
<updates>
|
250 |
-
<pptrack>
|
251 |
-
<file>pptrack.xml</file>
|
252 |
-
</pptrack>
|
253 |
-
</updates>
|
254 |
-
</layout>
|
255 |
-
<events>
|
256 |
-
<core_block_abstract_prepare_layout_after>
|
257 |
-
<observers>
|
258 |
-
<Packpin_Pptrack>
|
259 |
-
<class>pptrack/observer</class>
|
260 |
-
<method>coreBlockAbstractPrepareLayoutAfter</method>
|
261 |
-
</Packpin_Pptrack>
|
262 |
-
</observers>
|
263 |
-
</core_block_abstract_prepare_layout_after>
|
264 |
-
<core_block_abstract_to_html_after>
|
265 |
-
<observers>
|
266 |
-
<Packpin_Pptrack>
|
267 |
-
<class>pptrack/observer</class>
|
268 |
-
<method>coreBlockAbstractToHtmlAfter</method>
|
269 |
-
</Packpin_Pptrack>
|
270 |
-
</observers>
|
271 |
-
</core_block_abstract_to_html_after>
|
272 |
-
</events>
|
273 |
-
</adminhtml>
|
274 |
-
<default>
|
275 |
-
<pp_section_setttings>
|
276 |
-
<settings>
|
277 |
-
<status>1</status>
|
278 |
-
</settings>
|
279 |
-
<crosssell>
|
280 |
-
<cross_sell_page>1</cross_sell_page>
|
281 |
-
<cross_sell_email>1</cross_sell_email>
|
282 |
-
<cross_sell_page_items>6</cross_sell_page_items>
|
283 |
-
<cross_sell_email_items>4</cross_sell_email_items>
|
284 |
-
<cross_sell_page_type>products</cross_sell_page_type>
|
285 |
-
<cross_sell_email_type>products</cross_sell_email_type>
|
286 |
-
</crosssell>
|
287 |
-
<advanced>
|
288 |
-
<trigger_shipped_email>0</trigger_shipped_email>
|
289 |
-
</advanced>
|
290 |
-
</pp_section_setttings>
|
291 |
-
<pp_section_notification_emails>
|
292 |
-
<info_received>
|
293 |
-
<enabled_client>1</enabled_client>
|
294 |
-
<identity>general</identity>
|
295 |
-
</info_received>
|
296 |
-
<in_transit>
|
297 |
-
<enabled_client>1</enabled_client>
|
298 |
-
<identity>general</identity>
|
299 |
-
</in_transit>
|
300 |
-
<out_for_delivery>
|
301 |
-
<enabled_client>1</enabled_client>
|
302 |
-
<identity>general</identity>
|
303 |
-
</out_for_delivery>
|
304 |
-
<delivered>
|
305 |
-
<enabled_client>1</enabled_client>
|
306 |
-
<identity>general</identity>
|
307 |
-
</delivered>
|
308 |
-
<exception>
|
309 |
-
<enabled_client>1</enabled_client>
|
310 |
-
<identity>general</identity>
|
311 |
-
</exception>
|
312 |
-
<failed_attempt>
|
313 |
-
<enabled_client>1</enabled_client>
|
314 |
-
<identity>general</identity>
|
315 |
-
</failed_attempt>
|
316 |
-
</pp_section_notification_emails>
|
317 |
-
</default>
|
318 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Packpin_Pptrack>
|
5 |
+
<version>1.5.6</version>
|
6 |
+
</Packpin_Pptrack>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<pptrack>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Packpin_Pptrack</module>
|
14 |
+
<frontName>pptrack</frontName>
|
15 |
+
</args>
|
16 |
+
</pptrack>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<pptrack>
|
21 |
+
<file>pptrack.xml</file>
|
22 |
+
</pptrack>
|
23 |
+
<pptrack_unsubscribe>
|
24 |
+
<file>pptrackunsubscribe.xml</file>
|
25 |
+
</pptrack_unsubscribe>
|
26 |
+
</updates>
|
27 |
+
</layout>
|
28 |
+
<translate>
|
29 |
+
<modules>
|
30 |
+
<Packpin_Pptrack>
|
31 |
+
<files>
|
32 |
+
<default>Packpin_Pptrack.csv</default>
|
33 |
+
</files>
|
34 |
+
</Packpin_Pptrack>
|
35 |
+
</modules>
|
36 |
+
</translate>
|
37 |
+
</frontend>
|
38 |
+
<global>
|
39 |
+
<models>
|
40 |
+
<packpinpptrackvalidation>
|
41 |
+
<class>Packpin_Pptrack_Model</class>
|
42 |
+
</packpinpptrackvalidation>
|
43 |
+
<pptrack>
|
44 |
+
<class>Packpin_Pptrack_Model</class>
|
45 |
+
<resourceModel>pptrack_resource</resourceModel>
|
46 |
+
</pptrack>
|
47 |
+
<pptrackcron>
|
48 |
+
<class>Packpin_Pptrack_Model</class>
|
49 |
+
<resourceModel>pptrack_resource</resourceModel>
|
50 |
+
</pptrackcron>
|
51 |
+
<pptrack_resource>
|
52 |
+
<class>Packpin_Pptrack_Model_Resource</class>
|
53 |
+
<entities>
|
54 |
+
<track>
|
55 |
+
<table>pp_tracks</table>
|
56 |
+
</track>
|
57 |
+
<trackunsubscribed>
|
58 |
+
<table>pp_tracks_unsubscribed</table>
|
59 |
+
</trackunsubscribed>
|
60 |
+
<trackdetail>
|
61 |
+
<table>pp_track_details</table>
|
62 |
+
</trackdetail>
|
63 |
+
<carrier>
|
64 |
+
<table>pp_carriers</table>
|
65 |
+
</carrier>
|
66 |
+
<setting>
|
67 |
+
<table>pp_settings</table>
|
68 |
+
</setting>
|
69 |
+
<notification_setting>
|
70 |
+
<table>pp_notification_settings</table>
|
71 |
+
</notification_setting>
|
72 |
+
<notification_template>
|
73 |
+
<table>pp_notification_templates</table>
|
74 |
+
</notification_template>
|
75 |
+
<visit>
|
76 |
+
<table>pp_visits</table>
|
77 |
+
</visit>
|
78 |
+
</entities>
|
79 |
+
</pptrack_resource>
|
80 |
+
<status>
|
81 |
+
<class>Packpin_Track_Model</class>
|
82 |
+
</status>
|
83 |
+
<cron_job>
|
84 |
+
<class>Packpin_Track_Model</class>
|
85 |
+
</cron_job>
|
86 |
+
<notification>
|
87 |
+
<class>Packpin_Track_Model</class>
|
88 |
+
</notification>
|
89 |
+
<sales>
|
90 |
+
<rewrite>
|
91 |
+
<order_shipment>Packpin_Pptrack_Model_Order_Shipment</order_shipment>
|
92 |
+
</rewrite>
|
93 |
+
</sales>
|
94 |
+
<core>
|
95 |
+
<rewrite>
|
96 |
+
<translate>Packpin_Pptrack_Model_Translate</translate>
|
97 |
+
</rewrite>
|
98 |
+
</core>
|
99 |
+
</models>
|
100 |
+
<helpers>
|
101 |
+
<pptrack>
|
102 |
+
<class>Packpin_Pptrack_Helper</class>
|
103 |
+
</pptrack>
|
104 |
+
</helpers>
|
105 |
+
<blocks>
|
106 |
+
<pptrack>
|
107 |
+
<class>Packpin_Pptrack_Block</class>
|
108 |
+
<trackings>
|
109 |
+
<class>Packpin_Pptrack_Block_Trackings</class>
|
110 |
+
</trackings>
|
111 |
+
</pptrack>
|
112 |
+
<pptrack_adminhtml>
|
113 |
+
<class>Packpin_Pptrack_Block_Adminhtml</class>
|
114 |
+
</pptrack_adminhtml>
|
115 |
+
<adminhtml>
|
116 |
+
<rewrite>
|
117 |
+
<sales_order_shipment_view_tracking>Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking</sales_order_shipment_view_tracking>
|
118 |
+
<sales_order_shipment_create_tracking>Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking</sales_order_shipment_create_tracking>
|
119 |
+
</rewrite>
|
120 |
+
</adminhtml>
|
121 |
+
</blocks>
|
122 |
+
<resources>
|
123 |
+
<pptrack_setup>
|
124 |
+
<setup>
|
125 |
+
<module>Packpin_Pptrack</module>
|
126 |
+
</setup>
|
127 |
+
<connection>
|
128 |
+
<use>core_setup</use>
|
129 |
+
</connection>
|
130 |
+
</pptrack_setup>
|
131 |
+
<pptrack_write>
|
132 |
+
<connection>
|
133 |
+
<use>core_write</use>
|
134 |
+
</connection>
|
135 |
+
</pptrack_write>
|
136 |
+
<pptrack_read>
|
137 |
+
<connection>
|
138 |
+
<use>core_read</use>
|
139 |
+
</connection>
|
140 |
+
</pptrack_read>
|
141 |
+
</resources>
|
142 |
+
<events>
|
143 |
+
<sales_order_shipment_track_save_after>
|
144 |
+
<observers>
|
145 |
+
<pp_track_save>
|
146 |
+
<type>singleton</type>
|
147 |
+
<class>pptrack/observer</class>
|
148 |
+
<method>afterShipmentSaved</method>
|
149 |
+
</pp_track_save>
|
150 |
+
</observers>
|
151 |
+
</sales_order_shipment_track_save_after>
|
152 |
+
<sales_order_shipment_track_delete_after>
|
153 |
+
<observers>
|
154 |
+
<pp_track_delete>
|
155 |
+
<type>singleton</type>
|
156 |
+
<class>pptrack/observer</class>
|
157 |
+
<method>afterShipmentRemoved</method>
|
158 |
+
</pp_track_delete>
|
159 |
+
</observers>
|
160 |
+
</sales_order_shipment_track_delete_after>
|
161 |
+
<controller_action_predispatch_shipping_tracking_popup>
|
162 |
+
<observers>
|
163 |
+
<pp_tracking_popup_predispatch>
|
164 |
+
<type>singleton</type>
|
165 |
+
<class>pptrack/observer</class>
|
166 |
+
<method>trackingPopupPreDispatch</method>
|
167 |
+
</pp_tracking_popup_predispatch>
|
168 |
+
</observers>
|
169 |
+
</controller_action_predispatch_shipping_tracking_popup>
|
170 |
+
<admin_system_config_changed_section_pp_section_carriers>
|
171 |
+
<observers>
|
172 |
+
<module_name>
|
173 |
+
<type>singleton</type>
|
174 |
+
<class>pptrack/observer</class>
|
175 |
+
<method>saveCarriers</method>
|
176 |
+
</module_name>
|
177 |
+
</observers>
|
178 |
+
</admin_system_config_changed_section_pp_section_carriers>
|
179 |
+
</events>
|
180 |
+
<template>
|
181 |
+
<email>
|
182 |
+
<packpin_delivered_email>
|
183 |
+
<label>Packpin Delivered Notification Email</label>
|
184 |
+
<file>packpin/packpin_delivered_email.html</file>
|
185 |
+
<type>html</type>
|
186 |
+
</packpin_delivered_email>
|
187 |
+
<packpin_exception_email>
|
188 |
+
<label>Packpin Exception Notification Email</label>
|
189 |
+
<file>packpin/packpin_exception_email.html</file>
|
190 |
+
<type>html</type>
|
191 |
+
</packpin_exception_email>
|
192 |
+
<packpin_failed_attempt_email>
|
193 |
+
<label>Packpin Failed Attempt Notification Email</label>
|
194 |
+
<file>packpin/packpin_failed_attempt_email.html</file>
|
195 |
+
<type>html</type>
|
196 |
+
</packpin_failed_attempt_email>
|
197 |
+
<packpin_in_transit_email>
|
198 |
+
<label>Packpin in Transit Notification Email</label>
|
199 |
+
<file>packpin/packpin_in_transit_email.html</file>
|
200 |
+
<type>html</type>
|
201 |
+
</packpin_in_transit_email>
|
202 |
+
<packpin_info_received_email>
|
203 |
+
<label>Packpin Info Received Notification Email</label>
|
204 |
+
<file>packpin/packpin_info_received_email.html</file>
|
205 |
+
<type>html</type>
|
206 |
+
</packpin_info_received_email>
|
207 |
+
<packpin_out_for_delivery_email>
|
208 |
+
<label>Packpin Out for Delivery Notification Email</label>
|
209 |
+
<file>packpin/packpin_out_for_delivery_email.html</file>
|
210 |
+
<type>html</type>
|
211 |
+
</packpin_out_for_delivery_email>
|
212 |
+
</email>
|
213 |
+
</template>
|
214 |
+
</global>
|
215 |
+
<crontab>
|
216 |
+
<jobs>
|
217 |
+
<pptrack_check_tracks>
|
218 |
+
<schedule>
|
219 |
+
<cron_expr>1 */2 * * *</cron_expr>
|
220 |
+
</schedule>
|
221 |
+
<run>
|
222 |
+
<model>pptrack/observer::cron</model>
|
223 |
+
</run>
|
224 |
+
</pptrack_check_tracks>
|
225 |
+
</jobs>
|
226 |
+
</crontab>
|
227 |
+
<admin>
|
228 |
+
<routers>
|
229 |
+
<adminhtml>
|
230 |
+
<args>
|
231 |
+
<modules>
|
232 |
+
<Packpin_Pptrack before="Mage_Adminhtml">Packpin_Pptrack_Adminhtml</Packpin_Pptrack>
|
233 |
+
</modules>
|
234 |
+
</args>
|
235 |
+
</adminhtml>
|
236 |
+
</routers>
|
237 |
+
</admin>
|
238 |
+
<adminhtml>
|
239 |
+
<translate>
|
240 |
+
<modules>
|
241 |
+
<Packpin_Pptrack>
|
242 |
+
<files>
|
243 |
+
<default>Packpin_Pptrack.csv</default>
|
244 |
+
</files>
|
245 |
+
</Packpin_Pptrack>
|
246 |
+
</modules>
|
247 |
+
</translate>
|
248 |
+
<layout>
|
249 |
+
<updates>
|
250 |
+
<pptrack>
|
251 |
+
<file>pptrack.xml</file>
|
252 |
+
</pptrack>
|
253 |
+
</updates>
|
254 |
+
</layout>
|
255 |
+
<events>
|
256 |
+
<core_block_abstract_prepare_layout_after>
|
257 |
+
<observers>
|
258 |
+
<Packpin_Pptrack>
|
259 |
+
<class>pptrack/observer</class>
|
260 |
+
<method>coreBlockAbstractPrepareLayoutAfter</method>
|
261 |
+
</Packpin_Pptrack>
|
262 |
+
</observers>
|
263 |
+
</core_block_abstract_prepare_layout_after>
|
264 |
+
<core_block_abstract_to_html_after>
|
265 |
+
<observers>
|
266 |
+
<Packpin_Pptrack>
|
267 |
+
<class>pptrack/observer</class>
|
268 |
+
<method>coreBlockAbstractToHtmlAfter</method>
|
269 |
+
</Packpin_Pptrack>
|
270 |
+
</observers>
|
271 |
+
</core_block_abstract_to_html_after>
|
272 |
+
</events>
|
273 |
+
</adminhtml>
|
274 |
+
<default>
|
275 |
+
<pp_section_setttings>
|
276 |
+
<settings>
|
277 |
+
<status>1</status>
|
278 |
+
</settings>
|
279 |
+
<crosssell>
|
280 |
+
<cross_sell_page>1</cross_sell_page>
|
281 |
+
<cross_sell_email>1</cross_sell_email>
|
282 |
+
<cross_sell_page_items>6</cross_sell_page_items>
|
283 |
+
<cross_sell_email_items>4</cross_sell_email_items>
|
284 |
+
<cross_sell_page_type>products</cross_sell_page_type>
|
285 |
+
<cross_sell_email_type>products</cross_sell_email_type>
|
286 |
+
</crosssell>
|
287 |
+
<advanced>
|
288 |
+
<trigger_shipped_email>0</trigger_shipped_email>
|
289 |
+
</advanced>
|
290 |
+
</pp_section_setttings>
|
291 |
+
<pp_section_notification_emails>
|
292 |
+
<info_received>
|
293 |
+
<enabled_client>1</enabled_client>
|
294 |
+
<identity>general</identity>
|
295 |
+
</info_received>
|
296 |
+
<in_transit>
|
297 |
+
<enabled_client>1</enabled_client>
|
298 |
+
<identity>general</identity>
|
299 |
+
</in_transit>
|
300 |
+
<out_for_delivery>
|
301 |
+
<enabled_client>1</enabled_client>
|
302 |
+
<identity>general</identity>
|
303 |
+
</out_for_delivery>
|
304 |
+
<delivered>
|
305 |
+
<enabled_client>1</enabled_client>
|
306 |
+
<identity>general</identity>
|
307 |
+
</delivered>
|
308 |
+
<exception>
|
309 |
+
<enabled_client>1</enabled_client>
|
310 |
+
<identity>general</identity>
|
311 |
+
</exception>
|
312 |
+
<failed_attempt>
|
313 |
+
<enabled_client>1</enabled_client>
|
314 |
+
<identity>general</identity>
|
315 |
+
</failed_attempt>
|
316 |
+
</pp_section_notification_emails>
|
317 |
+
</default>
|
318 |
</config>
|
app/code/community/Packpin/Pptrack/etc/system.xml
CHANGED
@@ -1,595 +1,595 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<tabs>
|
4 |
-
<pp_tab translate="label" module="pptrack">
|
5 |
-
<label>Packpin</label>
|
6 |
-
<sort_order>51000</sort_order>
|
7 |
-
</pp_tab>
|
8 |
-
</tabs>
|
9 |
-
<sections>
|
10 |
-
<pp_section_setttings translate="label" module="pptrack">
|
11 |
-
<label>Packpin Settings</label>
|
12 |
-
<class>packpin-settings</class>
|
13 |
-
<tab>pp_tab</tab>
|
14 |
-
<frontend_type>text</frontend_type>
|
15 |
-
<sort_order>51001</sort_order>
|
16 |
-
<show_in_default>1</show_in_default>
|
17 |
-
<show_in_website>1</show_in_website>
|
18 |
-
<show_in_store>1</show_in_store>
|
19 |
-
<groups>
|
20 |
-
<hint>
|
21 |
-
<frontend_model>pptrack/adminhtml_system_config_fieldset_hint</frontend_model>
|
22 |
-
<sort_order>0</sort_order>
|
23 |
-
<show_in_default>1</show_in_default>
|
24 |
-
<show_in_website>1</show_in_website>
|
25 |
-
<show_in_store>1</show_in_store>
|
26 |
-
</hint>
|
27 |
-
<settings translate="label">
|
28 |
-
<expanded>1</expanded>
|
29 |
-
<label>General settings</label>
|
30 |
-
<frontend_type>text</frontend_type>
|
31 |
-
<sort_order>1</sort_order>
|
32 |
-
<show_in_default>1</show_in_default>
|
33 |
-
<show_in_website>1</show_in_website>
|
34 |
-
<show_in_store>0</show_in_store>
|
35 |
-
<fields>
|
36 |
-
<status translate="label">
|
37 |
-
<label>Status</label>
|
38 |
-
<frontend_type>select</frontend_type>
|
39 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
40 |
-
<sort_order>11</sort_order>
|
41 |
-
<show_in_default>1</show_in_default>
|
42 |
-
<show_in_website>1</show_in_website>
|
43 |
-
<show_in_store>0</show_in_store>
|
44 |
-
</status>
|
45 |
-
<api_key translate="label">
|
46 |
-
<label><![CDATA[ API key <strong style="color:red">*</strong>]]></label>
|
47 |
-
<frontend_type>text</frontend_type>
|
48 |
-
<sort_order>5</sort_order>
|
49 |
-
<show_in_default>1</show_in_default>
|
50 |
-
<show_in_website>1</show_in_website>
|
51 |
-
<show_in_store>0</show_in_store>
|
52 |
-
<validate>required-entry</validate>
|
53 |
-
</api_key>
|
54 |
-
<last_cron>
|
55 |
-
<label>Last Cron Time</label>
|
56 |
-
<frontend_type>text</frontend_type>
|
57 |
-
<sort_order>101</sort_order>
|
58 |
-
<show_in_default>0</show_in_default>
|
59 |
-
<show_in_website>0</show_in_website>
|
60 |
-
<show_in_store>0</show_in_store>
|
61 |
-
</last_cron>
|
62 |
-
<last_carrier_update>
|
63 |
-
<label>Last Carrier Update</label>
|
64 |
-
<frontend_type>text</frontend_type>
|
65 |
-
<sort_order>102</sort_order>
|
66 |
-
<show_in_default>0</show_in_default>
|
67 |
-
<show_in_website>0</show_in_website>
|
68 |
-
<show_in_store>0</show_in_store>
|
69 |
-
</last_carrier_update>
|
70 |
-
<temp_api_key>
|
71 |
-
<label>Is key being used a temporary one</label>
|
72 |
-
<frontend_type>text</frontend_type>
|
73 |
-
<sort_order>104</sort_order>
|
74 |
-
<show_in_default>0</show_in_default>
|
75 |
-
<show_in_website>0</show_in_website>
|
76 |
-
<show_in_store>0</show_in_store>
|
77 |
-
</temp_api_key>
|
78 |
-
<temp_key_installed>
|
79 |
-
<label>Unix time when temp key has been installed</label>
|
80 |
-
<frontend_type>text</frontend_type>
|
81 |
-
<sort_order>105</sort_order>
|
82 |
-
<show_in_default>0</show_in_default>
|
83 |
-
<show_in_website>0</show_in_website>
|
84 |
-
<show_in_store>0</show_in_store>
|
85 |
-
</temp_key_installed>
|
86 |
-
<upgrade_note>
|
87 |
-
<label><![CDATA[<strong>How to setup</strong>]]></label>
|
88 |
-
<frontend_type>note</frontend_type>
|
89 |
-
<sort_order>1</sort_order>
|
90 |
-
<show_in_default>1</show_in_default>
|
91 |
-
<show_in_website>1</show_in_website>
|
92 |
-
<show_in_store>0</show_in_store>
|
93 |
-
<comment>
|
94 |
-
<![CDATA[
|
95 |
-
<ol>
|
96 |
-
<li style="margin-bottom:10px !important;"><b>We will generate a temporary API key for you during installation. </b></li>
|
97 |
-
<li style="margin-bottom:10px !important;">In order to use all the features, please follow these steps:</li>
|
98 |
-
<li style="margin-bottom:10px !important;">1. Sign up at <a href="https://panel.packpin.com/" target="_blank">panel.packpin.com</a></li>
|
99 |
-
<li style="margin-bottom:10px !important;">2. Go to <a href="https://panel.packpin.com/api_keys" taget="_blank">"API keys"</a> and generate new key</li>
|
100 |
-
<li style="margin-bottom:10px !important;">3. Copy API key and paste to the field below</li>
|
101 |
-
<li>4. Now the plugin is active and running</li>
|
102 |
-
</ol>
|
103 |
-
]]>
|
104 |
-
</comment>
|
105 |
-
</upgrade_note>
|
106 |
-
<disable_default_carriers translate="label">
|
107 |
-
<label>Disable default carriers</label>
|
108 |
-
<frontend_type>select</frontend_type>
|
109 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
110 |
-
<sort_order>20</sort_order>
|
111 |
-
<show_in_default>1</show_in_default>
|
112 |
-
<show_in_website>1</show_in_website>
|
113 |
-
<show_in_store>0</show_in_store>
|
114 |
-
</disable_default_carriers>
|
115 |
-
<pp_enable_notifications translate="label">
|
116 |
-
<backend_model>packpinpptrackvalidation/enableNotifications</backend_model>
|
117 |
-
<label>Enable Notifications</label>
|
118 |
-
<frontend_type>select</frontend_type>
|
119 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
120 |
-
<sort_order>21</sort_order>
|
121 |
-
<show_in_default>1</show_in_default>
|
122 |
-
<show_in_website>1</show_in_website>
|
123 |
-
<show_in_store>0</show_in_store>
|
124 |
-
<comment>In order to enable notifications we will create SOAP/XML-RPC role and user.</comment>
|
125 |
-
</pp_enable_notifications>
|
126 |
-
</fields>
|
127 |
-
</settings>
|
128 |
-
<crosssell>
|
129 |
-
<expanded>1</expanded>
|
130 |
-
<label>Cross-sell settings</label>
|
131 |
-
<frontend_type>text</frontend_type>
|
132 |
-
<sort_order>2</sort_order>
|
133 |
-
<show_in_default>1</show_in_default>
|
134 |
-
<show_in_website>1</show_in_website>
|
135 |
-
<show_in_store>0</show_in_store>
|
136 |
-
<fields>
|
137 |
-
<cross_sell_page translate="label">
|
138 |
-
<label>Show cross-sell items on shipment information page</label>
|
139 |
-
<frontend_type>select</frontend_type>
|
140 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
141 |
-
<sort_order>30</sort_order>
|
142 |
-
<show_in_default>1</show_in_default>
|
143 |
-
<show_in_website>1</show_in_website>
|
144 |
-
<show_in_store>0</show_in_store>
|
145 |
-
</cross_sell_page>
|
146 |
-
<cross_sell_page_type translate="label">
|
147 |
-
<label>What cross-sell items to show on page</label>
|
148 |
-
<frontend_type>select</frontend_type>
|
149 |
-
<source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage</source_model>
|
150 |
-
<sort_order>35</sort_order>
|
151 |
-
<show_in_default>1</show_in_default>
|
152 |
-
<show_in_website>1</show_in_website>
|
153 |
-
<show_in_store>0</show_in_store>
|
154 |
-
</cross_sell_page_type>
|
155 |
-
<cross_sell_page_items translate="label">
|
156 |
-
<label>Number of cross-sell products on page</label>
|
157 |
-
<frontend_type>text</frontend_type>
|
158 |
-
<sort_order>40</sort_order>
|
159 |
-
<show_in_default>1</show_in_default>
|
160 |
-
<show_in_website>1</show_in_website>
|
161 |
-
<show_in_store>0</show_in_store>
|
162 |
-
<comment>Recommended value is between 4 and 6</comment>
|
163 |
-
</cross_sell_page_items>
|
164 |
-
<cross_sell_page_image translate="label">
|
165 |
-
<label>Banner image</label>
|
166 |
-
<comment>Allowed file types: jpeg, gif, png.</comment>
|
167 |
-
<frontend_type>image</frontend_type>
|
168 |
-
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
169 |
-
<upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
|
170 |
-
<base_url type="media" scope_info="1">theme</base_url>
|
171 |
-
<sort_order>42</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 |
-
</cross_sell_page_image>
|
176 |
-
<cross_sell_page_image_url translate="label">
|
177 |
-
<label>Banner url</label>
|
178 |
-
<comment><![CDATA[
|
179 |
-
Should start with <b>http</b>
|
180 |
-
]]></comment>
|
181 |
-
<frontend_type>text</frontend_type>
|
182 |
-
<sort_order>44</sort_order>
|
183 |
-
<show_in_default>1</show_in_default>
|
184 |
-
<show_in_website>1</show_in_website>
|
185 |
-
<show_in_store>0</show_in_store>
|
186 |
-
</cross_sell_page_image_url>
|
187 |
-
<cross_sell_page_script translate="label">
|
188 |
-
<label>Script</label>
|
189 |
-
<frontend_type>textarea</frontend_type>
|
190 |
-
<sort_order>46</sort_order>
|
191 |
-
<show_in_default>1</show_in_default>
|
192 |
-
<show_in_website>1</show_in_website>
|
193 |
-
<show_in_store>0</show_in_store>
|
194 |
-
<comment>Can enter HTML or JavaScript code here</comment>
|
195 |
-
</cross_sell_page_script>
|
196 |
-
|
197 |
-
|
198 |
-
<cross_sell_email translate="label">
|
199 |
-
<label>Show cross-sell items in notification emails</label>
|
200 |
-
<frontend_type>select</frontend_type>
|
201 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
202 |
-
<sort_order>50</sort_order>
|
203 |
-
<show_in_default>1</show_in_default>
|
204 |
-
<show_in_website>1</show_in_website>
|
205 |
-
<show_in_store>0</show_in_store>
|
206 |
-
</cross_sell_email>
|
207 |
-
<cross_sell_email_type translate="label">
|
208 |
-
<label>What cross-sell items to show in email</label>
|
209 |
-
<frontend_type>select</frontend_type>
|
210 |
-
<source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews</source_model>
|
211 |
-
<sort_order>55</sort_order>
|
212 |
-
<show_in_default>1</show_in_default>
|
213 |
-
<show_in_website>1</show_in_website>
|
214 |
-
<show_in_store>0</show_in_store>
|
215 |
-
</cross_sell_email_type>
|
216 |
-
<cross_sell_email_items translate="label">
|
217 |
-
<label>Number of cross-sell items in emails</label>
|
218 |
-
<frontend_type>text</frontend_type>
|
219 |
-
<sort_order>60</sort_order>
|
220 |
-
<show_in_default>1</show_in_default>
|
221 |
-
<show_in_website>1</show_in_website>
|
222 |
-
<show_in_store>0</show_in_store>
|
223 |
-
</cross_sell_email_items>
|
224 |
-
<cross_sell_email_image translate="label">
|
225 |
-
<label>Banner image</label>
|
226 |
-
<comment>Height should be at least 100px.</comment>
|
227 |
-
<frontend_type>image</frontend_type>
|
228 |
-
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
229 |
-
<upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
|
230 |
-
<base_url type="media" scope_info="1">theme</base_url>
|
231 |
-
<sort_order>62</sort_order>
|
232 |
-
<show_in_default>1</show_in_default>
|
233 |
-
<show_in_website>1</show_in_website>
|
234 |
-
<show_in_store>0</show_in_store>
|
235 |
-
</cross_sell_email_image>
|
236 |
-
<cross_sell_email_image_url translate="label">
|
237 |
-
<label>Banner url</label>
|
238 |
-
<comment><![CDATA[
|
239 |
-
Should start with <b>http</b>
|
240 |
-
]]></comment>
|
241 |
-
<frontend_type>text</frontend_type>
|
242 |
-
<sort_order>64</sort_order>
|
243 |
-
<show_in_default>1</show_in_default>
|
244 |
-
<show_in_website>1</show_in_website>
|
245 |
-
<show_in_store>0</show_in_store>
|
246 |
-
</cross_sell_email_image_url>
|
247 |
-
<cross_sell_scripts>
|
248 |
-
<frontend_type>text</frontend_type>
|
249 |
-
<frontend_model>pptrack/adminhtml_system_config_fieldset_scripts</frontend_model>
|
250 |
-
<sort_order>70</sort_order>
|
251 |
-
<show_in_default>1</show_in_default>
|
252 |
-
<show_in_website>1</show_in_website>
|
253 |
-
<show_in_store>0</show_in_store>
|
254 |
-
</cross_sell_scripts>
|
255 |
-
</fields>
|
256 |
-
</crosssell>
|
257 |
-
<advanced translate="label">
|
258 |
-
<expanded>1</expanded>
|
259 |
-
<label>Advanced</label>
|
260 |
-
<frontend_type>text</frontend_type>
|
261 |
-
<sort_order>4</sort_order>
|
262 |
-
<show_in_default>1</show_in_default>
|
263 |
-
<show_in_website>1</show_in_website>
|
264 |
-
<show_in_store>0</show_in_store>
|
265 |
-
<fields>
|
266 |
-
<trigger_shipped_email translate="label">
|
267 |
-
<label>Automatically send email to client when tracking information has been added</label>
|
268 |
-
<frontend_type>select</frontend_type>
|
269 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
270 |
-
<sort_order>1</sort_order>
|
271 |
-
<show_in_default>1</show_in_default>
|
272 |
-
<show_in_website>1</show_in_website>
|
273 |
-
<show_in_store>0</show_in_store>
|
274 |
-
<comment>Should only be enabled if your tracking information is being populated through 3rd party connector</comment>
|
275 |
-
</trigger_shipped_email>
|
276 |
-
</fields>
|
277 |
-
</advanced>
|
278 |
-
</groups>
|
279 |
-
</pp_section_setttings>
|
280 |
-
|
281 |
-
<pp_section_notification_emails translate="label" module="sales">
|
282 |
-
<label>Notification Emails</label>
|
283 |
-
<class>packpin-settings</class>
|
284 |
-
<tab>pp_tab</tab>
|
285 |
-
<frontend_type>text</frontend_type>
|
286 |
-
<sort_order>51002</sort_order>
|
287 |
-
<show_in_default>1</show_in_default>
|
288 |
-
<show_in_website>1</show_in_website>
|
289 |
-
<show_in_store>1</show_in_store>
|
290 |
-
<groups>
|
291 |
-
<info_received translate="label">
|
292 |
-
<label>Info Received</label>
|
293 |
-
<frontend_type>text</frontend_type>
|
294 |
-
<sort_order>1</sort_order>
|
295 |
-
<show_in_default>1</show_in_default>
|
296 |
-
<show_in_website>1</show_in_website>
|
297 |
-
<show_in_store>1</show_in_store>
|
298 |
-
<fields>
|
299 |
-
<enabled_client translate="label">
|
300 |
-
<label>Enabled for client</label>
|
301 |
-
<frontend_type>select</frontend_type>
|
302 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
303 |
-
<sort_order>0</sort_order>
|
304 |
-
<show_in_default>1</show_in_default>
|
305 |
-
<show_in_website>1</show_in_website>
|
306 |
-
<show_in_store>1</show_in_store>
|
307 |
-
</enabled_client>
|
308 |
-
<enabled_owner translate="label">
|
309 |
-
<label>Enabled for owner</label>
|
310 |
-
<frontend_type>select</frontend_type>
|
311 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
312 |
-
<sort_order>0</sort_order>
|
313 |
-
<show_in_default>1</show_in_default>
|
314 |
-
<show_in_website>1</show_in_website>
|
315 |
-
<show_in_store>1</show_in_store>
|
316 |
-
</enabled_owner>
|
317 |
-
<identity translate="label">
|
318 |
-
<label>Sender Email</label>
|
319 |
-
<frontend_type>select</frontend_type>
|
320 |
-
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
321 |
-
<sort_order>1</sort_order>
|
322 |
-
<show_in_default>1</show_in_default>
|
323 |
-
<show_in_website>1</show_in_website>
|
324 |
-
<show_in_store>1</show_in_store>
|
325 |
-
</identity>
|
326 |
-
<template translate="label">
|
327 |
-
<label>Template</label>
|
328 |
-
<frontend_type>select</frontend_type>
|
329 |
-
<source_model>adminhtml/system_config_source_email_template</source_model>
|
330 |
-
<sort_order>2</sort_order>
|
331 |
-
<show_in_default>1</show_in_default>
|
332 |
-
<show_in_website>1</show_in_website>
|
333 |
-
<show_in_store>1</show_in_store>
|
334 |
-
</template>
|
335 |
-
</fields>
|
336 |
-
</info_received>
|
337 |
-
|
338 |
-
<in_transit translate="label">
|
339 |
-
<label>In Transit</label>
|
340 |
-
<frontend_type>text</frontend_type>
|
341 |
-
<sort_order>2</sort_order>
|
342 |
-
<show_in_default>1</show_in_default>
|
343 |
-
<show_in_website>1</show_in_website>
|
344 |
-
<show_in_store>1</show_in_store>
|
345 |
-
<fields>
|
346 |
-
<enabled_client translate="label">
|
347 |
-
<label>Enabled for client</label>
|
348 |
-
<frontend_type>select</frontend_type>
|
349 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
350 |
-
<sort_order>0</sort_order>
|
351 |
-
<show_in_default>1</show_in_default>
|
352 |
-
<show_in_website>1</show_in_website>
|
353 |
-
<show_in_store>1</show_in_store>
|
354 |
-
</enabled_client>
|
355 |
-
<enabled_owner translate="label">
|
356 |
-
<label>Enabled for owner</label>
|
357 |
-
<frontend_type>select</frontend_type>
|
358 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
359 |
-
<sort_order>0</sort_order>
|
360 |
-
<show_in_default>1</show_in_default>
|
361 |
-
<show_in_website>1</show_in_website>
|
362 |
-
<show_in_store>1</show_in_store>
|
363 |
-
</enabled_owner>
|
364 |
-
<identity translate="label">
|
365 |
-
<label>Sender Email</label>
|
366 |
-
<frontend_type>select</frontend_type>
|
367 |
-
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
368 |
-
<sort_order>1</sort_order>
|
369 |
-
<show_in_default>1</show_in_default>
|
370 |
-
<show_in_website>1</show_in_website>
|
371 |
-
<show_in_store>1</show_in_store>
|
372 |
-
</identity>
|
373 |
-
<template translate="label">
|
374 |
-
<label>Template</label>
|
375 |
-
<frontend_type>select</frontend_type>
|
376 |
-
<source_model>adminhtml/system_config_source_email_template</source_model>
|
377 |
-
<sort_order>2</sort_order>
|
378 |
-
<show_in_default>1</show_in_default>
|
379 |
-
<show_in_website>1</show_in_website>
|
380 |
-
<show_in_store>1</show_in_store>
|
381 |
-
</template>
|
382 |
-
</fields>
|
383 |
-
</in_transit>
|
384 |
-
|
385 |
-
<out_for_delivery translate="label">
|
386 |
-
<label>Out for Delivery</label>
|
387 |
-
<frontend_type>text</frontend_type>
|
388 |
-
<sort_order>3</sort_order>
|
389 |
-
<show_in_default>1</show_in_default>
|
390 |
-
<show_in_website>1</show_in_website>
|
391 |
-
<show_in_store>1</show_in_store>
|
392 |
-
<fields>
|
393 |
-
<enabled_client translate="label">
|
394 |
-
<label>Enabled for client</label>
|
395 |
-
<frontend_type>select</frontend_type>
|
396 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
397 |
-
<sort_order>0</sort_order>
|
398 |
-
<show_in_default>1</show_in_default>
|
399 |
-
<show_in_website>1</show_in_website>
|
400 |
-
<show_in_store>1</show_in_store>
|
401 |
-
</enabled_client>
|
402 |
-
<enabled_owner translate="label">
|
403 |
-
<label>Enabled for owner</label>
|
404 |
-
<frontend_type>select</frontend_type>
|
405 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
406 |
-
<sort_order>0</sort_order>
|
407 |
-
<show_in_default>1</show_in_default>
|
408 |
-
<show_in_website>1</show_in_website>
|
409 |
-
<show_in_store>1</show_in_store>
|
410 |
-
</enabled_owner>
|
411 |
-
<identity translate="label">
|
412 |
-
<label>Sender Email</label>
|
413 |
-
<frontend_type>select</frontend_type>
|
414 |
-
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
415 |
-
<sort_order>1</sort_order>
|
416 |
-
<show_in_default>1</show_in_default>
|
417 |
-
<show_in_website>1</show_in_website>
|
418 |
-
<show_in_store>1</show_in_store>
|
419 |
-
</identity>
|
420 |
-
<template translate="label">
|
421 |
-
<label>Template</label>
|
422 |
-
<frontend_type>select</frontend_type>
|
423 |
-
<source_model>adminhtml/system_config_source_email_template</source_model>
|
424 |
-
<sort_order>2</sort_order>
|
425 |
-
<show_in_default>1</show_in_default>
|
426 |
-
<show_in_website>1</show_in_website>
|
427 |
-
<show_in_store>1</show_in_store>
|
428 |
-
</template>
|
429 |
-
</fields>
|
430 |
-
</out_for_delivery>
|
431 |
-
<delivered translate="label">
|
432 |
-
<label>Delivered</label>
|
433 |
-
<frontend_type>text</frontend_type>
|
434 |
-
<sort_order>4</sort_order>
|
435 |
-
<show_in_default>1</show_in_default>
|
436 |
-
<show_in_website>1</show_in_website>
|
437 |
-
<show_in_store>1</show_in_store>
|
438 |
-
<fields>
|
439 |
-
<enabled_client translate="label">
|
440 |
-
<label>Enabled for client</label>
|
441 |
-
<frontend_type>select</frontend_type>
|
442 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
443 |
-
<sort_order>0</sort_order>
|
444 |
-
<show_in_default>1</show_in_default>
|
445 |
-
<show_in_website>1</show_in_website>
|
446 |
-
<show_in_store>1</show_in_store>
|
447 |
-
</enabled_client>
|
448 |
-
<enabled_owner translate="label">
|
449 |
-
<label>Enabled for owner</label>
|
450 |
-
<frontend_type>select</frontend_type>
|
451 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
452 |
-
<sort_order>0</sort_order>
|
453 |
-
<show_in_default>1</show_in_default>
|
454 |
-
<show_in_website>1</show_in_website>
|
455 |
-
<show_in_store>1</show_in_store>
|
456 |
-
</enabled_owner>
|
457 |
-
<identity translate="label">
|
458 |
-
<label>Sender Email</label>
|
459 |
-
<frontend_type>select</frontend_type>
|
460 |
-
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
461 |
-
<sort_order>1</sort_order>
|
462 |
-
<show_in_default>1</show_in_default>
|
463 |
-
<show_in_website>1</show_in_website>
|
464 |
-
<show_in_store>1</show_in_store>
|
465 |
-
</identity>
|
466 |
-
<template translate="label">
|
467 |
-
<label>Template</label>
|
468 |
-
<frontend_type>select</frontend_type>
|
469 |
-
<source_model>adminhtml/system_config_source_email_template</source_model>
|
470 |
-
<sort_order>2</sort_order>
|
471 |
-
<show_in_default>1</show_in_default>
|
472 |
-
<show_in_website>1</show_in_website>
|
473 |
-
<show_in_store>1</show_in_store>
|
474 |
-
</template>
|
475 |
-
</fields>
|
476 |
-
</delivered>
|
477 |
-
|
478 |
-
<exception translate="label">
|
479 |
-
<label>Exception</label>
|
480 |
-
<frontend_type>text</frontend_type>
|
481 |
-
<sort_order>5</sort_order>
|
482 |
-
<show_in_default>1</show_in_default>
|
483 |
-
<show_in_website>1</show_in_website>
|
484 |
-
<show_in_store>1</show_in_store>
|
485 |
-
<fields>
|
486 |
-
<enabled_client translate="label">
|
487 |
-
<label>Enabled for client</label>
|
488 |
-
<frontend_type>select</frontend_type>
|
489 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
490 |
-
<sort_order>0</sort_order>
|
491 |
-
<show_in_default>1</show_in_default>
|
492 |
-
<show_in_website>1</show_in_website>
|
493 |
-
<show_in_store>1</show_in_store>
|
494 |
-
</enabled_client>
|
495 |
-
<enabled_owner translate="label">
|
496 |
-
<label>Enabled for owner</label>
|
497 |
-
<frontend_type>select</frontend_type>
|
498 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
499 |
-
<sort_order>0</sort_order>
|
500 |
-
<show_in_default>1</show_in_default>
|
501 |
-
<show_in_website>1</show_in_website>
|
502 |
-
<show_in_store>1</show_in_store>
|
503 |
-
</enabled_owner>
|
504 |
-
<identity translate="label">
|
505 |
-
<label>Sender Email</label>
|
506 |
-
<frontend_type>select</frontend_type>
|
507 |
-
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
508 |
-
<sort_order>1</sort_order>
|
509 |
-
<show_in_default>1</show_in_default>
|
510 |
-
<show_in_website>1</show_in_website>
|
511 |
-
<show_in_store>1</show_in_store>
|
512 |
-
</identity>
|
513 |
-
<template translate="label">
|
514 |
-
<label>Template</label>
|
515 |
-
<frontend_type>select</frontend_type>
|
516 |
-
<source_model>adminhtml/system_config_source_email_template</source_model>
|
517 |
-
<sort_order>2</sort_order>
|
518 |
-
<show_in_default>1</show_in_default>
|
519 |
-
<show_in_website>1</show_in_website>
|
520 |
-
<show_in_store>1</show_in_store>
|
521 |
-
</template>
|
522 |
-
</fields>
|
523 |
-
</exception>
|
524 |
-
<failed_attempt translate="label">
|
525 |
-
<label>Failed Attempt</label>
|
526 |
-
<frontend_type>text</frontend_type>
|
527 |
-
<sort_order>6</sort_order>
|
528 |
-
<show_in_default>1</show_in_default>
|
529 |
-
<show_in_website>1</show_in_website>
|
530 |
-
<show_in_store>1</show_in_store>
|
531 |
-
<fields>
|
532 |
-
<enabled_client translate="label">
|
533 |
-
<label>Enabled for client</label>
|
534 |
-
<frontend_type>select</frontend_type>
|
535 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
536 |
-
<sort_order>0</sort_order>
|
537 |
-
<show_in_default>1</show_in_default>
|
538 |
-
<show_in_website>1</show_in_website>
|
539 |
-
<show_in_store>1</show_in_store>
|
540 |
-
</enabled_client>
|
541 |
-
<enabled_owner translate="label">
|
542 |
-
<label>Enabled for owner</label>
|
543 |
-
<frontend_type>select</frontend_type>
|
544 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
545 |
-
<sort_order>0</sort_order>
|
546 |
-
<show_in_default>1</show_in_default>
|
547 |
-
<show_in_website>1</show_in_website>
|
548 |
-
<show_in_store>1</show_in_store>
|
549 |
-
</enabled_owner>
|
550 |
-
<identity translate="label">
|
551 |
-
<label>Sender Email</label>
|
552 |
-
<frontend_type>select</frontend_type>
|
553 |
-
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
554 |
-
<sort_order>1</sort_order>
|
555 |
-
<show_in_default>1</show_in_default>
|
556 |
-
<show_in_website>1</show_in_website>
|
557 |
-
<show_in_store>1</show_in_store>
|
558 |
-
</identity>
|
559 |
-
<template translate="label">
|
560 |
-
<label>Template</label>
|
561 |
-
<frontend_type>select</frontend_type>
|
562 |
-
<source_model>adminhtml/system_config_source_email_template</source_model>
|
563 |
-
<sort_order>2</sort_order>
|
564 |
-
<show_in_default>1</show_in_default>
|
565 |
-
<show_in_website>1</show_in_website>
|
566 |
-
<show_in_store>1</show_in_store>
|
567 |
-
</template>
|
568 |
-
</fields>
|
569 |
-
</failed_attempt>
|
570 |
-
</groups>
|
571 |
-
</pp_section_notification_emails>
|
572 |
-
<pp_section_carriers>
|
573 |
-
<label>Carrier Settings</label>
|
574 |
-
<class>packpin-settings</class>
|
575 |
-
<tab>pp_tab</tab>
|
576 |
-
<frontend_type>text</frontend_type>
|
577 |
-
<sort_order>51003</sort_order>
|
578 |
-
<show_in_default>1</show_in_default>
|
579 |
-
<show_in_website>1</show_in_website>
|
580 |
-
<show_in_store>0</show_in_store>
|
581 |
-
<groups>
|
582 |
-
<carriers translate="label">
|
583 |
-
<expanded>1</expanded>
|
584 |
-
<label>Enabled Carriers</label>
|
585 |
-
<frontend_type>text</frontend_type>
|
586 |
-
<frontend_model>pptrack/adminhtml_system_config_form_fieldset_carrier</frontend_model>
|
587 |
-
<sort_order>1</sort_order>
|
588 |
-
<show_in_default>1</show_in_default>
|
589 |
-
<show_in_website>1</show_in_website>
|
590 |
-
<show_in_store>0</show_in_store>
|
591 |
-
</carriers>
|
592 |
-
</groups>
|
593 |
-
</pp_section_carriers>
|
594 |
-
</sections>
|
595 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<pp_tab translate="label" module="pptrack">
|
5 |
+
<label>Packpin</label>
|
6 |
+
<sort_order>51000</sort_order>
|
7 |
+
</pp_tab>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<pp_section_setttings translate="label" module="pptrack">
|
11 |
+
<label>Packpin Settings</label>
|
12 |
+
<class>packpin-settings</class>
|
13 |
+
<tab>pp_tab</tab>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>51001</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>1</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<groups>
|
20 |
+
<hint>
|
21 |
+
<frontend_model>pptrack/adminhtml_system_config_fieldset_hint</frontend_model>
|
22 |
+
<sort_order>0</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
</hint>
|
27 |
+
<settings translate="label">
|
28 |
+
<expanded>1</expanded>
|
29 |
+
<label>General settings</label>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>1</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>0</show_in_store>
|
35 |
+
<fields>
|
36 |
+
<status translate="label">
|
37 |
+
<label>Status</label>
|
38 |
+
<frontend_type>select</frontend_type>
|
39 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
40 |
+
<sort_order>11</sort_order>
|
41 |
+
<show_in_default>1</show_in_default>
|
42 |
+
<show_in_website>1</show_in_website>
|
43 |
+
<show_in_store>0</show_in_store>
|
44 |
+
</status>
|
45 |
+
<api_key translate="label">
|
46 |
+
<label><![CDATA[ API key <strong style="color:red">*</strong>]]></label>
|
47 |
+
<frontend_type>text</frontend_type>
|
48 |
+
<sort_order>5</sort_order>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>0</show_in_store>
|
52 |
+
<validate>required-entry</validate>
|
53 |
+
</api_key>
|
54 |
+
<last_cron>
|
55 |
+
<label>Last Cron Time</label>
|
56 |
+
<frontend_type>text</frontend_type>
|
57 |
+
<sort_order>101</sort_order>
|
58 |
+
<show_in_default>0</show_in_default>
|
59 |
+
<show_in_website>0</show_in_website>
|
60 |
+
<show_in_store>0</show_in_store>
|
61 |
+
</last_cron>
|
62 |
+
<last_carrier_update>
|
63 |
+
<label>Last Carrier Update</label>
|
64 |
+
<frontend_type>text</frontend_type>
|
65 |
+
<sort_order>102</sort_order>
|
66 |
+
<show_in_default>0</show_in_default>
|
67 |
+
<show_in_website>0</show_in_website>
|
68 |
+
<show_in_store>0</show_in_store>
|
69 |
+
</last_carrier_update>
|
70 |
+
<temp_api_key>
|
71 |
+
<label>Is key being used a temporary one</label>
|
72 |
+
<frontend_type>text</frontend_type>
|
73 |
+
<sort_order>104</sort_order>
|
74 |
+
<show_in_default>0</show_in_default>
|
75 |
+
<show_in_website>0</show_in_website>
|
76 |
+
<show_in_store>0</show_in_store>
|
77 |
+
</temp_api_key>
|
78 |
+
<temp_key_installed>
|
79 |
+
<label>Unix time when temp key has been installed</label>
|
80 |
+
<frontend_type>text</frontend_type>
|
81 |
+
<sort_order>105</sort_order>
|
82 |
+
<show_in_default>0</show_in_default>
|
83 |
+
<show_in_website>0</show_in_website>
|
84 |
+
<show_in_store>0</show_in_store>
|
85 |
+
</temp_key_installed>
|
86 |
+
<upgrade_note>
|
87 |
+
<label><![CDATA[<strong>How to setup</strong>]]></label>
|
88 |
+
<frontend_type>note</frontend_type>
|
89 |
+
<sort_order>1</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>0</show_in_store>
|
93 |
+
<comment>
|
94 |
+
<![CDATA[
|
95 |
+
<ol>
|
96 |
+
<li style="margin-bottom:10px !important;"><b>We will generate a temporary API key for you during installation. </b></li>
|
97 |
+
<li style="margin-bottom:10px !important;">In order to use all the features, please follow these steps:</li>
|
98 |
+
<li style="margin-bottom:10px !important;">1. Sign up at <a href="https://panel.packpin.com/" target="_blank">panel.packpin.com</a></li>
|
99 |
+
<li style="margin-bottom:10px !important;">2. Go to <a href="https://panel.packpin.com/api_keys" taget="_blank">"API keys"</a> and generate new key</li>
|
100 |
+
<li style="margin-bottom:10px !important;">3. Copy API key and paste to the field below</li>
|
101 |
+
<li>4. Now the plugin is active and running</li>
|
102 |
+
</ol>
|
103 |
+
]]>
|
104 |
+
</comment>
|
105 |
+
</upgrade_note>
|
106 |
+
<disable_default_carriers translate="label">
|
107 |
+
<label>Disable default carriers</label>
|
108 |
+
<frontend_type>select</frontend_type>
|
109 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
110 |
+
<sort_order>20</sort_order>
|
111 |
+
<show_in_default>1</show_in_default>
|
112 |
+
<show_in_website>1</show_in_website>
|
113 |
+
<show_in_store>0</show_in_store>
|
114 |
+
</disable_default_carriers>
|
115 |
+
<pp_enable_notifications translate="label">
|
116 |
+
<backend_model>packpinpptrackvalidation/enableNotifications</backend_model>
|
117 |
+
<label>Enable Notifications</label>
|
118 |
+
<frontend_type>select</frontend_type>
|
119 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
120 |
+
<sort_order>21</sort_order>
|
121 |
+
<show_in_default>1</show_in_default>
|
122 |
+
<show_in_website>1</show_in_website>
|
123 |
+
<show_in_store>0</show_in_store>
|
124 |
+
<comment>In order to enable notifications we will create SOAP/XML-RPC role and user.</comment>
|
125 |
+
</pp_enable_notifications>
|
126 |
+
</fields>
|
127 |
+
</settings>
|
128 |
+
<crosssell>
|
129 |
+
<expanded>1</expanded>
|
130 |
+
<label>Cross-sell settings</label>
|
131 |
+
<frontend_type>text</frontend_type>
|
132 |
+
<sort_order>2</sort_order>
|
133 |
+
<show_in_default>1</show_in_default>
|
134 |
+
<show_in_website>1</show_in_website>
|
135 |
+
<show_in_store>0</show_in_store>
|
136 |
+
<fields>
|
137 |
+
<cross_sell_page translate="label">
|
138 |
+
<label>Show cross-sell items on shipment information page</label>
|
139 |
+
<frontend_type>select</frontend_type>
|
140 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
141 |
+
<sort_order>30</sort_order>
|
142 |
+
<show_in_default>1</show_in_default>
|
143 |
+
<show_in_website>1</show_in_website>
|
144 |
+
<show_in_store>0</show_in_store>
|
145 |
+
</cross_sell_page>
|
146 |
+
<cross_sell_page_type translate="label">
|
147 |
+
<label>What cross-sell items to show on page</label>
|
148 |
+
<frontend_type>select</frontend_type>
|
149 |
+
<source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage</source_model>
|
150 |
+
<sort_order>35</sort_order>
|
151 |
+
<show_in_default>1</show_in_default>
|
152 |
+
<show_in_website>1</show_in_website>
|
153 |
+
<show_in_store>0</show_in_store>
|
154 |
+
</cross_sell_page_type>
|
155 |
+
<cross_sell_page_items translate="label">
|
156 |
+
<label>Number of cross-sell products on page</label>
|
157 |
+
<frontend_type>text</frontend_type>
|
158 |
+
<sort_order>40</sort_order>
|
159 |
+
<show_in_default>1</show_in_default>
|
160 |
+
<show_in_website>1</show_in_website>
|
161 |
+
<show_in_store>0</show_in_store>
|
162 |
+
<comment>Recommended value is between 4 and 6</comment>
|
163 |
+
</cross_sell_page_items>
|
164 |
+
<cross_sell_page_image translate="label">
|
165 |
+
<label>Banner image</label>
|
166 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
167 |
+
<frontend_type>image</frontend_type>
|
168 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
169 |
+
<upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
|
170 |
+
<base_url type="media" scope_info="1">theme</base_url>
|
171 |
+
<sort_order>42</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 |
+
</cross_sell_page_image>
|
176 |
+
<cross_sell_page_image_url translate="label">
|
177 |
+
<label>Banner url</label>
|
178 |
+
<comment><![CDATA[
|
179 |
+
Should start with <b>http</b>
|
180 |
+
]]></comment>
|
181 |
+
<frontend_type>text</frontend_type>
|
182 |
+
<sort_order>44</sort_order>
|
183 |
+
<show_in_default>1</show_in_default>
|
184 |
+
<show_in_website>1</show_in_website>
|
185 |
+
<show_in_store>0</show_in_store>
|
186 |
+
</cross_sell_page_image_url>
|
187 |
+
<cross_sell_page_script translate="label">
|
188 |
+
<label>Script</label>
|
189 |
+
<frontend_type>textarea</frontend_type>
|
190 |
+
<sort_order>46</sort_order>
|
191 |
+
<show_in_default>1</show_in_default>
|
192 |
+
<show_in_website>1</show_in_website>
|
193 |
+
<show_in_store>0</show_in_store>
|
194 |
+
<comment>Can enter HTML or JavaScript code here</comment>
|
195 |
+
</cross_sell_page_script>
|
196 |
+
|
197 |
+
|
198 |
+
<cross_sell_email translate="label">
|
199 |
+
<label>Show cross-sell items in notification emails</label>
|
200 |
+
<frontend_type>select</frontend_type>
|
201 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
202 |
+
<sort_order>50</sort_order>
|
203 |
+
<show_in_default>1</show_in_default>
|
204 |
+
<show_in_website>1</show_in_website>
|
205 |
+
<show_in_store>0</show_in_store>
|
206 |
+
</cross_sell_email>
|
207 |
+
<cross_sell_email_type translate="label">
|
208 |
+
<label>What cross-sell items to show in email</label>
|
209 |
+
<frontend_type>select</frontend_type>
|
210 |
+
<source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews</source_model>
|
211 |
+
<sort_order>55</sort_order>
|
212 |
+
<show_in_default>1</show_in_default>
|
213 |
+
<show_in_website>1</show_in_website>
|
214 |
+
<show_in_store>0</show_in_store>
|
215 |
+
</cross_sell_email_type>
|
216 |
+
<cross_sell_email_items translate="label">
|
217 |
+
<label>Number of cross-sell items in emails</label>
|
218 |
+
<frontend_type>text</frontend_type>
|
219 |
+
<sort_order>60</sort_order>
|
220 |
+
<show_in_default>1</show_in_default>
|
221 |
+
<show_in_website>1</show_in_website>
|
222 |
+
<show_in_store>0</show_in_store>
|
223 |
+
</cross_sell_email_items>
|
224 |
+
<cross_sell_email_image translate="label">
|
225 |
+
<label>Banner image</label>
|
226 |
+
<comment>Height should be at least 100px.</comment>
|
227 |
+
<frontend_type>image</frontend_type>
|
228 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
229 |
+
<upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
|
230 |
+
<base_url type="media" scope_info="1">theme</base_url>
|
231 |
+
<sort_order>62</sort_order>
|
232 |
+
<show_in_default>1</show_in_default>
|
233 |
+
<show_in_website>1</show_in_website>
|
234 |
+
<show_in_store>0</show_in_store>
|
235 |
+
</cross_sell_email_image>
|
236 |
+
<cross_sell_email_image_url translate="label">
|
237 |
+
<label>Banner url</label>
|
238 |
+
<comment><![CDATA[
|
239 |
+
Should start with <b>http</b>
|
240 |
+
]]></comment>
|
241 |
+
<frontend_type>text</frontend_type>
|
242 |
+
<sort_order>64</sort_order>
|
243 |
+
<show_in_default>1</show_in_default>
|
244 |
+
<show_in_website>1</show_in_website>
|
245 |
+
<show_in_store>0</show_in_store>
|
246 |
+
</cross_sell_email_image_url>
|
247 |
+
<cross_sell_scripts>
|
248 |
+
<frontend_type>text</frontend_type>
|
249 |
+
<frontend_model>pptrack/adminhtml_system_config_fieldset_scripts</frontend_model>
|
250 |
+
<sort_order>70</sort_order>
|
251 |
+
<show_in_default>1</show_in_default>
|
252 |
+
<show_in_website>1</show_in_website>
|
253 |
+
<show_in_store>0</show_in_store>
|
254 |
+
</cross_sell_scripts>
|
255 |
+
</fields>
|
256 |
+
</crosssell>
|
257 |
+
<advanced translate="label">
|
258 |
+
<expanded>1</expanded>
|
259 |
+
<label>Advanced</label>
|
260 |
+
<frontend_type>text</frontend_type>
|
261 |
+
<sort_order>4</sort_order>
|
262 |
+
<show_in_default>1</show_in_default>
|
263 |
+
<show_in_website>1</show_in_website>
|
264 |
+
<show_in_store>0</show_in_store>
|
265 |
+
<fields>
|
266 |
+
<trigger_shipped_email translate="label">
|
267 |
+
<label>Automatically send email to client when tracking information has been added</label>
|
268 |
+
<frontend_type>select</frontend_type>
|
269 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
270 |
+
<sort_order>1</sort_order>
|
271 |
+
<show_in_default>1</show_in_default>
|
272 |
+
<show_in_website>1</show_in_website>
|
273 |
+
<show_in_store>0</show_in_store>
|
274 |
+
<comment>Should only be enabled if your tracking information is being populated through 3rd party connector</comment>
|
275 |
+
</trigger_shipped_email>
|
276 |
+
</fields>
|
277 |
+
</advanced>
|
278 |
+
</groups>
|
279 |
+
</pp_section_setttings>
|
280 |
+
|
281 |
+
<pp_section_notification_emails translate="label" module="sales">
|
282 |
+
<label>Notification Emails</label>
|
283 |
+
<class>packpin-settings</class>
|
284 |
+
<tab>pp_tab</tab>
|
285 |
+
<frontend_type>text</frontend_type>
|
286 |
+
<sort_order>51002</sort_order>
|
287 |
+
<show_in_default>1</show_in_default>
|
288 |
+
<show_in_website>1</show_in_website>
|
289 |
+
<show_in_store>1</show_in_store>
|
290 |
+
<groups>
|
291 |
+
<info_received translate="label">
|
292 |
+
<label>Info Received</label>
|
293 |
+
<frontend_type>text</frontend_type>
|
294 |
+
<sort_order>1</sort_order>
|
295 |
+
<show_in_default>1</show_in_default>
|
296 |
+
<show_in_website>1</show_in_website>
|
297 |
+
<show_in_store>1</show_in_store>
|
298 |
+
<fields>
|
299 |
+
<enabled_client translate="label">
|
300 |
+
<label>Enabled for client</label>
|
301 |
+
<frontend_type>select</frontend_type>
|
302 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
303 |
+
<sort_order>0</sort_order>
|
304 |
+
<show_in_default>1</show_in_default>
|
305 |
+
<show_in_website>1</show_in_website>
|
306 |
+
<show_in_store>1</show_in_store>
|
307 |
+
</enabled_client>
|
308 |
+
<enabled_owner translate="label">
|
309 |
+
<label>Enabled for owner</label>
|
310 |
+
<frontend_type>select</frontend_type>
|
311 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
312 |
+
<sort_order>0</sort_order>
|
313 |
+
<show_in_default>1</show_in_default>
|
314 |
+
<show_in_website>1</show_in_website>
|
315 |
+
<show_in_store>1</show_in_store>
|
316 |
+
</enabled_owner>
|
317 |
+
<identity translate="label">
|
318 |
+
<label>Sender Email</label>
|
319 |
+
<frontend_type>select</frontend_type>
|
320 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
321 |
+
<sort_order>1</sort_order>
|
322 |
+
<show_in_default>1</show_in_default>
|
323 |
+
<show_in_website>1</show_in_website>
|
324 |
+
<show_in_store>1</show_in_store>
|
325 |
+
</identity>
|
326 |
+
<template translate="label">
|
327 |
+
<label>Template</label>
|
328 |
+
<frontend_type>select</frontend_type>
|
329 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
330 |
+
<sort_order>2</sort_order>
|
331 |
+
<show_in_default>1</show_in_default>
|
332 |
+
<show_in_website>1</show_in_website>
|
333 |
+
<show_in_store>1</show_in_store>
|
334 |
+
</template>
|
335 |
+
</fields>
|
336 |
+
</info_received>
|
337 |
+
|
338 |
+
<in_transit translate="label">
|
339 |
+
<label>In Transit</label>
|
340 |
+
<frontend_type>text</frontend_type>
|
341 |
+
<sort_order>2</sort_order>
|
342 |
+
<show_in_default>1</show_in_default>
|
343 |
+
<show_in_website>1</show_in_website>
|
344 |
+
<show_in_store>1</show_in_store>
|
345 |
+
<fields>
|
346 |
+
<enabled_client translate="label">
|
347 |
+
<label>Enabled for client</label>
|
348 |
+
<frontend_type>select</frontend_type>
|
349 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
350 |
+
<sort_order>0</sort_order>
|
351 |
+
<show_in_default>1</show_in_default>
|
352 |
+
<show_in_website>1</show_in_website>
|
353 |
+
<show_in_store>1</show_in_store>
|
354 |
+
</enabled_client>
|
355 |
+
<enabled_owner translate="label">
|
356 |
+
<label>Enabled for owner</label>
|
357 |
+
<frontend_type>select</frontend_type>
|
358 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
359 |
+
<sort_order>0</sort_order>
|
360 |
+
<show_in_default>1</show_in_default>
|
361 |
+
<show_in_website>1</show_in_website>
|
362 |
+
<show_in_store>1</show_in_store>
|
363 |
+
</enabled_owner>
|
364 |
+
<identity translate="label">
|
365 |
+
<label>Sender Email</label>
|
366 |
+
<frontend_type>select</frontend_type>
|
367 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
368 |
+
<sort_order>1</sort_order>
|
369 |
+
<show_in_default>1</show_in_default>
|
370 |
+
<show_in_website>1</show_in_website>
|
371 |
+
<show_in_store>1</show_in_store>
|
372 |
+
</identity>
|
373 |
+
<template translate="label">
|
374 |
+
<label>Template</label>
|
375 |
+
<frontend_type>select</frontend_type>
|
376 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
377 |
+
<sort_order>2</sort_order>
|
378 |
+
<show_in_default>1</show_in_default>
|
379 |
+
<show_in_website>1</show_in_website>
|
380 |
+
<show_in_store>1</show_in_store>
|
381 |
+
</template>
|
382 |
+
</fields>
|
383 |
+
</in_transit>
|
384 |
+
|
385 |
+
<out_for_delivery translate="label">
|
386 |
+
<label>Out for Delivery</label>
|
387 |
+
<frontend_type>text</frontend_type>
|
388 |
+
<sort_order>3</sort_order>
|
389 |
+
<show_in_default>1</show_in_default>
|
390 |
+
<show_in_website>1</show_in_website>
|
391 |
+
<show_in_store>1</show_in_store>
|
392 |
+
<fields>
|
393 |
+
<enabled_client translate="label">
|
394 |
+
<label>Enabled for client</label>
|
395 |
+
<frontend_type>select</frontend_type>
|
396 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
397 |
+
<sort_order>0</sort_order>
|
398 |
+
<show_in_default>1</show_in_default>
|
399 |
+
<show_in_website>1</show_in_website>
|
400 |
+
<show_in_store>1</show_in_store>
|
401 |
+
</enabled_client>
|
402 |
+
<enabled_owner translate="label">
|
403 |
+
<label>Enabled for owner</label>
|
404 |
+
<frontend_type>select</frontend_type>
|
405 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
406 |
+
<sort_order>0</sort_order>
|
407 |
+
<show_in_default>1</show_in_default>
|
408 |
+
<show_in_website>1</show_in_website>
|
409 |
+
<show_in_store>1</show_in_store>
|
410 |
+
</enabled_owner>
|
411 |
+
<identity translate="label">
|
412 |
+
<label>Sender Email</label>
|
413 |
+
<frontend_type>select</frontend_type>
|
414 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
415 |
+
<sort_order>1</sort_order>
|
416 |
+
<show_in_default>1</show_in_default>
|
417 |
+
<show_in_website>1</show_in_website>
|
418 |
+
<show_in_store>1</show_in_store>
|
419 |
+
</identity>
|
420 |
+
<template translate="label">
|
421 |
+
<label>Template</label>
|
422 |
+
<frontend_type>select</frontend_type>
|
423 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
424 |
+
<sort_order>2</sort_order>
|
425 |
+
<show_in_default>1</show_in_default>
|
426 |
+
<show_in_website>1</show_in_website>
|
427 |
+
<show_in_store>1</show_in_store>
|
428 |
+
</template>
|
429 |
+
</fields>
|
430 |
+
</out_for_delivery>
|
431 |
+
<delivered translate="label">
|
432 |
+
<label>Delivered</label>
|
433 |
+
<frontend_type>text</frontend_type>
|
434 |
+
<sort_order>4</sort_order>
|
435 |
+
<show_in_default>1</show_in_default>
|
436 |
+
<show_in_website>1</show_in_website>
|
437 |
+
<show_in_store>1</show_in_store>
|
438 |
+
<fields>
|
439 |
+
<enabled_client translate="label">
|
440 |
+
<label>Enabled for client</label>
|
441 |
+
<frontend_type>select</frontend_type>
|
442 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
443 |
+
<sort_order>0</sort_order>
|
444 |
+
<show_in_default>1</show_in_default>
|
445 |
+
<show_in_website>1</show_in_website>
|
446 |
+
<show_in_store>1</show_in_store>
|
447 |
+
</enabled_client>
|
448 |
+
<enabled_owner translate="label">
|
449 |
+
<label>Enabled for owner</label>
|
450 |
+
<frontend_type>select</frontend_type>
|
451 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
452 |
+
<sort_order>0</sort_order>
|
453 |
+
<show_in_default>1</show_in_default>
|
454 |
+
<show_in_website>1</show_in_website>
|
455 |
+
<show_in_store>1</show_in_store>
|
456 |
+
</enabled_owner>
|
457 |
+
<identity translate="label">
|
458 |
+
<label>Sender Email</label>
|
459 |
+
<frontend_type>select</frontend_type>
|
460 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
461 |
+
<sort_order>1</sort_order>
|
462 |
+
<show_in_default>1</show_in_default>
|
463 |
+
<show_in_website>1</show_in_website>
|
464 |
+
<show_in_store>1</show_in_store>
|
465 |
+
</identity>
|
466 |
+
<template translate="label">
|
467 |
+
<label>Template</label>
|
468 |
+
<frontend_type>select</frontend_type>
|
469 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
470 |
+
<sort_order>2</sort_order>
|
471 |
+
<show_in_default>1</show_in_default>
|
472 |
+
<show_in_website>1</show_in_website>
|
473 |
+
<show_in_store>1</show_in_store>
|
474 |
+
</template>
|
475 |
+
</fields>
|
476 |
+
</delivered>
|
477 |
+
|
478 |
+
<exception translate="label">
|
479 |
+
<label>Exception</label>
|
480 |
+
<frontend_type>text</frontend_type>
|
481 |
+
<sort_order>5</sort_order>
|
482 |
+
<show_in_default>1</show_in_default>
|
483 |
+
<show_in_website>1</show_in_website>
|
484 |
+
<show_in_store>1</show_in_store>
|
485 |
+
<fields>
|
486 |
+
<enabled_client translate="label">
|
487 |
+
<label>Enabled for client</label>
|
488 |
+
<frontend_type>select</frontend_type>
|
489 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
490 |
+
<sort_order>0</sort_order>
|
491 |
+
<show_in_default>1</show_in_default>
|
492 |
+
<show_in_website>1</show_in_website>
|
493 |
+
<show_in_store>1</show_in_store>
|
494 |
+
</enabled_client>
|
495 |
+
<enabled_owner translate="label">
|
496 |
+
<label>Enabled for owner</label>
|
497 |
+
<frontend_type>select</frontend_type>
|
498 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
499 |
+
<sort_order>0</sort_order>
|
500 |
+
<show_in_default>1</show_in_default>
|
501 |
+
<show_in_website>1</show_in_website>
|
502 |
+
<show_in_store>1</show_in_store>
|
503 |
+
</enabled_owner>
|
504 |
+
<identity translate="label">
|
505 |
+
<label>Sender Email</label>
|
506 |
+
<frontend_type>select</frontend_type>
|
507 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
508 |
+
<sort_order>1</sort_order>
|
509 |
+
<show_in_default>1</show_in_default>
|
510 |
+
<show_in_website>1</show_in_website>
|
511 |
+
<show_in_store>1</show_in_store>
|
512 |
+
</identity>
|
513 |
+
<template translate="label">
|
514 |
+
<label>Template</label>
|
515 |
+
<frontend_type>select</frontend_type>
|
516 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
517 |
+
<sort_order>2</sort_order>
|
518 |
+
<show_in_default>1</show_in_default>
|
519 |
+
<show_in_website>1</show_in_website>
|
520 |
+
<show_in_store>1</show_in_store>
|
521 |
+
</template>
|
522 |
+
</fields>
|
523 |
+
</exception>
|
524 |
+
<failed_attempt translate="label">
|
525 |
+
<label>Failed Attempt</label>
|
526 |
+
<frontend_type>text</frontend_type>
|
527 |
+
<sort_order>6</sort_order>
|
528 |
+
<show_in_default>1</show_in_default>
|
529 |
+
<show_in_website>1</show_in_website>
|
530 |
+
<show_in_store>1</show_in_store>
|
531 |
+
<fields>
|
532 |
+
<enabled_client translate="label">
|
533 |
+
<label>Enabled for client</label>
|
534 |
+
<frontend_type>select</frontend_type>
|
535 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
536 |
+
<sort_order>0</sort_order>
|
537 |
+
<show_in_default>1</show_in_default>
|
538 |
+
<show_in_website>1</show_in_website>
|
539 |
+
<show_in_store>1</show_in_store>
|
540 |
+
</enabled_client>
|
541 |
+
<enabled_owner translate="label">
|
542 |
+
<label>Enabled for owner</label>
|
543 |
+
<frontend_type>select</frontend_type>
|
544 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
545 |
+
<sort_order>0</sort_order>
|
546 |
+
<show_in_default>1</show_in_default>
|
547 |
+
<show_in_website>1</show_in_website>
|
548 |
+
<show_in_store>1</show_in_store>
|
549 |
+
</enabled_owner>
|
550 |
+
<identity translate="label">
|
551 |
+
<label>Sender Email</label>
|
552 |
+
<frontend_type>select</frontend_type>
|
553 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
554 |
+
<sort_order>1</sort_order>
|
555 |
+
<show_in_default>1</show_in_default>
|
556 |
+
<show_in_website>1</show_in_website>
|
557 |
+
<show_in_store>1</show_in_store>
|
558 |
+
</identity>
|
559 |
+
<template translate="label">
|
560 |
+
<label>Template</label>
|
561 |
+
<frontend_type>select</frontend_type>
|
562 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
563 |
+
<sort_order>2</sort_order>
|
564 |
+
<show_in_default>1</show_in_default>
|
565 |
+
<show_in_website>1</show_in_website>
|
566 |
+
<show_in_store>1</show_in_store>
|
567 |
+
</template>
|
568 |
+
</fields>
|
569 |
+
</failed_attempt>
|
570 |
+
</groups>
|
571 |
+
</pp_section_notification_emails>
|
572 |
+
<pp_section_carriers>
|
573 |
+
<label>Carrier Settings</label>
|
574 |
+
<class>packpin-settings</class>
|
575 |
+
<tab>pp_tab</tab>
|
576 |
+
<frontend_type>text</frontend_type>
|
577 |
+
<sort_order>51003</sort_order>
|
578 |
+
<show_in_default>1</show_in_default>
|
579 |
+
<show_in_website>1</show_in_website>
|
580 |
+
<show_in_store>0</show_in_store>
|
581 |
+
<groups>
|
582 |
+
<carriers translate="label">
|
583 |
+
<expanded>1</expanded>
|
584 |
+
<label>Enabled Carriers</label>
|
585 |
+
<frontend_type>text</frontend_type>
|
586 |
+
<frontend_model>pptrack/adminhtml_system_config_form_fieldset_carrier</frontend_model>
|
587 |
+
<sort_order>1</sort_order>
|
588 |
+
<show_in_default>1</show_in_default>
|
589 |
+
<show_in_website>1</show_in_website>
|
590 |
+
<show_in_store>0</show_in_store>
|
591 |
+
</carriers>
|
592 |
+
</groups>
|
593 |
+
</pp_section_carriers>
|
594 |
+
</sections>
|
595 |
+
</config>
|
app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-install-0.1.2.php
CHANGED
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
|
4 |
-
$installer->startSetup();
|
5 |
-
|
6 |
-
$tableNameTrack = $installer->getTable('pptrack/track');
|
7 |
-
$tableNameDetails = $installer->getTable('pptrack/trackdetail');
|
8 |
-
$tableNameCarriers = $installer->getTable('pptrack/carrier');
|
9 |
-
$tableNameSettings = $installer->getTable('pptrack/setting');
|
10 |
-
|
11 |
-
$installer->run("DROP TABLE IF EXISTS `{$tableNameDetails}`;");
|
12 |
-
$installer->run("DROP TABLE IF EXISTS `{$tableNameTrack}`;");
|
13 |
-
$installer->run("DROP TABLE IF EXISTS `{$tableNameCarriers}`;");
|
14 |
-
$installer->run("DROP TABLE IF EXISTS `{$tableNameSettings}`;");
|
15 |
-
|
16 |
-
$sql=<<<SQLTEXT
|
17 |
-
|
18 |
-
CREATE TABLE IF NOT EXISTS `{$tableNameTrack}` (
|
19 |
-
`id` INT NOT NULL AUTO_INCREMENT ,
|
20 |
-
`hash` varchar(255) NOT NULL,
|
21 |
-
`order_id` varchar(255) NOT NULL,
|
22 |
-
`shipment_id` INT DEFAULT NULL,
|
23 |
-
`code` varchar(50) NOT NULL,
|
24 |
-
`carrier_code` varchar(50) DEFAULT NULL,
|
25 |
-
`carrier_name` varchar(255) DEFAULT NULL,
|
26 |
-
`postal_code` varchar(50) DEFAULT NULL,
|
27 |
-
`ship_date` varchar(50) DEFAULT NULL,
|
28 |
-
`destination_country` varchar(50) DEFAULT NULL,
|
29 |
-
`status` varchar(50) DEFAULT 'pending',
|
30 |
-
`email` varchar(255) DEFAULT NULL,
|
31 |
-
`phone` varchar(255) DEFAULT NULL,
|
32 |
-
`created_at` INT DEFAULT NULL,
|
33 |
-
`updated_at` INT DEFAULT NULL,
|
34 |
-
`submitted` INT NOT NULL DEFAULT '0',
|
35 |
-
PRIMARY KEY (`id`),
|
36 |
-
KEY `hash` (`hash`),
|
37 |
-
KEY `order_id` (`order_id`),
|
38 |
-
KEY `submitted` (`submitted`)
|
39 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
40 |
-
|
41 |
-
|
42 |
-
CREATE TABLE IF NOT EXISTS `{$tableNameDetails}` (
|
43 |
-
`id` INT NOT NULL AUTO_INCREMENT ,
|
44 |
-
`track_id` INT NOT NULL,
|
45 |
-
`carrier` varchar(50) DEFAULT NULL,
|
46 |
-
`status` varchar(50) NOT NULL,
|
47 |
-
`status_string` varchar(255) DEFAULT NULL,
|
48 |
-
`event_date` DATE DEFAULT NULL,
|
49 |
-
`event_time` TIME DEFAULT NULL,
|
50 |
-
`address` varchar(255) DEFAULT NULL,
|
51 |
-
`country` char(2) DEFAULT NULL,
|
52 |
-
PRIMARY KEY (`id`)
|
53 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
54 |
-
|
55 |
-
|
56 |
-
CREATE TABLE IF NOT EXISTS `{$tableNameCarriers}` (
|
57 |
-
`id` INT NOT NULL AUTO_INCREMENT ,
|
58 |
-
`code` varchar(50) NOT NULL,
|
59 |
-
`name` varchar(255) NOT NULL,
|
60 |
-
`phone` varchar(255) DEFAULT NULL,
|
61 |
-
`homepage` varchar(255) DEFAULT NULL,
|
62 |
-
`enabled` INT NOT NULL DEFAULT '1',
|
63 |
-
PRIMARY KEY (`id`)
|
64 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
65 |
-
|
66 |
-
CREATE TABLE IF NOT EXISTS `{$tableNameSettings}` (
|
67 |
-
`id` INT NOT NULL AUTO_INCREMENT ,
|
68 |
-
`setting` varchar(255) NOT NULL,
|
69 |
-
`value` varchar(255) NOT NULL,
|
70 |
-
PRIMARY KEY (`id`)
|
71 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
72 |
-
|
73 |
-
ALTER TABLE `{$tableNameDetails}`
|
74 |
-
ADD KEY `track_details_track_id_foreign` (`track_id`);
|
75 |
-
|
76 |
-
ALTER TABLE `{$tableNameDetails}`
|
77 |
-
ADD CONSTRAINT `track_details_track_id_foreign` FOREIGN KEY (`track_id`) REFERENCES `{$tableNameTrack}` (`id`) ON DELETE CASCADE;
|
78 |
-
|
79 |
-
ALTER TABLE `$tableNameSettings`
|
80 |
-
ADD UNIQUE KEY `pp_settings_setting_unique` (`setting`);
|
81 |
-
|
82 |
-
SQLTEXT;
|
83 |
-
|
84 |
-
$installer->run($sql);
|
85 |
-
|
86 |
$installer->endSetup();
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$tableNameTrack = $installer->getTable('pptrack/track');
|
7 |
+
$tableNameDetails = $installer->getTable('pptrack/trackdetail');
|
8 |
+
$tableNameCarriers = $installer->getTable('pptrack/carrier');
|
9 |
+
$tableNameSettings = $installer->getTable('pptrack/setting');
|
10 |
+
|
11 |
+
$installer->run("DROP TABLE IF EXISTS `{$tableNameDetails}`;");
|
12 |
+
$installer->run("DROP TABLE IF EXISTS `{$tableNameTrack}`;");
|
13 |
+
$installer->run("DROP TABLE IF EXISTS `{$tableNameCarriers}`;");
|
14 |
+
$installer->run("DROP TABLE IF EXISTS `{$tableNameSettings}`;");
|
15 |
+
|
16 |
+
$sql=<<<SQLTEXT
|
17 |
+
|
18 |
+
CREATE TABLE IF NOT EXISTS `{$tableNameTrack}` (
|
19 |
+
`id` INT NOT NULL AUTO_INCREMENT ,
|
20 |
+
`hash` varchar(255) NOT NULL,
|
21 |
+
`order_id` varchar(255) NOT NULL,
|
22 |
+
`shipment_id` INT DEFAULT NULL,
|
23 |
+
`code` varchar(50) NOT NULL,
|
24 |
+
`carrier_code` varchar(50) DEFAULT NULL,
|
25 |
+
`carrier_name` varchar(255) DEFAULT NULL,
|
26 |
+
`postal_code` varchar(50) DEFAULT NULL,
|
27 |
+
`ship_date` varchar(50) DEFAULT NULL,
|
28 |
+
`destination_country` varchar(50) DEFAULT NULL,
|
29 |
+
`status` varchar(50) DEFAULT 'pending',
|
30 |
+
`email` varchar(255) DEFAULT NULL,
|
31 |
+
`phone` varchar(255) DEFAULT NULL,
|
32 |
+
`created_at` INT DEFAULT NULL,
|
33 |
+
`updated_at` INT DEFAULT NULL,
|
34 |
+
`submitted` INT NOT NULL DEFAULT '0',
|
35 |
+
PRIMARY KEY (`id`),
|
36 |
+
KEY `hash` (`hash`),
|
37 |
+
KEY `order_id` (`order_id`),
|
38 |
+
KEY `submitted` (`submitted`)
|
39 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
40 |
+
|
41 |
+
|
42 |
+
CREATE TABLE IF NOT EXISTS `{$tableNameDetails}` (
|
43 |
+
`id` INT NOT NULL AUTO_INCREMENT ,
|
44 |
+
`track_id` INT NOT NULL,
|
45 |
+
`carrier` varchar(50) DEFAULT NULL,
|
46 |
+
`status` varchar(50) NOT NULL,
|
47 |
+
`status_string` varchar(255) DEFAULT NULL,
|
48 |
+
`event_date` DATE DEFAULT NULL,
|
49 |
+
`event_time` TIME DEFAULT NULL,
|
50 |
+
`address` varchar(255) DEFAULT NULL,
|
51 |
+
`country` char(2) DEFAULT NULL,
|
52 |
+
PRIMARY KEY (`id`)
|
53 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
54 |
+
|
55 |
+
|
56 |
+
CREATE TABLE IF NOT EXISTS `{$tableNameCarriers}` (
|
57 |
+
`id` INT NOT NULL AUTO_INCREMENT ,
|
58 |
+
`code` varchar(50) NOT NULL,
|
59 |
+
`name` varchar(255) NOT NULL,
|
60 |
+
`phone` varchar(255) DEFAULT NULL,
|
61 |
+
`homepage` varchar(255) DEFAULT NULL,
|
62 |
+
`enabled` INT NOT NULL DEFAULT '1',
|
63 |
+
PRIMARY KEY (`id`)
|
64 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
65 |
+
|
66 |
+
CREATE TABLE IF NOT EXISTS `{$tableNameSettings}` (
|
67 |
+
`id` INT NOT NULL AUTO_INCREMENT ,
|
68 |
+
`setting` varchar(255) NOT NULL,
|
69 |
+
`value` varchar(255) NOT NULL,
|
70 |
+
PRIMARY KEY (`id`)
|
71 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
72 |
+
|
73 |
+
ALTER TABLE `{$tableNameDetails}`
|
74 |
+
ADD KEY `track_details_track_id_foreign` (`track_id`);
|
75 |
+
|
76 |
+
ALTER TABLE `{$tableNameDetails}`
|
77 |
+
ADD CONSTRAINT `track_details_track_id_foreign` FOREIGN KEY (`track_id`) REFERENCES `{$tableNameTrack}` (`id`) ON DELETE CASCADE;
|
78 |
+
|
79 |
+
ALTER TABLE `$tableNameSettings`
|
80 |
+
ADD UNIQUE KEY `pp_settings_setting_unique` (`setting`);
|
81 |
+
|
82 |
+
SQLTEXT;
|
83 |
+
|
84 |
+
$installer->run($sql);
|
85 |
+
|
86 |
$installer->endSetup();
|
app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.2-0.1.5.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
|
4 |
-
$installer->startSetup();
|
5 |
-
|
6 |
-
$tableNameUnsubscribe = $installer->getTable('pptrack/trackunsubscribed');
|
7 |
-
|
8 |
-
|
9 |
-
$sql=<<<SQLTEXT
|
10 |
-
|
11 |
-
CREATE TABLE IF NOT EXISTS `{$tableNameUnsubscribe}` (
|
12 |
-
`id` INT NOT NULL AUTO_INCREMENT ,
|
13 |
-
`track_id` INT NOT NULL,
|
14 |
-
PRIMARY KEY (`id`),
|
15 |
-
KEY `track_id` (`track_id`)
|
16 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
17 |
-
|
18 |
-
SQLTEXT;
|
19 |
-
|
20 |
-
$installer->run($sql);
|
21 |
-
|
22 |
$installer->endSetup();
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$tableNameUnsubscribe = $installer->getTable('pptrack/trackunsubscribed');
|
7 |
+
|
8 |
+
|
9 |
+
$sql=<<<SQLTEXT
|
10 |
+
|
11 |
+
CREATE TABLE IF NOT EXISTS `{$tableNameUnsubscribe}` (
|
12 |
+
`id` INT NOT NULL AUTO_INCREMENT ,
|
13 |
+
`track_id` INT NOT NULL,
|
14 |
+
PRIMARY KEY (`id`),
|
15 |
+
KEY `track_id` (`track_id`)
|
16 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
17 |
+
|
18 |
+
SQLTEXT;
|
19 |
+
|
20 |
+
$installer->run($sql);
|
21 |
+
|
22 |
$installer->endSetup();
|
app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.5-1.3.0.php
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
|
4 |
-
$installer->startSetup();
|
5 |
-
|
6 |
-
$table = $installer->getTable('pptrack/visit');
|
7 |
-
$tableNameTrack = $installer->getTable('pptrack/track');
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$sql=<<<SQLTEXT
|
12 |
-
|
13 |
-
CREATE TABLE IF NOT EXISTS `{$table}` (
|
14 |
-
`id` INT NOT NULL AUTO_INCREMENT ,
|
15 |
-
`track_id` INT DEFAULT NULL,
|
16 |
-
`user_hash` char(32) NOT NULL,
|
17 |
-
`user_ip` varchar(255) NOT NULL,
|
18 |
-
`user_agent` varchar(255) DEFAULT NULL,
|
19 |
-
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
|
20 |
-
PRIMARY KEY (`id`),
|
21 |
-
KEY `track_id` (`track_id`),
|
22 |
-
KEY `user_hash` (`user_hash`),
|
23 |
-
KEY `created_at` (`created_at`)
|
24 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
25 |
-
|
26 |
-
ALTER TABLE `{$tableNameTrack}` ADD INDEX(`created_at`);
|
27 |
-
|
28 |
-
SQLTEXT;
|
29 |
-
|
30 |
-
$installer->run($sql);
|
31 |
-
|
32 |
$installer->endSetup();
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$table = $installer->getTable('pptrack/visit');
|
7 |
+
$tableNameTrack = $installer->getTable('pptrack/track');
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
$sql=<<<SQLTEXT
|
12 |
+
|
13 |
+
CREATE TABLE IF NOT EXISTS `{$table}` (
|
14 |
+
`id` INT NOT NULL AUTO_INCREMENT ,
|
15 |
+
`track_id` INT DEFAULT NULL,
|
16 |
+
`user_hash` char(32) NOT NULL,
|
17 |
+
`user_ip` varchar(255) NOT NULL,
|
18 |
+
`user_agent` varchar(255) DEFAULT NULL,
|
19 |
+
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
|
20 |
+
PRIMARY KEY (`id`),
|
21 |
+
KEY `track_id` (`track_id`),
|
22 |
+
KEY `user_hash` (`user_hash`),
|
23 |
+
KEY `created_at` (`created_at`)
|
24 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
25 |
+
|
26 |
+
ALTER TABLE `{$tableNameTrack}` ADD INDEX(`created_at`);
|
27 |
+
|
28 |
+
SQLTEXT;
|
29 |
+
|
30 |
+
$installer->run($sql);
|
31 |
+
|
32 |
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/pptrack.xml
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="1.3.3">
|
3 |
-
<adminhtml_packpintracks_dashboard>
|
4 |
-
<reference name="head">
|
5 |
-
<action method="addCss">
|
6 |
-
<name>pptrack/css/dashboard.css</name>
|
7 |
-
</action>
|
8 |
-
<action method="addCss">
|
9 |
-
<name>pptrack/css/pptrack.css</name>
|
10 |
-
</action>
|
11 |
-
<action method="addItem">
|
12 |
-
<type>skin_js</type>
|
13 |
-
<name>pptrack/js/dashboard.js</name>
|
14 |
-
</action>
|
15 |
-
</reference>
|
16 |
-
<reference name="content">
|
17 |
-
<block type="pptrack/adminhtml_dashboard" name="pptrack_adminhtml_trackings.dashboard" template="pptrack/dashboard/index.phtml"/>
|
18 |
-
<block type="pptrack/adminhtml_tracks" name="pptrack_tracks" />
|
19 |
-
</reference>
|
20 |
-
</adminhtml_packpintracks_dashboard>
|
21 |
-
<adminhtml_system_config_edit>
|
22 |
-
<reference name="head">
|
23 |
-
<action method="addCss">
|
24 |
-
<name>pptrack/css/pptrack.css</name>
|
25 |
-
</action>
|
26 |
-
</reference>
|
27 |
-
</adminhtml_system_config_edit>
|
28 |
</layout>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="1.3.3">
|
3 |
+
<adminhtml_packpintracks_dashboard>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss">
|
6 |
+
<name>pptrack/css/dashboard.css</name>
|
7 |
+
</action>
|
8 |
+
<action method="addCss">
|
9 |
+
<name>pptrack/css/pptrack.css</name>
|
10 |
+
</action>
|
11 |
+
<action method="addItem">
|
12 |
+
<type>skin_js</type>
|
13 |
+
<name>pptrack/js/dashboard.js</name>
|
14 |
+
</action>
|
15 |
+
</reference>
|
16 |
+
<reference name="content">
|
17 |
+
<block type="pptrack/adminhtml_dashboard" name="pptrack_adminhtml_trackings.dashboard" template="pptrack/dashboard/index.phtml"/>
|
18 |
+
<block type="pptrack/adminhtml_tracks" name="pptrack_tracks" />
|
19 |
+
</reference>
|
20 |
+
</adminhtml_packpintracks_dashboard>
|
21 |
+
<adminhtml_system_config_edit>
|
22 |
+
<reference name="head">
|
23 |
+
<action method="addCss">
|
24 |
+
<name>pptrack/css/pptrack.css</name>
|
25 |
+
</action>
|
26 |
+
</reference>
|
27 |
+
</adminhtml_system_config_edit>
|
28 |
</layout>
|
app/design/adminhtml/default/default/template/pptrack/dashboard/index.phtml
CHANGED
@@ -1,182 +1,182 @@
|
|
1 |
-
<?php
|
2 |
-
$planDetails = $this->getPlanDetails();
|
3 |
-
$rangeInfo = $this->getRangeInfo();
|
4 |
-
$range = $this->getSelectedRange();
|
5 |
-
$rangeStats = $this->getRangeStats();
|
6 |
-
$data = $rangeStats['graph'];
|
7 |
-
?>
|
8 |
-
<div class="content-header">
|
9 |
-
<table cellspacing="0">
|
10 |
-
<tr>
|
11 |
-
<td style="width:50%;"><h3><?php echo Mage::helper('pptrack')->__('Packpin Dashboard') ?></h3></td>
|
12 |
-
</tr>
|
13 |
-
</table>
|
14 |
-
</div>
|
15 |
-
|
16 |
-
<?php if (!$this->pluginEnabled() || !$this->notificationsEnabled()) : ?>
|
17 |
-
<ul class="messages">
|
18 |
-
<li class="error-msg">
|
19 |
-
<ul>
|
20 |
-
<li>
|
21 |
-
<span>
|
22 |
-
<?php echo !$this->pluginEnabled() ? Mage::helper('pptrack')->__('Packpin extension is disabled.') : Mage::helper('pptrack')->__('Packpin notifications are disabled.') ?>
|
23 |
-
<a href="<?php echo $this->getUrl('adminhtml/system_config/edit/section/pp_section_setttings') ?>"><?php echo Mage::helper('pptrack')->__('Click here') ?></a> <?php echo Mage::helper('pptrack')->__('to change your settings') ?>
|
24 |
-
</span>
|
25 |
-
</li>
|
26 |
-
</ul>
|
27 |
-
</li>
|
28 |
-
</ul>
|
29 |
-
<?php endif; ?>
|
30 |
-
|
31 |
-
<div id="dashboard_diagram_totals" class="box">
|
32 |
-
<div class="entry-edit">
|
33 |
-
<table width="100%" cellspacing="0">
|
34 |
-
<tbody><tr>
|
35 |
-
<td style="width:33%;" class="a-center bold">
|
36 |
-
<span><?php echo Mage::helper('pptrack')->__('Plan Name') ?></span><br>
|
37 |
-
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['name']) ? $planDetails['name'] : '?' ?></span>
|
38 |
-
</td>
|
39 |
-
<td style="width:33%;" class="a-center bold">
|
40 |
-
<span><?php echo Mage::helper('pptrack')->__('Total Trackings') ?></span><br>
|
41 |
-
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['count']) ? number_format($planDetails['trackings']['count']) : '?' ?></span>
|
42 |
-
</td>
|
43 |
-
<td style="width:33%;" class="a-center bold">
|
44 |
-
<span><?php echo Mage::helper('pptrack')->__('Trackings Left This Month') ?></span><br>
|
45 |
-
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['left']) ? number_format($planDetails['trackings']['left']) : '?' ?></span>
|
46 |
-
</td>
|
47 |
-
</tr>
|
48 |
-
</tbody></table>
|
49 |
-
</div>
|
50 |
-
</div>
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
<div class="dashboard-container">
|
55 |
-
<form id="dateRangeForm" method="get" action="<?php echo $this->getUrl('adminhtml/packpintracks/dashboard') ?>">
|
56 |
-
<p class="switcher"><label for="store_switcher"><?php echo Mage::helper('pptrack')->__('Date range') ?></label>
|
57 |
-
<select id="range_switcher" name="range">
|
58 |
-
<?php foreach ($rangeInfo as $code => $item) : ?>
|
59 |
-
<option <?php echo $range == $code ? 'selected="selected"' : '' ?> value="<?php echo $code ?>"><?php echo $item['label'] ?></option>
|
60 |
-
<?php endforeach; ?>
|
61 |
-
</select>
|
62 |
-
|
63 |
-
<input class="a-center" type="text" name="date_from" id="date_from" value="<?php echo $rangeInfo[$range]['date_start'] ?>" >
|
64 |
-
<img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_from_trig"/>
|
65 |
-
<input class="a-center" type="text" name="date_to" id="date_to" value="<?php echo $rangeInfo[$range]['date_end'] ?>" >
|
66 |
-
<img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_to_trig"/>
|
67 |
-
</p>
|
68 |
-
</form>
|
69 |
-
<table cellspacing='5' width='100%'>
|
70 |
-
<tr>
|
71 |
-
<td style="width: 25%;">
|
72 |
-
<div class="entry-edit">
|
73 |
-
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></h4>
|
74 |
-
</div>
|
75 |
-
<fieldset class="a-center bold" style="padding:20px 0;">
|
76 |
-
<span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['trackings']) ?></span>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
</td>
|
80 |
-
<td style="width: 25%;">
|
81 |
-
<div class="entry-edit">
|
82 |
-
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Notification Emails Sent') ?></h4>
|
83 |
-
</div>
|
84 |
-
<fieldset class="a-center bold" style="padding:20px 0;">
|
85 |
-
<span style="font-size:18px;" class="nowrap"><?php echo is_int($rangeStats['emails']) ? number_format($rangeStats['emails']) : $rangeStats['emails'] ?></span>
|
86 |
-
</fieldset>
|
87 |
-
</div>
|
88 |
-
</td>
|
89 |
-
<td style="width: 25%;">
|
90 |
-
<div class="entry-edit">
|
91 |
-
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></h4>
|
92 |
-
</div>
|
93 |
-
<fieldset class="a-center bold" style="padding:20px 0;">
|
94 |
-
<span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['visits']) ?></span>
|
95 |
-
</fieldset>
|
96 |
-
</div>
|
97 |
-
</td>
|
98 |
-
<td style="width: 25%;">
|
99 |
-
<div class="entry-edit">
|
100 |
-
<div class="entry-edit-head">
|
101 |
-
<h4><?php echo Mage::helper('pptrack')->__('Average trackings per shipment') ?></h4></div>
|
102 |
-
<fieldset class="a-center bold" style="padding:20px 0;">
|
103 |
-
<span style="font-size:18px;"
|
104 |
-
class="nowrap"><?php echo number_format($rangeStats['average'], 2) ?></span>
|
105 |
-
</fieldset>
|
106 |
-
</div>
|
107 |
-
</td>
|
108 |
-
</tr>
|
109 |
-
</table>
|
110 |
-
<div id="graph1"></div>
|
111 |
-
</div>
|
112 |
-
<br>
|
113 |
-
<br>
|
114 |
-
<br>
|
115 |
-
<script type="text/javascript">
|
116 |
-
var rangeInfo = <?php echo json_encode($rangeInfo) ?>;
|
117 |
-
|
118 |
-
Calendar.setup({
|
119 |
-
inputField: 'date_from',
|
120 |
-
ifFormat: '%Y-%m-%d',
|
121 |
-
button: 'date_from_trig',
|
122 |
-
align: 'Bl',
|
123 |
-
singleClick: true,
|
124 |
-
onUpdate: function() {
|
125 |
-
jQuery("#range_switcher").val("custom");
|
126 |
-
jQuery("#dateRangeForm").submit();
|
127 |
-
}
|
128 |
-
});
|
129 |
-
|
130 |
-
Calendar.setup({
|
131 |
-
inputField: 'date_to',
|
132 |
-
ifFormat: '%Y-%m-%d',
|
133 |
-
button: 'date_to_trig',
|
134 |
-
align: 'Bl',
|
135 |
-
singleClick: true,
|
136 |
-
onUpdate: function() {
|
137 |
-
jQuery("#range_switcher").val("custom");
|
138 |
-
jQuery("#dateRangeForm").submit();
|
139 |
-
}
|
140 |
-
});
|
141 |
-
|
142 |
-
jQuery("#date_from,#date_to").change(function() {
|
143 |
-
jQuery("#range_switcher").val("custom");
|
144 |
-
jQuery("#dateRangeForm").submit();
|
145 |
-
});
|
146 |
-
jQuery("#range_switcher").change(function() {
|
147 |
-
var v = jQuery(this).val();
|
148 |
-
if (v != "custom") {
|
149 |
-
jQuery("#dateRangeForm").submit();
|
150 |
-
}
|
151 |
-
});
|
152 |
-
|
153 |
-
|
154 |
-
Morris.Area({
|
155 |
-
element: 'graph1',
|
156 |
-
data: <?php echo json_encode(array_values($data)) ?>,
|
157 |
-
xkey: 'period',
|
158 |
-
ykeys: ['count', 'count2'],
|
159 |
-
labels: ['Shipments', 'Visits'],
|
160 |
-
pointSize: 2,
|
161 |
-
hideHover: 'auto',
|
162 |
-
lineWidth: 2,
|
163 |
-
resize: false,
|
164 |
-
xLabels: "day"
|
165 |
-
});
|
166 |
-
|
167 |
-
<?php $user = Mage::getSingleton('admin/session'); ?>
|
168 |
-
window.intercomSettings = {
|
169 |
-
"plugin": "magento",
|
170 |
-
name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
|
171 |
-
email: "<?php echo $user->getUser()->getEmail() ?>",
|
172 |
-
app_id: "n806bjdu",
|
173 |
-
"api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
|
174 |
-
"plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
|
175 |
-
"plugin_shop_version": "<?php echo Mage::getVersion() ?>",
|
176 |
-
"shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
|
177 |
-
"shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
|
178 |
-
"shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
|
179 |
-
};
|
180 |
-
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
|
181 |
-
|
182 |
-
</script>
|
1 |
+
<?php
|
2 |
+
$planDetails = $this->getPlanDetails();
|
3 |
+
$rangeInfo = $this->getRangeInfo();
|
4 |
+
$range = $this->getSelectedRange();
|
5 |
+
$rangeStats = $this->getRangeStats();
|
6 |
+
$data = $rangeStats['graph'];
|
7 |
+
?>
|
8 |
+
<div class="content-header">
|
9 |
+
<table cellspacing="0">
|
10 |
+
<tr>
|
11 |
+
<td style="width:50%;"><h3><?php echo Mage::helper('pptrack')->__('Packpin Dashboard') ?></h3></td>
|
12 |
+
</tr>
|
13 |
+
</table>
|
14 |
+
</div>
|
15 |
+
|
16 |
+
<?php if (!$this->pluginEnabled() || !$this->notificationsEnabled()) : ?>
|
17 |
+
<ul class="messages">
|
18 |
+
<li class="error-msg">
|
19 |
+
<ul>
|
20 |
+
<li>
|
21 |
+
<span>
|
22 |
+
<?php echo !$this->pluginEnabled() ? Mage::helper('pptrack')->__('Packpin extension is disabled.') : Mage::helper('pptrack')->__('Packpin notifications are disabled.') ?>
|
23 |
+
<a href="<?php echo $this->getUrl('adminhtml/system_config/edit/section/pp_section_setttings') ?>"><?php echo Mage::helper('pptrack')->__('Click here') ?></a> <?php echo Mage::helper('pptrack')->__('to change your settings') ?>
|
24 |
+
</span>
|
25 |
+
</li>
|
26 |
+
</ul>
|
27 |
+
</li>
|
28 |
+
</ul>
|
29 |
+
<?php endif; ?>
|
30 |
+
|
31 |
+
<div id="dashboard_diagram_totals" class="box">
|
32 |
+
<div class="entry-edit">
|
33 |
+
<table width="100%" cellspacing="0">
|
34 |
+
<tbody><tr>
|
35 |
+
<td style="width:33%;" class="a-center bold">
|
36 |
+
<span><?php echo Mage::helper('pptrack')->__('Plan Name') ?></span><br>
|
37 |
+
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['name']) ? $planDetails['name'] : '?' ?></span>
|
38 |
+
</td>
|
39 |
+
<td style="width:33%;" class="a-center bold">
|
40 |
+
<span><?php echo Mage::helper('pptrack')->__('Total Trackings') ?></span><br>
|
41 |
+
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['count']) ? number_format($planDetails['trackings']['count']) : '?' ?></span>
|
42 |
+
</td>
|
43 |
+
<td style="width:33%;" class="a-center bold">
|
44 |
+
<span><?php echo Mage::helper('pptrack')->__('Trackings Left This Month') ?></span><br>
|
45 |
+
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['left']) ? number_format($planDetails['trackings']['left']) : '?' ?></span>
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
+
</tbody></table>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
<div class="dashboard-container">
|
55 |
+
<form id="dateRangeForm" method="get" action="<?php echo $this->getUrl('adminhtml/packpintracks/dashboard') ?>">
|
56 |
+
<p class="switcher"><label for="store_switcher"><?php echo Mage::helper('pptrack')->__('Date range') ?></label>
|
57 |
+
<select id="range_switcher" name="range">
|
58 |
+
<?php foreach ($rangeInfo as $code => $item) : ?>
|
59 |
+
<option <?php echo $range == $code ? 'selected="selected"' : '' ?> value="<?php echo $code ?>"><?php echo $item['label'] ?></option>
|
60 |
+
<?php endforeach; ?>
|
61 |
+
</select>
|
62 |
+
|
63 |
+
<input class="a-center" type="text" name="date_from" id="date_from" value="<?php echo $rangeInfo[$range]['date_start'] ?>" >
|
64 |
+
<img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_from_trig"/>
|
65 |
+
<input class="a-center" type="text" name="date_to" id="date_to" value="<?php echo $rangeInfo[$range]['date_end'] ?>" >
|
66 |
+
<img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_to_trig"/>
|
67 |
+
</p>
|
68 |
+
</form>
|
69 |
+
<table cellspacing='5' width='100%'>
|
70 |
+
<tr>
|
71 |
+
<td style="width: 25%;">
|
72 |
+
<div class="entry-edit">
|
73 |
+
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></h4>
|
74 |
+
</div>
|
75 |
+
<fieldset class="a-center bold" style="padding:20px 0;">
|
76 |
+
<span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['trackings']) ?></span>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
</td>
|
80 |
+
<td style="width: 25%;">
|
81 |
+
<div class="entry-edit">
|
82 |
+
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Notification Emails Sent') ?></h4>
|
83 |
+
</div>
|
84 |
+
<fieldset class="a-center bold" style="padding:20px 0;">
|
85 |
+
<span style="font-size:18px;" class="nowrap"><?php echo is_int($rangeStats['emails']) ? number_format($rangeStats['emails']) : $rangeStats['emails'] ?></span>
|
86 |
+
</fieldset>
|
87 |
+
</div>
|
88 |
+
</td>
|
89 |
+
<td style="width: 25%;">
|
90 |
+
<div class="entry-edit">
|
91 |
+
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></h4>
|
92 |
+
</div>
|
93 |
+
<fieldset class="a-center bold" style="padding:20px 0;">
|
94 |
+
<span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['visits']) ?></span>
|
95 |
+
</fieldset>
|
96 |
+
</div>
|
97 |
+
</td>
|
98 |
+
<td style="width: 25%;">
|
99 |
+
<div class="entry-edit">
|
100 |
+
<div class="entry-edit-head">
|
101 |
+
<h4><?php echo Mage::helper('pptrack')->__('Average trackings per shipment') ?></h4></div>
|
102 |
+
<fieldset class="a-center bold" style="padding:20px 0;">
|
103 |
+
<span style="font-size:18px;"
|
104 |
+
class="nowrap"><?php echo number_format($rangeStats['average'], 2) ?></span>
|
105 |
+
</fieldset>
|
106 |
+
</div>
|
107 |
+
</td>
|
108 |
+
</tr>
|
109 |
+
</table>
|
110 |
+
<div id="graph1"></div>
|
111 |
+
</div>
|
112 |
+
<br>
|
113 |
+
<br>
|
114 |
+
<br>
|
115 |
+
<script type="text/javascript">
|
116 |
+
var rangeInfo = <?php echo json_encode($rangeInfo) ?>;
|
117 |
+
|
118 |
+
Calendar.setup({
|
119 |
+
inputField: 'date_from',
|
120 |
+
ifFormat: '%Y-%m-%d',
|
121 |
+
button: 'date_from_trig',
|
122 |
+
align: 'Bl',
|
123 |
+
singleClick: true,
|
124 |
+
onUpdate: function() {
|
125 |
+
jQuery("#range_switcher").val("custom");
|
126 |
+
jQuery("#dateRangeForm").submit();
|
127 |
+
}
|
128 |
+
});
|
129 |
+
|
130 |
+
Calendar.setup({
|
131 |
+
inputField: 'date_to',
|
132 |
+
ifFormat: '%Y-%m-%d',
|
133 |
+
button: 'date_to_trig',
|
134 |
+
align: 'Bl',
|
135 |
+
singleClick: true,
|
136 |
+
onUpdate: function() {
|
137 |
+
jQuery("#range_switcher").val("custom");
|
138 |
+
jQuery("#dateRangeForm").submit();
|
139 |
+
}
|
140 |
+
});
|
141 |
+
|
142 |
+
jQuery("#date_from,#date_to").change(function() {
|
143 |
+
jQuery("#range_switcher").val("custom");
|
144 |
+
jQuery("#dateRangeForm").submit();
|
145 |
+
});
|
146 |
+
jQuery("#range_switcher").change(function() {
|
147 |
+
var v = jQuery(this).val();
|
148 |
+
if (v != "custom") {
|
149 |
+
jQuery("#dateRangeForm").submit();
|
150 |
+
}
|
151 |
+
});
|
152 |
+
|
153 |
+
|
154 |
+
Morris.Area({
|
155 |
+
element: 'graph1',
|
156 |
+
data: <?php echo json_encode(array_values($data)) ?>,
|
157 |
+
xkey: 'period',
|
158 |
+
ykeys: ['count', 'count2'],
|
159 |
+
labels: ['Shipments', 'Visits'],
|
160 |
+
pointSize: 2,
|
161 |
+
hideHover: 'auto',
|
162 |
+
lineWidth: 2,
|
163 |
+
resize: false,
|
164 |
+
xLabels: "day"
|
165 |
+
});
|
166 |
+
|
167 |
+
<?php $user = Mage::getSingleton('admin/session'); ?>
|
168 |
+
window.intercomSettings = {
|
169 |
+
"plugin": "magento",
|
170 |
+
name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
|
171 |
+
email: "<?php echo $user->getUser()->getEmail() ?>",
|
172 |
+
app_id: "n806bjdu",
|
173 |
+
"api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
|
174 |
+
"plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
|
175 |
+
"plugin_shop_version": "<?php echo Mage::getVersion() ?>",
|
176 |
+
"shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
|
177 |
+
"shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
|
178 |
+
"shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
|
179 |
+
};
|
180 |
+
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
|
181 |
+
|
182 |
+
</script>
|
app/design/adminhtml/default/default/template/pptrack/dashboard/packpin.phtml
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<div class="entry-edit">
|
2 |
-
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Packpin Stats') ?></h4></div>
|
3 |
-
<fieldset style="padding:10px 0 0;">
|
4 |
-
<table width="100%" cellspacing="0">
|
5 |
-
<tbody>
|
6 |
-
<tr>
|
7 |
-
<td class="a-center bold">
|
8 |
-
<span><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></span><br>
|
9 |
-
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalShipments() ?></span>
|
10 |
-
</td>
|
11 |
-
<td class="a-center bold">
|
12 |
-
<span><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></span><br>
|
13 |
-
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalVisits() ?></span>
|
14 |
-
</td>
|
15 |
-
</tr>
|
16 |
-
</tbody>
|
17 |
-
</table>
|
18 |
-
<a class="a-right"
|
19 |
-
style="display:block;text-decoration:none;padding:5px 15px;border-top:1px solid #dadfe0;margin-top:10px;"
|
20 |
-
href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/packpintracks/dashboard") ?>"><?php echo Mage::helper('pptrack')->__('More Details') ?> »</a>
|
21 |
-
</fieldset>
|
22 |
</div>
|
1 |
+
<div class="entry-edit">
|
2 |
+
<div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Packpin Stats') ?></h4></div>
|
3 |
+
<fieldset style="padding:10px 0 0;">
|
4 |
+
<table width="100%" cellspacing="0">
|
5 |
+
<tbody>
|
6 |
+
<tr>
|
7 |
+
<td class="a-center bold">
|
8 |
+
<span><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></span><br>
|
9 |
+
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalShipments() ?></span>
|
10 |
+
</td>
|
11 |
+
<td class="a-center bold">
|
12 |
+
<span><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></span><br>
|
13 |
+
<span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalVisits() ?></span>
|
14 |
+
</td>
|
15 |
+
</tr>
|
16 |
+
</tbody>
|
17 |
+
</table>
|
18 |
+
<a class="a-right"
|
19 |
+
style="display:block;text-decoration:none;padding:5px 15px;border-top:1px solid #dadfe0;margin-top:10px;"
|
20 |
+
href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/packpintracks/dashboard") ?>"><?php echo Mage::helper('pptrack')->__('More Details') ?> »</a>
|
21 |
+
</fieldset>
|
22 |
</div>
|
app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/hint.phtml
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @see Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
|
4 |
-
*/
|
5 |
-
?>
|
6 |
-
<?php if ($this->haveTempKey()) : ?>
|
7 |
-
<div class="packpin-notice">
|
8 |
-
<h4>
|
9 |
-
<?php if (!$this->getDaysLeft()) : ?>
|
10 |
-
<span class="packpin-notice-date"><?php echo Mage::helper('pptrack')->__('Your temporary API key has expired!') ?></span>
|
11 |
-
<?php else : ?>
|
12 |
-
<?php echo Mage::helper('pptrack')->__('Your temporary API key will expire in') ?>
|
13 |
-
<span class="packpin-notice-date"><?php echo sprintf(Mage::helper('pptrack')->__('%s days'), $this->getDaysLeft()) ?>!</span>
|
14 |
-
<?php endif; ?>
|
15 |
-
</h4>
|
16 |
-
</div>
|
17 |
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @see Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
|
4 |
+
*/
|
5 |
+
?>
|
6 |
+
<?php if ($this->haveTempKey()) : ?>
|
7 |
+
<div class="packpin-notice">
|
8 |
+
<h4>
|
9 |
+
<?php if (!$this->getDaysLeft()) : ?>
|
10 |
+
<span class="packpin-notice-date"><?php echo Mage::helper('pptrack')->__('Your temporary API key has expired!') ?></span>
|
11 |
+
<?php else : ?>
|
12 |
+
<?php echo Mage::helper('pptrack')->__('Your temporary API key will expire in') ?>
|
13 |
+
<span class="packpin-notice-date"><?php echo sprintf(Mage::helper('pptrack')->__('%s days'), $this->getDaysLeft()) ?>!</span>
|
14 |
+
<?php endif; ?>
|
15 |
+
</h4>
|
16 |
+
</div>
|
17 |
<?php endif; ?>
|
app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/scripts.phtml
CHANGED
@@ -1,79 +1,79 @@
|
|
1 |
-
<script>
|
2 |
-
//Event.observe(window, 'load', function() {
|
3 |
-
//Event.observe('points_options_config_points_expiration_period', 'change', checkExpirationPeriod);
|
4 |
-
//checkExpirationPeriod();
|
5 |
-
//})
|
6 |
-
function checkCrossInputs() {
|
7 |
-
var v1 = $('pp_section_setttings_crosssell_cross_sell_page_type').value;
|
8 |
-
var v2 = $('pp_section_setttings_crosssell_cross_sell_email_type').value;
|
9 |
-
|
10 |
-
if (v1 == 'products') {
|
11 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
|
12 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
|
13 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
|
14 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_items').show();
|
15 |
-
}
|
16 |
-
else if (v1 == 'ads') {
|
17 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_image').show();
|
18 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_image_url').show();
|
19 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
|
20 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
|
21 |
-
}
|
22 |
-
else {
|
23 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_script').show();
|
24 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
|
25 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
|
26 |
-
$('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
|
27 |
-
}
|
28 |
-
|
29 |
-
if (v2 == 'products') {
|
30 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_image').hide();
|
31 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_image_url').hide();
|
32 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
|
33 |
-
}
|
34 |
-
else if (v2 == 'ads') {
|
35 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
|
36 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
|
37 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_items').hide();
|
38 |
-
}
|
39 |
-
else {
|
40 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
|
41 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
|
42 |
-
$('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
|
43 |
-
}
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
Event.observe(window, "load", function() {
|
48 |
-
checkCrossInputs();
|
49 |
-
Event.observe('pp_section_setttings_crosssell_cross_sell_page_type', 'change', checkCrossInputs);
|
50 |
-
Event.observe('pp_section_setttings_crosssell_cross_sell_email_type', 'change', checkCrossInputs);
|
51 |
-
});
|
52 |
-
|
53 |
-
//for packpin chat
|
54 |
-
<?php $user = Mage::getSingleton('admin/session'); ?>
|
55 |
-
window.intercomSettings = {
|
56 |
-
"plugin": "magento",
|
57 |
-
name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
|
58 |
-
email: "<?php echo $user->getUser()->getEmail() ?>",
|
59 |
-
app_id: "n806bjdu",
|
60 |
-
"api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
|
61 |
-
"plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
|
62 |
-
"plugin_shop_version": "<?php echo Mage::getVersion() ?>",
|
63 |
-
"shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
|
64 |
-
"shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
|
65 |
-
"shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
|
66 |
-
};
|
67 |
-
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
|
68 |
-
|
69 |
-
if ($$(".error-msg").length) {
|
70 |
-
Intercom('showNewMessage');
|
71 |
-
|
72 |
-
if ($$(".error-msg")[0].innerHTML.indexOf("notifications") != -1) {
|
73 |
-
|
74 |
-
}
|
75 |
-
else {
|
76 |
-
|
77 |
-
}
|
78 |
-
}
|
79 |
</script>
|
1 |
+
<script>
|
2 |
+
//Event.observe(window, 'load', function() {
|
3 |
+
//Event.observe('points_options_config_points_expiration_period', 'change', checkExpirationPeriod);
|
4 |
+
//checkExpirationPeriod();
|
5 |
+
//})
|
6 |
+
function checkCrossInputs() {
|
7 |
+
var v1 = $('pp_section_setttings_crosssell_cross_sell_page_type').value;
|
8 |
+
var v2 = $('pp_section_setttings_crosssell_cross_sell_email_type').value;
|
9 |
+
|
10 |
+
if (v1 == 'products') {
|
11 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
|
12 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
|
13 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
|
14 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_items').show();
|
15 |
+
}
|
16 |
+
else if (v1 == 'ads') {
|
17 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_image').show();
|
18 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_image_url').show();
|
19 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
|
20 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
|
21 |
+
}
|
22 |
+
else {
|
23 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_script').show();
|
24 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
|
25 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
|
26 |
+
$('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
|
27 |
+
}
|
28 |
+
|
29 |
+
if (v2 == 'products') {
|
30 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_image').hide();
|
31 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_image_url').hide();
|
32 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
|
33 |
+
}
|
34 |
+
else if (v2 == 'ads') {
|
35 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
|
36 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
|
37 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_items').hide();
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
|
41 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
|
42 |
+
$('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
Event.observe(window, "load", function() {
|
48 |
+
checkCrossInputs();
|
49 |
+
Event.observe('pp_section_setttings_crosssell_cross_sell_page_type', 'change', checkCrossInputs);
|
50 |
+
Event.observe('pp_section_setttings_crosssell_cross_sell_email_type', 'change', checkCrossInputs);
|
51 |
+
});
|
52 |
+
|
53 |
+
//for packpin chat
|
54 |
+
<?php $user = Mage::getSingleton('admin/session'); ?>
|
55 |
+
window.intercomSettings = {
|
56 |
+
"plugin": "magento",
|
57 |
+
name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
|
58 |
+
email: "<?php echo $user->getUser()->getEmail() ?>",
|
59 |
+
app_id: "n806bjdu",
|
60 |
+
"api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
|
61 |
+
"plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
|
62 |
+
"plugin_shop_version": "<?php echo Mage::getVersion() ?>",
|
63 |
+
"shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
|
64 |
+
"shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
|
65 |
+
"shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
|
66 |
+
};
|
67 |
+
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
|
68 |
+
|
69 |
+
if ($$(".error-msg").length) {
|
70 |
+
Intercom('showNewMessage');
|
71 |
+
|
72 |
+
if ($$(".error-msg")[0].innerHTML.indexOf("notifications") != -1) {
|
73 |
+
|
74 |
+
}
|
75 |
+
else {
|
76 |
+
|
77 |
+
}
|
78 |
+
}
|
79 |
</script>
|
app/design/frontend/base/default/layout/pptrack.xml
CHANGED
@@ -1,52 +1,52 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="1.5.4">
|
3 |
-
<pptrack_index_index>
|
4 |
-
<reference name="root">
|
5 |
-
<action method="setTemplate">
|
6 |
-
<template>page/1column.phtml</template>
|
7 |
-
</action>
|
8 |
-
</reference>
|
9 |
-
<reference name="head">
|
10 |
-
<action method="addCss">
|
11 |
-
<stylesheet>css/pptrack.css</stylesheet>
|
12 |
-
</action>
|
13 |
-
</reference>
|
14 |
-
<reference name="content">
|
15 |
-
<block type="pptrack/index" name="pptrack_index" template="pptrack/index.phtml">
|
16 |
-
<block type="pptrack/crosssell" name="pptrack_crosssell" template="pptrack/crosssell.phtml"/>
|
17 |
-
<block type="pptrack/ads" name="pptrack_ads" template="pptrack/ads.phtml"/>
|
18 |
-
<block type="pptrack/script" name="pptrack_script" template="pptrack/script.phtml"/>
|
19 |
-
</block>
|
20 |
-
</reference>
|
21 |
-
</pptrack_index_index>
|
22 |
-
<pptrack_index_popup>
|
23 |
-
<reference name="root">
|
24 |
-
<action method="setTemplate">
|
25 |
-
<template>page/popup.phtml</template>
|
26 |
-
</action>
|
27 |
-
</reference>
|
28 |
-
<reference name="head">
|
29 |
-
<action method="addCss">
|
30 |
-
<stylesheet>css/pptrack.css</stylesheet>
|
31 |
-
</action>
|
32 |
-
</reference>
|
33 |
-
<reference name="content">
|
34 |
-
<block type="pptrack/index" name="pptrack_popup" template="pptrack/popup.phtml"/>
|
35 |
-
</reference>
|
36 |
-
</pptrack_index_popup>
|
37 |
-
<pptrack_unsubscribe_index>
|
38 |
-
<reference name="root">
|
39 |
-
<action method="setTemplate">
|
40 |
-
<template>page/1column.phtml</template>
|
41 |
-
</action>
|
42 |
-
</reference>
|
43 |
-
<reference name="head">
|
44 |
-
<action method="addCss">
|
45 |
-
<stylesheet>css/pptrack.css</stylesheet>
|
46 |
-
</action>
|
47 |
-
</reference>
|
48 |
-
<reference name="content">
|
49 |
-
<block type="pptrack/index" name="pptrack_unsubscribe_index" template="pptrack/unsubscribe.phtml"/>
|
50 |
-
</reference>
|
51 |
-
</pptrack_unsubscribe_index>
|
52 |
-
</layout>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="1.5.4">
|
3 |
+
<pptrack_index_index>
|
4 |
+
<reference name="root">
|
5 |
+
<action method="setTemplate">
|
6 |
+
<template>page/1column.phtml</template>
|
7 |
+
</action>
|
8 |
+
</reference>
|
9 |
+
<reference name="head">
|
10 |
+
<action method="addCss">
|
11 |
+
<stylesheet>css/pptrack.css</stylesheet>
|
12 |
+
</action>
|
13 |
+
</reference>
|
14 |
+
<reference name="content">
|
15 |
+
<block type="pptrack/index" name="pptrack_index" template="pptrack/index.phtml">
|
16 |
+
<block type="pptrack/crosssell" name="pptrack_crosssell" template="pptrack/crosssell.phtml"/>
|
17 |
+
<block type="pptrack/ads" name="pptrack_ads" template="pptrack/ads.phtml"/>
|
18 |
+
<block type="pptrack/script" name="pptrack_script" template="pptrack/script.phtml"/>
|
19 |
+
</block>
|
20 |
+
</reference>
|
21 |
+
</pptrack_index_index>
|
22 |
+
<pptrack_index_popup>
|
23 |
+
<reference name="root">
|
24 |
+
<action method="setTemplate">
|
25 |
+
<template>page/popup.phtml</template>
|
26 |
+
</action>
|
27 |
+
</reference>
|
28 |
+
<reference name="head">
|
29 |
+
<action method="addCss">
|
30 |
+
<stylesheet>css/pptrack.css</stylesheet>
|
31 |
+
</action>
|
32 |
+
</reference>
|
33 |
+
<reference name="content">
|
34 |
+
<block type="pptrack/index" name="pptrack_popup" template="pptrack/popup.phtml"/>
|
35 |
+
</reference>
|
36 |
+
</pptrack_index_popup>
|
37 |
+
<pptrack_unsubscribe_index>
|
38 |
+
<reference name="root">
|
39 |
+
<action method="setTemplate">
|
40 |
+
<template>page/1column.phtml</template>
|
41 |
+
</action>
|
42 |
+
</reference>
|
43 |
+
<reference name="head">
|
44 |
+
<action method="addCss">
|
45 |
+
<stylesheet>css/pptrack.css</stylesheet>
|
46 |
+
</action>
|
47 |
+
</reference>
|
48 |
+
<reference name="content">
|
49 |
+
<block type="pptrack/index" name="pptrack_unsubscribe_index" template="pptrack/unsubscribe.phtml"/>
|
50 |
+
</reference>
|
51 |
+
</pptrack_unsubscribe_index>
|
52 |
+
</layout>
|
app/design/frontend/base/default/template/pptrack/ads.phtml
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
$image = $this->getImage();
|
3 |
-
$url = $this->getImageUrl();
|
4 |
-
?>
|
5 |
-
<?php if ($image) : ?>
|
6 |
-
<div class="pptrack-top-image">
|
7 |
-
<?php if ($url) : ?>
|
8 |
-
<a href="<?php echo $url ?>" target="_blank">
|
9 |
-
<?php endif; ?>
|
10 |
-
<img src="<?php echo $image ?>" alt="">
|
11 |
-
<?php if ($url) : ?>
|
12 |
-
</a>
|
13 |
-
<?php endif; ?>
|
14 |
-
</div>
|
15 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
$image = $this->getImage();
|
3 |
+
$url = $this->getImageUrl();
|
4 |
+
?>
|
5 |
+
<?php if ($image) : ?>
|
6 |
+
<div class="pptrack-top-image">
|
7 |
+
<?php if ($url) : ?>
|
8 |
+
<a href="<?php echo $url ?>" target="_blank">
|
9 |
+
<?php endif; ?>
|
10 |
+
<img src="<?php echo $image ?>" alt="">
|
11 |
+
<?php if ($url) : ?>
|
12 |
+
</a>
|
13 |
+
<?php endif; ?>
|
14 |
+
</div>
|
15 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/pptrack/ads_email.phtml
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
$image = $this->getEmailImage();
|
3 |
-
$url = $this->getEmailImageUrl();
|
4 |
-
?>
|
5 |
-
<?php if ($image) : ?>
|
6 |
-
<div class="pptrack-top-image" style="margin-top:5px;text-align:center;width:100%;">
|
7 |
-
<?php if ($url) : ?>
|
8 |
-
<a style="display:block;text-align:center;width:100%;text-decoration: none;" href="<?php echo $url ?>" target="_blank">
|
9 |
-
<?php endif; ?>
|
10 |
-
<img style="max-width: 100%;height: auto;margin: 0 auto;" src="<?php echo $image ?>" alt="">
|
11 |
-
<?php if ($url) : ?>
|
12 |
-
</a>
|
13 |
-
<?php endif; ?>
|
14 |
-
</div>
|
15 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
$image = $this->getEmailImage();
|
3 |
+
$url = $this->getEmailImageUrl();
|
4 |
+
?>
|
5 |
+
<?php if ($image) : ?>
|
6 |
+
<div class="pptrack-top-image" style="margin-top:5px;text-align:center;width:100%;">
|
7 |
+
<?php if ($url) : ?>
|
8 |
+
<a style="display:block;text-align:center;width:100%;text-decoration: none;" href="<?php echo $url ?>" target="_blank">
|
9 |
+
<?php endif; ?>
|
10 |
+
<img style="max-width: 100%;height: auto;margin: 0 auto;" src="<?php echo $image ?>" alt="">
|
11 |
+
<?php if ($url) : ?>
|
12 |
+
</a>
|
13 |
+
<?php endif; ?>
|
14 |
+
</div>
|
15 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/pptrack/crosssell.phtml
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
<?php
|
2 |
-
$limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_items');
|
3 |
-
$collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
|
4 |
-
$count = count($collection);
|
5 |
-
?>
|
6 |
-
<?php if($count): ?>
|
7 |
-
<div class="pptrack-crosssell">
|
8 |
-
<h2><?php echo Mage::helper('pptrack')->__('While waiting, we have something for you. Check offerings bellow:') ?></h2>
|
9 |
-
<ul class="pptrack-products-grid pptrack-products-grid--col-<?php echo $count ?>">
|
10 |
-
<?php foreach ($collection as $_item): ?>
|
11 |
-
<li>
|
12 |
-
<div class="pptrack-list-info-box-wrap">
|
13 |
-
<div class="pptrack-list-info-box">
|
14 |
-
<a class="pptrack-product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
|
15 |
-
<img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 150); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
|
16 |
-
</a>
|
17 |
-
<h3 class="pptrack-product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h3>
|
18 |
-
<?php echo $this->getPriceHtml($_item, true) ?>
|
19 |
-
</div>
|
20 |
-
</div>
|
21 |
-
<button type="button" title="<?php echo Mage::helper('pptrack')->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo Mage::helper('pptrack')->__('Add to Cart') ?></span></span></button>
|
22 |
-
</li>
|
23 |
-
<?php endforeach; ?>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
<script type="text/javascript">
|
27 |
-
function fixCrossBoxes() {
|
28 |
-
var max = 0;
|
29 |
-
$$(".pptrack-list-info-box").forEach(function (el) {
|
30 |
-
max = Math.max(max, el.getHeight());
|
31 |
-
});
|
32 |
-
$$(".pptrack-list-info-box-wrap").forEach(function (el) {
|
33 |
-
el.setStyle({
|
34 |
-
height: max + 'px'
|
35 |
-
});
|
36 |
-
});
|
37 |
-
}
|
38 |
-
window.onresize = function(event) {
|
39 |
-
fixCrossBoxes();
|
40 |
-
};
|
41 |
-
|
42 |
-
Event.observe(window, "load", function() {
|
43 |
-
fixCrossBoxes();
|
44 |
-
|
45 |
-
}, false);
|
46 |
-
|
47 |
-
</script>
|
48 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
$limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_items');
|
3 |
+
$collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
|
4 |
+
$count = count($collection);
|
5 |
+
?>
|
6 |
+
<?php if($count): ?>
|
7 |
+
<div class="pptrack-crosssell">
|
8 |
+
<h2><?php echo Mage::helper('pptrack')->__('While waiting, we have something for you. Check offerings bellow:') ?></h2>
|
9 |
+
<ul class="pptrack-products-grid pptrack-products-grid--col-<?php echo $count ?>">
|
10 |
+
<?php foreach ($collection as $_item): ?>
|
11 |
+
<li>
|
12 |
+
<div class="pptrack-list-info-box-wrap">
|
13 |
+
<div class="pptrack-list-info-box">
|
14 |
+
<a class="pptrack-product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
|
15 |
+
<img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 150); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
|
16 |
+
</a>
|
17 |
+
<h3 class="pptrack-product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h3>
|
18 |
+
<?php echo $this->getPriceHtml($_item, true) ?>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
<button type="button" title="<?php echo Mage::helper('pptrack')->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo Mage::helper('pptrack')->__('Add to Cart') ?></span></span></button>
|
22 |
+
</li>
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</ul>
|
25 |
+
</div>
|
26 |
+
<script type="text/javascript">
|
27 |
+
function fixCrossBoxes() {
|
28 |
+
var max = 0;
|
29 |
+
$$(".pptrack-list-info-box").forEach(function (el) {
|
30 |
+
max = Math.max(max, el.getHeight());
|
31 |
+
});
|
32 |
+
$$(".pptrack-list-info-box-wrap").forEach(function (el) {
|
33 |
+
el.setStyle({
|
34 |
+
height: max + 'px'
|
35 |
+
});
|
36 |
+
});
|
37 |
+
}
|
38 |
+
window.onresize = function(event) {
|
39 |
+
fixCrossBoxes();
|
40 |
+
};
|
41 |
+
|
42 |
+
Event.observe(window, "load", function() {
|
43 |
+
fixCrossBoxes();
|
44 |
+
|
45 |
+
}, false);
|
46 |
+
|
47 |
+
</script>
|
48 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/pptrack/crosssell_email.phtml
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
$limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_items');
|
3 |
-
$collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
|
4 |
-
?>
|
5 |
-
|
6 |
-
<?php if(count($collection)): ?>
|
7 |
-
<div style="margin-top:5px;font-size:12px;font-weight:400;text-align:center;;line-height:14px;">
|
8 |
-
While you are waiting, we have something for you.
|
9 |
-
<br>
|
10 |
-
Check the offerings bellow:
|
11 |
-
</div>
|
12 |
-
<div style="margin-top:20px;">
|
13 |
-
<table border="0" cellspacing="10" width="100%;">
|
14 |
-
<tr>
|
15 |
-
<?php foreach ($collection as $_item): ?>
|
16 |
-
<td valign="top" style="text-align:center !important;font-size:11px;background:#ffffff;padding:10px;">
|
17 |
-
<a style="display:block;text-decoration:none;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
|
18 |
-
<img style="max-width:100%;" src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 100); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
|
19 |
-
</a>
|
20 |
-
<a style="display:block;text-decoration:none;font-size:11px;font-weight:400;text-align:center;color:#333333;text-transform:uppercase;" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a>
|
21 |
-
<div style="margin-top:7px;font-size:11px;font-weight:700;text-align:center;">
|
22 |
-
<?php echo $this->getPriceHtml($_item, false) ?>
|
23 |
-
</div>
|
24 |
-
<a style="display:inline-block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;margin-top:3px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
|
25 |
-
READ MORE
|
26 |
-
</a>
|
27 |
-
</td>
|
28 |
-
<?php endforeach; ?>
|
29 |
-
</tr>
|
30 |
-
</table>
|
31 |
-
</div>
|
32 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
$limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_items');
|
3 |
+
$collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
|
4 |
+
?>
|
5 |
+
|
6 |
+
<?php if(count($collection)): ?>
|
7 |
+
<div style="margin-top:5px;font-size:12px;font-weight:400;text-align:center;;line-height:14px;">
|
8 |
+
While you are waiting, we have something for you.
|
9 |
+
<br>
|
10 |
+
Check the offerings bellow:
|
11 |
+
</div>
|
12 |
+
<div style="margin-top:20px;">
|
13 |
+
<table border="0" cellspacing="10" width="100%;">
|
14 |
+
<tr>
|
15 |
+
<?php foreach ($collection as $_item): ?>
|
16 |
+
<td valign="top" style="text-align:center !important;font-size:11px;background:#ffffff;padding:10px;">
|
17 |
+
<a style="display:block;text-decoration:none;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
|
18 |
+
<img style="max-width:100%;" src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 100); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
|
19 |
+
</a>
|
20 |
+
<a style="display:block;text-decoration:none;font-size:11px;font-weight:400;text-align:center;color:#333333;text-transform:uppercase;" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a>
|
21 |
+
<div style="margin-top:7px;font-size:11px;font-weight:700;text-align:center;">
|
22 |
+
<?php echo $this->getPriceHtml($_item, false) ?>
|
23 |
+
</div>
|
24 |
+
<a style="display:inline-block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;margin-top:3px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
|
25 |
+
READ MORE
|
26 |
+
</a>
|
27 |
+
</td>
|
28 |
+
<?php endforeach; ?>
|
29 |
+
</tr>
|
30 |
+
</table>
|
31 |
+
</div>
|
32 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/pptrack/email/order/shipment/track.phtml
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
<?php $_shipment=$this->getShipment() ?>
|
2 |
-
<?php $_order=$this->getOrder() ?>
|
3 |
-
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
|
4 |
-
<table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
|
5 |
-
<thead>
|
6 |
-
<tr>
|
7 |
-
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Shipped By') ?></th>
|
8 |
-
<th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Tracking Number') ?></th>
|
9 |
-
<th bgcolor="#EAEAEA" style="padding:3px 9px"> </th>
|
10 |
-
</tr>
|
11 |
-
</thead>
|
12 |
-
<tbody>
|
13 |
-
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
|
14 |
-
<tr <?php echo $i%2?'bgcolor="#F6F6F6"':'' ?>>
|
15 |
-
<td align="left" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getTitle()) ?></td>
|
16 |
-
<td align="center" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getNumber()) ?></td>
|
17 |
-
<td align="center" valign="top" style="padding:3px 9px">
|
18 |
-
<?php if ($this->shipmentTracked($_item, $_order)) : ?>
|
19 |
-
<?php $ppTrack = $this->getTrackModel(); ?>
|
20 |
-
<a href="<?php echo $ppTrack->getDetailsUrl() ?>" style="cursor:pointer;text-decoration:none;display:inline-block;padding:4px 14px;border:1px solid transparent;border-radius:6px;color:#ffffff;background: #24aaa3;"><img style="vertical-align: middle;margin-right:7px;" width="16" height="16" src="<?php echo $this->getSkinUrl('images/pptrack/truck.png') ?>" alt="track"><?php echo Mage::helper('pptrack')->__('Track your item') ?></a>
|
21 |
-
<?php endif; ?>
|
22 |
-
</td>
|
23 |
-
</tr>
|
24 |
-
<?php endforeach ?>
|
25 |
-
</tbody>
|
26 |
-
</table>
|
27 |
<?php endif; ?>
|
1 |
+
<?php $_shipment=$this->getShipment() ?>
|
2 |
+
<?php $_order=$this->getOrder() ?>
|
3 |
+
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
|
4 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
|
5 |
+
<thead>
|
6 |
+
<tr>
|
7 |
+
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Shipped By') ?></th>
|
8 |
+
<th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Tracking Number') ?></th>
|
9 |
+
<th bgcolor="#EAEAEA" style="padding:3px 9px"> </th>
|
10 |
+
</tr>
|
11 |
+
</thead>
|
12 |
+
<tbody>
|
13 |
+
<?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
|
14 |
+
<tr <?php echo $i%2?'bgcolor="#F6F6F6"':'' ?>>
|
15 |
+
<td align="left" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getTitle()) ?></td>
|
16 |
+
<td align="center" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getNumber()) ?></td>
|
17 |
+
<td align="center" valign="top" style="padding:3px 9px">
|
18 |
+
<?php if ($this->shipmentTracked($_item, $_order)) : ?>
|
19 |
+
<?php $ppTrack = $this->getTrackModel(); ?>
|
20 |
+
<a href="<?php echo $ppTrack->getDetailsUrl() ?>" style="cursor:pointer;text-decoration:none;display:inline-block;padding:4px 14px;border:1px solid transparent;border-radius:6px;color:#ffffff;background: #24aaa3;"><img style="vertical-align: middle;margin-right:7px;" width="16" height="16" src="<?php echo $this->getSkinUrl('images/pptrack/truck.png') ?>" alt="track"><?php echo Mage::helper('pptrack')->__('Track your item') ?></a>
|
21 |
+
<?php endif; ?>
|
22 |
+
</td>
|
23 |
+
</tr>
|
24 |
+
<?php endforeach ?>
|
25 |
+
</tbody>
|
26 |
+
</table>
|
27 |
<?php endif; ?>
|
app/design/frontend/base/default/template/pptrack/index.phtml
CHANGED
@@ -1,175 +1,175 @@
|
|
1 |
-
<?php
|
2 |
-
if ($this->newTemplate) {
|
3 |
-
echo $this->setTemplate('pptrack/index_new.phtml')->toHtml();
|
4 |
-
|
5 |
-
return false;
|
6 |
-
}
|
7 |
-
|
8 |
-
|
9 |
-
if ($this->model)
|
10 |
-
$model = $this->model;
|
11 |
-
else
|
12 |
-
$model = Mage::registry('model');
|
13 |
-
|
14 |
-
$shippingInfo = $model->getShippingInfo();
|
15 |
-
$_helper = $this->helper('catalog/output');
|
16 |
-
?>
|
17 |
-
|
18 |
-
<?php
|
19 |
-
if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
|
20 |
-
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
|
21 |
-
$child = $this->getChild("pptrack_script");
|
22 |
-
if ($child) {
|
23 |
-
echo $this->getChildHtml('pptrack_script');
|
24 |
-
}
|
25 |
-
}
|
26 |
-
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
|
27 |
-
$child = $this->getChild("pptrack_ads");
|
28 |
-
if ($child) {
|
29 |
-
echo $this->getChildHtml('pptrack_ads');
|
30 |
-
}
|
31 |
-
}
|
32 |
-
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
|
33 |
-
$child = $this->getChild("pptrack_crosssell");
|
34 |
-
if ($child) {
|
35 |
-
$child->setData("orderId", $model->getOrderId());
|
36 |
-
echo $this->getChildHtml('pptrack_crosssell');
|
37 |
-
}
|
38 |
-
}
|
39 |
-
}
|
40 |
-
?>
|
41 |
-
|
42 |
-
<div style="clear:both;"></div>
|
43 |
-
<?php if (!$model->getStatus()): ?>
|
44 |
-
<br>
|
45 |
-
<br>
|
46 |
-
<h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
|
47 |
-
<br>
|
48 |
-
<?php else: ?>
|
49 |
-
|
50 |
-
<div class="pptrack-wrapper">
|
51 |
-
<h2><?php echo Mage::helper('pptrack')->__('Shipment Information'); ?></h2>
|
52 |
-
<br/>
|
53 |
-
|
54 |
-
<div class="pptrack-progress">
|
55 |
-
<div class="pptrack-progress-bar-wrapper">
|
56 |
-
<div class="pptrack-progress-bar-wrapper">
|
57 |
-
<ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
|
58 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
|
59 |
-
<div
|
60 |
-
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
|
61 |
-
<span class="pptrack-progress-bubble"></span>
|
62 |
-
</li>
|
63 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
|
64 |
-
<div
|
65 |
-
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
|
66 |
-
<span class="pptrack-progress-bubble"></span>
|
67 |
-
</li>
|
68 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
|
69 |
-
<div
|
70 |
-
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
|
71 |
-
<span class="pptrack-progress-bubble"></span>
|
72 |
-
</li>
|
73 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
|
74 |
-
<div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
|
75 |
-
<span class="pptrack-progress-bubble"></span>
|
76 |
-
</li>
|
77 |
-
</ul>
|
78 |
-
</div>
|
79 |
-
</div>
|
80 |
-
</div>
|
81 |
-
<br/>
|
82 |
-
<br/>
|
83 |
-
|
84 |
-
<div class="pptrack-tracking-info">
|
85 |
-
<h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
|
86 |
-
|
87 |
-
<div class="pptrack-tracking-info-details">
|
88 |
-
<?php $details = $model->getDetails(); ?>
|
89 |
-
<?php if (!$details) : ?>
|
90 |
-
<div class="pptrack-info-row">
|
91 |
-
<div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
|
92 |
-
<br/><?php echo date("H:i:s", $model->created_at) ?></div>
|
93 |
-
<div class="pptrack-info-row-details-wrapper">
|
94 |
-
<div class="pptrack-info-row-details">
|
95 |
-
<?php echo Mage::helper('pptrack')->__("Package prepared for dispatch") ?>
|
96 |
-
</div>
|
97 |
-
</div>
|
98 |
-
<div style="clear:both;display:table;"></div>
|
99 |
-
</div>
|
100 |
-
<?php else : ?>
|
101 |
-
<?php foreach ($details as $detail): ?>
|
102 |
-
<div class="pptrack-info-row">
|
103 |
-
<div>
|
104 |
-
<div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
|
105 |
-
<br/><?php echo $detail->getEventTime(); ?></div>
|
106 |
-
<div class="pptrack-info-row-details-wrapper">
|
107 |
-
<div class="pptrack-info-row-details">
|
108 |
-
<?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
|
109 |
-
<div
|
110 |
-
class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
|
111 |
-
</div>
|
112 |
-
</div>
|
113 |
-
<div style="clear:both;display:table;"></div>
|
114 |
-
</div>
|
115 |
-
</div>
|
116 |
-
<?php endforeach; ?>
|
117 |
-
<?php endif; ?>
|
118 |
-
</div>
|
119 |
-
</div>
|
120 |
-
<div class="pptrack-tracking-general-info">
|
121 |
-
<h2>Info</h2>
|
122 |
-
|
123 |
-
<div class="pptrack-tracking-general-info-details">
|
124 |
-
<div class="pptrack-tracking-row">
|
125 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
|
126 |
-
<span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
|
127 |
-
<br style="clear: both;"/>
|
128 |
-
</div>
|
129 |
-
<div class="pptrack-tracking-row">
|
130 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
|
131 |
-
<span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
|
132 |
-
<br style="clear: both;"/>
|
133 |
-
</div>
|
134 |
-
<div class="pptrack-tracking-row">
|
135 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
|
136 |
-
<span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
|
137 |
-
<br style="clear: both;"/>
|
138 |
-
</div>
|
139 |
-
<div class="pptrack-tracking-row">
|
140 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
|
141 |
-
<span
|
142 |
-
class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
|
143 |
-
<br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
|
144 |
-
<br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
|
145 |
-
<br style="clear: both;"/>
|
146 |
-
</div>
|
147 |
-
|
148 |
-
<br/>
|
149 |
-
|
150 |
-
<div class="pptrack-tracking-carrier-info-wrapper">
|
151 |
-
<span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
|
152 |
-
<br/>
|
153 |
-
|
154 |
-
<div class="pptrack-tracking-courier-logo">
|
155 |
-
<img src="<?php echo $model->getCarrierIcon() ?>"/>
|
156 |
-
</div>
|
157 |
-
<div class="pptrack-tracking-courier-info">
|
158 |
-
<h3><?php echo $model->getCarrierName() ?></h3>
|
159 |
-
<?php
|
160 |
-
$phone = $model->getCarrierPhone();
|
161 |
-
$homepage = $model->getCarrierHomepage();
|
162 |
-
?>
|
163 |
-
<?php if ($phone) : ?>
|
164 |
-
<span><?php echo $phone ?></span><br/>
|
165 |
-
<?php endif; ?>
|
166 |
-
<?php if ($homepage) : ?>
|
167 |
-
<a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
|
168 |
-
<?php endif; ?>
|
169 |
-
</div>
|
170 |
-
<div style="clear:both;"></div>
|
171 |
-
</div>
|
172 |
-
</div>
|
173 |
-
</div>
|
174 |
-
</div>
|
175 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
if ($this->newTemplate) {
|
3 |
+
echo $this->setTemplate('pptrack/index_new.phtml')->toHtml();
|
4 |
+
|
5 |
+
return false;
|
6 |
+
}
|
7 |
+
|
8 |
+
|
9 |
+
if ($this->model)
|
10 |
+
$model = $this->model;
|
11 |
+
else
|
12 |
+
$model = Mage::registry('model');
|
13 |
+
|
14 |
+
$shippingInfo = $model->getShippingInfo();
|
15 |
+
$_helper = $this->helper('catalog/output');
|
16 |
+
?>
|
17 |
+
|
18 |
+
<?php
|
19 |
+
if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
|
20 |
+
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
|
21 |
+
$child = $this->getChild("pptrack_script");
|
22 |
+
if ($child) {
|
23 |
+
echo $this->getChildHtml('pptrack_script');
|
24 |
+
}
|
25 |
+
}
|
26 |
+
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
|
27 |
+
$child = $this->getChild("pptrack_ads");
|
28 |
+
if ($child) {
|
29 |
+
echo $this->getChildHtml('pptrack_ads');
|
30 |
+
}
|
31 |
+
}
|
32 |
+
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
|
33 |
+
$child = $this->getChild("pptrack_crosssell");
|
34 |
+
if ($child) {
|
35 |
+
$child->setData("orderId", $model->getOrderId());
|
36 |
+
echo $this->getChildHtml('pptrack_crosssell');
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
|
42 |
+
<div style="clear:both;"></div>
|
43 |
+
<?php if (!$model->getStatus()): ?>
|
44 |
+
<br>
|
45 |
+
<br>
|
46 |
+
<h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
|
47 |
+
<br>
|
48 |
+
<?php else: ?>
|
49 |
+
|
50 |
+
<div class="pptrack-wrapper">
|
51 |
+
<h2><?php echo Mage::helper('pptrack')->__('Shipment Information'); ?></h2>
|
52 |
+
<br/>
|
53 |
+
|
54 |
+
<div class="pptrack-progress">
|
55 |
+
<div class="pptrack-progress-bar-wrapper">
|
56 |
+
<div class="pptrack-progress-bar-wrapper">
|
57 |
+
<ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
|
58 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
|
59 |
+
<div
|
60 |
+
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
|
61 |
+
<span class="pptrack-progress-bubble"></span>
|
62 |
+
</li>
|
63 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
|
64 |
+
<div
|
65 |
+
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
|
66 |
+
<span class="pptrack-progress-bubble"></span>
|
67 |
+
</li>
|
68 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
|
69 |
+
<div
|
70 |
+
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
|
71 |
+
<span class="pptrack-progress-bubble"></span>
|
72 |
+
</li>
|
73 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
|
74 |
+
<div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
|
75 |
+
<span class="pptrack-progress-bubble"></span>
|
76 |
+
</li>
|
77 |
+
</ul>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
<br/>
|
82 |
+
<br/>
|
83 |
+
|
84 |
+
<div class="pptrack-tracking-info">
|
85 |
+
<h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
|
86 |
+
|
87 |
+
<div class="pptrack-tracking-info-details">
|
88 |
+
<?php $details = $model->getDetails(); ?>
|
89 |
+
<?php if (!$details) : ?>
|
90 |
+
<div class="pptrack-info-row">
|
91 |
+
<div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
|
92 |
+
<br/><?php echo date("H:i:s", $model->created_at) ?></div>
|
93 |
+
<div class="pptrack-info-row-details-wrapper">
|
94 |
+
<div class="pptrack-info-row-details">
|
95 |
+
<?php echo Mage::helper('pptrack')->__("Package prepared for dispatch") ?>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
<div style="clear:both;display:table;"></div>
|
99 |
+
</div>
|
100 |
+
<?php else : ?>
|
101 |
+
<?php foreach ($details as $detail): ?>
|
102 |
+
<div class="pptrack-info-row">
|
103 |
+
<div>
|
104 |
+
<div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
|
105 |
+
<br/><?php echo $detail->getEventTime(); ?></div>
|
106 |
+
<div class="pptrack-info-row-details-wrapper">
|
107 |
+
<div class="pptrack-info-row-details">
|
108 |
+
<?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
|
109 |
+
<div
|
110 |
+
class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
<div style="clear:both;display:table;"></div>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
<?php endforeach; ?>
|
117 |
+
<?php endif; ?>
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
<div class="pptrack-tracking-general-info">
|
121 |
+
<h2>Info</h2>
|
122 |
+
|
123 |
+
<div class="pptrack-tracking-general-info-details">
|
124 |
+
<div class="pptrack-tracking-row">
|
125 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
|
126 |
+
<span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
|
127 |
+
<br style="clear: both;"/>
|
128 |
+
</div>
|
129 |
+
<div class="pptrack-tracking-row">
|
130 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
|
131 |
+
<span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
|
132 |
+
<br style="clear: both;"/>
|
133 |
+
</div>
|
134 |
+
<div class="pptrack-tracking-row">
|
135 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
|
136 |
+
<span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
|
137 |
+
<br style="clear: both;"/>
|
138 |
+
</div>
|
139 |
+
<div class="pptrack-tracking-row">
|
140 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
|
141 |
+
<span
|
142 |
+
class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
|
143 |
+
<br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
|
144 |
+
<br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
|
145 |
+
<br style="clear: both;"/>
|
146 |
+
</div>
|
147 |
+
|
148 |
+
<br/>
|
149 |
+
|
150 |
+
<div class="pptrack-tracking-carrier-info-wrapper">
|
151 |
+
<span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
|
152 |
+
<br/>
|
153 |
+
|
154 |
+
<div class="pptrack-tracking-courier-logo">
|
155 |
+
<img src="<?php echo $model->getCarrierIcon() ?>"/>
|
156 |
+
</div>
|
157 |
+
<div class="pptrack-tracking-courier-info">
|
158 |
+
<h3><?php echo $model->getCarrierName() ?></h3>
|
159 |
+
<?php
|
160 |
+
$phone = $model->getCarrierPhone();
|
161 |
+
$homepage = $model->getCarrierHomepage();
|
162 |
+
?>
|
163 |
+
<?php if ($phone) : ?>
|
164 |
+
<span><?php echo $phone ?></span><br/>
|
165 |
+
<?php endif; ?>
|
166 |
+
<?php if ($homepage) : ?>
|
167 |
+
<a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
|
168 |
+
<?php endif; ?>
|
169 |
+
</div>
|
170 |
+
<div style="clear:both;"></div>
|
171 |
+
</div>
|
172 |
+
</div>
|
173 |
+
</div>
|
174 |
+
</div>
|
175 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/pptrack/index_new.phtml
CHANGED
@@ -1,195 +1,195 @@
|
|
1 |
-
<?php
|
2 |
-
$_helper = $this->helper('catalog/output');
|
3 |
-
?>
|
4 |
-
|
5 |
-
<?php
|
6 |
-
if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
|
7 |
-
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
|
8 |
-
$child = $this->getChild("pptrack_script");
|
9 |
-
if ($child) {
|
10 |
-
echo $this->getChildHtml('pptrack_script');
|
11 |
-
}
|
12 |
-
}
|
13 |
-
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
|
14 |
-
$child = $this->getChild("pptrack_ads");
|
15 |
-
if ($child) {
|
16 |
-
echo $this->getChildHtml('pptrack_ads');
|
17 |
-
}
|
18 |
-
}
|
19 |
-
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
|
20 |
-
$child = $this->getChild("pptrack_crosssell");
|
21 |
-
if ($child) {
|
22 |
-
$child->setData("orderId", $this->orderId);
|
23 |
-
echo $this->getChildHtml('pptrack_crosssell');
|
24 |
-
}
|
25 |
-
}
|
26 |
-
}
|
27 |
-
?>
|
28 |
-
|
29 |
-
<div class="clearfix"></div>
|
30 |
-
<h2><?php echo Mage::helper('pptrack')->__('Track your order'); ?></h2>
|
31 |
-
<div class="clearfix"></div>
|
32 |
-
<form class="pptrack-form pptrack-boxmodel" method="get" action="">
|
33 |
-
<div class="pptrack-row">
|
34 |
-
<div class="pptrack-form-controls">
|
35 |
-
<label class="pptrack-label" for="pp_email"><?php echo Mage::helper('pptrack')->__('Your email'); ?></label>
|
36 |
-
<input value="<?php echo $this->email ?>" id="pp_email" class="pptrack-input" name="email" type="text" required>
|
37 |
-
</div>
|
38 |
-
<div class="pptrack-form-controls">
|
39 |
-
<label class="pptrack-label" for="pp_order"><?php echo Mage::helper('pptrack')->__('Order number'); ?></label>
|
40 |
-
<input value="<?php echo $this->orderNumber ?>" id="pp_order" class="pptrack-input" name="order"
|
41 |
-
type="text" required>
|
42 |
-
</div>
|
43 |
-
</div>
|
44 |
-
<button class="btn button pptrack-btn" type="submit"><?php echo Mage::helper('pptrack')->__('Submit'); ?></button>
|
45 |
-
</form>
|
46 |
-
<?php if ($this->msg) : ?>
|
47 |
-
<div class="pptrack-info">
|
48 |
-
<?php echo $this->msg ?>
|
49 |
-
</div>
|
50 |
-
<?php endif; ?>
|
51 |
-
|
52 |
-
<?php foreach($this->trackModels as $model) : ?>
|
53 |
-
<?php
|
54 |
-
$shippingInfo = $model->getShippingInfo();
|
55 |
-
?>
|
56 |
-
<br>
|
57 |
-
<div class="clearfix"></div>
|
58 |
-
<?php if (!$model->getStatus()): ?>
|
59 |
-
<br>
|
60 |
-
<br>
|
61 |
-
<h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
|
62 |
-
<br>
|
63 |
-
<?php else: ?>
|
64 |
-
|
65 |
-
<div class="pptrack-wrapper clearfix">
|
66 |
-
<h2><?php echo count($this->trackModels) == 1 ? Mage::helper('pptrack')->__('Shipment Information') : Mage::helper('pptrack')->__('Package:') . ' ' . strtoupper($model->code); ?></h2>
|
67 |
-
<br/>
|
68 |
-
|
69 |
-
<div id="#<?php echo strtoupper($model->code) ?>" class="pptrack-progress">
|
70 |
-
<div class="pptrack-progress-bar-wrapper">
|
71 |
-
<div class="pptrack-progress-bar-wrapper">
|
72 |
-
<ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
|
73 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
|
74 |
-
<div
|
75 |
-
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
|
76 |
-
<span class="pptrack-progress-bubble"></span>
|
77 |
-
</li>
|
78 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
|
79 |
-
<div
|
80 |
-
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
|
81 |
-
<span class="pptrack-progress-bubble"></span>
|
82 |
-
</li>
|
83 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
|
84 |
-
<div
|
85 |
-
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
|
86 |
-
<span class="pptrack-progress-bubble"></span>
|
87 |
-
</li>
|
88 |
-
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
|
89 |
-
<div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
|
90 |
-
<span class="pptrack-progress-bubble"></span>
|
91 |
-
</li>
|
92 |
-
</ul>
|
93 |
-
</div>
|
94 |
-
</div>
|
95 |
-
</div>
|
96 |
-
<br/>
|
97 |
-
<br/>
|
98 |
-
|
99 |
-
<div class="pptrack-tracking-info">
|
100 |
-
<h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
|
101 |
-
|
102 |
-
<div class="pptrack-tracking-info-details">
|
103 |
-
<?php $details = $model->getDetails(); ?>
|
104 |
-
<?php if (!$details) : ?>
|
105 |
-
<div class="pptrack-info-row">
|
106 |
-
<div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
|
107 |
-
<br/><?php echo date("H:i:s", $model->created_at) ?></div>
|
108 |
-
<div class="pptrack-info-row-details-wrapper">
|
109 |
-
<div class="pptrack-info-row-details">
|
110 |
-
<?php if ($model->status == Packpin_Pptrack_Model_Track::STATUS_PENDING) : ?>
|
111 |
-
<?php echo Mage::helper('pptrack')->__("Package status pending"); ?>
|
112 |
-
<?php else : ?>
|
113 |
-
<?php echo Mage::helper('pptrack')->__("Package prepared for dispatch"); ?>
|
114 |
-
<?php endif; ?>
|
115 |
-
</div>
|
116 |
-
</div>
|
117 |
-
<div style="clear:both;display:table;"></div>
|
118 |
-
</div>
|
119 |
-
<?php else : ?>
|
120 |
-
<?php foreach ($details as $detail): ?>
|
121 |
-
<div class="pptrack-info-row">
|
122 |
-
<div>
|
123 |
-
<div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
|
124 |
-
<br/><?php echo $detail->getEventTime(); ?></div>
|
125 |
-
<div class="pptrack-info-row-details-wrapper">
|
126 |
-
<div class="pptrack-info-row-details">
|
127 |
-
<?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
|
128 |
-
<div
|
129 |
-
class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
|
130 |
-
</div>
|
131 |
-
</div>
|
132 |
-
<div style="clear:both;display:table;"></div>
|
133 |
-
</div>
|
134 |
-
</div>
|
135 |
-
<?php endforeach; ?>
|
136 |
-
<?php endif; ?>
|
137 |
-
</div>
|
138 |
-
</div>
|
139 |
-
<div class="pptrack-tracking-general-info">
|
140 |
-
<h2>Info</h2>
|
141 |
-
|
142 |
-
<div class="pptrack-tracking-general-info-details">
|
143 |
-
<div class="pptrack-tracking-row">
|
144 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
|
145 |
-
<span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
|
146 |
-
<br style="clear: both;"/>
|
147 |
-
</div>
|
148 |
-
<div class="pptrack-tracking-row">
|
149 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
|
150 |
-
<span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
|
151 |
-
<br style="clear: both;"/>
|
152 |
-
</div>
|
153 |
-
<div class="pptrack-tracking-row">
|
154 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
|
155 |
-
<span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
|
156 |
-
<br style="clear: both;"/>
|
157 |
-
</div>
|
158 |
-
<div class="pptrack-tracking-row">
|
159 |
-
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
|
160 |
-
<span
|
161 |
-
class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
|
162 |
-
<br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
|
163 |
-
<br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
|
164 |
-
<br style="clear: both;"/>
|
165 |
-
</div>
|
166 |
-
|
167 |
-
<br/>
|
168 |
-
|
169 |
-
<div class="pptrack-tracking-carrier-info-wrapper">
|
170 |
-
<span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
|
171 |
-
<br/>
|
172 |
-
|
173 |
-
<div class="pptrack-tracking-courier-logo">
|
174 |
-
<img src="<?php echo $model->getCarrierIcon() ?>"/>
|
175 |
-
</div>
|
176 |
-
<div class="pptrack-tracking-courier-info">
|
177 |
-
<h3><?php echo $model->getCarrierName() ?></h3>
|
178 |
-
<?php
|
179 |
-
$phone = $model->getCarrierPhone();
|
180 |
-
$homepage = $model->getCarrierHomepage();
|
181 |
-
?>
|
182 |
-
<?php if ($phone) : ?>
|
183 |
-
<span><?php echo $phone ?></span><br/>
|
184 |
-
<?php endif; ?>
|
185 |
-
<?php if ($homepage) : ?>
|
186 |
-
<a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
|
187 |
-
<?php endif; ?>
|
188 |
-
</div>
|
189 |
-
<div style="clear:both;"></div>
|
190 |
-
</div>
|
191 |
-
</div>
|
192 |
-
</div>
|
193 |
-
</div>
|
194 |
-
<?php endif; ?>
|
195 |
-
<?php endforeach; ?>
|
1 |
+
<?php
|
2 |
+
$_helper = $this->helper('catalog/output');
|
3 |
+
?>
|
4 |
+
|
5 |
+
<?php
|
6 |
+
if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
|
7 |
+
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
|
8 |
+
$child = $this->getChild("pptrack_script");
|
9 |
+
if ($child) {
|
10 |
+
echo $this->getChildHtml('pptrack_script');
|
11 |
+
}
|
12 |
+
}
|
13 |
+
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
|
14 |
+
$child = $this->getChild("pptrack_ads");
|
15 |
+
if ($child) {
|
16 |
+
echo $this->getChildHtml('pptrack_ads');
|
17 |
+
}
|
18 |
+
}
|
19 |
+
if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
|
20 |
+
$child = $this->getChild("pptrack_crosssell");
|
21 |
+
if ($child) {
|
22 |
+
$child->setData("orderId", $this->orderId);
|
23 |
+
echo $this->getChildHtml('pptrack_crosssell');
|
24 |
+
}
|
25 |
+
}
|
26 |
+
}
|
27 |
+
?>
|
28 |
+
|
29 |
+
<div class="clearfix"></div>
|
30 |
+
<h2><?php echo Mage::helper('pptrack')->__('Track your order'); ?></h2>
|
31 |
+
<div class="clearfix"></div>
|
32 |
+
<form class="pptrack-form pptrack-boxmodel" method="get" action="">
|
33 |
+
<div class="pptrack-row">
|
34 |
+
<div class="pptrack-form-controls">
|
35 |
+
<label class="pptrack-label" for="pp_email"><?php echo Mage::helper('pptrack')->__('Your email'); ?></label>
|
36 |
+
<input value="<?php echo $this->email ?>" id="pp_email" class="pptrack-input" name="email" type="text" required>
|
37 |
+
</div>
|
38 |
+
<div class="pptrack-form-controls">
|
39 |
+
<label class="pptrack-label" for="pp_order"><?php echo Mage::helper('pptrack')->__('Order number'); ?></label>
|
40 |
+
<input value="<?php echo $this->orderNumber ?>" id="pp_order" class="pptrack-input" name="order"
|
41 |
+
type="text" required>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
<button class="btn button pptrack-btn" type="submit"><?php echo Mage::helper('pptrack')->__('Submit'); ?></button>
|
45 |
+
</form>
|
46 |
+
<?php if ($this->msg) : ?>
|
47 |
+
<div class="pptrack-info">
|
48 |
+
<?php echo $this->msg ?>
|
49 |
+
</div>
|
50 |
+
<?php endif; ?>
|
51 |
+
|
52 |
+
<?php foreach($this->trackModels as $model) : ?>
|
53 |
+
<?php
|
54 |
+
$shippingInfo = $model->getShippingInfo();
|
55 |
+
?>
|
56 |
+
<br>
|
57 |
+
<div class="clearfix"></div>
|
58 |
+
<?php if (!$model->getStatus()): ?>
|
59 |
+
<br>
|
60 |
+
<br>
|
61 |
+
<h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
|
62 |
+
<br>
|
63 |
+
<?php else: ?>
|
64 |
+
|
65 |
+
<div class="pptrack-wrapper clearfix">
|
66 |
+
<h2><?php echo count($this->trackModels) == 1 ? Mage::helper('pptrack')->__('Shipment Information') : Mage::helper('pptrack')->__('Package:') . ' ' . strtoupper($model->code); ?></h2>
|
67 |
+
<br/>
|
68 |
+
|
69 |
+
<div id="#<?php echo strtoupper($model->code) ?>" class="pptrack-progress">
|
70 |
+
<div class="pptrack-progress-bar-wrapper">
|
71 |
+
<div class="pptrack-progress-bar-wrapper">
|
72 |
+
<ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
|
73 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
|
74 |
+
<div
|
75 |
+
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
|
76 |
+
<span class="pptrack-progress-bubble"></span>
|
77 |
+
</li>
|
78 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
|
79 |
+
<div
|
80 |
+
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
|
81 |
+
<span class="pptrack-progress-bubble"></span>
|
82 |
+
</li>
|
83 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
|
84 |
+
<div
|
85 |
+
class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
|
86 |
+
<span class="pptrack-progress-bubble"></span>
|
87 |
+
</li>
|
88 |
+
<li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
|
89 |
+
<div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
|
90 |
+
<span class="pptrack-progress-bubble"></span>
|
91 |
+
</li>
|
92 |
+
</ul>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
<br/>
|
97 |
+
<br/>
|
98 |
+
|
99 |
+
<div class="pptrack-tracking-info">
|
100 |
+
<h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
|
101 |
+
|
102 |
+
<div class="pptrack-tracking-info-details">
|
103 |
+
<?php $details = $model->getDetails(); ?>
|
104 |
+
<?php if (!$details) : ?>
|
105 |
+
<div class="pptrack-info-row">
|
106 |
+
<div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
|
107 |
+
<br/><?php echo date("H:i:s", $model->created_at) ?></div>
|
108 |
+
<div class="pptrack-info-row-details-wrapper">
|
109 |
+
<div class="pptrack-info-row-details">
|
110 |
+
<?php if ($model->status == Packpin_Pptrack_Model_Track::STATUS_PENDING) : ?>
|
111 |
+
<?php echo Mage::helper('pptrack')->__("Package status pending"); ?>
|
112 |
+
<?php else : ?>
|
113 |
+
<?php echo Mage::helper('pptrack')->__("Package prepared for dispatch"); ?>
|
114 |
+
<?php endif; ?>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
<div style="clear:both;display:table;"></div>
|
118 |
+
</div>
|
119 |
+
<?php else : ?>
|
120 |
+
<?php foreach ($details as $detail): ?>
|
121 |
+
<div class="pptrack-info-row">
|
122 |
+
<div>
|
123 |
+
<div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
|
124 |
+
<br/><?php echo $detail->getEventTime(); ?></div>
|
125 |
+
<div class="pptrack-info-row-details-wrapper">
|
126 |
+
<div class="pptrack-info-row-details">
|
127 |
+
<?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
|
128 |
+
<div
|
129 |
+
class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
<div style="clear:both;display:table;"></div>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
<?php endforeach; ?>
|
136 |
+
<?php endif; ?>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
<div class="pptrack-tracking-general-info">
|
140 |
+
<h2>Info</h2>
|
141 |
+
|
142 |
+
<div class="pptrack-tracking-general-info-details">
|
143 |
+
<div class="pptrack-tracking-row">
|
144 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
|
145 |
+
<span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
|
146 |
+
<br style="clear: both;"/>
|
147 |
+
</div>
|
148 |
+
<div class="pptrack-tracking-row">
|
149 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
|
150 |
+
<span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
|
151 |
+
<br style="clear: both;"/>
|
152 |
+
</div>
|
153 |
+
<div class="pptrack-tracking-row">
|
154 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
|
155 |
+
<span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
|
156 |
+
<br style="clear: both;"/>
|
157 |
+
</div>
|
158 |
+
<div class="pptrack-tracking-row">
|
159 |
+
<span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
|
160 |
+
<span
|
161 |
+
class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
|
162 |
+
<br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
|
163 |
+
<br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
|
164 |
+
<br style="clear: both;"/>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
<br/>
|
168 |
+
|
169 |
+
<div class="pptrack-tracking-carrier-info-wrapper">
|
170 |
+
<span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
|
171 |
+
<br/>
|
172 |
+
|
173 |
+
<div class="pptrack-tracking-courier-logo">
|
174 |
+
<img src="<?php echo $model->getCarrierIcon() ?>"/>
|
175 |
+
</div>
|
176 |
+
<div class="pptrack-tracking-courier-info">
|
177 |
+
<h3><?php echo $model->getCarrierName() ?></h3>
|
178 |
+
<?php
|
179 |
+
$phone = $model->getCarrierPhone();
|
180 |
+
$homepage = $model->getCarrierHomepage();
|
181 |
+
?>
|
182 |
+
<?php if ($phone) : ?>
|
183 |
+
<span><?php echo $phone ?></span><br/>
|
184 |
+
<?php endif; ?>
|
185 |
+
<?php if ($homepage) : ?>
|
186 |
+
<a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
|
187 |
+
<?php endif; ?>
|
188 |
+
</div>
|
189 |
+
<div style="clear:both;"></div>
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
+
<?php endif; ?>
|
195 |
+
<?php endforeach; ?>
|
app/design/frontend/base/default/template/pptrack/popup.phtml
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
<div class="page-title title-buttons">
|
2 |
-
<h1><?php echo $this->__('Tracking Information'); ?></h1>
|
3 |
-
<button class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
|
4 |
-
</div>
|
5 |
-
<br>
|
6 |
-
<?php $models = Mage::registry('models'); ?>
|
7 |
-
<?php if ($models) : ?>
|
8 |
-
<?php foreach ($models as $trackModel) : ?>
|
9 |
-
<table class="tracking-table-popup data-table" style="margin-bottom:25px;">
|
10 |
-
<colgroup><col width="15%">
|
11 |
-
<col>
|
12 |
-
</colgroup><tbody>
|
13 |
-
<tr class="first last odd">
|
14 |
-
<th class="label"><?php echo $trackModel->getCarrierName() ?>: </th>
|
15 |
-
<td class="value last"><?php echo $trackModel->getCode() ?></td>
|
16 |
-
</tr>
|
17 |
-
</tbody>
|
18 |
-
</table>
|
19 |
-
<?php echo $this->getLayout()->createBlock('pptrack/index')->setData(array('model' => $trackModel))->setTemplate('pptrack/index.phtml')->toHtml(); ?>
|
20 |
-
<div class="clearfix"></div>
|
21 |
-
<br>
|
22 |
-
<?php endforeach; ?>
|
23 |
-
<?php else : ?>
|
24 |
-
<?php echo $this->getLayout()->createBlock('pptrack/index')->setTemplate('pptrack/index.phtml')->toHtml(); ?>
|
25 |
-
<?php endif; ?>
|
26 |
-
<div class="clearfix"></div>
|
27 |
-
<div class="buttons-set" style="margin-top:20px;">
|
28 |
-
<button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
|
29 |
-
</div>
|
1 |
+
<div class="page-title title-buttons">
|
2 |
+
<h1><?php echo $this->__('Tracking Information'); ?></h1>
|
3 |
+
<button class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
|
4 |
+
</div>
|
5 |
+
<br>
|
6 |
+
<?php $models = Mage::registry('models'); ?>
|
7 |
+
<?php if ($models) : ?>
|
8 |
+
<?php foreach ($models as $trackModel) : ?>
|
9 |
+
<table class="tracking-table-popup data-table" style="margin-bottom:25px;">
|
10 |
+
<colgroup><col width="15%">
|
11 |
+
<col>
|
12 |
+
</colgroup><tbody>
|
13 |
+
<tr class="first last odd">
|
14 |
+
<th class="label"><?php echo $trackModel->getCarrierName() ?>: </th>
|
15 |
+
<td class="value last"><?php echo $trackModel->getCode() ?></td>
|
16 |
+
</tr>
|
17 |
+
</tbody>
|
18 |
+
</table>
|
19 |
+
<?php echo $this->getLayout()->createBlock('pptrack/index')->setData(array('model' => $trackModel))->setTemplate('pptrack/index.phtml')->toHtml(); ?>
|
20 |
+
<div class="clearfix"></div>
|
21 |
+
<br>
|
22 |
+
<?php endforeach; ?>
|
23 |
+
<?php else : ?>
|
24 |
+
<?php echo $this->getLayout()->createBlock('pptrack/index')->setTemplate('pptrack/index.phtml')->toHtml(); ?>
|
25 |
+
<?php endif; ?>
|
26 |
+
<div class="clearfix"></div>
|
27 |
+
<div class="buttons-set" style="margin-top:20px;">
|
28 |
+
<button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
|
29 |
+
</div>
|
app/design/frontend/base/default/template/pptrack/script.phtml
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php echo $this->getScript(); ?>
|
1 |
+
<?php echo $this->getScript(); ?>
|
app/etc/modules/Packpin_Pptrack.xml
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Packpin_Pptrack>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>community</codePool>
|
7 |
-
<version>1.5.
|
8 |
-
</Packpin_Pptrack>
|
9 |
-
</modules>
|
10 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Packpin_Pptrack>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>1.5.6</version>
|
8 |
+
</Packpin_Pptrack>
|
9 |
+
</modules>
|
10 |
</config>
|
app/locale/de_DE/Packpin_Pptrack.csv
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
"Total tracks","Total tracks"
|
2 |
-
"Unique sessions","Unique sessions"
|
3 |
-
"More Details","More Details"
|
4 |
-
"Visits Generated","Visits Generated"
|
5 |
-
"Shipments Tracked","Shipments Tracked"
|
6 |
-
"Packpin Stats","Packpin Stats"
|
7 |
-
"----- Packpin carriers -----","----- Packpin-Boten -----"
|
8 |
-
"Select All","Alle markieren"
|
9 |
-
"Unselect All","Keine markieren"
|
10 |
-
"Packpin Notifications","Packpin Nachrichten"
|
11 |
-
"Packpin Notification Settings","Einstellungen der Packpin nachrichten"
|
12 |
-
"Shipment status","Sendungsstatus"
|
13 |
-
"You have successfully unsubscribed from package status updates","Sie haben die Aktualisierung des Sendungsstatus erfolgreich abbestellt"
|
14 |
-
"Subscription not found or already unsubscribed!","Abbonement nicht gefunden oder wurde von Ihnen abbestellt"
|
15 |
-
"Tracking info not found!","Verfolgungsinformation nicht gefunden"
|
16 |
-
"Unsubscribe","Newsletter abbestellen"
|
17 |
-
"You have to enter API key before saving config!","Geben Sie ihr Kennwort ein, um die Änderungen zu speichern!"
|
18 |
-
"Error sending data to API","Fehler beim Senden die Daten zur API"
|
19 |
-
"Your temporary API key has expired!","Vorübergehendes Kennwort ist nicht mehr gültig"
|
20 |
-
"Your temporary API key will expire in","Die Gültigkeit ihres temporäres Kennworts endet in"
|
21 |
-
"%s days","%s dag(en)"
|
22 |
-
"While waiting, we have something for you. Check offerings bellow:","Während der Wartezeit haben wir etwas für Sie. Die Angebote weiter unten:"
|
23 |
-
"Add to Cart","In den Warenkorb"
|
24 |
-
"Shipped By","Absender"
|
25 |
-
"Tracking Number","Sendungsnummer"
|
26 |
-
"Track your item","Sendungsverfolgung"
|
27 |
-
"No tracking info!","Keine Verfolgungsinformation vorhanden!"
|
28 |
-
"Shipment Information","Sendungsinformation"
|
29 |
-
"Dispatched","Versant"
|
30 |
-
"In Transit","Unterwegs"
|
31 |
-
"Out for delivery","In Zustellung"
|
32 |
-
"Delivered","Zugestellt"
|
33 |
-
"Tracking Info","Verfolgungsinformation"
|
34 |
-
"Package prepared for dispatch","Die Sendung liegt für den Versand bereit"
|
35 |
-
"Order number","Bestellungsnummer"
|
36 |
-
"Tracking code","Verfolgungs-Code"
|
37 |
-
"Shipped on","Versandt am"
|
38 |
-
"Ships to","Versand nach"
|
39 |
-
"For questions regarding your shipment contact carrier directly","Für weitere Fragen kontaktieren Sie bitte den Boten"
|
1 |
+
"Total tracks","Total tracks"
|
2 |
+
"Unique sessions","Unique sessions"
|
3 |
+
"More Details","More Details"
|
4 |
+
"Visits Generated","Visits Generated"
|
5 |
+
"Shipments Tracked","Shipments Tracked"
|
6 |
+
"Packpin Stats","Packpin Stats"
|
7 |
+
"----- Packpin carriers -----","----- Packpin-Boten -----"
|
8 |
+
"Select All","Alle markieren"
|
9 |
+
"Unselect All","Keine markieren"
|
10 |
+
"Packpin Notifications","Packpin Nachrichten"
|
11 |
+
"Packpin Notification Settings","Einstellungen der Packpin nachrichten"
|
12 |
+
"Shipment status","Sendungsstatus"
|
13 |
+
"You have successfully unsubscribed from package status updates","Sie haben die Aktualisierung des Sendungsstatus erfolgreich abbestellt"
|
14 |
+
"Subscription not found or already unsubscribed!","Abbonement nicht gefunden oder wurde von Ihnen abbestellt"
|
15 |
+
"Tracking info not found!","Verfolgungsinformation nicht gefunden"
|
16 |
+
"Unsubscribe","Newsletter abbestellen"
|
17 |
+
"You have to enter API key before saving config!","Geben Sie ihr Kennwort ein, um die Änderungen zu speichern!"
|
18 |
+
"Error sending data to API","Fehler beim Senden die Daten zur API"
|
19 |
+
"Your temporary API key has expired!","Vorübergehendes Kennwort ist nicht mehr gültig"
|
20 |
+
"Your temporary API key will expire in","Die Gültigkeit ihres temporäres Kennworts endet in"
|
21 |
+
"%s days","%s dag(en)"
|
22 |
+
"While waiting, we have something for you. Check offerings bellow:","Während der Wartezeit haben wir etwas für Sie. Die Angebote weiter unten:"
|
23 |
+
"Add to Cart","In den Warenkorb"
|
24 |
+
"Shipped By","Absender"
|
25 |
+
"Tracking Number","Sendungsnummer"
|
26 |
+
"Track your item","Sendungsverfolgung"
|
27 |
+
"No tracking info!","Keine Verfolgungsinformation vorhanden!"
|
28 |
+
"Shipment Information","Sendungsinformation"
|
29 |
+
"Dispatched","Versant"
|
30 |
+
"In Transit","Unterwegs"
|
31 |
+
"Out for delivery","In Zustellung"
|
32 |
+
"Delivered","Zugestellt"
|
33 |
+
"Tracking Info","Verfolgungsinformation"
|
34 |
+
"Package prepared for dispatch","Die Sendung liegt für den Versand bereit"
|
35 |
+
"Order number","Bestellungsnummer"
|
36 |
+
"Tracking code","Verfolgungs-Code"
|
37 |
+
"Shipped on","Versandt am"
|
38 |
+
"Ships to","Versand nach"
|
39 |
+
"For questions regarding your shipment contact carrier directly","Für weitere Fragen kontaktieren Sie bitte den Boten"
|
app/locale/en_US/Packpin_Pptrack.csv
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
"Total tracks","Total tracks"
|
2 |
-
"Unique sessions","Unique sessions"
|
3 |
-
"More Details","More Details"
|
4 |
-
"Visits Generated","Visits Generated"
|
5 |
-
"Shipments Tracked","Shipments Tracked"
|
6 |
-
"Packpin Stats","Packpin Stats"
|
7 |
-
"----- Packpin carriers -----","----- Packpin carriers -----"
|
8 |
-
"Select All","Select All"
|
9 |
-
"Unselect All","Unselect All"
|
10 |
-
"Packpin Notifications","Packpin Notifications"
|
11 |
-
"Packpin Notification Settings","Packpin Notification Settings"
|
12 |
-
"Shipment status","Shipment status"
|
13 |
-
"You have successfully unsubscribed from package status updates","You have successfully unsubscribed from package status updates"
|
14 |
-
"Subscription not found or already unsubscribed!","Subscription not found or already unsubscribed!"
|
15 |
-
"Tracking info not found!","Tracking info not found!"
|
16 |
-
"Unsubscribe","Unsubscribe"
|
17 |
-
"You have to enter API key before saving config!","You have to enter API key before saving config!"
|
18 |
-
"Error sending data to API","Error sending data to API"
|
19 |
-
"Your temporary API key has expired!","Your temporary API key has expired!"
|
20 |
-
"Your temporary API key will expire in","Your temporary API key will expire in"
|
21 |
-
"%s days","%s days"
|
22 |
-
"While waiting, we have something for you. Check offerings bellow:","While waiting, we have something for you. Check offerings bellow:"
|
23 |
-
"Add to Cart","Add to Cart"
|
24 |
-
"Shipped By","Shipped By"
|
25 |
-
"Tracking Number","Tracking Number"
|
26 |
-
"Track your item","Track your item"
|
27 |
-
"No tracking info!","No tracking info!"
|
28 |
-
"Shipment Information","Shipment Information"
|
29 |
-
"Dispatched","Dispatched"
|
30 |
-
"In Transit","In Transit"
|
31 |
-
"Out for delivery","Out for delivery"
|
32 |
-
"Delivered","Delivered"
|
33 |
-
"Tracking Info","Tracking Info"
|
34 |
-
"Package prepared for dispatch","Package prepared for dispatch"
|
35 |
-
"Order number","Order number"
|
36 |
-
"Tracking code","Tracking code"
|
37 |
-
"Shipped on","Shipped on"
|
38 |
-
"Ships to","Ships to"
|
39 |
-
"For questions regarding your shipment contact carrier directly","For questions regarding your shipment contact carrier directly"
|
1 |
+
"Total tracks","Total tracks"
|
2 |
+
"Unique sessions","Unique sessions"
|
3 |
+
"More Details","More Details"
|
4 |
+
"Visits Generated","Visits Generated"
|
5 |
+
"Shipments Tracked","Shipments Tracked"
|
6 |
+
"Packpin Stats","Packpin Stats"
|
7 |
+
"----- Packpin carriers -----","----- Packpin carriers -----"
|
8 |
+
"Select All","Select All"
|
9 |
+
"Unselect All","Unselect All"
|
10 |
+
"Packpin Notifications","Packpin Notifications"
|
11 |
+
"Packpin Notification Settings","Packpin Notification Settings"
|
12 |
+
"Shipment status","Shipment status"
|
13 |
+
"You have successfully unsubscribed from package status updates","You have successfully unsubscribed from package status updates"
|
14 |
+
"Subscription not found or already unsubscribed!","Subscription not found or already unsubscribed!"
|
15 |
+
"Tracking info not found!","Tracking info not found!"
|
16 |
+
"Unsubscribe","Unsubscribe"
|
17 |
+
"You have to enter API key before saving config!","You have to enter API key before saving config!"
|
18 |
+
"Error sending data to API","Error sending data to API"
|
19 |
+
"Your temporary API key has expired!","Your temporary API key has expired!"
|
20 |
+
"Your temporary API key will expire in","Your temporary API key will expire in"
|
21 |
+
"%s days","%s days"
|
22 |
+
"While waiting, we have something for you. Check offerings bellow:","While waiting, we have something for you. Check offerings bellow:"
|
23 |
+
"Add to Cart","Add to Cart"
|
24 |
+
"Shipped By","Shipped By"
|
25 |
+
"Tracking Number","Tracking Number"
|
26 |
+
"Track your item","Track your item"
|
27 |
+
"No tracking info!","No tracking info!"
|
28 |
+
"Shipment Information","Shipment Information"
|
29 |
+
"Dispatched","Dispatched"
|
30 |
+
"In Transit","In Transit"
|
31 |
+
"Out for delivery","Out for delivery"
|
32 |
+
"Delivered","Delivered"
|
33 |
+
"Tracking Info","Tracking Info"
|
34 |
+
"Package prepared for dispatch","Package prepared for dispatch"
|
35 |
+
"Order number","Order number"
|
36 |
+
"Tracking code","Tracking code"
|
37 |
+
"Shipped on","Shipped on"
|
38 |
+
"Ships to","Ships to"
|
39 |
+
"For questions regarding your shipment contact carrier directly","For questions regarding your shipment contact carrier directly"
|
app/locale/en_US/template/email/packpin/packpin_delivered_email.html
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<!--@subject Order shipment status has been updated. @-->
|
2 |
-
<!DOCTYPE html>
|
3 |
-
<html>
|
4 |
-
<head>
|
5 |
-
<meta charset="utf-8">
|
6 |
-
<style>
|
7 |
-
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
-
</style>
|
9 |
-
</head>
|
10 |
-
<body style="background:#ebebeb;">
|
11 |
-
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
-
<div style="background:#ececed;">
|
13 |
-
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
-
<img
|
15 |
-
{{if logo_width}}
|
16 |
-
width="{{var logo_width}}"
|
17 |
-
{{else}}
|
18 |
-
width="auto"
|
19 |
-
{{/if}}
|
20 |
-
{{if logo_height}}
|
21 |
-
height="{{var logo_height}}"
|
22 |
-
{{else}}
|
23 |
-
height="35"
|
24 |
-
{{/if}}
|
25 |
-
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
-
</a>
|
27 |
-
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
-
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
-
</div>
|
30 |
-
{{var banner}}
|
31 |
-
{{var crossSell}}
|
32 |
-
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
-
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
-
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
-
<tr>
|
36 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
-
Order number:
|
38 |
-
</td>
|
39 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
-
{{var track.getOrderNumber()}}
|
41 |
-
</td>
|
42 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
-
Carrier:
|
44 |
-
</td>
|
45 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
-
{{var track.getCarrierName()}}
|
47 |
-
</td>
|
48 |
-
</tr>
|
49 |
-
<tr>
|
50 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
-
</td>
|
52 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
-
</td>
|
54 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
-
Tracking number:
|
56 |
-
</td>
|
57 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
-
{{var track.getCode()}}
|
59 |
-
</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td> </td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
-
If you have questions regarding shipment,
|
67 |
-
<br>
|
68 |
-
please contact carrier direcly.
|
69 |
-
</td>
|
70 |
-
<td valign="top" colspan="2">
|
71 |
-
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
-
SEE FULL TRACKING INFO
|
73 |
-
</a>
|
74 |
-
</td>
|
75 |
-
</tr>
|
76 |
-
</table>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
-
This email was sent to {{var email}}
|
81 |
-
<br>
|
82 |
-
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
</body>
|
87 |
</html>
|
1 |
+
<!--@subject Order shipment status has been updated. @-->
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<style>
|
7 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
+
</style>
|
9 |
+
</head>
|
10 |
+
<body style="background:#ebebeb;">
|
11 |
+
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
+
<div style="background:#ececed;">
|
13 |
+
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
+
<img
|
15 |
+
{{if logo_width}}
|
16 |
+
width="{{var logo_width}}"
|
17 |
+
{{else}}
|
18 |
+
width="auto"
|
19 |
+
{{/if}}
|
20 |
+
{{if logo_height}}
|
21 |
+
height="{{var logo_height}}"
|
22 |
+
{{else}}
|
23 |
+
height="35"
|
24 |
+
{{/if}}
|
25 |
+
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
+
</a>
|
27 |
+
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
+
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
+
</div>
|
30 |
+
{{var banner}}
|
31 |
+
{{var crossSell}}
|
32 |
+
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
+
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
+
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
+
<tr>
|
36 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
+
Order number:
|
38 |
+
</td>
|
39 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
+
{{var track.getOrderNumber()}}
|
41 |
+
</td>
|
42 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
+
Carrier:
|
44 |
+
</td>
|
45 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
+
{{var track.getCarrierName()}}
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
+
</td>
|
52 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
+
</td>
|
54 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
+
Tracking number:
|
56 |
+
</td>
|
57 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
+
{{var track.getCode()}}
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td> </td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
+
If you have questions regarding shipment,
|
67 |
+
<br>
|
68 |
+
please contact carrier direcly.
|
69 |
+
</td>
|
70 |
+
<td valign="top" colspan="2">
|
71 |
+
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
+
SEE FULL TRACKING INFO
|
73 |
+
</a>
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
</table>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
+
This email was sent to {{var email}}
|
81 |
+
<br>
|
82 |
+
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
</body>
|
87 |
</html>
|
app/locale/en_US/template/email/packpin/packpin_exception_email.html
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<!--@subject Order shipment status has been updated. @-->
|
2 |
-
<!DOCTYPE html>
|
3 |
-
<html>
|
4 |
-
<head>
|
5 |
-
<meta charset="utf-8">
|
6 |
-
<style>
|
7 |
-
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
-
</style>
|
9 |
-
</head>
|
10 |
-
<body style="background:#ebebeb;">
|
11 |
-
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
-
<div style="background:#ececed;">
|
13 |
-
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
-
<img
|
15 |
-
{{if logo_width}}
|
16 |
-
width="{{var logo_width}}"
|
17 |
-
{{else}}
|
18 |
-
width="auto"
|
19 |
-
{{/if}}
|
20 |
-
{{if logo_height}}
|
21 |
-
height="{{var logo_height}}"
|
22 |
-
{{else}}
|
23 |
-
height="35"
|
24 |
-
{{/if}}
|
25 |
-
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
-
</a>
|
27 |
-
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
-
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
-
</div>
|
30 |
-
{{var banner}}
|
31 |
-
{{var crossSell}}
|
32 |
-
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
-
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
-
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
-
<tr>
|
36 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
-
Order number:
|
38 |
-
</td>
|
39 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
-
{{var track.getOrderNumber()}}
|
41 |
-
</td>
|
42 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
-
Carrier:
|
44 |
-
</td>
|
45 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
-
{{var track.getCarrierName()}}
|
47 |
-
</td>
|
48 |
-
</tr>
|
49 |
-
<tr>
|
50 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
-
</td>
|
52 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
-
</td>
|
54 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
-
Tracking number:
|
56 |
-
</td>
|
57 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
-
{{var track.getCode()}}
|
59 |
-
</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td> </td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
-
If you have questions regarding shipment,
|
67 |
-
<br>
|
68 |
-
please contact carrier direcly.
|
69 |
-
</td>
|
70 |
-
<td valign="top" colspan="2">
|
71 |
-
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
-
SEE FULL TRACKING INFO
|
73 |
-
</a>
|
74 |
-
</td>
|
75 |
-
</tr>
|
76 |
-
</table>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
-
This email was sent to {{var email}}
|
81 |
-
<br>
|
82 |
-
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
</body>
|
87 |
</html>
|
1 |
+
<!--@subject Order shipment status has been updated. @-->
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<style>
|
7 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
+
</style>
|
9 |
+
</head>
|
10 |
+
<body style="background:#ebebeb;">
|
11 |
+
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
+
<div style="background:#ececed;">
|
13 |
+
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
+
<img
|
15 |
+
{{if logo_width}}
|
16 |
+
width="{{var logo_width}}"
|
17 |
+
{{else}}
|
18 |
+
width="auto"
|
19 |
+
{{/if}}
|
20 |
+
{{if logo_height}}
|
21 |
+
height="{{var logo_height}}"
|
22 |
+
{{else}}
|
23 |
+
height="35"
|
24 |
+
{{/if}}
|
25 |
+
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
+
</a>
|
27 |
+
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
+
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
+
</div>
|
30 |
+
{{var banner}}
|
31 |
+
{{var crossSell}}
|
32 |
+
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
+
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
+
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
+
<tr>
|
36 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
+
Order number:
|
38 |
+
</td>
|
39 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
+
{{var track.getOrderNumber()}}
|
41 |
+
</td>
|
42 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
+
Carrier:
|
44 |
+
</td>
|
45 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
+
{{var track.getCarrierName()}}
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
+
</td>
|
52 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
+
</td>
|
54 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
+
Tracking number:
|
56 |
+
</td>
|
57 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
+
{{var track.getCode()}}
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td> </td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
+
If you have questions regarding shipment,
|
67 |
+
<br>
|
68 |
+
please contact carrier direcly.
|
69 |
+
</td>
|
70 |
+
<td valign="top" colspan="2">
|
71 |
+
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
+
SEE FULL TRACKING INFO
|
73 |
+
</a>
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
</table>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
+
This email was sent to {{var email}}
|
81 |
+
<br>
|
82 |
+
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
</body>
|
87 |
</html>
|
app/locale/en_US/template/email/packpin/packpin_failed_attempt_email.html
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<!--@subject Order shipment status has been updated. @-->
|
2 |
-
<!DOCTYPE html>
|
3 |
-
<html>
|
4 |
-
<head>
|
5 |
-
<meta charset="utf-8">
|
6 |
-
<style>
|
7 |
-
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
-
</style>
|
9 |
-
</head>
|
10 |
-
<body style="background:#ebebeb;">
|
11 |
-
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
-
<div style="background:#ececed;">
|
13 |
-
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
-
<img
|
15 |
-
{{if logo_width}}
|
16 |
-
width="{{var logo_width}}"
|
17 |
-
{{else}}
|
18 |
-
width="auto"
|
19 |
-
{{/if}}
|
20 |
-
{{if logo_height}}
|
21 |
-
height="{{var logo_height}}"
|
22 |
-
{{else}}
|
23 |
-
height="35"
|
24 |
-
{{/if}}
|
25 |
-
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
-
</a>
|
27 |
-
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
-
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
-
</div>
|
30 |
-
{{var banner}}
|
31 |
-
{{var crossSell}}
|
32 |
-
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
-
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
-
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
-
<tr>
|
36 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
-
Order number:
|
38 |
-
</td>
|
39 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
-
{{var track.getOrderNumber()}}
|
41 |
-
</td>
|
42 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
-
Carrier:
|
44 |
-
</td>
|
45 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
-
{{var track.getCarrierName()}}
|
47 |
-
</td>
|
48 |
-
</tr>
|
49 |
-
<tr>
|
50 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
-
</td>
|
52 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
-
</td>
|
54 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
-
Tracking number:
|
56 |
-
</td>
|
57 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
-
{{var track.getCode()}}
|
59 |
-
</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td> </td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
-
If you have questions regarding shipment,
|
67 |
-
<br>
|
68 |
-
please contact carrier direcly.
|
69 |
-
</td>
|
70 |
-
<td valign="top" colspan="2">
|
71 |
-
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
-
SEE FULL TRACKING INFO
|
73 |
-
</a>
|
74 |
-
</td>
|
75 |
-
</tr>
|
76 |
-
</table>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
-
This email was sent to {{var email}}
|
81 |
-
<br>
|
82 |
-
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
</body>
|
87 |
</html>
|
1 |
+
<!--@subject Order shipment status has been updated. @-->
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<style>
|
7 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
+
</style>
|
9 |
+
</head>
|
10 |
+
<body style="background:#ebebeb;">
|
11 |
+
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
+
<div style="background:#ececed;">
|
13 |
+
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
+
<img
|
15 |
+
{{if logo_width}}
|
16 |
+
width="{{var logo_width}}"
|
17 |
+
{{else}}
|
18 |
+
width="auto"
|
19 |
+
{{/if}}
|
20 |
+
{{if logo_height}}
|
21 |
+
height="{{var logo_height}}"
|
22 |
+
{{else}}
|
23 |
+
height="35"
|
24 |
+
{{/if}}
|
25 |
+
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
+
</a>
|
27 |
+
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
+
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
+
</div>
|
30 |
+
{{var banner}}
|
31 |
+
{{var crossSell}}
|
32 |
+
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
+
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
+
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
+
<tr>
|
36 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
+
Order number:
|
38 |
+
</td>
|
39 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
+
{{var track.getOrderNumber()}}
|
41 |
+
</td>
|
42 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
+
Carrier:
|
44 |
+
</td>
|
45 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
+
{{var track.getCarrierName()}}
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
+
</td>
|
52 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
+
</td>
|
54 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
+
Tracking number:
|
56 |
+
</td>
|
57 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
+
{{var track.getCode()}}
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td> </td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
+
If you have questions regarding shipment,
|
67 |
+
<br>
|
68 |
+
please contact carrier direcly.
|
69 |
+
</td>
|
70 |
+
<td valign="top" colspan="2">
|
71 |
+
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
+
SEE FULL TRACKING INFO
|
73 |
+
</a>
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
</table>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
+
This email was sent to {{var email}}
|
81 |
+
<br>
|
82 |
+
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
</body>
|
87 |
</html>
|
app/locale/en_US/template/email/packpin/packpin_in_transit_email.html
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<!--@subject Order shipment status has been updated. @-->
|
2 |
-
<!DOCTYPE html>
|
3 |
-
<html>
|
4 |
-
<head>
|
5 |
-
<meta charset="utf-8">
|
6 |
-
<style>
|
7 |
-
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
-
</style>
|
9 |
-
</head>
|
10 |
-
<body style="background:#ebebeb;">
|
11 |
-
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
-
<div style="background:#ececed;">
|
13 |
-
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
-
<img
|
15 |
-
{{if logo_width}}
|
16 |
-
width="{{var logo_width}}"
|
17 |
-
{{else}}
|
18 |
-
width="auto"
|
19 |
-
{{/if}}
|
20 |
-
{{if logo_height}}
|
21 |
-
height="{{var logo_height}}"
|
22 |
-
{{else}}
|
23 |
-
height="35"
|
24 |
-
{{/if}}
|
25 |
-
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
-
</a>
|
27 |
-
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
-
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
-
</div>
|
30 |
-
{{var banner}}
|
31 |
-
{{var crossSell}}
|
32 |
-
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
-
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
-
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
-
<tr>
|
36 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
-
Order number:
|
38 |
-
</td>
|
39 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
-
{{var track.getOrderNumber()}}
|
41 |
-
</td>
|
42 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
-
Carrier:
|
44 |
-
</td>
|
45 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
-
{{var track.getCarrierName()}}
|
47 |
-
</td>
|
48 |
-
</tr>
|
49 |
-
<tr>
|
50 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
-
</td>
|
52 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
-
</td>
|
54 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
-
Tracking number:
|
56 |
-
</td>
|
57 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
-
{{var track.getCode()}}
|
59 |
-
</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td> </td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
-
If you have questions regarding shipment,
|
67 |
-
<br>
|
68 |
-
please contact carrier direcly.
|
69 |
-
</td>
|
70 |
-
<td valign="top" colspan="2">
|
71 |
-
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
-
SEE FULL TRACKING INFO
|
73 |
-
</a>
|
74 |
-
</td>
|
75 |
-
</tr>
|
76 |
-
</table>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
-
This email was sent to {{var email}}
|
81 |
-
<br>
|
82 |
-
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
</body>
|
87 |
</html>
|
1 |
+
<!--@subject Order shipment status has been updated. @-->
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<style>
|
7 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
+
</style>
|
9 |
+
</head>
|
10 |
+
<body style="background:#ebebeb;">
|
11 |
+
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
+
<div style="background:#ececed;">
|
13 |
+
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
+
<img
|
15 |
+
{{if logo_width}}
|
16 |
+
width="{{var logo_width}}"
|
17 |
+
{{else}}
|
18 |
+
width="auto"
|
19 |
+
{{/if}}
|
20 |
+
{{if logo_height}}
|
21 |
+
height="{{var logo_height}}"
|
22 |
+
{{else}}
|
23 |
+
height="35"
|
24 |
+
{{/if}}
|
25 |
+
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
+
</a>
|
27 |
+
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
+
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
+
</div>
|
30 |
+
{{var banner}}
|
31 |
+
{{var crossSell}}
|
32 |
+
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
+
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
+
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
+
<tr>
|
36 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
+
Order number:
|
38 |
+
</td>
|
39 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
+
{{var track.getOrderNumber()}}
|
41 |
+
</td>
|
42 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
+
Carrier:
|
44 |
+
</td>
|
45 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
+
{{var track.getCarrierName()}}
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
+
</td>
|
52 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
+
</td>
|
54 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
+
Tracking number:
|
56 |
+
</td>
|
57 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
+
{{var track.getCode()}}
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td> </td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
+
If you have questions regarding shipment,
|
67 |
+
<br>
|
68 |
+
please contact carrier direcly.
|
69 |
+
</td>
|
70 |
+
<td valign="top" colspan="2">
|
71 |
+
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
+
SEE FULL TRACKING INFO
|
73 |
+
</a>
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
</table>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
+
This email was sent to {{var email}}
|
81 |
+
<br>
|
82 |
+
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
</body>
|
87 |
</html>
|
app/locale/en_US/template/email/packpin/packpin_info_received_email.html
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<!--@subject Order shipment status has been updated. @-->
|
2 |
-
<!DOCTYPE html>
|
3 |
-
<html>
|
4 |
-
<head>
|
5 |
-
<meta charset="utf-8">
|
6 |
-
<style>
|
7 |
-
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
-
</style>
|
9 |
-
</head>
|
10 |
-
<body style="background:#ebebeb;">
|
11 |
-
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
-
<div style="background:#ececed;">
|
13 |
-
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
-
<img
|
15 |
-
{{if logo_width}}
|
16 |
-
width="{{var logo_width}}"
|
17 |
-
{{else}}
|
18 |
-
width="auto"
|
19 |
-
{{/if}}
|
20 |
-
{{if logo_height}}
|
21 |
-
height="{{var logo_height}}"
|
22 |
-
{{else}}
|
23 |
-
height="35"
|
24 |
-
{{/if}}
|
25 |
-
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
-
</a>
|
27 |
-
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
-
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
-
</div>
|
30 |
-
{{var banner}}
|
31 |
-
{{var crossSell}}
|
32 |
-
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
-
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
-
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
-
<tr>
|
36 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
-
Order number:
|
38 |
-
</td>
|
39 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
-
{{var track.getOrderNumber()}}
|
41 |
-
</td>
|
42 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
-
Carrier:
|
44 |
-
</td>
|
45 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
-
{{var track.getCarrierName()}}
|
47 |
-
</td>
|
48 |
-
</tr>
|
49 |
-
<tr>
|
50 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
-
</td>
|
52 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
-
</td>
|
54 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
-
Tracking number:
|
56 |
-
</td>
|
57 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
-
{{var track.getCode()}}
|
59 |
-
</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td> </td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
-
If you have questions regarding shipment,
|
67 |
-
<br>
|
68 |
-
please contact carrier direcly.
|
69 |
-
</td>
|
70 |
-
<td valign="top" colspan="2">
|
71 |
-
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
-
SEE FULL TRACKING INFO
|
73 |
-
</a>
|
74 |
-
</td>
|
75 |
-
</tr>
|
76 |
-
</table>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
-
This email was sent to {{var email}}
|
81 |
-
<br>
|
82 |
-
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
</body>
|
87 |
</html>
|
1 |
+
<!--@subject Order shipment status has been updated. @-->
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<style>
|
7 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
+
</style>
|
9 |
+
</head>
|
10 |
+
<body style="background:#ebebeb;">
|
11 |
+
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
+
<div style="background:#ececed;">
|
13 |
+
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
+
<img
|
15 |
+
{{if logo_width}}
|
16 |
+
width="{{var logo_width}}"
|
17 |
+
{{else}}
|
18 |
+
width="auto"
|
19 |
+
{{/if}}
|
20 |
+
{{if logo_height}}
|
21 |
+
height="{{var logo_height}}"
|
22 |
+
{{else}}
|
23 |
+
height="35"
|
24 |
+
{{/if}}
|
25 |
+
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
+
</a>
|
27 |
+
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
+
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
+
</div>
|
30 |
+
{{var banner}}
|
31 |
+
{{var crossSell}}
|
32 |
+
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
+
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
+
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
+
<tr>
|
36 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
+
Order number:
|
38 |
+
</td>
|
39 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
+
{{var track.getOrderNumber()}}
|
41 |
+
</td>
|
42 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
+
Carrier:
|
44 |
+
</td>
|
45 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
+
{{var track.getCarrierName()}}
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
+
</td>
|
52 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
+
</td>
|
54 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
+
Tracking number:
|
56 |
+
</td>
|
57 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
+
{{var track.getCode()}}
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td> </td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
+
If you have questions regarding shipment,
|
67 |
+
<br>
|
68 |
+
please contact carrier direcly.
|
69 |
+
</td>
|
70 |
+
<td valign="top" colspan="2">
|
71 |
+
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
+
SEE FULL TRACKING INFO
|
73 |
+
</a>
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
</table>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
+
This email was sent to {{var email}}
|
81 |
+
<br>
|
82 |
+
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
</body>
|
87 |
</html>
|
app/locale/en_US/template/email/packpin/packpin_out_for_delivery_email.html
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<!--@subject Order shipment status has been updated. @-->
|
2 |
-
<!DOCTYPE html>
|
3 |
-
<html>
|
4 |
-
<head>
|
5 |
-
<meta charset="utf-8">
|
6 |
-
<style>
|
7 |
-
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
-
</style>
|
9 |
-
</head>
|
10 |
-
<body style="background:#ebebeb;">
|
11 |
-
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
-
<div style="background:#ececed;">
|
13 |
-
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
-
<img
|
15 |
-
{{if logo_width}}
|
16 |
-
width="{{var logo_width}}"
|
17 |
-
{{else}}
|
18 |
-
width="auto"
|
19 |
-
{{/if}}
|
20 |
-
{{if logo_height}}
|
21 |
-
height="{{var logo_height}}"
|
22 |
-
{{else}}
|
23 |
-
height="35"
|
24 |
-
{{/if}}
|
25 |
-
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
-
</a>
|
27 |
-
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
-
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
-
</div>
|
30 |
-
{{var banner}}
|
31 |
-
{{var crossSell}}
|
32 |
-
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
-
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
-
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
-
<tr>
|
36 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
-
Order number:
|
38 |
-
</td>
|
39 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
-
{{var track.getOrderNumber()}}
|
41 |
-
</td>
|
42 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
-
Carrier:
|
44 |
-
</td>
|
45 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
-
{{var track.getCarrierName()}}
|
47 |
-
</td>
|
48 |
-
</tr>
|
49 |
-
<tr>
|
50 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
-
</td>
|
52 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
-
</td>
|
54 |
-
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
-
Tracking number:
|
56 |
-
</td>
|
57 |
-
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
-
{{var track.getCode()}}
|
59 |
-
</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td> </td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
-
If you have questions regarding shipment,
|
67 |
-
<br>
|
68 |
-
please contact carrier direcly.
|
69 |
-
</td>
|
70 |
-
<td valign="top" colspan="2">
|
71 |
-
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
-
SEE FULL TRACKING INFO
|
73 |
-
</a>
|
74 |
-
</td>
|
75 |
-
</tr>
|
76 |
-
</table>
|
77 |
-
</fieldset>
|
78 |
-
</div>
|
79 |
-
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
-
This email was sent to {{var email}}
|
81 |
-
<br>
|
82 |
-
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
</body>
|
87 |
</html>
|
1 |
+
<!--@subject Order shipment status has been updated. @-->
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8">
|
6 |
+
<style>
|
7 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
|
8 |
+
</style>
|
9 |
+
</head>
|
10 |
+
<body style="background:#ebebeb;">
|
11 |
+
<div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
|
12 |
+
<div style="background:#ececed;">
|
13 |
+
<a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
|
14 |
+
<img
|
15 |
+
{{if logo_width}}
|
16 |
+
width="{{var logo_width}}"
|
17 |
+
{{else}}
|
18 |
+
width="auto"
|
19 |
+
{{/if}}
|
20 |
+
{{if logo_height}}
|
21 |
+
height="{{var logo_height}}"
|
22 |
+
{{else}}
|
23 |
+
height="35"
|
24 |
+
{{/if}}
|
25 |
+
style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
|
26 |
+
</a>
|
27 |
+
<div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
|
28 |
+
YOUR PACKAGE STATUS HAS BEEN UPDATED!
|
29 |
+
</div>
|
30 |
+
{{var banner}}
|
31 |
+
{{var crossSell}}
|
32 |
+
<fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
|
33 |
+
<legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
|
34 |
+
<table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
|
35 |
+
<tr>
|
36 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
37 |
+
Order number:
|
38 |
+
</td>
|
39 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
40 |
+
{{var track.getOrderNumber()}}
|
41 |
+
</td>
|
42 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
43 |
+
Carrier:
|
44 |
+
</td>
|
45 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
46 |
+
{{var track.getCarrierName()}}
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
<tr>
|
50 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
51 |
+
</td>
|
52 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
53 |
+
</td>
|
54 |
+
<td valign="top" style="text-align:left;font-weight:600">
|
55 |
+
Tracking number:
|
56 |
+
</td>
|
57 |
+
<td valign="top" style="text-align:left;font-weight:400">
|
58 |
+
{{var track.getCode()}}
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td> </td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td valign="top" colspan="2" style="text-align:left;line-height:15px;">
|
66 |
+
If you have questions regarding shipment,
|
67 |
+
<br>
|
68 |
+
please contact carrier direcly.
|
69 |
+
</td>
|
70 |
+
<td valign="top" colspan="2">
|
71 |
+
<a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
|
72 |
+
SEE FULL TRACKING INFO
|
73 |
+
</a>
|
74 |
+
</td>
|
75 |
+
</tr>
|
76 |
+
</table>
|
77 |
+
</fieldset>
|
78 |
+
</div>
|
79 |
+
<div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
|
80 |
+
This email was sent to {{var email}}
|
81 |
+
<br>
|
82 |
+
No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
</body>
|
87 |
</html>
|
app/locale/es_ES/Packpin_Pptrack.csv
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
"Total tracks","Total tracks"
|
2 |
-
"Unique sessions","Unique sessions"
|
3 |
-
"More Details","More Details"
|
4 |
-
"Visits Generated","Visits Generated"
|
5 |
-
"Shipments Tracked","Shipments Tracked"
|
6 |
-
"Packpin Stats","Packpin Stats"
|
7 |
-
"----- Packpin carriers -----","----- Packpin carriers -----"
|
8 |
-
"Select All","Seleccionar todo"
|
9 |
-
"Unselect All","Deseleccionar todo"
|
10 |
-
"Packpin Notifications","Packpin notificaciones"
|
11 |
-
"Packpin Notification Settings","Ajustes de Packpin notificaciones"
|
12 |
-
"Shipment status","Estado del envío"
|
13 |
-
"You have successfully unsubscribed from package status updates","Usted ha anulado su suscripción a las actualizaciones del estado del envío"
|
14 |
-
"Subscription not found or already unsubscribed!","Suscripción no encontrada o anulada!"
|
15 |
-
"Tracking info not found!","Información de seguimiento no encontrada!"
|
16 |
-
"Unsubscribe","Darse de baja"
|
17 |
-
"You have to enter API key before saving config!","Se debe entrar la clave de API para guardar configuración!"
|
18 |
-
"Error sending data to API","Error al enviar datos a API"
|
19 |
-
"Your temporary API key has expired!","Su clave API temporal ha caducado!"
|
20 |
-
"Your temporary API key will expire in","Su clave API temporal caducará en"
|
21 |
-
"%s days","%s días"
|
22 |
-
"While waiting, we have something for you. Check offerings bellow:","Mientras espere, tenemos algo para usted. Mire las ofertas:"
|
23 |
-
"Add to Cart","Añadir a cesta"
|
24 |
-
"Shipped By","Enviado por"
|
25 |
-
"Tracking Number","Número de seguimiento"
|
26 |
-
"Track your item","Seguir su artículo"
|
27 |
-
"No tracking info!","No hay información de seguimiento!"
|
28 |
-
"Shipment Information","Información de envío"
|
29 |
-
"Dispatched","Enviado"
|
30 |
-
"In Transit","En tránsito"
|
31 |
-
"Out for delivery","Por entregar"
|
32 |
-
"Delivered","Entregado"
|
33 |
-
"Tracking Info","Información de seguimiento"
|
34 |
-
"Package prepared for dispatch","Paquete preparado para enviar"
|
35 |
-
"Order number","Número del pedido"
|
36 |
-
"Tracking code","Código de seguimiento"
|
37 |
-
"Shipped on","Enviado el (fecha)"
|
38 |
-
"Ships to","Se puede enviar a"
|
39 |
-
"For questions regarding your shipment contact carrier directly","Si tiene preguntas sobre el envío, contacte al transportista directamente"
|
1 |
+
"Total tracks","Total tracks"
|
2 |
+
"Unique sessions","Unique sessions"
|
3 |
+
"More Details","More Details"
|
4 |
+
"Visits Generated","Visits Generated"
|
5 |
+
"Shipments Tracked","Shipments Tracked"
|
6 |
+
"Packpin Stats","Packpin Stats"
|
7 |
+
"----- Packpin carriers -----","----- Packpin carriers -----"
|
8 |
+
"Select All","Seleccionar todo"
|
9 |
+
"Unselect All","Deseleccionar todo"
|
10 |
+
"Packpin Notifications","Packpin notificaciones"
|
11 |
+
"Packpin Notification Settings","Ajustes de Packpin notificaciones"
|
12 |
+
"Shipment status","Estado del envío"
|
13 |
+
"You have successfully unsubscribed from package status updates","Usted ha anulado su suscripción a las actualizaciones del estado del envío"
|
14 |
+
"Subscription not found or already unsubscribed!","Suscripción no encontrada o anulada!"
|
15 |
+
"Tracking info not found!","Información de seguimiento no encontrada!"
|
16 |
+
"Unsubscribe","Darse de baja"
|
17 |
+
"You have to enter API key before saving config!","Se debe entrar la clave de API para guardar configuración!"
|
18 |
+
"Error sending data to API","Error al enviar datos a API"
|
19 |
+
"Your temporary API key has expired!","Su clave API temporal ha caducado!"
|
20 |
+
"Your temporary API key will expire in","Su clave API temporal caducará en"
|
21 |
+
"%s days","%s días"
|
22 |
+
"While waiting, we have something for you. Check offerings bellow:","Mientras espere, tenemos algo para usted. Mire las ofertas:"
|
23 |
+
"Add to Cart","Añadir a cesta"
|
24 |
+
"Shipped By","Enviado por"
|
25 |
+
"Tracking Number","Número de seguimiento"
|
26 |
+
"Track your item","Seguir su artículo"
|
27 |
+
"No tracking info!","No hay información de seguimiento!"
|
28 |
+
"Shipment Information","Información de envío"
|
29 |
+
"Dispatched","Enviado"
|
30 |
+
"In Transit","En tránsito"
|
31 |
+
"Out for delivery","Por entregar"
|
32 |
+
"Delivered","Entregado"
|
33 |
+
"Tracking Info","Información de seguimiento"
|
34 |
+
"Package prepared for dispatch","Paquete preparado para enviar"
|
35 |
+
"Order number","Número del pedido"
|
36 |
+
"Tracking code","Código de seguimiento"
|
37 |
+
"Shipped on","Enviado el (fecha)"
|
38 |
+
"Ships to","Se puede enviar a"
|
39 |
+
"For questions regarding your shipment contact carrier directly","Si tiene preguntas sobre el envío, contacte al transportista directamente"
|
app/locale/nl_NL/Packpin_Pptrack.csv
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
"Total tracks","Total tracks"
|
2 |
-
"Unique sessions","Unieke sessies"
|
3 |
-
"More Details","Meer informatie"
|
4 |
-
"Visits Generated","Gegenereerde bezoeken"
|
5 |
-
"Shipments Tracked","Getraceerde verzendingen"
|
6 |
-
"Packpin Stats","Packpin Statistieken"
|
7 |
-
"----- Packpin carriers -----","----- Packpin Vervoerders -----"
|
8 |
-
"Select All","Alles Aanvinken"
|
9 |
-
"Unselect All","Alles Uitvinken"
|
10 |
-
"Packpin Notifications","Packpin Meldingen"
|
11 |
-
"Packpin Notification Settings","Packpin Meldingen Instellingen"
|
12 |
-
"Shipment status","Status Verzending"
|
13 |
-
"You have successfully unsubscribed from package status updates","U heeft zich nu uitgeschreven van Packpin status updates"
|
14 |
-
"Subscription not found or already unsubscribed!","Uw gegevens zijn niet gevonden, of u heeft zich al uitgeschreven!"
|
15 |
-
"Tracking info not found!","Verzendinformatie niet gevonden!"
|
16 |
-
"Unsubscribe","Uitschrijven"
|
17 |
-
"You have to enter API key before saving config!","U moet uw API sleutel invoeren voordat u deze instellingen opslaat"
|
18 |
-
"Error sending data to API","Er is een fout opgetreden bij het verzenden van informatie naar de API"
|
19 |
-
"Your temporary API key has expired!","Uw tijdelijke API sleutel is verlopen"
|
20 |
-
"Your temporary API key will expire in","Uw tijdelijke API sleutel verloopt over"
|
21 |
-
"%s days","%s dag(en)"
|
22 |
-
"While waiting, we have something for you. Check offerings bellow:","Terwijl u wacht hebben we iets voor u. Bekijk het volgende aanbod:"
|
23 |
-
"Add to Cart","Aan winkelwagen toevoegen"
|
24 |
-
"Shipped By","Verzonden Door"
|
25 |
-
"Tracking Number","Volgnummer Verzending"
|
26 |
-
"Track your item","Volg uw verzending"
|
27 |
-
"No tracking info!","Geen verzendinformatie gevonden!"
|
28 |
-
"Shipment Information","Verzendinformatie"
|
29 |
-
"Dispatched","Vrijgegeven"
|
30 |
-
"In Transit","Op Tussenstation"
|
31 |
-
"Out for delivery","Onderweg naar bezorgadres"
|
32 |
-
"Delivered","Bezorgd"
|
33 |
-
"Tracking Info","Volg Informatie"
|
34 |
-
"Package prepared for dispatch","Pakket Klaar voor Bezorging"
|
35 |
-
"Order number","Ordernummer"
|
36 |
-
"Tracking code","Volgnummer"
|
37 |
-
"Shipped on","Verzonden op"
|
38 |
-
"Ships to","Verzonden naar"
|
39 |
-
"For questions regarding your shipment contact carrier directly","Voor vragen met betrekking tot uw verzending vragen wij u contact op te nemen met het verzendbedrijf"
|
1 |
+
"Total tracks","Total tracks"
|
2 |
+
"Unique sessions","Unieke sessies"
|
3 |
+
"More Details","Meer informatie"
|
4 |
+
"Visits Generated","Gegenereerde bezoeken"
|
5 |
+
"Shipments Tracked","Getraceerde verzendingen"
|
6 |
+
"Packpin Stats","Packpin Statistieken"
|
7 |
+
"----- Packpin carriers -----","----- Packpin Vervoerders -----"
|
8 |
+
"Select All","Alles Aanvinken"
|
9 |
+
"Unselect All","Alles Uitvinken"
|
10 |
+
"Packpin Notifications","Packpin Meldingen"
|
11 |
+
"Packpin Notification Settings","Packpin Meldingen Instellingen"
|
12 |
+
"Shipment status","Status Verzending"
|
13 |
+
"You have successfully unsubscribed from package status updates","U heeft zich nu uitgeschreven van Packpin status updates"
|
14 |
+
"Subscription not found or already unsubscribed!","Uw gegevens zijn niet gevonden, of u heeft zich al uitgeschreven!"
|
15 |
+
"Tracking info not found!","Verzendinformatie niet gevonden!"
|
16 |
+
"Unsubscribe","Uitschrijven"
|
17 |
+
"You have to enter API key before saving config!","U moet uw API sleutel invoeren voordat u deze instellingen opslaat"
|
18 |
+
"Error sending data to API","Er is een fout opgetreden bij het verzenden van informatie naar de API"
|
19 |
+
"Your temporary API key has expired!","Uw tijdelijke API sleutel is verlopen"
|
20 |
+
"Your temporary API key will expire in","Uw tijdelijke API sleutel verloopt over"
|
21 |
+
"%s days","%s dag(en)"
|
22 |
+
"While waiting, we have something for you. Check offerings bellow:","Terwijl u wacht hebben we iets voor u. Bekijk het volgende aanbod:"
|
23 |
+
"Add to Cart","Aan winkelwagen toevoegen"
|
24 |
+
"Shipped By","Verzonden Door"
|
25 |
+
"Tracking Number","Volgnummer Verzending"
|
26 |
+
"Track your item","Volg uw verzending"
|
27 |
+
"No tracking info!","Geen verzendinformatie gevonden!"
|
28 |
+
"Shipment Information","Verzendinformatie"
|
29 |
+
"Dispatched","Vrijgegeven"
|
30 |
+
"In Transit","Op Tussenstation"
|
31 |
+
"Out for delivery","Onderweg naar bezorgadres"
|
32 |
+
"Delivered","Bezorgd"
|
33 |
+
"Tracking Info","Volg Informatie"
|
34 |
+
"Package prepared for dispatch","Pakket Klaar voor Bezorging"
|
35 |
+
"Order number","Ordernummer"
|
36 |
+
"Tracking code","Volgnummer"
|
37 |
+
"Shipped on","Verzonden op"
|
38 |
+
"Ships to","Verzonden naar"
|
39 |
+
"For questions regarding your shipment contact carrier directly","Voor vragen met betrekking tot uw verzending vragen wij u contact op te nemen met het verzendbedrijf"
|
app/locale/pt_PT/Packpin_Pptrack.csv
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
"Total tracks","Total tracks"
|
2 |
-
"Unique sessions","Unique sessions"
|
3 |
-
"More Details","More Details"
|
4 |
-
"Visits Generated","Visits Generated"
|
5 |
-
"Shipments Tracked","Shipments Tracked"
|
6 |
-
"Packpin Stats","Packpin Stats"
|
7 |
-
"----- Packpin carriers -----","----- Packpin carriers -----"
|
8 |
-
"Select All","Seleccionar todos"
|
9 |
-
"Unselect All","Desseleccionar todos"
|
10 |
-
"Packpin Notifications","Packpin Notifications"
|
11 |
-
"Packpin Notification Settings","Packpin Notification Settings"
|
12 |
-
"Shipment status","Estado do envio"
|
13 |
-
"You have successfully unsubscribed from package status updates","Você cancelou as actualizações de estado de encomenda"
|
14 |
-
"Subscription not found or already unsubscribed!","Inscrição não foi encontrada ou já foi cancelada!"
|
15 |
-
"Tracking info not found!","Informação de localização não encontrada!"
|
16 |
-
"Unsubscribe","Anular inscrição"
|
17 |
-
"You have to enter API key before saving config!","Você tem de introduzir a chave API antes de salvar as configurações"
|
18 |
-
"Error sending data to API","Erro de envio de dados para API"
|
19 |
-
"Your temporary API key has expired!","A sua chave API temporária expirou!"
|
20 |
-
"Your temporary API key will expire in","A sua chave API vai expirar em"
|
21 |
-
"%s days","%s days"
|
22 |
-
"While waiting, we have something for you. Check offerings bellow:","Enquanto espera nós temos algo para si. Verifique as ofertas abaixo:"
|
23 |
-
"Add to Cart","Adicionar ao carrinho"
|
24 |
-
"Shipped By","Enviado por"
|
25 |
-
"Tracking Number","Número para localização"
|
26 |
-
"Track your item","Localize o seu item"
|
27 |
-
"No tracking info!","Sem informação de localização!"
|
28 |
-
"Shipment Information","Informação do despacho"
|
29 |
-
"Dispatched","Postado"
|
30 |
-
"In Transit","Em trânsito"
|
31 |
-
"Out for delivery","Expedido para entrega"
|
32 |
-
"Delivered","Entregue"
|
33 |
-
"Tracking Info","Informação de localização"
|
34 |
-
"Package prepared for dispatch","Encomenda preparada para expedição"
|
35 |
-
"Order number","Número de pedido"
|
36 |
-
"Tracking code","Código de localização"
|
37 |
-
"Shipped on","Enviado"
|
38 |
-
"Ships to","Envios para"
|
39 |
-
"For questions regarding your shipment contact carrier directly","Para questões relacionadas com o seu envio contacte directamente a sua transportadora"
|
1 |
+
"Total tracks","Total tracks"
|
2 |
+
"Unique sessions","Unique sessions"
|
3 |
+
"More Details","More Details"
|
4 |
+
"Visits Generated","Visits Generated"
|
5 |
+
"Shipments Tracked","Shipments Tracked"
|
6 |
+
"Packpin Stats","Packpin Stats"
|
7 |
+
"----- Packpin carriers -----","----- Packpin carriers -----"
|
8 |
+
"Select All","Seleccionar todos"
|
9 |
+
"Unselect All","Desseleccionar todos"
|
10 |
+
"Packpin Notifications","Packpin Notifications"
|
11 |
+
"Packpin Notification Settings","Packpin Notification Settings"
|
12 |
+
"Shipment status","Estado do envio"
|
13 |
+
"You have successfully unsubscribed from package status updates","Você cancelou as actualizações de estado de encomenda"
|
14 |
+
"Subscription not found or already unsubscribed!","Inscrição não foi encontrada ou já foi cancelada!"
|
15 |
+
"Tracking info not found!","Informação de localização não encontrada!"
|
16 |
+
"Unsubscribe","Anular inscrição"
|
17 |
+
"You have to enter API key before saving config!","Você tem de introduzir a chave API antes de salvar as configurações"
|
18 |
+
"Error sending data to API","Erro de envio de dados para API"
|
19 |
+
"Your temporary API key has expired!","A sua chave API temporária expirou!"
|
20 |
+
"Your temporary API key will expire in","A sua chave API vai expirar em"
|
21 |
+
"%s days","%s days"
|
22 |
+
"While waiting, we have something for you. Check offerings bellow:","Enquanto espera nós temos algo para si. Verifique as ofertas abaixo:"
|
23 |
+
"Add to Cart","Adicionar ao carrinho"
|
24 |
+
"Shipped By","Enviado por"
|
25 |
+
"Tracking Number","Número para localização"
|
26 |
+
"Track your item","Localize o seu item"
|
27 |
+
"No tracking info!","Sem informação de localização!"
|
28 |
+
"Shipment Information","Informação do despacho"
|
29 |
+
"Dispatched","Postado"
|
30 |
+
"In Transit","Em trânsito"
|
31 |
+
"Out for delivery","Expedido para entrega"
|
32 |
+
"Delivered","Entregue"
|
33 |
+
"Tracking Info","Informação de localização"
|
34 |
+
"Package prepared for dispatch","Encomenda preparada para expedição"
|
35 |
+
"Order number","Número de pedido"
|
36 |
+
"Tracking code","Código de localização"
|
37 |
+
"Shipped on","Enviado"
|
38 |
+
"Ships to","Envios para"
|
39 |
+
"For questions regarding your shipment contact carrier directly","Para questões relacionadas com o seu envio contacte directamente a sua transportadora"
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Packpin_Pptrack</name>
|
4 |
-
<version>1.5.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
@@ -18,11 +18,11 @@ Packpin created shipment tracking and cross selling solution within email notifi
|
|
18 |
- Shipment tracking button on shipment notification email.
|
19 |
- Tracking button in customer order.
|
20 |
- Easy 10 minutes installation.</description>
|
21 |
-
<notes>
|
22 |
<authors><author><name>Packpin Packpin</name><user>packpin</user><email>info@packpin.com</email></author></authors>
|
23 |
-
<date>2015-10-
|
24 |
-
<time>
|
25 |
-
<contents><target name="magecommunity"><dir name="Packpin"><dir name="Pptrack"><dir name="Block"><dir name="Adminhtml"><file name="Dashboard.php" hash="
|
26 |
<compatible/>
|
27 |
<dependencies><required><php><min>5.2.13</min><max>5.7.0</max></php></required></dependencies>
|
28 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Packpin_Pptrack</name>
|
4 |
+
<version>1.5.6</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
18 |
- Shipment tracking button on shipment notification email.
|
19 |
- Tracking button in customer order.
|
20 |
- Easy 10 minutes installation.</description>
|
21 |
+
<notes>Fixed tracking link generator</notes>
|
22 |
<authors><author><name>Packpin Packpin</name><user>packpin</user><email>info@packpin.com</email></author></authors>
|
23 |
+
<date>2015-10-09</date>
|
24 |
+
<time>10:50:38</time>
|
25 |
+
<contents><target name="magecommunity"><dir name="Packpin"><dir name="Pptrack"><dir name="Block"><dir name="Adminhtml"><file name="Dashboard.php" hash="772664d65fc4d919e5ef300cf38221df"/><dir name="Sales"><dir name="Order"><dir name="Shipment"><dir name="Create"><file name="Tracking.php" hash="616b55c4a6d34e63e70df593b0db228d"/></dir><dir name="View"><file name="Tracking.php" hash="9a2caca0e7aeeef3c5e4cdd8db18a0bd"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint-owner.php" hash="3f3029efceb1d0e1c8f37f08aa21a371"/><file name="Hint.php" hash="c4dff2072bfda0f7e380fa81485d4ab3"/><file name="Scripts.php" hash="cc9b7d5c648a742d75601da4753e85a8"/></dir><dir name="Form"><dir name="Fieldset"><file name="Carrier.php" hash="39e5dbca24ca0e2a6126b8073fa554fa"/></dir></dir></dir></dir><dir name="Tracks"><dir name="Edit"><file name="Form.php" hash="bb8dec319616ac5e0bb649655f6157ba"/></dir><file name="Edit.php" hash="b1295a8eae49bcfb67f939ccb566c986"/><file name="Grid.php" hash="27a72f977e2a9c668f9dd66d29e62937"/></dir><file name="Tracks.php" hash="32ac885537dc7ce3b35671e353d25abe"/></dir><file name="Ads.php" hash="a446e608892e7d05060b32137db1f03c"/><file name="Crosssell.php" hash="3588b41f8c8664bd871b247420f96f22"/><file name="Index.php" hash="64cbc12fd919d46b85c49edcd055ba2a"/><file name="Script.php" hash="d5a454b4ec9f08300e2056ef2d89da0c"/><file name="Trackings.php" hash="3ca3418bcc566ee1a00b3c2e2265114e"/></dir><dir name="Helper"><file name="Data.php" hash="4d50c54307801f4901464570679453a0"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Crossviews.php" hash="351f19d3a8fb2909c617441d90a7f944"/><file name="Crossviewspage.php" hash="1e3958a9c934eb3ba27c38515cf10d5e"/></dir></dir></dir></dir><file name="Api.php" hash="9844dad347d95f010e8ad6d612fae74f"/><file name="Carrier.php" hash="fab9074fa7d932b83bd3dc7c9ae1afdb"/><file name="EnableNotifications.php" hash="5c0e3b122acc8d0216ee078fcefd9d50"/><file name="Observer.php" hash="05b01f229a161f54c0b6195ac3086c46"/><dir name="Order"><file name="Shipment.php" hash="9ee3a28f2bb41fef2434d2a556d08a1f"/></dir><dir name="Resource"><dir name="Carrier"><file name="Collection.php" hash="ca3d8884d9a1d9a1dbb4c36cffd931e1"/></dir><file name="Carrier.php" hash="6ea29fe6b81b3f150ea683316654299b"/><dir name="Setting"><file name="Collection.php" hash="30e53e9dc4973fec4f0e6bd68f29412d"/></dir><file name="Setting.php" hash="dff1ce85bebf8e48c64a7653d5c8ac4e"/><dir name="Track"><file name="Collection.php" hash="360902f340284bd6e37a79955b0265b9"/></dir><file name="Track.php" hash="043618746031d58f437d8f6864f344ba"/><dir name="Trackdetail"><file name="Collection.php" hash="34749cd437737d3fef0181e6a2d4adaf"/></dir><file name="Trackdetail.php" hash="b6ecc039ed80366e3cc969645d57a7cf"/><dir name="Trackunsubscribed"><file name="Collection.php" hash="b15d2d83f287dbabbce646f12902cc39"/></dir><file name="Trackunsubscribed.php" hash="1b3d6508bb8e93c4272224bba1106b6a"/><dir name="Visit"><file name="Collection.php" hash="5b9a70fb53daece2efd716c6193d5794"/></dir><file name="Visit.php" hash="c8474419b1298b1c9989d781a0b44fd5"/></dir><file name="Setting.php" hash="ec277f1b93dbb4f4e271d39cccd3424d"/><file name="Track.php" hash="868c23083b446cf3a0b5d49cca324aef"/><file name="Trackdetail.php" hash="b385925f9770f84ce9a98f6af2baa0b6"/><file name="Trackunsubscribed.php" hash="9fa077052e8c1e6cc9d92fbead95b5b6"/><file name="Translate.php" hash="9f1887b6969ddedb551fee93452839e8"/><file name="Visit.php" hash="73af7da05602b349f3edf1a841274c92"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PackpintracksController.php" hash="a0535a604ed2782c9e58d4933a9f8445"/><file name="PpnotificationsController.php" hash="6e838648091201e517c1982ed13a0318"/></dir><file name="IndexController.php" hash="6f85dc709b23f5d36027562e1bddc32a"/><file name="UnsubscribeController.php" hash="df56f68d860aba0724ab2206e10e3266"/></dir><dir name="data"><dir name="pptrack_setup"><file name="data-upgrade-0.1.5-1.1.0.php" hash="fc015f14bf96711532b08ee447254e80"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="9d0afe8b7348803af05fd6cbdd8666c2"/><file name="api.xml" hash="7b3b9aca175d02617293b2833bf72e26"/><file name="config.xml" hash="025b5f42ea3dac22f6c4bcf94293bf69"/><file name="system.xml" hash="30cfce795aa23c504ea4870e8a81270d"/></dir><dir name="sql"><dir name="pptrack_setup"><file name="mysql4-install-0.1.2.php" hash="51665242241e4cf49ef1c3d0c03e9bbd"/><file name="mysql4-upgrade-0.1.2-0.1.5.php" hash="48c7400eceaaed4a7395697362289cab"/><file name="mysql4-upgrade-0.1.5-1.3.0.php" hash="82848914065e9549d21c44fd19cef3d3"/><file name="mysql4-upgrade-0.3.0-1.5.5.php" hash="efb4d41d21be9be1e44f57f6ca0e57b9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pptrack.xml" hash="3ddb5fe17e8c826ba2ee8bad03282cb1"/></dir><dir name="template"><dir name="pptrack"><file name="ads.phtml" hash="1fdd498f350d6482e233dfd9b6dc8227"/><file name="ads_email.phtml" hash="8e513589d31ecf120155022e3d623432"/><file name="crosssell.phtml" hash="8e180d67c2df0da3437be1fbc1f96b97"/><file name="crosssell_email.phtml" hash="e7363c178d6e8d50bc2f49ba4e78a8b2"/><dir name="email"><dir name="order"><dir name="shipment"><file name="track.phtml" hash="c73ad2f9e8f9a4f788bf8e3149d2c75b"/></dir></dir></dir><file name="index.phtml" hash="256af29c5fc8840e32b72bbc85198370"/><file name="index_new.phtml" hash="bfe20974f66f072e54a2a309ccc40f56"/><file name="popup.phtml" hash="fc6d4a9cb9dccc2e5bbf716f90cab8ff"/><file name="script.phtml" hash="a90b9e61aa2550a3b4cbf7c6e57c3a05"/><file name="unsubscribe.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pptrack.xml" hash="677b2cfae47ab3c30cd6b8d2a23b8aa2"/></dir><dir name="template"><dir name="pptrack"><dir name="dashboard"><file name="index.phtml" hash="0b02b9768ba6e5743453a93903f3cf05"/><file name="packpin.phtml" hash="641727a031613c7d6486371b57580b86"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="fb57796c9ddd69c3e5075d326957ab29"/><file name="scripts.phtml" hash="562020b1ada26a3184b852f79eb05710"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Packpin_Pptrack.xml" hash="b7b6888699c5f717fa9bb12a31e3e5c0"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="pptrack.css" hash="7b287b9cf779bdd445e865890dbe511c"/></dir><dir name="images"><dir name="pptrack"><file name="bulletIcon.png" hash="15f6fd65c7a62f940b7d17b9186a2b35"/><file name="checkedIcon.png" hash="cef38265bdd7675a0497a2296f5b7332"/><file name="postnlLogo.png" hash="3b4595ba4262c574c1147ed39e862092"/><file name="trackingStatus.png" hash="6dcf522f4e22b69bb25c3b3c199bb464"/><file name="truck.png" hash="3eb50f750a0fefa1903613e0bc26a2ee"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pptrack"><dir name="css"><file name="dashboard.css" hash="b6b60f1fca6cafc98cf4483c3299ab4d"/><file name="pptrack.css" hash="b4c42edf3884eb62617f2347f1740b3f"/></dir><dir name="images"><file name="pp_logo1.png" hash="1a79f10d0f028271ac0b2646243e39d1"/></dir><dir name="js"><file name="dashboard.js" hash="1a4bd65a41a4c5d4d7ba6d4f94fe4955"/><file name="pptrack.js" hash="7bc0ee636b3b83484fc3b9348863bd22"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="packpin"><file name="packpin_delivered_email.html" hash="b8fbabbb6633d214752ae49d289bb2a1"/><file name="packpin_exception_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_failed_attempt_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_in_transit_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_info_received_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_out_for_delivery_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/></dir></dir></dir><file name="Packpin_Pptrack.csv" hash="de614713c9a1e184f303eb38284b5ca9"/></dir><dir name="es_ES"><file name="Packpin_Pptrack.csv" hash="42b28f85af8c85568b670dc9f1e5bc65"/></dir><dir name="de_DE"><file name="Packpin_Pptrack.csv" hash="0e0f4cdf6e51bc74fcb017adebe667bd"/></dir><dir name="nl_NL"><file name="Packpin_Pptrack.csv" hash="94baa20e1a27e1856f27206bdf88f53e"/></dir><dir name="pt_PT"><file name="Packpin_Pptrack.csv" hash="f46682dd7dd5abbe788895b942985658"/></dir></target></contents>
|
26 |
<compatible/>
|
27 |
<dependencies><required><php><min>5.2.13</min><max>5.7.0</max></php></required></dependencies>
|
28 |
</package>
|