Version Notes
* Added state variable in shipping and delivery address. (if state/region is not avaialbe, it will be exported as empty string to be used by tracking script)
* Big refactoring and clean code, disable UV execution on admin page. (https://github.com/QubitProducts/UniversalVariable-Magento-Extension/pull/32)
Download this release
Release Info
Developer | Jing Dong |
Extension | QuBit_UniversalVariable |
Version | 1.0.20 |
Comparing to | |
See all releases |
Code changes from version 1.0.18 to 1.0.20
- app/code/community/QuBit/UniversalVariable/Model/Page/Observer.php +2 -12
- app/code/community/QuBit/UniversalVariable/etc/adminhtml.xml +23 -0
- app/code/community/QuBit/UniversalVariable/etc/config.xml +19 -66
- app/code/community/QuBit/UniversalVariable/etc/system.xml +2 -2
- app/design/frontend/base/default/layout/qubit/universal_variable.xml +1 -1
- app/design/frontend/base/default/template/qubit/universal_variable.phtml +2 -1
- app/etc/modules/QuBit_all.xml +0 -11
- package.xml +7 -8
app/code/community/QuBit/UniversalVariable/Model/Page/Observer.php
CHANGED
@@ -77,16 +77,6 @@ class QuBit_UniversalVariable_Model_Page_Observer {
|
|
77 |
return Mage::getModel('sales/order_address');
|
78 |
}
|
79 |
|
80 |
-
|
81 |
-
/*
|
82 |
-
* Creates Block View
|
83 |
-
*/
|
84 |
-
protected function _createBlock() {
|
85 |
-
$layout = Mage::app()->getLayout();
|
86 |
-
$block = $layout->createBlock('QuBit_UniversalVariable_Block_Uv','universal_variable_block');
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
/*
|
91 |
* Determine which page type we're on
|
92 |
*/
|
@@ -286,8 +276,9 @@ class QuBit_UniversalVariable_Model_Page_Observer {
|
|
286 |
$billing['city'] = $address->getCity();
|
287 |
$billing['postcode'] = $address->getPostcode();
|
288 |
$billing['country'] = $address->getCountry();
|
|
|
|
|
289 |
}
|
290 |
-
// TODO: $billing['state']
|
291 |
return $billing;
|
292 |
}
|
293 |
|
@@ -488,7 +479,6 @@ class QuBit_UniversalVariable_Model_Page_Observer {
|
|
488 |
$this->_setTranscation();
|
489 |
}
|
490 |
|
491 |
-
$this->_createBlock();
|
492 |
return $this;
|
493 |
}
|
494 |
|
77 |
return Mage::getModel('sales/order_address');
|
78 |
}
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
/*
|
81 |
* Determine which page type we're on
|
82 |
*/
|
276 |
$billing['city'] = $address->getCity();
|
277 |
$billing['postcode'] = $address->getPostcode();
|
278 |
$billing['country'] = $address->getCountry();
|
279 |
+
$state = $address->getRegion();
|
280 |
+
$billing['state'] = $state ? $state : '';
|
281 |
}
|
|
|
282 |
return $billing;
|
283 |
}
|
284 |
|
479 |
$this->_setTranscation();
|
480 |
}
|
481 |
|
|
|
482 |
return $this;
|
483 |
}
|
484 |
|
app/code/community/QuBit/UniversalVariable/etc/adminhtml.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<qubit_universalvariable translate="title" module="universal_variable_main">
|
12 |
+
<sort_order>0</sort_order>
|
13 |
+
<title>Manage QuBit Script</title>
|
14 |
+
</qubit_universalvariable>
|
15 |
+
</children>
|
16 |
+
</config>
|
17 |
+
</children>
|
18 |
+
</system>
|
19 |
+
</children>
|
20 |
+
</admin>
|
21 |
+
</resources>
|
22 |
+
</acl>
|
23 |
+
</config>
|
app/code/community/QuBit/UniversalVariable/etc/config.xml
CHANGED
@@ -9,45 +9,22 @@
|
|
9 |
<global>
|
10 |
<models>
|
11 |
<universal_variable_main>
|
12 |
-
<class>
|
13 |
</universal_variable_main>
|
14 |
</models>
|
15 |
<helpers>
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
<class>QuBit_UniversalVariable_Helper_Data</class>
|
21 |
-
</universal_variable_data_helper>
|
22 |
-
</helpers>
|
23 |
-
<events>
|
24 |
-
<controller_action_layout_load_before>
|
25 |
-
<observers>
|
26 |
-
<QuBit_UniversalVariable_Model_Page_Observer>
|
27 |
-
<type>singleton</type>
|
28 |
-
<class>universal_variable_main/observer</class>
|
29 |
-
<method>setUniversalVariable</method>
|
30 |
-
</QuBit_UniversalVariable_Model_Page_Observer>
|
31 |
-
</observers>
|
32 |
-
</controller_action_layout_load_before>
|
33 |
-
</events>
|
34 |
<blocks>
|
35 |
-
<
|
36 |
-
<class>
|
37 |
-
</
|
38 |
</blocks>
|
39 |
</global>
|
40 |
|
41 |
<frontend>
|
42 |
-
<routers>
|
43 |
-
<routeurfrontend>
|
44 |
-
<use>standard</use>
|
45 |
-
<args>
|
46 |
-
<module>QuBit_UniversalVariable</module>
|
47 |
-
<frontName>universal_variable</frontName>
|
48 |
-
</args>
|
49 |
-
</routeurfrontend>
|
50 |
-
</routers>
|
51 |
|
52 |
<!-- Layout -->
|
53 |
<layout>
|
@@ -57,42 +34,18 @@
|
|
57 |
</qubit_universal_variable>
|
58 |
</updates>
|
59 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
</frontend>
|
61 |
-
<adminhtml>
|
62 |
-
<acl>
|
63 |
-
<resources>
|
64 |
-
<all>
|
65 |
-
<title>Allow Everything</title>
|
66 |
-
</all>
|
67 |
-
<admin>
|
68 |
-
<children>
|
69 |
-
<QuBit_UniversalVariable module="universal_variable_main">
|
70 |
-
<title>QuBit</title>
|
71 |
-
<sort_order>0</sort_order>
|
72 |
-
<children>
|
73 |
-
<QuBit_UniversalVariable module="universal_variable_main">
|
74 |
-
<title>Manage QuBit Script</title>
|
75 |
-
<sort_order>0</sort_order>
|
76 |
-
</QuBit_UniversalVariable>
|
77 |
-
</children>
|
78 |
-
</QuBit_UniversalVariable>
|
79 |
-
<system>
|
80 |
-
<children>
|
81 |
-
<config>
|
82 |
-
<children>
|
83 |
-
<QuBit_UniversalVariable translate="title" module="universal_variable_main">
|
84 |
-
<sort_order>0</sort_order>
|
85 |
-
<title>Manage QuBit Script</title>
|
86 |
-
</QuBit_UniversalVariable>
|
87 |
-
</children>
|
88 |
-
</config>
|
89 |
-
</children>
|
90 |
-
</system>
|
91 |
-
</children>
|
92 |
-
</admin>
|
93 |
-
</resources>
|
94 |
-
</acl>
|
95 |
-
</adminhtml>
|
96 |
|
97 |
<!-- Admin Configuration Default Values -->
|
98 |
<default>
|
9 |
<global>
|
10 |
<models>
|
11 |
<universal_variable_main>
|
12 |
+
<class>QuBit_UniversalVariable_Model</class>
|
13 |
</universal_variable_main>
|
14 |
</models>
|
15 |
<helpers>
|
16 |
+
<universal_variable_main>
|
17 |
+
<class>QuBit_UniversalVariable_Helper</class>
|
18 |
+
</universal_variable_main>
|
19 |
+
</helpers>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<blocks>
|
21 |
+
<universal_variable_main>
|
22 |
+
<class>QuBit_UniversalVariable_Block</class>
|
23 |
+
</universal_variable_main>
|
24 |
</blocks>
|
25 |
</global>
|
26 |
|
27 |
<frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
<!-- Layout -->
|
30 |
<layout>
|
34 |
</qubit_universal_variable>
|
35 |
</updates>
|
36 |
</layout>
|
37 |
+
<events>
|
38 |
+
<controller_action_layout_load_before>
|
39 |
+
<observers>
|
40 |
+
<QuBit_UniversalVariable_Model_Page_Observer>
|
41 |
+
<type>singleton</type>
|
42 |
+
<class>universal_variable_main/page_observer</class>
|
43 |
+
<method>setUniversalVariable</method>
|
44 |
+
</QuBit_UniversalVariable_Model_Page_Observer>
|
45 |
+
</observers>
|
46 |
+
</controller_action_layout_load_before>
|
47 |
+
</events>
|
48 |
</frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
<!-- Admin Configuration Default Values -->
|
51 |
<default>
|
app/code/community/QuBit/UniversalVariable/etc/system.xml
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
</tabs>
|
9 |
|
10 |
<sections>
|
11 |
-
<
|
12 |
<label>Configuration</label>
|
13 |
<tab>QuBit_tab</tab>
|
14 |
<frontend_type>text</frontend_type>
|
@@ -89,6 +89,6 @@ Your container ID should look like 1234-56789, for example: <br/>
|
|
89 |
|
90 |
|
91 |
</groups>
|
92 |
-
</
|
93 |
</sections>
|
94 |
</config>
|
8 |
</tabs>
|
9 |
|
10 |
<sections>
|
11 |
+
<qubit_universalvariable translate="label">
|
12 |
<label>Configuration</label>
|
13 |
<tab>QuBit_tab</tab>
|
14 |
<frontend_type>text</frontend_type>
|
89 |
|
90 |
|
91 |
</groups>
|
92 |
+
</qubit_universalvariable>
|
93 |
</sections>
|
94 |
</config>
|
app/design/frontend/base/default/layout/qubit/universal_variable.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<layout version="0.1.0">
|
3 |
<default>
|
4 |
<reference name="head">
|
5 |
-
<block type="
|
6 |
</reference>
|
7 |
</default>
|
8 |
</layout>
|
2 |
<layout version="0.1.0">
|
3 |
<default>
|
4 |
<reference name="head">
|
5 |
+
<block type="universal_variable_main/uv" name="universal_variable" as="universal_variable" template="qubit/universal_variable.phtml"/>
|
6 |
</reference>
|
7 |
</default>
|
8 |
</layout>
|
app/design/frontend/base/default/template/qubit/universal_variable.phtml
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
<?php
|
|
|
2 |
$qubit_opentag_container_id = Mage::getStoreConfig('qubit/qubit_opentag_container_id');
|
3 |
$qubit_opentag_async = Mage::getStoreConfig('qubit/qubit_opentag_async');
|
4 |
$qubit_opentag_enabled = Mage::getStoreConfig('qubit/qubit_opentag_enabled');
|
5 |
$qubit_universal_variable_enabled = Mage::getStoreConfig('qubit/qubit_universal_variable_enabled');
|
6 |
|
7 |
-
$observer = 'universal_variable_main/
|
8 |
$mage = Mage::getSingleton($observer);
|
9 |
|
10 |
if ($qubit_opentag_async == 1) {
|
1 |
<?php
|
2 |
+
/* @var $this QuBit_UniversalVariable_Block_Uv */
|
3 |
$qubit_opentag_container_id = Mage::getStoreConfig('qubit/qubit_opentag_container_id');
|
4 |
$qubit_opentag_async = Mage::getStoreConfig('qubit/qubit_opentag_async');
|
5 |
$qubit_opentag_enabled = Mage::getStoreConfig('qubit/qubit_opentag_enabled');
|
6 |
$qubit_universal_variable_enabled = Mage::getStoreConfig('qubit/qubit_universal_variable_enabled');
|
7 |
|
8 |
+
$observer = 'universal_variable_main/page_observer';
|
9 |
$mage = Mage::getSingleton($observer);
|
10 |
|
11 |
if ($qubit_opentag_async == 1) {
|
app/etc/modules/QuBit_all.xml
CHANGED
@@ -6,15 +6,4 @@
|
|
6 |
<codePool>community</codePool>
|
7 |
</QuBit_UniversalVariable>
|
8 |
</modules>
|
9 |
-
<frontend>
|
10 |
-
<routers>
|
11 |
-
<routeurfrontend>
|
12 |
-
<use>standard</use>
|
13 |
-
<args>
|
14 |
-
<module>QuBit_UniversalVariable</module>
|
15 |
-
<frontName>universal_variable</frontName>
|
16 |
-
</args>
|
17 |
-
</routeurfrontend>
|
18 |
-
</routers>
|
19 |
-
</frontend>
|
20 |
</config>
|
6 |
<codePool>community</codePool>
|
7 |
</QuBit_UniversalVariable>
|
8 |
</modules>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>QuBit_UniversalVariable</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">Extension license name (OSL v3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -12,14 +12,13 @@
|
|
12 |
<description>QuBit OpenTag recommends creating the releavant JavaScript object on your page prior to the OpenTag container script. This will assure the values are present on the page when a script tries to access them.
|
13 |

|
14 |
If a page does not have the variables of an object that are mentioned below, simply do not even declare them. For example, if your pages only have category and no subcategory, just declare your category. Likewise, if you feel the need to extend the objects below or feel like renaming them, please do so. However, please take a note of the new variable names or the edited ones, because in order to access them from your scripts in your OpenTag container, you will need to use the new variable names.</description>
|
15 |
-
<notes>* Added
|
16 |
-
|
17 |
-
*
|
18 |
-
* DEPRECATION: page.category and page.subcategory will soon be deprecated in the next release</notes>
|
19 |
<authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
|
20 |
-
<date>
|
21 |
-
<time>11:
|
22 |
-
<contents><target name="magecommunity"><dir name="QuBit"><dir name="UniversalVariable"><dir name="Block"><file name="Uv.php" hash="9b5cd71bebc9576b5d0714b3fe5c13bb"/></dir><dir name="Helper"><file name="Data.php" hash="b05ea847c16520d5e6eec91e9f604886"/></dir><dir name="Model"><dir name="Page"><file name="Observer.php" hash="
|
23 |
<compatible/>
|
24 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
25 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>QuBit_UniversalVariable</name>
|
4 |
+
<version>1.0.20</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">Extension license name (OSL v3.0)</license>
|
7 |
<channel>community</channel>
|
12 |
<description>QuBit OpenTag recommends creating the releavant JavaScript object on your page prior to the OpenTag container script. This will assure the values are present on the page when a script tries to access them.
|
13 |

|
14 |
If a page does not have the variables of an object that are mentioned below, simply do not even declare them. For example, if your pages only have category and no subcategory, just declare your category. Likewise, if you feel the need to extend the objects below or feel like renaming them, please do so. However, please take a note of the new variable names or the edited ones, because in order to access them from your scripts in your OpenTag container, you will need to use the new variable names.</description>
|
15 |
+
<notes>* Added state variable in shipping and delivery address. (if state/region is not avaialbe, it will be exported as empty string to be used by tracking script)
|
16 |
+

|
17 |
+
* Big refactoring and clean code, disable UV execution on admin page. (https://github.com/QubitProducts/UniversalVariable-Magento-Extension/pull/32)</notes>
|
|
|
18 |
<authors><author><name>Jing Dong</name><user>qubitproducts</user><email>jing@qubitdigital.com</email></author></authors>
|
19 |
+
<date>2014-01-13</date>
|
20 |
+
<time>11:24:30</time>
|
21 |
+
<contents><target name="magecommunity"><dir name="QuBit"><dir name="UniversalVariable"><dir name="Block"><file name="Uv.php" hash="9b5cd71bebc9576b5d0714b3fe5c13bb"/></dir><dir name="Helper"><file name="Data.php" hash="b05ea847c16520d5e6eec91e9f604886"/></dir><dir name="Model"><dir name="Page"><file name="Observer.php" hash="7adc18a6bd74117594c7001c17545c59"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="35f6ea94bc8984d18119a6fc5e63ec9f"/><file name="config.xml" hash="fa918eeac4d6e2b9692642b23789d7c8"/><file name="system.xml" hash="26e9e0d4d1559c8c5fbb69fe707e43a3"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="qubit"><file name="universal_variable.xml" hash="d492e66356dadf46ead546118d8b91ac"/></dir></dir><dir name="template"><dir name="qubit"><file name="universal_variable.phtml" hash="1775b4ca50c1df8e9542dd2c7bcd14f1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="QuBit_all.xml" hash="a0b70506c32aeeb4198d59d86a019ec9"/></dir></target></contents>
|
22 |
<compatible/>
|
23 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
24 |
</package>
|