VWOPlugin - Version 2.1.0

Version Notes

Added product attributes which can be used for targeting campaigns.

Download this release

Release Info

Developer Wingify Integrations
Extension VWOPlugin
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.1 to 2.1.0

app/code/local/Wingify/.DS_Store DELETED
Binary file
app/code/local/Wingify/Abtester/.DS_Store DELETED
Binary file
app/code/local/Wingify/Abtester/etc/system.xml CHANGED
@@ -20,7 +20,7 @@
20
  <comment><![CDATA[<br />
21
  <div class="box">
22
  <p>
23
- <a href="http://visualwebsiteoptimizer.com">Visual Website Optimizer</a> is an A/B testing tool for your Magento website. To use this extension, simply enter your Visual Website Optimizer account ID and enable it (account ID can be found after logging into your VWO account). This plugin uses <a href="http://visualwebsiteoptimizer.com/split-testing-blog/asynchronous-code/" target="_blank">asynchronous version of code snippet</a> which ensures much faster loading of your website.
24
  </p>
25
  </div>
26
  ]]>
@@ -60,6 +60,140 @@
60
 
61
  </fields>
62
  </general>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  <revenue_options translate="label comment">
64
  <comment><![CDATA[<br />
65
  <div class="box">
20
  <comment><![CDATA[<br />
21
  <div class="box">
22
  <p>
23
+ <a href="https://vwo.com">Visual Website Optimizer</a> is an A/B testing tool for your Magento website. To use this extension, simply enter your Visual Website Optimizer account ID and enable it (account ID can be found after logging into your VWO account). This plugin uses <a href="https://vwo.com/blog/asynchronous-code/" target="_blank">asynchronous version of code snippet</a> which ensures much faster loading of your website.
24
  </p>
25
  </div>
26
  ]]>
60
 
61
  </fields>
62
  </general>
63
+
64
+ <custom translate="label comment">
65
+
66
+ <comment><![CDATA[<br />
67
+ <div class="box">
68
+ <p>
69
+ Select the product attributes you want to target. These will be included in your page as javascript variables. You can target the values of these variables using VWO's custom targeting option of 'javascript variables'.
70
+ </p>
71
+ <p>
72
+ For ex: If you have a product attribute called 'Color' in Magento you can then select it below.
73
+ </p>
74
+ <p>
75
+ In VWO you can use Custom Targeting with Javascript Variable to target product pages with a particular value for the variable 'Colour'. For instance you can target all product pages where the product's Colour attribute is Red.
76
+ </p>
77
+ </div>
78
+ ]]>
79
+
80
+ </comment>
81
+
82
+
83
+ <label>Include product attributes in page</label>
84
+ <frontend_type>text</frontend_type>
85
+ <sort_order>12</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ <fields>
90
+ <customvar1 translate="label">
91
+ <label>Include product attribute</label>
92
+ <frontend_type>select</frontend_type>
93
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
94
+ <sort_order>1</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ <comment>Please do not select same attribute twice.</comment>
99
+ </customvar1>
100
+ <customvar2 translate="label">
101
+ <label>Include product attribute</label>
102
+ <frontend_type>select</frontend_type>
103
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
104
+ <sort_order>2</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ <comment>Please do not select same attribute twice.</comment>
109
+ </customvar2>
110
+ <customvar3 translate="label">
111
+ <label>Include product attribute</label>
112
+ <frontend_type>select</frontend_type>
113
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
114
+ <sort_order>3</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>1</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ <comment>Please do not select same attribute twice.</comment>
119
+ </customvar3>
120
+ <customvar4 translate="label">
121
+ <label>Include product attribute</label>
122
+ <frontend_type>select</frontend_type>
123
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
124
+ <sort_order>1</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>1</show_in_store>
128
+ <comment>Please do not select same attribute twice.</comment>
129
+ </customvar4>
130
+ <customvar5 translate="label">
131
+ <label>Include product attribute</label>
132
+ <frontend_type>select</frontend_type>
133
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
134
+ <sort_order>2</sort_order>
135
+ <show_in_default>1</show_in_default>
136
+ <show_in_website>1</show_in_website>
137
+ <show_in_store>1</show_in_store>
138
+ <comment>Please do not select same attribute twice.</comment>
139
+ </customvar5>
140
+ <customvar6 translate="label">
141
+ <label>Include product attribute</label>
142
+ <frontend_type>select</frontend_type>
143
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
144
+ <sort_order>3</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>1</show_in_website>
147
+ <show_in_store>1</show_in_store>
148
+ <comment>Please do not select same attribute twice.</comment>
149
+ </customvar6>
150
+ <customvar7 translate="label">
151
+ <label>Include product attribute</label>
152
+ <frontend_type>select</frontend_type>
153
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
154
+ <sort_order>1</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ <comment>Please do not select same attribute twice.</comment>
159
+ </customvar7>
160
+ <customvar8 translate="label">
161
+ <label>Include product attribute</label>
162
+ <frontend_type>select</frontend_type>
163
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
164
+ <sort_order>2</sort_order>
165
+ <show_in_default>1</show_in_default>
166
+ <show_in_website>1</show_in_website>
167
+ <show_in_store>1</show_in_store>
168
+ <comment>Please do not select same attribute twice.</comment>
169
+ </customvar8>
170
+ <customvar9 translate="label">
171
+ <label>Include product attribute</label>
172
+ <frontend_type>select</frontend_type>
173
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
174
+ <sort_order>3</sort_order>
175
+ <show_in_default>1</show_in_default>
176
+ <show_in_website>1</show_in_website>
177
+ <show_in_store>1</show_in_store>
178
+ <comment>Please do not select same attribute twice.</comment>
179
+ </customvar9>
180
+
181
+ <customvar10 translate="label">
182
+ <label>Include product attribute</label>
183
+ <frontend_type>select</frontend_type>
184
+ <source_model>Wingify_Adminhtml_Model_System_Config_Source_Attributes</source_model>
185
+ <sort_order>3</sort_order>
186
+ <show_in_default>1</show_in_default>
187
+ <show_in_website>1</show_in_website>
188
+ <show_in_store>1</show_in_store>
189
+ <comment>Please do not select same attribute twice.</comment>
190
+ </customvar10>
191
+
192
+ </fields>
193
+ </custom>
194
+
195
+
196
+
197
  <revenue_options translate="label comment">
198
  <comment><![CDATA[<br />
199
  <div class="box">
app/code/local/Wingify/Adminhtml/Model/System/Config/Source/Attributes.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Wingify_Adminhtml_Model_System_Config_Source_Attributes
29
+ {
30
+ protected $_options;
31
+
32
+ public function toOptionArray($isMultiselect=false)
33
+ {
34
+ if (!$this->_options) {
35
+
36
+ $attributes = Mage::getResourceModel('catalog/product_attribute_collection')->addVisibleFilter();
37
+ $attributeArray = array();
38
+
39
+ foreach($attributes as $attribute){
40
+ $attributeArray[] = array(
41
+ 'label' => $attribute->getData('frontend_label'),
42
+ 'value' => $attribute->getData('attribute_code')
43
+ );
44
+ }
45
+
46
+ $this->_options = $attributeArray;
47
+ }
48
+
49
+ $options = $this->_options;
50
+ if(!$isMultiselect){
51
+ array_unshift($options, array('value'=>'', 'label'=> Mage::helper('adminhtml')->__('--Please Select--')));
52
+ }
53
+
54
+ return $options;
55
+ }
56
+ }
app/design/frontend/base/default/template/abtester/abtester.phtml CHANGED
@@ -4,6 +4,67 @@ if(Mage::getStoreConfig('abtester/general/enable') == 1):
4
  if($account_id != '' && is_numeric($account_id)):
5
  $account_id = Mage::getStoreConfig('abtester/general/accountid');
6
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  <!-- Start Visual Website Optimizer Asynchronous Code -->
8
  <?php
9
  if (Mage::getStoreConfig('abtester/general/detailedurl')):
4
  if($account_id != '' && is_numeric($account_id)):
5
  $account_id = Mage::getStoreConfig('abtester/general/accountid');
6
  ?>
7
+ <?php
8
+ if($this->getRequest()->getModuleName()=='catalog' && $this->getRequest()->getControllerName()=='product'){
9
+ $variables = array();
10
+
11
+ $storeId = Mage::app()->getStore()->getStoreId();
12
+ $product_id = Mage::registry('current_product')->getId();
13
+ $product = Mage::getModel('catalog/product')->getCollection()->addFieldToFilter('entity_id',$product_id);
14
+
15
+ //$productResourceModel = Mage::getResourceModel('catalog/product');
16
+ $productModel = Mage::getModel('catalog/product')->load($product_id);
17
+
18
+ $variables['page_type'] = 'product';
19
+ $variables['product_type'] = $productModel->getTypeId();
20
+ $variables['product_sku'] = $productModel->getSku();
21
+ $variables['product_name'] = $productModel->getName();
22
+ $variables['product_price'] = $productModel->getFinalPrice();
23
+ $variables['category_name'] = Mage::getSingleton('catalog/layer')->getCurrentCategory()->getName();
24
+
25
+ $attributeHolder = array('type','sku','name','price');
26
+
27
+ for($i=1;$i<11;$i++)
28
+ {
29
+
30
+ if(Mage::getStoreConfigFlag('abtester/custom/customvar'.$i))
31
+ {
32
+ $attribute_code = Mage::getStoreConfig('abtester/custom/customvar'.$i);
33
+ error_log($i . Mage::getStoreConfigFlag('abtester/custom/customvar'.$i) . $attribute_code);
34
+
35
+ if(!in_array($attribute_code,$attributeHolder))
36
+ {
37
+ $attributeObj = Mage::getModel('eav/config')->getAttribute('catalog_product', $attribute_code);
38
+ $id = $attributeObj->getId();
39
+ $attribute = Mage::getModel('eav/entity_attribute')->load($id);
40
+ $atrr_type = $attribute->getFrontendInput();
41
+ array_push($attributeHolder,$attribute_code);
42
+ $attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, $attribute_code, $storeId);
43
+ if($atrr_type=='select')
44
+ {
45
+ $productModel->setData($attribute_code,$attribute_option_id);
46
+ $variables[$attribute_code] =
47
+ $productModel->getAttributeText($attribute_code);
48
+ }
49
+ else
50
+ {
51
+ $variables[$attribute_code] = $attribute_option_id;
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ if(!empty($variables))
58
+ {
59
+ ?>
60
+ <script type="text/javascript" language="javascript">
61
+ var _vwo_custom_magento = <?php echo json_encode($variables); ?>;
62
+ </script>
63
+ <?php
64
+ }
65
+
66
+ }
67
+ ?>
68
  <!-- Start Visual Website Optimizer Asynchronous Code -->
69
  <?php
70
  if (Mage::getStoreConfig('abtester/general/detailedurl')):
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>VWOPlugin</name>
4
- <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license>MITL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrate VWO conversion optimization platform with your Magento store without hassle.</summary>
10
- <description>This plugin adds VWO code snippet to your complete Magento web store. VWO helps you track and analyse multiple product pages at once. You can create integrated heatmaps for your product pages, track Revenue on checkout pages and can use advanced URLs to customize optimization tests for your Magento store. VWO integration is the easiest and best to way to continuously optimize your Magento store and get your conversions soaring high.</description>
11
- <notes>Changes in the extension as per the new Magento security guidelines.</notes>
12
  <authors><author><name>Wingify Integrations</name><user>wingify</user><email>integrations@wingify.com</email></author></authors>
13
- <date>2015-11-20</date>
14
- <time>09:13:51</time>
15
- <contents><target name="magelocal"><dir name="Wingify"><dir name="Abtester"><dir name="Block"><dir name="Multishipping"><file name="Success.php" hash="1cee7b040966b29ac3510b28f0942816"/></dir><dir name="Onepage"><file name="Success.php" hash="ef552f6ad5898892a3009e9907a31c3b"/></dir></dir><dir name="Helper"><file name="Data.php" hash="5c1a7413431871515dd4fa9621c430b3"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Values.php" hash="b8625d618a81e68ec41e4dc11db98961"/></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="0642db589cd35fd50131f602ac9acf61"/><file name="system.xml" hash="d3a482c3116b79d54b8b39bfd1ef26c5"/></dir><file name=".DS_Store" hash="e88a82c6ebfbff71ace4c237f1ef5f70"/></dir><file name=".DS_Store" hash="6d92d8e767e1171e85c1bdcb3e3890fc"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="abtester.xml" hash="ef015b4476106b7bbee6ff218c45c0f9"/></dir><dir name="template"><dir name="abtester"><file name="Success.phtml" hash="52c17f469a14f5fc7379d70eeb29c645"/><file name="abtester.phtml" hash="4c92fc626ef0e60e65474797d1ae46af"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wingify_Abtester.xml" hash="e475a6e847922f5090b1d59792a36202"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>VWOPlugin</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license>MITL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrate VWO conversion optimization platform with your Magento store without hassle.</summary>
10
+ <description>This plugin adds VWO code snippet to your complete Magento web store. VWO helps you track and analyse multiple product pages at once. You can create integrated heatmaps for your product pages, track Revenue on checkout pages and can use advanced URLs to customize optimization tests for your Magento store. VWO integration is the easiest and best way to continuously optimize your Magento store and get your conversions soaring high.</description>
11
+ <notes>Added product attributes which can be used for targeting campaigns.</notes>
12
  <authors><author><name>Wingify Integrations</name><user>wingify</user><email>integrations@wingify.com</email></author></authors>
13
+ <date>2016-08-23</date>
14
+ <time>07:13:12</time>
15
+ <contents><target name="magelocal"><dir name="Wingify"><dir name="Abtester"><dir name="Block"><dir name="Multishipping"><file name="Success.php" hash="1cee7b040966b29ac3510b28f0942816"/></dir><dir name="Onepage"><file name="Success.php" hash="ef552f6ad5898892a3009e9907a31c3b"/></dir></dir><dir name="Helper"><file name="Data.php" hash="5c1a7413431871515dd4fa9621c430b3"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Values.php" hash="b8625d618a81e68ec41e4dc11db98961"/></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="0642db589cd35fd50131f602ac9acf61"/><file name="system.xml" hash="8539ae858adff001079b75df4413d0ba"/></dir></dir><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Attributes.php" hash="6d45525829fb0f82513044c323084047"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="abtester.xml" hash="ef015b4476106b7bbee6ff218c45c0f9"/></dir><dir name="template"><dir name="abtester"><file name="Success.phtml" hash="52c17f469a14f5fc7379d70eeb29c645"/><file name="abtester.phtml" hash="48ce90d5556d5a8fa21dfa52a579ce29"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wingify_Abtester.xml" hash="e475a6e847922f5090b1d59792a36202"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
18
  </package>