Version Notes
Email Booster Release 1.0.0
Download this release
Release Info
Developer | Magento Core Team |
Extension | Exclusiveconcepts4_Conversionsondemand |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Conversionsondemand/Conversions360/Block/Code.php +67 -0
- app/code/community/Conversionsondemand/Conversions360/Block/Identifier.php +114 -0
- app/code/community/Conversionsondemand/Conversions360/Block/Multishipping/Success.php +15 -0
- app/code/community/Conversionsondemand/Conversions360/Block/Success.php +15 -0
- app/code/community/Conversionsondemand/Conversions360/Helper/Data.php +122 -0
- app/code/community/Conversionsondemand/Conversions360/Model/Config/Source/Edition.php +23 -0
- app/code/community/Conversionsondemand/Conversions360/Model/Container/Code.php +47 -0
- app/code/community/Conversionsondemand/Conversions360/Model/Container/Identifier.php +54 -0
- app/code/community/Conversionsondemand/Conversions360/Model/Observer.php +35 -0
- app/code/community/Conversionsondemand/Conversions360/controllers/IndexController.php +15 -0
- app/code/community/Conversionsondemand/Conversions360/etc/cache.xml +17 -0
- app/code/community/Conversionsondemand/Conversions360/etc/config.xml +74 -0
- app/code/community/Conversionsondemand/Conversions360/etc/system.xml +62 -0
- app/design/frontend/base/default/layout/conversionsondemand/conversions360/conversions360.xml +107 -0
- app/design/frontend/base/default/template/conversionsondemand/conversions360/code.phtml +17 -0
- app/design/frontend/base/default/template/conversionsondemand/conversions360/success.phtml +36 -0
- app/etc/modules/Conversionsondemand_Conversions360.xml +8 -0
- package.xml +28 -0
app/code/community/Conversionsondemand/Conversions360/Block/Code.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*/
|
7 |
+
|
8 |
+
class Conversionsondemand_Conversions360_Block_Code extends Mage_Checkout_Block_Cart_Abstract
|
9 |
+
{
|
10 |
+
|
11 |
+
public $codConfig;
|
12 |
+
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
$this->codConfig = Mage::helper('conversionsondemand_conversions360')->getCodConfig();
|
16 |
+
}
|
17 |
+
/**
|
18 |
+
* Retrieve the store identifier of the current magento store.
|
19 |
+
*
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public function getStoreIdentifier()
|
23 |
+
{
|
24 |
+
return trim($this->codConfig['storeIdentifier']);
|
25 |
+
}
|
26 |
+
/**
|
27 |
+
* Return the conversionsondemand.com service URL
|
28 |
+
*
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function getCodServiceUrl()
|
32 |
+
{
|
33 |
+
return trim($this->codConfig['serviceUrl']);
|
34 |
+
}
|
35 |
+
/**
|
36 |
+
* Check if the COD code snippet is enabled on the backend.
|
37 |
+
*
|
38 |
+
* @return boolean
|
39 |
+
*/
|
40 |
+
public function codSnippetEnabled()
|
41 |
+
{
|
42 |
+
$codeEnabled = intval($this->codConfig['snippetEnabled']);
|
43 |
+
return ($codeEnabled === 1) ? true: false;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Return the sub-total amount on the user's shopping cart.
|
48 |
+
*
|
49 |
+
* @return float
|
50 |
+
*/
|
51 |
+
/*public function getCartSubTotal()
|
52 |
+
{
|
53 |
+
$totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
|
54 |
+
$subTotal = $totals["subtotal"]->getValue();
|
55 |
+
return floatval($subTotal);
|
56 |
+
}*/
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Retrieve the platform of the Magento store as per backend configuration.
|
60 |
+
*
|
61 |
+
* @return string
|
62 |
+
*/
|
63 |
+
public function getStorePlatform()
|
64 |
+
{
|
65 |
+
return trim($this->codConfig['magentoEdition']);
|
66 |
+
}
|
67 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Block/Identifier.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Conversionsondemand_Conversions360_Block_Identifier extends Mage_Core_Block_Text
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
*
|
13 |
+
* The page identifier that checks the current page type.
|
14 |
+
* @var string
|
15 |
+
* @example PRODUCT, CART etc.
|
16 |
+
*/
|
17 |
+
public $pageIdentifier;
|
18 |
+
/**
|
19 |
+
* Set the page identifier of the currently viewed page.
|
20 |
+
* Called on the layout file conversionsondemand.xml
|
21 |
+
*
|
22 |
+
* @param string $identifier
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
public function setCodIdentifier( $identifier )
|
26 |
+
{
|
27 |
+
$this->pageIdentifier = $identifier;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Generate the JS codebase required for the conversionsondemand snippet to identify the current page type.
|
32 |
+
*
|
33 |
+
* @param string $identifier
|
34 |
+
* @param string $cartSubTotal
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function codIdentifierHtml ($identifier, $cod_cartDetails)
|
39 |
+
{
|
40 |
+
$codConfig = Mage::helper('conversionsondemand_conversions360')->getCodConfig();
|
41 |
+
$validIdentifiers = array('PRODUCT','CART','CHECKOUT','SUCCESS');
|
42 |
+
$codIdentifierHtml = '';
|
43 |
+
|
44 |
+
if(strlen($codConfig['storeIdentifier']) === 0) {
|
45 |
+
return $codIdentifierHtml;
|
46 |
+
}
|
47 |
+
|
48 |
+
if($codConfig['snippetEnabled'] == 0) {
|
49 |
+
return $codIdentifierHtml;
|
50 |
+
}
|
51 |
+
|
52 |
+
$commentTag = '<!--- Conversions On Demand script, more info at www.conversionsondemand.com - Do Not Remove or Replace -->';
|
53 |
+
$autoDiscounterScript = '';
|
54 |
+
|
55 |
+
if(in_array($identifier,$validIdentifiers)){
|
56 |
+
if($identifier == 'CART'){
|
57 |
+
$autoDiscounterScript = '<script language=javascript>'
|
58 |
+
.'var cod_cartSubtotalAmt = parseFloat(' . $cod_cartDetails["cartSubTotal"] . ');'
|
59 |
+
.'var cod_cartItems = "' . $cod_cartDetails["cartItems"] . '";'
|
60 |
+
. 'var COD_CONFIG= {"platform": "' . $codConfig['magentoEdition'] . '","stoken":"' . $codConfig['storeIdentifier'] . '"};'
|
61 |
+
.'</script>'
|
62 |
+
.'<script language="javascript" '
|
63 |
+
.'src="'. $codConfig['serviceUrl'] .'core/couponHandler.php'
|
64 |
+
.'?p='.$codConfig['magentoEdition'].'&d='.$codConfig['storeIdentifier'].'"></script>';
|
65 |
+
}
|
66 |
+
|
67 |
+
$codIdentifierHtml = $commentTag
|
68 |
+
. '<script language="javascript">'
|
69 |
+
. 'var cod_page_guid = "' . $identifier . '";'
|
70 |
+
. '</script>'
|
71 |
+
. $autoDiscounterScript
|
72 |
+
. $commentTag;
|
73 |
+
|
74 |
+
} else {
|
75 |
+
$codIdentifierHtml = $commentTag
|
76 |
+
. '<script language=javascript>'
|
77 |
+
. 'var cod_page_guid = "NON-PRODUCT";'
|
78 |
+
. '</script>'
|
79 |
+
. $commentTag;
|
80 |
+
}
|
81 |
+
|
82 |
+
return $codIdentifierHtml;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Return additional data required for Magento Full Page Caching.
|
87 |
+
*
|
88 |
+
* @return array
|
89 |
+
*/
|
90 |
+
public function getCacheKeyInfo()
|
91 |
+
{
|
92 |
+
$cacheKeyInfo = parent::getCacheKeyInfo();
|
93 |
+
$cacheKeyInfo['pageIdentifier'] = $this->pageIdentifier;
|
94 |
+
$cacheKeyInfo['cartSubTotal'] = Mage::helper('conversionsondemand_conversions360')->getCartSubTotal();
|
95 |
+
$cacheKeyInfo['cartItems'] = Mage::helper('conversionsondemand_conversions360')->getCartItems();
|
96 |
+
|
97 |
+
|
98 |
+
return $cacheKeyInfo;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Returns the javascript code that is used to identify the currently viewed page type on the store.
|
103 |
+
*
|
104 |
+
* @return string
|
105 |
+
*/
|
106 |
+
protected function _toHtml()
|
107 |
+
{
|
108 |
+
$cod_cartDetails = array();
|
109 |
+
//$cartSubTotal = Mage::helper('conversionsondemand_conversions360')->getCartSubTotal();
|
110 |
+
$cod_cartDetails['cartSubTotal'] = Mage::helper('conversionsondemand_conversions360')->getCartSubTotal();
|
111 |
+
$cod_cartDetails['cartItems'] = Mage::helper('conversionsondemand_conversions360')->getCartItems();
|
112 |
+
return $this->codIdentifierHtml($this->pageIdentifier, $cod_cartDetails);
|
113 |
+
}
|
114 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Block/Multishipping/Success.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Conversionsondemand_Conversions360_Block_Multishipping_Success extends Mage_Checkout_Block_Multishipping_Success
|
9 |
+
{
|
10 |
+
public function getOrderDetail(){
|
11 |
+
$orders = $this->getOrderIds();
|
12 |
+
$orderData = Mage::helper('conversionsondemand_conversions360')->getOrderSummary($orders);
|
13 |
+
return $orderData;
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Block/Success.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Conversionsondemand_Conversions360_Block_Success extends Mage_Checkout_Block_Onepage_Success
|
9 |
+
{
|
10 |
+
public function getOrderDetail(){
|
11 |
+
$orders = Mage::getSingleton('checkout/session')->getLastOrderId();
|
12 |
+
$orderData = Mage::helper('conversionsondemand_conversions360')->getOrderSummary(array($orders));
|
13 |
+
return $orderData;
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Helper/Data.php
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Conversionsondemand_Conversions360_Helper_Data extends Mage_Core_Helper_Abstract
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* The service URL to retrieve additional information from conversionsondemand.com
|
12 |
+
*
|
13 |
+
* @var const string
|
14 |
+
*/
|
15 |
+
const _COD_SERVICE_URL = 'https://www.conversionsondemand.com/codadmin2/framework/';
|
16 |
+
/**
|
17 |
+
* Returns all the configuration data from the
|
18 |
+
* magento administration related to conversionsondemand.com
|
19 |
+
*
|
20 |
+
* @return array
|
21 |
+
*/
|
22 |
+
public function getCodConfig()
|
23 |
+
{
|
24 |
+
$codConfig = array();
|
25 |
+
$codConfig['serviceUrl'] = self::_COD_SERVICE_URL;
|
26 |
+
$codConfig['magentoEdition'] = Mage::getStoreConfig('conversions360_options/store/magentoedition');
|
27 |
+
$codConfig['storeIdentifier']= strip_tags(Mage::getStoreConfig('conversions360_options/store/identifier'));
|
28 |
+
$codConfig['snippetEnabled'] = Mage::getStoreConfig('conversions360_options/store/enabled');
|
29 |
+
return $codConfig;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
*
|
34 |
+
* Retrieve the order details related to the provided order ids
|
35 |
+
*
|
36 |
+
* @param array $orders (array of increment id in case of multiple shipping)
|
37 |
+
* @return array
|
38 |
+
*/
|
39 |
+
public function getOrderSummary($orders)
|
40 |
+
{
|
41 |
+
$orderSummary = array('orderids'=>array(),'numitems'=>array(),'subtotals'=>array(),
|
42 |
+
'discounts'=>array(), 'totals'=>array(),
|
43 |
+
'itemids'=>array(),'itemcodes'=>array(),'itemqty'=>array(),
|
44 |
+
'itemnames'=>array(),'itemprices'=>array()
|
45 |
+
);
|
46 |
+
|
47 |
+
if(count($orders)>0){
|
48 |
+
foreach($orders as $k=>$orderId){
|
49 |
+
|
50 |
+
if (Mage::helper('checkout')->canOnepageCheckout()) {
|
51 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
52 |
+
} else {
|
53 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
54 |
+
}
|
55 |
+
|
56 |
+
$orderSummary['orderids'][] = $order->getData('increment_id');
|
57 |
+
$orderSummary['numitems'][] = $order->getData('total_item_count');
|
58 |
+
$orderSummary['subtotals'][] = floatval($order->getData('subtotal'));
|
59 |
+
$orderSummary['discounts'][] = abs($order->getData('discount_amount'));
|
60 |
+
$orderSummary['totals'][] = $order->getData('grand_total');
|
61 |
+
|
62 |
+
$orderedItems = $order->getAllVisibleItems();
|
63 |
+
$orderedItemSummary = array('itemcode'=>array());
|
64 |
+
|
65 |
+
if(count($orderedItems > 0)){
|
66 |
+
foreach($orderedItems as $j=>$orderedItem){
|
67 |
+
$orderedItemSummary['itemids'][] = $orderedItem->getData('product_id');
|
68 |
+
$orderedItemSummary['itemcodes'][] = $orderedItem->getData('sku');
|
69 |
+
$orderedItemSummary['itemqty'][] = intval($orderedItem->getData('qty_ordered'));
|
70 |
+
$orderedItemSummary['itemnames'][] = rawurlencode($orderedItem->getData('name'));
|
71 |
+
$orderedItemSummary['itemprices'][] = floatval($orderedItem->getData('price'));
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
if(count($orderedItemSummary['itemids']) > 0) {
|
76 |
+
$orderSummary['itemids'][] = implode($orderedItemSummary['itemids'],',');
|
77 |
+
}
|
78 |
+
if(count($orderedItemSummary['itemcodes']) > 0) {
|
79 |
+
$orderSummary['itemcodes'][] = "'" . implode($orderedItemSummary['itemcodes'],"','") . "'";
|
80 |
+
}
|
81 |
+
if(count($orderedItemSummary['itemqty']) > 0) {
|
82 |
+
$orderSummary['itemqty'][] = implode($orderedItemSummary['itemqty'],',');
|
83 |
+
}
|
84 |
+
if(count($orderedItemSummary['itemnames']) > 0) {
|
85 |
+
$orderSummary['itemnames'][] = "'". implode($orderedItemSummary['itemnames'],"','") . "'";
|
86 |
+
}
|
87 |
+
if(count($orderedItemSummary['itemprices']) > 0) {
|
88 |
+
$orderSummary['itemprices'][] = implode($orderedItemSummary['itemprices'],',');
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
return $orderSummary;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Return the sub-total amount on the user's shopping cart.
|
97 |
+
*
|
98 |
+
* @return float
|
99 |
+
*/
|
100 |
+
public function getCartSubTotal()
|
101 |
+
{
|
102 |
+
$totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
|
103 |
+
$subTotal = $totals["subtotal"]->getValue();
|
104 |
+
return floatval($subTotal);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Return the sub-total amount on the user's shopping cart.
|
109 |
+
*
|
110 |
+
* @return String
|
111 |
+
*/
|
112 |
+
public function getCartItems()
|
113 |
+
{
|
114 |
+
$productName = array();
|
115 |
+
$cart = Mage::getModel('checkout/cart')->getQuote();
|
116 |
+
foreach ($cart->getAllItems() as $item) {
|
117 |
+
$product = $item->getProduct();
|
118 |
+
$productName[] = $product->getUrlModel()->getUrl($product);
|
119 |
+
}
|
120 |
+
return implode(";;",$productName);
|
121 |
+
}
|
122 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Model/Config/Source/Edition.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Conversionsondemand_Conversions360_Model_Config_Source_Edition
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Return the dropdown options required for the Configuration page on the Magento backend
|
13 |
+
*
|
14 |
+
* @return array
|
15 |
+
*/
|
16 |
+
public function toOptionArray()
|
17 |
+
{
|
18 |
+
return array(
|
19 |
+
array('value'=>'magento', 'label'=>Mage::helper('adminhtml')->__('Magento Community')),
|
20 |
+
array('value'=>'magentoenterprise', 'label'=>Mage::helper('adminhtml')->__('Magento Enterprise'))
|
21 |
+
);
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Model/Container/Code.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Conversionsondemand_Conversions360_Model_Container_Code extends Enterprise_PageCache_Model_Container_Abstract
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Get customer identifier
|
12 |
+
*
|
13 |
+
* @return string
|
14 |
+
*/
|
15 |
+
protected function _getIdentifier()
|
16 |
+
{
|
17 |
+
return md5(strtotime('now'));
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Get cache identifier
|
22 |
+
*
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
protected function _getCacheId()
|
26 |
+
{
|
27 |
+
return 'CONVERSIONSONDEMAND_CONVERSIONS360CODE'
|
28 |
+
. md5($this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier());
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Render block content
|
33 |
+
*
|
34 |
+
* @return string
|
35 |
+
*/
|
36 |
+
protected function _renderBlock()
|
37 |
+
{
|
38 |
+
$block = $this->_placeholder->getAttribute('block');
|
39 |
+
$template = $this->_placeholder->getAttribute('template');
|
40 |
+
|
41 |
+
$block = new $block;
|
42 |
+
$block->setTemplate($template);
|
43 |
+
|
44 |
+
$block->setLayout(Mage::app()->getLayout());
|
45 |
+
return $block->toHtml();
|
46 |
+
}
|
47 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Model/Container/Identifier.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Placeholder container for the identifiers related to page type.
|
4 |
+
*
|
5 |
+
* @category Conversionsondemand
|
6 |
+
* @package Conversionsondemand_Conversions360
|
7 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
8 |
+
*/
|
9 |
+
class Conversionsondemand_Conversions360_Model_Container_Identifier extends Enterprise_PageCache_Model_Container_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Get customer identifier from cookies
|
14 |
+
*
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
protected function _getIdentifier()
|
18 |
+
{
|
19 |
+
return md5(strtotime('now'));
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get cache identifier
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
protected function _getCacheId()
|
28 |
+
{
|
29 |
+
return 'CONVERSIONSONDEMAND_CONVERSIONS360_IDENTIFIER' . md5($this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier());
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Render block content
|
34 |
+
*
|
35 |
+
* @return string
|
36 |
+
*/
|
37 |
+
protected function _renderBlock()
|
38 |
+
{
|
39 |
+
$block = $this->_placeholder->getAttribute('block');
|
40 |
+
$template = $this->_placeholder->getAttribute('template');
|
41 |
+
|
42 |
+
$block = new $block;
|
43 |
+
$block->setTemplate($template);
|
44 |
+
|
45 |
+
$block->setLayout(Mage::app()->getLayout());
|
46 |
+
$pageIdentifier = $this->_placeholder->getAttribute('pageIdentifier');
|
47 |
+
$cartSubTotal = $this->_placeholder->getAttribute('cartSubTotal');
|
48 |
+
$cartItems = $this->_placeholder->getAttribute('cartItems');
|
49 |
+
$cod_cartDetails['cartSubTotal'] = $cartSubTotal;
|
50 |
+
$cod_cartDetails['cartItems'] = $cartItems;
|
51 |
+
|
52 |
+
return $block->codIdentifierHtml($pageIdentifier , $cod_cartDetails);
|
53 |
+
}
|
54 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/Model/Observer.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Conversionsondemand
|
4 |
+
* @package Conversionsondemand_Conversions360
|
5 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
class Conversionsondemand_Conversions360_Model_Observer
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
*
|
12 |
+
* The querystring parameter that disables the conversionsondemand.com services on a magento store.
|
13 |
+
* @var const string
|
14 |
+
*/
|
15 |
+
const FLAG_COD_DISABLED = 'codDisabled';
|
16 |
+
/**
|
17 |
+
*
|
18 |
+
* Disable the conversionsondemand.com code snippet and refresh the cache.
|
19 |
+
* @param string $observer
|
20 |
+
*/
|
21 |
+
public function checkServiceDisabledParam($observer)
|
22 |
+
{
|
23 |
+
$is_set = array_key_exists(self::FLAG_COD_DISABLED, $_GET);
|
24 |
+
if($is_set){
|
25 |
+
try {
|
26 |
+
Mage::getConfig()->saveConfig('conversions360_options/store/enabled', 0 );
|
27 |
+
$allTypes = Mage::app()->useCache();
|
28 |
+
foreach($allTypes as $type => $blah) {
|
29 |
+
Mage::app()->getCacheInstance()->cleanType($type);
|
30 |
+
}
|
31 |
+
} catch (Exception $e) {
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/controllers/IndexController.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Dummy controller to receive the querystring parameter on Observer
|
4 |
+
*
|
5 |
+
* @category Conversionsondemand
|
6 |
+
* @package Conversionsondemand_Conversions360
|
7 |
+
* @copyright Copyright (c) 2012 Exclusive Concepts (http://www.exclusiveconcepts.com)
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
class Conversionsondemand_Conversions360_IndexController extends Mage_Core_Controller_Front_Action {
|
11 |
+
public function indexAction()
|
12 |
+
{
|
13 |
+
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Conversionsondemand/Conversions360/etc/cache.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<placeholders>
|
4 |
+
<conversionsondemand_conversions360code>
|
5 |
+
<block>conversions360/code</block>
|
6 |
+
<placeholder>CONVERSIONSONDEMAND_CONVERSIONS360CODE</placeholder>
|
7 |
+
<container>Conversionsondemand_Conversions360_Model_Container_Code</container>
|
8 |
+
<cache_lifetime>86400</cache_lifetime>
|
9 |
+
</conversionsondemand_conversions360code>
|
10 |
+
<conversionsondemand_conversions360identifier>
|
11 |
+
<block>conversions360/identifier</block>
|
12 |
+
<placeholder>CONVERSIONSONDEMAND_CONVERSIONS360IDENTIFIER</placeholder>
|
13 |
+
<container>Conversionsondemand_Conversions360_Model_Container_Identifier</container>
|
14 |
+
<cache_lifetime>86400</cache_lifetime>
|
15 |
+
</conversionsondemand_conversions360identifier>
|
16 |
+
</placeholders>
|
17 |
+
</config>
|
app/code/community/Conversionsondemand/Conversions360/etc/config.xml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<modules>
|
3 |
+
<Conversionsondemand_Conversions360>
|
4 |
+
<version>1.1.0</version>
|
5 |
+
</Conversionsondemand_Conversions360>
|
6 |
+
</modules>
|
7 |
+
<global>
|
8 |
+
<models>
|
9 |
+
<conversions360>
|
10 |
+
<class>Conversionsondemand_Conversions360_Model</class>
|
11 |
+
</conversions360>
|
12 |
+
</models>
|
13 |
+
<blocks>
|
14 |
+
<conversions360>
|
15 |
+
<class>Conversionsondemand_Conversions360_Block</class>
|
16 |
+
</conversions360>
|
17 |
+
</blocks>
|
18 |
+
<helpers>
|
19 |
+
<conversionsondemand_conversions360>
|
20 |
+
<class>Conversionsondemand_Conversions360_Helper</class>
|
21 |
+
</conversionsondemand_conversions360>
|
22 |
+
</helpers>
|
23 |
+
<events>
|
24 |
+
<controller_action_postdispatch>
|
25 |
+
<observers>
|
26 |
+
<conversionsondemand_conversions360_model_observer>
|
27 |
+
<type>singleton</type>
|
28 |
+
<class>Conversionsondemand_Conversions360_Model_Observer</class>
|
29 |
+
<method>checkServiceDisabledParam</method>
|
30 |
+
</conversionsondemand_conversions360_model_observer>
|
31 |
+
</observers>
|
32 |
+
</controller_action_postdispatch>
|
33 |
+
</events>
|
34 |
+
</global>
|
35 |
+
<frontend>
|
36 |
+
<layout>
|
37 |
+
<updates>
|
38 |
+
<conversions360>
|
39 |
+
<file>conversionsondemand/conversions360/conversions360.xml</file>
|
40 |
+
</conversions360>
|
41 |
+
</updates>
|
42 |
+
</layout>
|
43 |
+
<routers>
|
44 |
+
<conversions360>
|
45 |
+
<use>standard</use>
|
46 |
+
<args>
|
47 |
+
<module>Conversionsondemand_Conversions360</module>
|
48 |
+
<frontName>conversions360</frontName>
|
49 |
+
</args>
|
50 |
+
</conversions360>
|
51 |
+
</routers>
|
52 |
+
</frontend>
|
53 |
+
<adminhtml>
|
54 |
+
<acl>
|
55 |
+
<resources>
|
56 |
+
<admin>
|
57 |
+
<children>
|
58 |
+
<system>
|
59 |
+
<children>
|
60 |
+
<config>
|
61 |
+
<children>
|
62 |
+
<conversions360_options>
|
63 |
+
<title>Conversionsondemand.com options</title>
|
64 |
+
</conversions360_options>
|
65 |
+
</children>
|
66 |
+
</config>
|
67 |
+
</children>
|
68 |
+
</system>
|
69 |
+
</children>
|
70 |
+
</admin>
|
71 |
+
</resources>
|
72 |
+
</acl>
|
73 |
+
</adminhtml>
|
74 |
+
</config>
|
app/code/community/Conversionsondemand/Conversions360/etc/system.xml
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<tabs>
|
3 |
+
<conversions360 translate="label"
|
4 |
+
module="conversionsondemand_conversions360">
|
5 |
+
<label>Conversions On Demand</label>
|
6 |
+
<sort_order>99999</sort_order>
|
7 |
+
</conversions360>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<conversions360_options translate="label"
|
11 |
+
module="conversionsondemand_conversions360">
|
12 |
+
<label>Conversions On Demand Setup</label>
|
13 |
+
<tab>conversions360</tab>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>1000</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 |
+
<store translate="label">
|
21 |
+
<label>Store Information</label>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>1</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<fields>
|
28 |
+
<magentoedition translate="label comment">
|
29 |
+
<label>Choose Edition</label>
|
30 |
+
<comment><![CDATA[Choose the appropriate Magento Edition of your store.]]></comment>
|
31 |
+
<frontend_type>select</frontend_type>
|
32 |
+
<source_model>conversions360/config_source_edition</source_model>
|
33 |
+
<sort_order>1</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</magentoedition>
|
38 |
+
<identifier>
|
39 |
+
<label>Store Identifier</label>
|
40 |
+
<comment><![CDATA[Please use the store identifier provided during registration.]]></comment>
|
41 |
+
<frontend_type>text</frontend_type>
|
42 |
+
<sort_order>2</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</identifier>
|
47 |
+
<enabled translate="label comment">
|
48 |
+
<label>Enabled</label>
|
49 |
+
<comment><![CDATA[Choose "yes" after you have completed signing up for <a href="https://www.conversionsondemand.com/signup.php">Conversions on Demand</a> and received your welcome email with the store identifier.]]></comment>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
52 |
+
<sort_order>3</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
</enabled>
|
57 |
+
</fields>
|
58 |
+
</store>
|
59 |
+
</groups>
|
60 |
+
</conversions360_options>
|
61 |
+
</sections>
|
62 |
+
</config>
|
app/design/frontend/base/default/layout/conversionsondemand/conversions360/conversions360.xml
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="before_body_end">
|
5 |
+
<block type="conversions360/code" name="conversionsondemand_conversions360" template="conversionsondemand/conversions360/code.phtml" as="conversionsondemand_conversions360" />
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
<catalog_product_view>
|
9 |
+
<reference name="head">
|
10 |
+
<block type="conversions360/identifier" name="conversions360.identifier.product">
|
11 |
+
<action method="setCodIdentifier">
|
12 |
+
<value>PRODUCT</value>
|
13 |
+
</action>
|
14 |
+
</block>
|
15 |
+
</reference>
|
16 |
+
</catalog_product_view>
|
17 |
+
<checkout_cart_index>
|
18 |
+
<reference name="head">
|
19 |
+
<block type="conversions360/identifier" name="conversions360.identifier.cart">
|
20 |
+
<action method="setCodIdentifier">
|
21 |
+
<value>CART</value>
|
22 |
+
</action>
|
23 |
+
</block>
|
24 |
+
</reference>
|
25 |
+
</checkout_cart_index>
|
26 |
+
<checkout_onepage_index>
|
27 |
+
<reference name="head">
|
28 |
+
<block type="conversions360/identifier" name="conversions360.identifier.checkout">
|
29 |
+
<action method="setCodIdentifier">
|
30 |
+
<value>CHECKOUT</value>
|
31 |
+
</action>
|
32 |
+
</block>
|
33 |
+
</reference>
|
34 |
+
</checkout_onepage_index>
|
35 |
+
<checkout_onepage_success translate="label">
|
36 |
+
<reference name="head">
|
37 |
+
<block type="conversions360/success" name="conversions360.success.onepage" template="conversionsondemand/conversions360/success.phtml">
|
38 |
+
<action method="setCodIdentifier">
|
39 |
+
<value>SUCCESS</value>
|
40 |
+
</action>
|
41 |
+
</block>
|
42 |
+
</reference>
|
43 |
+
</checkout_onepage_success>
|
44 |
+
<checkout_multishipping_login>
|
45 |
+
<reference name="head">
|
46 |
+
<block type="conversions360/identifier" name="conversions360.identifier.checkout.multishipping.login">
|
47 |
+
<action method="setCodIdentifier">
|
48 |
+
<value>CHECKOUT</value>
|
49 |
+
</action>
|
50 |
+
</block>
|
51 |
+
</reference>
|
52 |
+
</checkout_multishipping_login>
|
53 |
+
<checkout_multishipping_register>
|
54 |
+
<reference name="head">
|
55 |
+
<block type="conversions360/identifier" name="conversions360.identifier.checkout.multishipping.register">
|
56 |
+
<action method="setCodIdentifier">
|
57 |
+
<value>CHECKOUT</value>
|
58 |
+
</action>
|
59 |
+
</block>
|
60 |
+
</reference>
|
61 |
+
</checkout_multishipping_register>
|
62 |
+
<checkout_multishipping_addresses>
|
63 |
+
<reference name="head">
|
64 |
+
<block type="conversions360/identifier" name="conversions360.identifier.checkout.multishipping.addresses">
|
65 |
+
<action method="setCodIdentifier">
|
66 |
+
<value>CHECKOUT</value>
|
67 |
+
</action>
|
68 |
+
</block>
|
69 |
+
</reference>
|
70 |
+
</checkout_multishipping_addresses>
|
71 |
+
<checkout_multishipping_shipping>
|
72 |
+
<reference name="head">
|
73 |
+
<block type="conversions360/identifier" name="conversions360.identifier.checkout.multishipping.shipping">
|
74 |
+
<action method="setCodIdentifier">
|
75 |
+
<value>CHECKOUT</value>
|
76 |
+
</action>
|
77 |
+
</block>
|
78 |
+
</reference>
|
79 |
+
</checkout_multishipping_shipping>
|
80 |
+
<checkout_multishipping_billing>
|
81 |
+
<reference name="head">
|
82 |
+
<block type="conversions360/identifier" name="conversions360.identifier.checkout.multishipping.billing">
|
83 |
+
<action method="setCodIdentifier">
|
84 |
+
<value>CHECKOUT</value>
|
85 |
+
</action>
|
86 |
+
</block>
|
87 |
+
</reference>
|
88 |
+
</checkout_multishipping_billing>
|
89 |
+
<checkout_multishipping_overview>
|
90 |
+
<reference name="head">
|
91 |
+
<block type="conversions360/identifier" name="conversions360.identifier.checkout.multishipping.overview">
|
92 |
+
<action method="setCodIdentifier">
|
93 |
+
<value>CHECKOUT</value>
|
94 |
+
</action>
|
95 |
+
</block>
|
96 |
+
</reference>
|
97 |
+
</checkout_multishipping_overview>
|
98 |
+
<checkout_multishipping_success translate="label">
|
99 |
+
<reference name="head">
|
100 |
+
<block type="conversions360/multishipping_success" name="conversions360.success.multishipping" template="conversionsondemand/conversions360/success.phtml">
|
101 |
+
<action method="setCodIdentifier">
|
102 |
+
<value>SUCCESS</value>
|
103 |
+
</action>
|
104 |
+
</block>
|
105 |
+
</reference>
|
106 |
+
</checkout_multishipping_success>
|
107 |
+
</layout>
|
app/design/frontend/base/default/template/conversionsondemand/conversions360/code.phtml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if($this->codSnippetEnabled() && strlen($this->getStoreIdentifier()) > 0):
|
3 |
+
$storeIdentifier = strip_tags($this->getStoreIdentifier());
|
4 |
+
$storePlatform = strip_tags($this->getStorePlatform());
|
5 |
+
$codServiceUrl = $this->getCodServiceUrl() . 'magento-loader.php?d=' . $storeIdentifier . '&p=' . $storePlatform ;
|
6 |
+
?>
|
7 |
+
<!--- Conversions On Demand script, more info at www.conversionsondemand.com - Do Not Remove or Replace -->
|
8 |
+
<script language="javascript">
|
9 |
+
var cod_cartSubtotalAmt = parseFloat(<?php echo floatval(Mage::helper('conversionsondemand_conversions360')->getCartSubTotal()); ?>);
|
10 |
+
var cod_cartItems = "<?php echo Mage::helper('conversionsondemand_conversions360')->getCartItems(); ?>";
|
11 |
+
var COD_CONFIG= {'platform': '<?php echo $storePlatform; ?>','stoken':'<?php echo $storeIdentifier; ?>'};
|
12 |
+
</script>
|
13 |
+
<script language=javascript src="<?php echo $codServiceUrl; ?>"></script>
|
14 |
+
<!--- Conversions On Demand script, more info at www.conversionsondemand.com - Do Not Remove or Replace -->
|
15 |
+
<?php
|
16 |
+
endif;
|
17 |
+
?>
|
app/design/frontend/base/default/template/conversionsondemand/conversions360/success.phtml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$orderSummary = $this->getOrderDetail();
|
3 |
+
?>
|
4 |
+
<script language=javascript>
|
5 |
+
var cod_page_guid = 'SUCCESS';
|
6 |
+
var cod_ab_orderSubTotal = [<?php echo implode($orderSummary['subtotals'],',') ?>];
|
7 |
+
var cod_ab_orderTotal = [<?php echo implode($orderSummary['totals'],',') ?>];
|
8 |
+
var cod_ab_orderNum=[<?php echo implode($orderSummary['orderids'],',') ?>];
|
9 |
+
var cod_ab_numOfItems=[<?php echo implode($orderSummary['numitems'],',') ?>];
|
10 |
+
var cod_ab_orderSubTotalDiscounted = [<?php echo implode($orderSummary['discounts'],',') ?>];
|
11 |
+
<?php if(count($orderSummary['itemnames']) > 0): ?>
|
12 |
+
var cod_ab_product_items=[<?php echo "[". implode($orderSummary['itemnames'],'],[') . "]"; ?>];
|
13 |
+
<?php else: ?>
|
14 |
+
var cod_ab_product_items=[];
|
15 |
+
<?php endif;?>
|
16 |
+
<?php if(count($orderSummary['itemids']) > 0): ?>
|
17 |
+
var cod_ab_product_ids=[<?php echo "[". implode($orderSummary['itemids'],'],[') . "]"; ?>];
|
18 |
+
<?php else: ?>
|
19 |
+
var cod_ab_product_ids=[];
|
20 |
+
<?php endif;?>
|
21 |
+
<?php if(count($orderSummary['itemcodes']) > 0): ?>
|
22 |
+
var cod_ab_product_codes=[<?php echo "[". implode($orderSummary['itemcodes'],'],[') . "]"; ?>];
|
23 |
+
<?php else: ?>
|
24 |
+
var cod_ab_product_codes=[];
|
25 |
+
<?php endif;?>
|
26 |
+
<?php if(count($orderSummary['itemqty']) > 0): ?>
|
27 |
+
var cod_ab_product_qtys=[<?php echo "[". implode($orderSummary['itemqty'],'],[') . "]"; ?>];
|
28 |
+
<?php else: ?>
|
29 |
+
var cod_ab_product_qtys=[];
|
30 |
+
<?php endif;?>
|
31 |
+
<?php if(count($orderSummary['itemprices']) > 0): ?>
|
32 |
+
var cod_ab_product_price=[<?php echo "[". implode($orderSummary['itemprices'],'],[') . "]"; ?>];
|
33 |
+
<?php else: ?>
|
34 |
+
var cod_ab_product_price=[];
|
35 |
+
<?php endif;?>
|
36 |
+
</script>
|
app/etc/modules/Conversionsondemand_Conversions360.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<modules>
|
3 |
+
<Conversionsondemand_Conversions360>
|
4 |
+
<active>true</active>
|
5 |
+
<codePool>community</codePool>
|
6 |
+
</Conversionsondemand_Conversions360>
|
7 |
+
</modules>
|
8 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Exclusiveconcepts4_Conversionsondemand</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="https://www.conversionsondemand.com/codadmin2/files/COD-Master-Agreement.pdf">Conversions On Demand Terms Of Service</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Conversions On Demand is designed to prevent shoppers from leaving your site before making a purchase. Years of testing and data analysis power each application we make available through Conversions On Demand. The Conversions On Demand Suite includes a The Daily Deal Bar, The Cart Closer, Time2Buy, Cart Reminder, and Email Booster. All 5 are available separately or in combination to improve your store's conversion rate.</summary>
|
10 |
+
<description>Conversions On Demand is a comprehensive and easy to manage suite of services to improve conversion rates. 
|
11 |
+

|
12 |
+
Email Booster helps you build the number of shoppers you can target ultimately increasing your sales.
|
13 |
+

|
14 |
+
Cart Reminder reminds shoppers they left something in their cart and see your profits increase. It will display the reminder the first time the shopper returns to your store on any page the shopper enters on.
|
15 |
+

|
16 |
+
The Cart Closer is designed to convert shoppers that abandon the cart before completing a sale. The Cart Closer displays a customizable offer to the shopper as they are exiting the cart to incent them to stay and complete a sale.
|
17 |
+

|
18 |
+
The Daily Deal Bar enables you to schedule promotions days, weeks or months in advance. After uploading your promotions (including single-use coupon), you can forget about them and trust the Daily Deal Bar to automatically update your site and Twitter on the days and times that you've preconfigured.
|
19 |
+

|
20 |
+
Time2Buy is patent-pending technology that monitors the browsing behavior of shoppers on your site, and displays hyper time-sensitive offers to motivate shoppers to immediately buy from you. You can control the time, trigger behavior and offer value.</description>
|
21 |
+
<notes>Email Booster Release 1.0.0</notes>
|
22 |
+
<authors><author><name>Frank Kjaersgaard</name><user>auto-converted</user><email>fkjaersgaard@exclusiveconcepts.com</email></author></authors>
|
23 |
+
<date>2015-08-17</date>
|
24 |
+
<time>10:47:45</time>
|
25 |
+
<contents><target name="magecommunity"><dir name="Conversionsondemand"><dir name="Conversions360"><dir name="Block"><dir name="Multishipping"><file name="Success.php" hash="91f894fed9c4b94ccb3cfcd346627f92"/></dir><file name="Code.php" hash="55ebe5ae23049e1af8c1a3e782203407"/><file name="Identifier.php" hash="e13d08c9fb0dbae88cf3f024796741f0"/><file name="Success.php" hash="0544e1889e339aef0c3953fd00450684"/></dir><dir name="Helper"><file name="Data.php" hash="447fbbfff8eb1b4288c52170a5a8a92d"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Edition.php" hash="a7268f311f457305189ca2906f2a7c41"/></dir></dir><dir name="Container"><file name="Code.php" hash="90e9cba3004db39fe2443c467fa0577d"/><file name="Identifier.php" hash="e84921a03b4e986e69da129d0a39b4d7"/></dir><file name="Observer.php" hash="ebcbe407157dd30e71366dc5620ce1d7"/></dir><dir name="controllers"><file name="IndexController.php" hash="60d63f5bf5b208193567a72682475b02"/></dir><dir name="etc"><file name="cache.xml" hash="5f5c7e42e915f9607ee710d5b31bad5d"/><file name="config.xml" hash="75707d44e6b8296b68c37e624db1d409"/><file name="system.xml" hash="ab64016b6349164727277e4d075d6164"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Conversionsondemand_Conversions360.xml" hash="2ba3e087b9bf8d769741b89481dee559"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="conversionsondemand"><dir name="conversions360"><file name="conversions360.xml" hash="3698c3553a37b1799afe2899a9937a96"/></dir></dir></dir><dir name="template"><dir name="conversionsondemand"><dir name="conversions360"><file name="code.phtml" hash="521f808238bfc4d32d9d9e845511319b"/><file name="success.phtml" hash="0f4f25812b1484d69e8b6285213ef616"/></dir></dir></dir></dir></dir></dir></target></contents>
|
26 |
+
<compatible/>
|
27 |
+
<dependencies/>
|
28 |
+
</package>
|