Version Notes
Reuploaded stable version of TagMan Intellitag extension
Download this release
Release Info
Developer | Toby Doig |
Extension | Tagman_Intellitag |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
app/code/community/Tagman/Intellitag/Block/JsInjector.php
CHANGED
@@ -6,185 +6,183 @@ class Tagman_Intellitag_Block_JsInjector
|
|
6 |
public function addTagManJavascriptBlock()
|
7 |
{
|
8 |
|
9 |
-
$
|
10 |
-
$
|
11 |
-
$
|
12 |
|
13 |
//page_type
|
14 |
-
$
|
15 |
|
16 |
-
$
|
17 |
|
18 |
|
19 |
-
$
|
20 |
<script type="text/javascript">
|
21 |
window.tmParam = {
|
22 |
-
page_type: "'.$
|
23 |
};
|
24 |
</script>
|
25 |
|
26 |
<script type="text/javascript">
|
27 |
|
28 |
(function(d,s){
|
29 |
-
var client = "'.$
|
30 |
-
var siteId = '.$
|
31 |
// do not edit
|
32 |
var a=d.createElement(s),b=d.getElementsByTagName(s)[0];
|
33 |
a.async=true;a.type="text/javascript";
|
34 |
-
a.src="//'.$
|
35 |
a.tagman="st=(" + new Date() +")&c=" + client + "&sid=" + siteId;
|
36 |
b.parentNode.insertBefore(a,b);
|
37 |
})(document,"script");
|
38 |
|
39 |
</script>';
|
40 |
|
41 |
-
return ($
|
42 |
}
|
43 |
|
44 |
private function getTmParams()
|
45 |
{
|
46 |
-
$
|
47 |
-
$
|
48 |
-
$
|
49 |
-
$
|
50 |
';
|
51 |
-
foreach($
|
52 |
-
$
|
53 |
-
$
|
54 |
-
$
|
55 |
-
$
|
56 |
-
if($
|
57 |
-
$
|
58 |
} else {
|
59 |
-
$dynamic = explode('&&', $cModel->getData('magento_value'));
|
60 |
-
$tmp_model = Mage::getModel($dynamic[0]);
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
$tmParam .= $this->getCatalogCategory($prefix, $name, $tmp_model, $dynamic);
|
68 |
-
break;
|
69 |
-
case 'customer/customer':
|
70 |
-
$tmParam .= $this->getCustomerCustomer($prefix, $name, $tmp_model, $dynamic);
|
71 |
break;
|
72 |
-
|
73 |
-
|
74 |
break;
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
}
|
84 |
-
|
|
|
85 |
}
|
86 |
|
87 |
-
private function getCatalogProduct($
|
88 |
$lParam = '';
|
89 |
if(Mage::registry('current_product')){
|
90 |
-
$
|
91 |
-
$
|
92 |
-
$
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
$methodVal = $methodVal->$dynamic[2]();
|
97 |
}
|
98 |
-
if(gettype($
|
99 |
-
$
|
100 |
}
|
101 |
-
$
|
102 |
-
$lParam .= $
|
103 |
|
104 |
}
|
105 |
return ($lParam);
|
106 |
}
|
107 |
|
108 |
-
private function getCatalogCategory($
|
109 |
$lParam = '';
|
110 |
if(Mage::registry('current_category')){
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
if (gettype($
|
115 |
-
$
|
116 |
}
|
117 |
-
if(gettype($
|
118 |
-
$
|
119 |
}
|
120 |
|
121 |
-
$lParam .= $
|
122 |
}
|
123 |
return ($lParam);
|
124 |
}
|
125 |
|
126 |
-
private function getCustomerCustomer($
|
127 |
$lParam = '';
|
128 |
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
129 |
$id=Mage::getSingleton('customer/session')->getId();
|
130 |
-
$
|
131 |
-
$
|
132 |
-
|
133 |
-
|
134 |
-
//var_dump('2'.$dynamic[2]);
|
135 |
-
$methodVal = $methodVal->$dynamic[2]();
|
136 |
}
|
137 |
-
if(gettype($
|
138 |
-
$
|
139 |
}
|
140 |
-
$lParam .= $
|
141 |
}
|
142 |
return ($lParam);
|
143 |
}
|
144 |
|
145 |
-
private function getSalesOrder($
|
146 |
$lParam = '';
|
147 |
-
$
|
148 |
-
$
|
149 |
|
150 |
-
if (gettype($
|
151 |
-
$
|
152 |
}
|
153 |
-
if($
|
154 |
-
$
|
155 |
}
|
156 |
-
elseif(gettype($
|
157 |
-
$
|
158 |
}
|
159 |
-
$lParam .= $
|
160 |
return ($lParam);
|
161 |
}
|
162 |
|
163 |
-
private function getSalesQuote($
|
164 |
$lParam = '';
|
165 |
-
$
|
166 |
-
$
|
167 |
|
168 |
-
if($
|
169 |
-
$
|
170 |
}
|
171 |
|
172 |
-
elseif(gettype($
|
173 |
-
$
|
174 |
}
|
175 |
-
$lParam .= $
|
176 |
return ($lParam);
|
177 |
}
|
178 |
|
179 |
-
private function getAllItems($
|
180 |
-
$
|
181 |
-
$
|
182 |
-
foreach($
|
183 |
-
if($
|
184 |
-
$
|
185 |
-
$
|
186 |
}
|
187 |
}
|
188 |
-
return ($
|
189 |
}
|
190 |
}
|
6 |
public function addTagManJavascriptBlock()
|
7 |
{
|
8 |
|
9 |
+
$lClient = Mage::getStoreConfig('tab1/credentials/client_id_text_field',Mage::app()->getStore());
|
10 |
+
$lSite = Mage::getStoreConfig('tab1/credentials/site_id_text_field',Mage::app()->getStore());
|
11 |
+
$lHost = Mage::getStoreConfig('tab1/credentials/host_text_field',Mage::app()->getStore());
|
12 |
|
13 |
//page_type
|
14 |
+
$lControlerName = Mage::app()->getRequest()->getControllerName();
|
15 |
|
16 |
+
$lTmParams = $this->getTmParams();
|
17 |
|
18 |
|
19 |
+
$lJs = '
|
20 |
<script type="text/javascript">
|
21 |
window.tmParam = {
|
22 |
+
page_type: "'.$lControlerName.'"'.$lTmParams.'
|
23 |
};
|
24 |
</script>
|
25 |
|
26 |
<script type="text/javascript">
|
27 |
|
28 |
(function(d,s){
|
29 |
+
var client = "'.$lClient.'";
|
30 |
+
var siteId = '.$lSite.';
|
31 |
// do not edit
|
32 |
var a=d.createElement(s),b=d.getElementsByTagName(s)[0];
|
33 |
a.async=true;a.type="text/javascript";
|
34 |
+
a.src="//'.$lHost.'/clients/"+client+"/"+siteId+".js";
|
35 |
a.tagman="st=(" + new Date() +")&c=" + client + "&sid=" + siteId;
|
36 |
b.parentNode.insertBefore(a,b);
|
37 |
})(document,"script");
|
38 |
|
39 |
</script>';
|
40 |
|
41 |
+
return ($lJs);
|
42 |
}
|
43 |
|
44 |
private function getTmParams()
|
45 |
{
|
46 |
+
$lVariables = unserialize(Mage::getStoreConfig("tab1/variables/field"));
|
47 |
+
$lModel = Mage::getModel('tagman_intellitag/variables');
|
48 |
+
$lTmParam = '';
|
49 |
+
$aPrefix = ',
|
50 |
';
|
51 |
+
foreach($lVariables as $tVar){
|
52 |
+
$aVarName = $tVar['text_field'];
|
53 |
+
$lVarId = $tVar['drop_down'];
|
54 |
+
$lModel->load($lVarId);
|
55 |
+
$lIsStatic=$lModel->getData('is_static');
|
56 |
+
if($lIsStatic==1){
|
57 |
+
$lTmParam .= $aPrefix . $aVarName.': '. '"' . $lModel->getValue() .'"';
|
58 |
} else {
|
|
|
|
|
59 |
|
60 |
+
$aDynamic = explode('&&', $lModel->getData('magento_value'));
|
61 |
+
$aModel = Mage::getModel($aDynamic[0]);
|
62 |
+
switch($aDynamic[0]){
|
63 |
+
case 'catalog/product':
|
64 |
+
$lTmParam .= $this->getCatalogProduct($aPrefix, $aVarName, $aModel, $aDynamic);
|
|
|
|
|
|
|
|
|
65 |
break;
|
66 |
+
case 'catalog/category':
|
67 |
+
$lTmParam .= $this->getCatalogCategory($aPrefix, $aVarName, $aModel, $aDynamic);
|
68 |
break;
|
69 |
+
case 'customer/customer':
|
70 |
+
$lTmParam .= $this->getCustomerCustomer($aPrefix, $aVarName, $aModel, $aDynamic);
|
71 |
+
break;
|
72 |
+
case 'sales/order':
|
73 |
+
$lTmParam .= $this->getSalesOrder($aPrefix, $aVarName, $aModel, $aDynamic);
|
74 |
+
break;
|
75 |
+
case 'sales/quote':
|
76 |
+
|
77 |
+
$lTmParam .= $this->getSalesQuote($aPrefix, $aVarName, $aModel, $aDynamic);
|
78 |
+
break;
|
79 |
+
default:
|
80 |
+
|
81 |
+
break;
|
82 |
+
}
|
83 |
}
|
84 |
}
|
85 |
+
|
86 |
+
return ($lTmParam);
|
87 |
}
|
88 |
|
89 |
+
private function getCatalogProduct($aPrefix, $aVarName, $aModel, $aDynamic){
|
90 |
$lParam = '';
|
91 |
if(Mage::registry('current_product')){
|
92 |
+
$lId=Mage::registry('current_product')->getId();
|
93 |
+
$aModel->load($lId);
|
94 |
+
$lMethodVal = $aModel->$aDynamic[1]();
|
95 |
+
if (gettype($lMethodVal)=="object"){
|
96 |
+
$lMethodVal = $lMethodVal->$aDynamic[2]();
|
|
|
|
|
97 |
}
|
98 |
+
if(gettype($lMethodVal)=="array"){
|
99 |
+
$lMethodVal=implode("|", $lMethodVal);
|
100 |
}
|
101 |
+
$lMethodVal = strip_tags($lMethodVal);
|
102 |
+
$lParam .= $aPrefix . $aVarName.': "'.addslashes($lMethodVal).'"';
|
103 |
|
104 |
}
|
105 |
return ($lParam);
|
106 |
}
|
107 |
|
108 |
+
private function getCatalogCategory($aPrefix, $aVarName, $aModel, $aDynamic){
|
109 |
$lParam = '';
|
110 |
if(Mage::registry('current_category')){
|
111 |
+
$lId=Mage::registry('current_category')->getId();
|
112 |
+
$aModel->load($lId);
|
113 |
+
$lMethodVal = $aModel->$aDynamic[1]();
|
114 |
+
if (gettype($lMethodVal)=="object"){
|
115 |
+
$lMethodVal = $lMethodVal->$aDynamic[2]();
|
116 |
}
|
117 |
+
if(gettype($lMethodVal)=="array"){
|
118 |
+
$lMethodVal=implode("|", $lMethodVal);
|
119 |
}
|
120 |
|
121 |
+
$lParam .= $aPrefix . $aVarName.': "'.addslashes($lMethodVal).'"';
|
122 |
}
|
123 |
return ($lParam);
|
124 |
}
|
125 |
|
126 |
+
private function getCustomerCustomer($aPrefix, $aVarName, $aModel, $aDynamic){
|
127 |
$lParam = '';
|
128 |
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
129 |
$id=Mage::getSingleton('customer/session')->getId();
|
130 |
+
$aModel->load($id);
|
131 |
+
$lMethodVal = $aModel->$aDynamic[1]();
|
132 |
+
if (gettype($lMethodVal)=="object"){
|
133 |
+
$lMethodVal = $lMethodVal->$aDynamic[2]();
|
|
|
|
|
134 |
}
|
135 |
+
if(gettype($lMethodVal)=="array"){
|
136 |
+
$lMethodVal=implode("|", $lMethodVal);
|
137 |
}
|
138 |
+
$lParam .= $aPrefix . $aVarName.': "'.addslashes($lMethodVal).'"';
|
139 |
}
|
140 |
return ($lParam);
|
141 |
}
|
142 |
|
143 |
+
private function getSalesOrder($aPrefix, $aVarName, $aModel, $aDynamic){
|
144 |
$lParam = '';
|
145 |
+
$aModel->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
146 |
+
$lMethodVal = $aModel->$aDynamic[1]();
|
147 |
|
148 |
+
if (gettype($lMethodVal)=="object"){
|
149 |
+
$lMethodVal = $lMethodVal->$aDynamic[2]();
|
150 |
}
|
151 |
+
if($aDynamic[1]=="getAllItems"){
|
152 |
+
$lMethodVal = $this->getAllItems($lMethodVal, $aDynamic);
|
153 |
}
|
154 |
+
elseif(gettype($lMethodVal)=="array"){
|
155 |
+
$lMethodVal=implode("|", $lMethodVal);
|
156 |
}
|
157 |
+
$lParam .= $aPrefix . $aVarName.': "'.$lMethodVal.'"';
|
158 |
return ($lParam);
|
159 |
}
|
160 |
|
161 |
+
private function getSalesQuote($aPrefix, $aVarName, $aModel, $aDynamic){
|
162 |
$lParam = '';
|
163 |
+
$lQuote = Mage::getSingleton('checkout/session')->getQuote();
|
164 |
+
$lMethodVal = $lQuote->$aDynamic[1]();
|
165 |
|
166 |
+
if($aDynamic[1]=="getAllItems"){
|
167 |
+
$lMethodVal = $this->getAllItems($lMethodVal, $aDynamic);
|
168 |
}
|
169 |
|
170 |
+
elseif(gettype($lMethodVal)=="array"){
|
171 |
+
$lMethodVal=implode("|", $lMethodVal);
|
172 |
}
|
173 |
+
$lParam .= $aPrefix . $aVarName.': "'.$lMethodVal.'"';
|
174 |
return ($lParam);
|
175 |
}
|
176 |
|
177 |
+
private function getAllItems($lMethod, $aDynamic){
|
178 |
+
$lAllItemsVal='';
|
179 |
+
$lPipe = '';
|
180 |
+
foreach($lMethod as $tItem) {
|
181 |
+
if($tItem->getOriginalPrice()> 0){
|
182 |
+
$lAllItemsVal .= $lPipe . addslashes($tItem->$aDynamic[2]());
|
183 |
+
$lPipe = '|';
|
184 |
}
|
185 |
}
|
186 |
+
return ($lAllItemsVal);
|
187 |
}
|
188 |
}
|
app/code/community/Tagman/Intellitag/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Tagman_Intellitag>
|
5 |
-
<version>1.0.
|
6 |
</Tagman_Intellitag>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Tagman_Intellitag>
|
5 |
+
<version>1.0.1</version>
|
6 |
</Tagman_Intellitag>
|
7 |
</modules>
|
8 |
<global>
|
app/code/community/Tagman/Intellitag/sql/tagman_intellitag_setup/{mysql4-install-1.0.0.php → mysql4-install-1.0.1.php}
RENAMED
File without changes
|
package.xml
CHANGED
@@ -1,19 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tagman_Intellitag</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
|
12 |
-
<notes>First stable version of TagMan Intellitag extension</notes>
|
13 |
<authors><author><name>TagMan Ltd.</name><user>tobyattagman</user><email>toby.doig@tagman.com</email></author></authors>
|
14 |
-
<date>2013-09-
|
15 |
-
<time>
|
16 |
-
<contents><target name="magecommunity"><dir name="Tagman"><dir name="Intellitag"><dir name="Block"><dir name="Adminhtml"><dir name="Variables"><dir name="Edit"><file name="Form.php" hash="6e2a841521829e4e74f407d9ff8f2d6a"/></dir><file name="Edit.php" hash="c27734e57889971ae4cafff4ddb08ed8"/><file name="Grid.php" hash="3e6b1c8e49e60af21aa1d1c55ec7ef69"/></dir><file name="Variables.php" hash="9d5fa2b7442f92bfa5840abb2017d067"/></dir><file name="Field.php" hash="50b4bace6bec94d4693923b79ace1f44"/><file name="JsInjector.php" hash="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.3.24</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.2</min><max>1.7.0.2</max></package></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tagman_Intellitag</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Provides a simple and seamless integration with TagMan's Marketing Data Platform and Tag Management System.</summary>
|
10 |
+
<description>TagMan’s Marketing Data Platform (MDP) is powered by our leading tag management system to provide marketers the ability to collect, unify and distribute a clean layer of third-party, first-party and CRM data to your marketing technology vendors in real-time.</description>
|
11 |
+
<notes>Reuploaded stable version of TagMan Intellitag extension</notes>
|
|
|
12 |
<authors><author><name>TagMan Ltd.</name><user>tobyattagman</user><email>toby.doig@tagman.com</email></author></authors>
|
13 |
+
<date>2013-09-23</date>
|
14 |
+
<time>10:25:07</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Tagman"><dir name="Intellitag"><dir name="Block"><dir name="Adminhtml"><dir name="Variables"><dir name="Edit"><file name="Form.php" hash="6e2a841521829e4e74f407d9ff8f2d6a"/></dir><file name="Edit.php" hash="c27734e57889971ae4cafff4ddb08ed8"/><file name="Grid.php" hash="3e6b1c8e49e60af21aa1d1c55ec7ef69"/></dir><file name="Variables.php" hash="9d5fa2b7442f92bfa5840abb2017d067"/></dir><file name="Field.php" hash="50b4bace6bec94d4693923b79ace1f44"/><file name="JsInjector.php" hash="f3d2402aee0fb88ef0e1fd647b7b9aff"/><file name="Select.php" hash="01aa8523ede2440a5d3de5dc32085866"/><file name="Text.php" hash="0ef1ce4825caa74406ee9b37a397c0b3"/></dir><dir name="Helper"><file name="Data.php" hash="906f295b2d648c9a349c2565e09ddc18"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Variables"><file name="Collection.php" hash="dc0ef1f229e89cef8c52ac20adbc395b"/></dir><file name="Variables.php" hash="1b5357557412cdfa258b3bf532c869f3"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Model"><file name="Select.php" hash="61b6852fdf992661525d1da63dfdca4e"/></dir></dir></dir></dir><file name="Variables.php" hash="2d3ed7cf392258cd8868c9c8cd45e7d6"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="VariablesController.php" hash="b281e1de3d527046960aad9ba4890e35"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="61187b3ac51a10ca5ba73ccd0880db7f"/><file name="config.xml" hash="8276124106a83a7395e5035ea1a7e6fc"/><file name="system.xml" hash="8484f9945f5246b2d9f44dc76e3ae0bf"/></dir><dir name="sql"><dir name="tagman_intellitag_setup"><file name="mysql4-install-1.0.1.php" hash="a91da3d51779b91d218caa9482268c45"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="tagman"><file name="intellitag.xml" hash="444a905ddb69a1062501acd3984e80b1"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tagman_intellitag.xml" hash="2c9db0e32a9075302a7beae53b925971"/></dir><dir name="template"><dir name="tagman_intellitag"><file name="jsinjector.phtml" hash="58add90971f6d8ff56b6f80930d8b4a9"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tagman_Intellitag.xml" hash="333d03b67ee4a65f9a78910b2f901803"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.24</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7.0.2</min><max>1.7.0.2</max></package></required></dependencies>
|
18 |
</package>
|