Version Notes
Supports out of the box Revenue tracking and Custom URL support.
Download this release
Release Info
Developer | Wingify Integrations |
Extension | VWOPlugin |
Version | 2.0.0 |
Comparing to | |
See all releases |
Version 2.0.0
- app/code/local/Wingify/Abtester/Block/Multishipping/Success.php +42 -0
- app/code/local/Wingify/Abtester/Block/Onepage/Success.php +32 -0
- app/code/local/Wingify/Abtester/Helper/Data.php +6 -0
- app/code/local/Wingify/Abtester/Model/System/Config/Source/Dropdown/Values.php +28 -0
- app/code/local/Wingify/Abtester/etc/config.xml +123 -0
- app/code/local/Wingify/Abtester/etc/system.xml +102 -0
- app/design/frontend/base/default/layout/abtester.xml +28 -0
- app/design/frontend/base/default/template/abtester/Success.phtml +50 -0
- app/design/frontend/base/default/template/abtester/abtester.phtml +29 -0
- app/etc/modules/Wingify_Abtester.xml +9 -0
- package.xml +18 -0
app/code/local/Wingify/Abtester/Block/Multishipping/Success.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
class Wingify_Abtester_Block_Multishipping_Success extends Mage_Checkout_Block_Multishipping_Success
|
6 |
+
{
|
7 |
+
public function getTotalRevenue()
|
8 |
+
{
|
9 |
+
$total = 0;
|
10 |
+
$_orderIds = $this->getOrderIds();
|
11 |
+
foreach ($_orderIds as $id=>$incrementId) {
|
12 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
|
13 |
+
$total += $order->getGrandTotal();
|
14 |
+
}
|
15 |
+
|
16 |
+
return $total;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getTotalWithoutShipping()
|
20 |
+
{
|
21 |
+
$total = 0;
|
22 |
+
$_orderIds = $this->getOrderIds();
|
23 |
+
foreach ($_orderIds as $id=>$incrementId) {
|
24 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
|
25 |
+
$total += $order->getGrandTotal() - $order->getShippingAmount();
|
26 |
+
}
|
27 |
+
|
28 |
+
return $total;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getTotalWithoutShippingTax()
|
32 |
+
{
|
33 |
+
$total = 0;
|
34 |
+
$_orderIds = $this->getOrderIds();
|
35 |
+
foreach ($_orderIds as $id=>$incrementId) {
|
36 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
|
37 |
+
$total += $order->getGrandTotal() - $order->getShippingAmount() - $order->getTaxAmount() ;
|
38 |
+
}
|
39 |
+
|
40 |
+
return $total;
|
41 |
+
}
|
42 |
+
}
|
app/code/local/Wingify/Abtester/Block/Onepage/Success.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
class Wingify_Abtester_Block_Onepage_Success extends Mage_Checkout_Block_Onepage_Success
|
6 |
+
{
|
7 |
+
public function getOrder()
|
8 |
+
{
|
9 |
+
$sOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
10 |
+
$oOrder = Mage::getModel('sales/order')->loadByIncrementId($sOrderId);
|
11 |
+
return $oOrder;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function getTotalRevenue()
|
15 |
+
{
|
16 |
+
return $this->getOrder()->getGrandTotal();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getTotalWithoutShipping(){
|
20 |
+
$order = $this->getOrder();
|
21 |
+
$total = $order->getGrandTotal() - $order->getShippingAmount();
|
22 |
+
return $total;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getTotalWithoutShippingTax()
|
26 |
+
{
|
27 |
+
$order = $this->getOrder();
|
28 |
+
$total = $order->getGrandTotal() - $order->getShippingAmount() - $order->getTaxAmount();
|
29 |
+
return $total;
|
30 |
+
|
31 |
+
}
|
32 |
+
}
|
app/code/local/Wingify/Abtester/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Wingify_Abtester_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/local/Wingify/Abtester/Model/System/Config/Source/Dropdown/Values.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Used in creating options for Revenue Track config value selection
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
class Wingify_Abtester_Model_System_Config_Source_Dropdown_Values
|
7 |
+
{
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
return array(
|
12 |
+
array(
|
13 |
+
'value' => 'key1',
|
14 |
+
'label' => 'Grand Total',
|
15 |
+
),
|
16 |
+
array(
|
17 |
+
'value' => 'key2',
|
18 |
+
'label' => 'Grand Total less Shipping Amount',
|
19 |
+
),
|
20 |
+
array(
|
21 |
+
'value' => 'key3',
|
22 |
+
'label' => 'Subtotal before Shipping and Tax',
|
23 |
+
),
|
24 |
+
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
}
|
app/code/local/Wingify/Abtester/etc/config.xml
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Wingify_Abtester>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Wingify_Abtester>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<abtester>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Wingify_Abtester</module>
|
14 |
+
<frontName>abtester</frontName>
|
15 |
+
</args>
|
16 |
+
</abtester>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<abtester>
|
21 |
+
<file>abtester.xml</file>
|
22 |
+
</abtester>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<abtester>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Wingify_Abtester</module>
|
32 |
+
<frontName>abtester</frontName>
|
33 |
+
</args>
|
34 |
+
</abtester>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<acl>
|
39 |
+
<resources>
|
40 |
+
<all>
|
41 |
+
<title>Allow Everything</title>
|
42 |
+
</all>
|
43 |
+
<admin>
|
44 |
+
<children>
|
45 |
+
<abtester>
|
46 |
+
<title>A/B Testing using Visual Website Optimizer</title>
|
47 |
+
<children>
|
48 |
+
<config translate="title">
|
49 |
+
<title>Configuration</title>
|
50 |
+
<sort_order>2</sort_order>
|
51 |
+
</config>
|
52 |
+
</children>
|
53 |
+
</abtester>
|
54 |
+
<system>
|
55 |
+
<children>
|
56 |
+
<config>
|
57 |
+
<children>
|
58 |
+
<abtester>
|
59 |
+
<title>A/B Testing Section</title>
|
60 |
+
</abtester>
|
61 |
+
</children>
|
62 |
+
</config>
|
63 |
+
</children>
|
64 |
+
</system>
|
65 |
+
</children>
|
66 |
+
</admin>
|
67 |
+
</resources>
|
68 |
+
</acl>
|
69 |
+
<layout>
|
70 |
+
<updates>
|
71 |
+
<abtester>
|
72 |
+
<file>abtester.xml</file>
|
73 |
+
</abtester>
|
74 |
+
</updates>
|
75 |
+
</layout>
|
76 |
+
</adminhtml>
|
77 |
+
<global>
|
78 |
+
<models>
|
79 |
+
<abtester>
|
80 |
+
<class>Wingify_Abtester_Model</class>
|
81 |
+
<resourceModel>abtester_mysql4</resourceModel>
|
82 |
+
</abtester>
|
83 |
+
<abtester_mysql4>
|
84 |
+
<class>Wingify_Abtester_Model_Mysql4</class>
|
85 |
+
<entities>
|
86 |
+
<abtester>
|
87 |
+
<table>abtester</table>
|
88 |
+
</abtester>
|
89 |
+
</entities>
|
90 |
+
</abtester_mysql4>
|
91 |
+
</models>
|
92 |
+
<resources>
|
93 |
+
<abtester_setup>
|
94 |
+
<setup>
|
95 |
+
<module>Wingify_Abtester</module>
|
96 |
+
</setup>
|
97 |
+
<connection>
|
98 |
+
<use>core_setup</use>
|
99 |
+
</connection>
|
100 |
+
</abtester_setup>
|
101 |
+
<abtester_write>
|
102 |
+
<connection>
|
103 |
+
<use>core_write</use>
|
104 |
+
</connection>
|
105 |
+
</abtester_write>
|
106 |
+
<abtester_read>
|
107 |
+
<connection>
|
108 |
+
<use>core_read</use>
|
109 |
+
</connection>
|
110 |
+
</abtester_read>
|
111 |
+
</resources>
|
112 |
+
<blocks>
|
113 |
+
<abtester>
|
114 |
+
<class>Wingify_Abtester_Block</class>
|
115 |
+
</abtester>
|
116 |
+
</blocks>
|
117 |
+
<helpers>
|
118 |
+
<abtester>
|
119 |
+
<class>Wingify_Abtester_Helper</class>
|
120 |
+
</abtester>
|
121 |
+
</helpers>
|
122 |
+
</global>
|
123 |
+
</config>
|
app/code/local/Wingify/Abtester/etc/system.xml
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<wingify translate="label" module="abtester">
|
5 |
+
<label>Wingify</label>
|
6 |
+
<sort_order>299</sort_order>
|
7 |
+
</wingify>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<abtester translate="label" module="abtester">
|
11 |
+
<label>A/B Testing using Visual Website Optimizer</label>
|
12 |
+
<tab>wingify</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>100</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<general translate="label comment">
|
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 |
+
]]>
|
27 |
+
</comment>
|
28 |
+
<label>General</label>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
<sort_order>10</sort_order>
|
33 |
+
<fields>
|
34 |
+
<enable translate="label">
|
35 |
+
<label>Enable</label>
|
36 |
+
<frontend_type>select</frontend_type>
|
37 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
+
<sort_order>1</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
</enable>
|
43 |
+
<accountid translate="label">
|
44 |
+
<label>Account ID</label>
|
45 |
+
<frontend_type>text</frontend_type>
|
46 |
+
<sort_order>2</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<show_in_store>1</show_in_store>
|
50 |
+
</accountid>
|
51 |
+
<detailedurl translate="label">
|
52 |
+
<label>Detailed URLs?</label>
|
53 |
+
<frontend_type>select</frontend_type>
|
54 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
55 |
+
<sort_order>3</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>1</show_in_store>
|
59 |
+
</detailedurl>
|
60 |
+
|
61 |
+
</fields>
|
62 |
+
</general>
|
63 |
+
<revenue_options translate="label comment">
|
64 |
+
<comment><![CDATA[<br />
|
65 |
+
<div class="box">
|
66 |
+
<p>
|
67 |
+
You can choose if you want to enable Revenue Tracking in VWO and furthermore which revenue type would you like to track. For e.g. you can choose among "Grand Total" or "Grand Total less shiping".
|
68 |
+
</p>
|
69 |
+
</div>
|
70 |
+
]]>
|
71 |
+
|
72 |
+
</comment>
|
73 |
+
<label>Revenue Tracking</label>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
<sort_order>11</sort_order>
|
78 |
+
<fields>
|
79 |
+
<enable translate="label">
|
80 |
+
<label>Enable</label>
|
81 |
+
<frontend_type>select</frontend_type>
|
82 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
83 |
+
<sort_order>1</sort_order>
|
84 |
+
<show_in_default>1</show_in_default>
|
85 |
+
<show_in_website>1</show_in_website>
|
86 |
+
<show_in_store>1</show_in_store>
|
87 |
+
</enable>
|
88 |
+
<mode translate="label">
|
89 |
+
<label>Revenue Value Type</label>
|
90 |
+
<frontend_type>select</frontend_type>
|
91 |
+
<source_model>abtester/system_config_source_dropdown_values</source_model>
|
92 |
+
<sort_order>2</sort_order>
|
93 |
+
<show_in_default>1</show_in_default>
|
94 |
+
<show_in_website>1</show_in_website>
|
95 |
+
<show_in_store>1</show_in_store>
|
96 |
+
</mode>
|
97 |
+
</fields>
|
98 |
+
</revenue_options>
|
99 |
+
</groups>
|
100 |
+
</abtester>
|
101 |
+
</sections>
|
102 |
+
</config>
|
app/design/frontend/base/default/layout/abtester.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<block type="core/template" name="abtester" after="-" template="abtester/abtester.phtml" />
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
<!--
|
9 |
+
Onepage checkout success
|
10 |
+
-->
|
11 |
+
<checkout_onepage_success translate="label">
|
12 |
+
<label>One Page Checkout Success</label>
|
13 |
+
<reference name="head">
|
14 |
+
<block type="abtester/onepage_success" name="abtester" after="-" template="abtester/Success.phtml" />
|
15 |
+
</reference>
|
16 |
+
</checkout_onepage_success>
|
17 |
+
<!--
|
18 |
+
Multi address shipping checkout success
|
19 |
+
-->
|
20 |
+
|
21 |
+
<checkout_multishipping_success translate="label">
|
22 |
+
<label>Multishipping Checkout Success</label>
|
23 |
+
<reference name="head">
|
24 |
+
<block type="abtester/multishipping_success" name="abtester" after="-" template="abtester/Success.phtml"/>
|
25 |
+
</reference>
|
26 |
+
</checkout_multishipping_success>
|
27 |
+
|
28 |
+
</layout>
|
app/design/frontend/base/default/template/abtester/Success.phtml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(Mage::getStoreConfig('abtester/general/enable') == 1):
|
3 |
+
$account_id = Mage::getStoreConfig('abtester/general/accountid');
|
4 |
+
if($account_id != '' && is_numeric($account_id)):
|
5 |
+
$account_id = Mage::getStoreConfig('abtester/general/accountid');
|
6 |
+
?>
|
7 |
+
<?php
|
8 |
+
if (Mage::getStoreConfig('abtester/general/detailedurl')):
|
9 |
+
?>
|
10 |
+
<!-- Start Visual Website Optimizer Asynchronous Code -->
|
11 |
+
<script type='text/javascript'>
|
12 |
+
var _vwo_url_prefix = '/ctrl_<?php echo $this->getRequest()->getControllerName(); ?>/act_<?php echo $this->getRequest()->getActionName(); ?>/rt_<?php echo $this->getRequest()->getRouteName(); ?>/mod_<?php echo $this->getRequest()->getModuleName(); ?>';
|
13 |
+
var _vis_opt_url = document.location.origin + _vwo_url_prefix + document.location.pathname + document.location.search;
|
14 |
+
</script>
|
15 |
+
<?php endif; ?>
|
16 |
+
|
17 |
+
|
18 |
+
<script type='text/javascript'>
|
19 |
+
var _vwo_code=(function(){
|
20 |
+
var account_id=<?php echo $account_id; ?>,
|
21 |
+
_vis_opt_url = window._vis_opt_url || document.URL,
|
22 |
+
settings_tolerance=2000,
|
23 |
+
library_tolerance=2500,
|
24 |
+
use_existing_jquery=false,
|
25 |
+
code_source='magento',
|
26 |
+
// DO NOT EDIT BELOW THIS LINE
|
27 |
+
f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(_vis_opt_url)+'&s='+code_source+'&r='+Math.random());var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();
|
28 |
+
|
29 |
+
<?php
|
30 |
+
if(Mage::getStoreConfig('abtester/revenue_options/enable') == 1):
|
31 |
+
$revenue_opt = Mage::getStoreConfig('abtester/revenue_options/mode');
|
32 |
+
if($revenue_opt == "key1"):
|
33 |
+
$revenue_amount = $this->getTotalRevenue();
|
34 |
+
elseif($revenue_opt == "key2"):
|
35 |
+
$revenue_amount = $this->getTotalWithoutShipping();
|
36 |
+
elseif($revenue_opt == "key3"):
|
37 |
+
$revenue_amount = $this->getTotalWithoutShippingTax();
|
38 |
+
endif;
|
39 |
+
?>
|
40 |
+
|
41 |
+
var _vis_opt_revenue = <?php echo $revenue_amount ; ?> ;
|
42 |
+
window._vis_opt_queue = window._vis_opt_queue || [];
|
43 |
+
window._vis_opt_queue.push(function() {_vis_opt_revenue_conversion(_vis_opt_revenue);});
|
44 |
+
|
45 |
+
<?php endif; ?>
|
46 |
+
</script>
|
47 |
+
<!-- End Visual Website Optimizer Asynchronous Code -->
|
48 |
+
|
49 |
+
<?php
|
50 |
+
endif;endif; ?>
|
app/design/frontend/base/default/template/abtester/abtester.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(Mage::getStoreConfig('abtester/general/enable') == 1):
|
3 |
+
$account_id = Mage::getStoreConfig('abtester/general/accountid');
|
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')):
|
10 |
+
?>
|
11 |
+
<script type='text/javascript'>
|
12 |
+
var _vwo_url_prefix = '/ctrl_<?php echo $this->getRequest()->getControllerName(); ?>/act_<?php echo $this->getRequest()->getActionName(); ?>/rt_<?php echo $this->getRequest()->getRouteName(); ?>/mod_<?php echo $this->getRequest()->getModuleName(); ?>';
|
13 |
+
var _vis_opt_url = document.location.origin + _vwo_url_prefix + document.location.pathname + document.location.search;
|
14 |
+
</script>
|
15 |
+
<?php endif; ?>
|
16 |
+
|
17 |
+
<script type='text/javascript'>
|
18 |
+
var _vwo_code=(function(){
|
19 |
+
var account_id=<?php echo $account_id; ?>,
|
20 |
+
_vis_opt_url = window._vis_opt_url || document.URL,
|
21 |
+
settings_tolerance=2000,
|
22 |
+
library_tolerance=2500,
|
23 |
+
use_existing_jquery=false,
|
24 |
+
code_source='magento',
|
25 |
+
// DO NOT EDIT BELOW THIS LINE
|
26 |
+
f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(_vis_opt_url)+'&s='+code_source+'&r='+Math.random());var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();
|
27 |
+
</script>
|
28 |
+
<!-- End Visual Website Optimizer Asynchronous Code -->
|
29 |
+
<?php endif;endif; ?>
|
app/etc/modules/Wingify_Abtester.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Wingify_Abtester>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Wingify_Abtester>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>VWOPlugin</name>
|
4 |
+
<version>2.0.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 to way to continuously optimize your Magento store and get your conversions soaring high.</description>
|
11 |
+
<notes>Supports out of the box Revenue tracking and Custom URL support.</notes>
|
12 |
+
<authors><author><name>Wingify Integrations</name><user>wingify</user><email>integrations@wingify.com</email></author></authors>
|
13 |
+
<date>2015-06-18</date>
|
14 |
+
<time>11:00:13</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="9b0a9ee76232efac68a3bcf3157cd4cf"/><file name="system.xml" hash="d3a482c3116b79d54b8b39bfd1ef26c5"/></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="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>
|