conversify - Version 1.1.3

Version Notes

Optimized production ready release.

Download this release

Release Info

Developer Conversify.com
Extension conversify
Version 1.1.3
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.3

app/code/community/Conversify/ScriptManager/Block/Scriptmanager.php CHANGED
@@ -39,6 +39,16 @@ class Conversify_ScriptManager_Block_Scriptmanager extends Mage_Core_Block_Templ
39
  }
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Get support data for the Conversify script
44
  *
@@ -59,7 +69,6 @@ class Conversify_ScriptManager_Block_Scriptmanager extends Mage_Core_Block_Templ
59
  $this->_getProductInfo()
60
  )
61
  ) : null,
62
-
63
  /**
64
  * DISABLED: CAUSING HIGH LOAD ON SEVERAL SETUPS
65
  */
@@ -120,7 +129,7 @@ class Conversify_ScriptManager_Block_Scriptmanager extends Mage_Core_Block_Templ
120
  */
121
  private function _getProductInfo() {
122
  try {
123
- if ($this->_getPagetype() == 'product') {
124
  /* @var $productInfoHelper Conversify_ScriptManager_Helper_Productinfo */
125
  $productInfoHelper = $this->helper('conversifyscriptmanager/productinfo');
126
  return $productInfoHelper->getProductInfo();
39
  }
40
  }
41
 
42
+ public function getProductId() {
43
+ if ($this->getPagetype() == "product") {
44
+ $p = $this->_getProductInfo();
45
+ if (!is_null($p)) {
46
+ return $p['id'];
47
+ }
48
+ }
49
+ return '';
50
+ }
51
+
52
  /**
53
  * Get support data for the Conversify script
54
  *
69
  $this->_getProductInfo()
70
  )
71
  ) : null,
 
72
  /**
73
  * DISABLED: CAUSING HIGH LOAD ON SEVERAL SETUPS
74
  */
129
  */
130
  private function _getProductInfo() {
131
  try {
132
+ if ($this->getPagetype() == 'product') {
133
  /* @var $productInfoHelper Conversify_ScriptManager_Helper_Productinfo */
134
  $productInfoHelper = $this->helper('conversifyscriptmanager/productinfo');
135
  return $productInfoHelper->getProductInfo();
app/code/community/Conversify/ScriptManager/Helper/Productinfo.php CHANGED
@@ -25,22 +25,12 @@ class Conversify_ScriptManager_Helper_Productinfo extends Mage_Core_Helper_Abstr
25
  return null;
26
  }
27
 
28
- /* @var $productCollection Mage_Reports_Model_Resource_Product_Collection */
29
- $productCollection = Mage::getResourceModel('reports/product_collection');
30
-
31
- /* @var $catalogInventory Mage_CatalogInventory_Model_Stock_Item */
32
- $catalogInventory = Mage::getModel('cataloginventory/stock_item');
33
-
34
- $timesSold = $productCollection
35
- ->addOrderedQty()
36
- ->addAttributeToFilter('sku', $product->getSku())
37
- ->setOrder('ordered_qty', 'desc')
38
- ->getFirstItem()
39
- ->ordered_qty;
40
 
41
  return array(
42
- 'times_sold_alltime' => $timesSold,
43
- 'stock' => intval($catalogInventory->loadByProduct($product)->getQty())
44
  );
45
  }
46
  }
25
  return null;
26
  }
27
 
28
+ /* @var $productInventory Mage_CatalogInventory_Model_Stock_Item */
29
+ $productInventory = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
 
 
 
 
 
 
 
 
 
 
30
 
31
  return array(
32
+ 'id' => $product->getId(),
33
+ 'stock'=> $productInventory->getIsInStock() ? intval($productInventory->getQty()) : 0
34
  );
35
  }
36
  }
app/code/community/Conversify/ScriptManager/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Conversify_ScriptManager>
5
- <version>0.2</version>
6
  </Conversify_ScriptManager>
7
  </modules>
8
  <global>
@@ -54,11 +54,10 @@
54
  <default>
55
  <conversify>
56
  <global>
57
- <active>1</active>
58
- <api_key>{0}</api_key>
59
  <stock_info>1</stock_info>
60
- <order_info>1</order_info>
61
  </global>
62
  </conversify>
63
  </default>
64
- </config>
2
  <config>
3
  <modules>
4
  <Conversify_ScriptManager>
5
+ <version>1.1.3</version>
6
  </Conversify_ScriptManager>
7
  </modules>
8
  <global>
54
  <default>
55
  <conversify>
56
  <global>
57
+ <active>0</active>
58
+ <api_key></api_key>
59
  <stock_info>1</stock_info>
 
60
  </global>
61
  </conversify>
62
  </default>
63
+ </config>
app/design/frontend/base/default/template/conversifyscriptmanager/scriptmanager.phtml CHANGED
@@ -3,19 +3,19 @@
3
  <script type="text/javascript">
4
  var Conversify = Conversify || [];
5
  <?php if (is_array($CFY)): ?>
6
- Conversify.product = "<?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_PRODUCT]; ?>";
7
- Conversify.pagetype = "<?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_PAGETYPE]; ?>";
8
- Conversify.cart = "<?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_CART]; ?>";
9
- Conversify.orders = "<?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_ORDERS]; ?>";
10
  <?php else: ?>
11
- Conversify.gibberish = "<?php echo $CFY; ?>";
12
- Conversify.pagetype = "<?php echo $this->getPagetype();?>";
13
  <?php endif; ?>
14
 
15
  (function(d,e,c,cn,f,cfy) {
16
  f=d.cookie.split(cn)[1];f=f?f.split(';')[0]:'';
17
  cfy=d.createElement("script");cfy.type="text/javascript";cfy.async=true;
18
- cfy.src='//js.conversify.com/v2/<?php echo $this->getAPIKey();?>.js?pt='+e(c.pagetype)+'&ut='+e(f)+'&rf='+e(d.referrer||'');
19
  (d.getElementsByTagName('head')[0]||d.getElementsByTagName('body')[0]).appendChild(cfy);
20
  })(document, window.encodeURIComponent, Conversify, "__conversify_uid=");
21
  </script>
3
  <script type="text/javascript">
4
  var Conversify = Conversify || [];
5
  <?php if (is_array($CFY)): ?>
6
+ Conversify.product = <?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_PRODUCT]; ?>;
7
+ Conversify.pagetype = '<?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_PAGETYPE]; ?>';
8
+ Conversify.cart = '<?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_CART]; ?>';
9
+ <?php /*Conversify.orders = '<?php echo $CFY[Conversify_ScriptManager_Block_Scriptmanager::DATA_ORDERS]; ?>'; */ ?>
10
  <?php else: ?>
11
+ Conversify.gibberish = '<?php echo $CFY; ?>'
12
+ Conversify.pagetype = '<?php echo $this->getPagetype();?>';
13
  <?php endif; ?>
14
 
15
  (function(d,e,c,cn,f,cfy) {
16
  f=d.cookie.split(cn)[1];f=f?f.split(';')[0]:'';
17
  cfy=d.createElement("script");cfy.type="text/javascript";cfy.async=true;
18
+ cfy.src='//js.conversify.com/v2/<?php echo $this->getAPIKey();?>.js?pt='+e(c.pagetype)+'&ut='+e(f)+'&rf='+e(d.referrer||'')+'&p='+e('<?php echo $this->getProductId()?>');
19
  (d.getElementsByTagName('head')[0]||d.getElementsByTagName('body')[0]).appendChild(cfy);
20
  })(document, window.encodeURIComponent, Conversify, "__conversify_uid=");
21
  </script>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>conversify</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://choosealicense.com/licenses/no-license/">Copyright 2014 - Conversify BV</license>
7
  <channel>community</channel>
@@ -33,9 +33,9 @@ Sign up at Conversify.com for your API key.</description>
33
  <notes>Optimized production ready release.&#xD;
34
  </notes>
35
  <authors><author><name>Conversify.com</name><user>conversify</user><email>info@conversify.com</email></author></authors>
36
- <date>2014-10-07</date>
37
- <time>13:48:43</time>
38
- <contents><target name="magecommunity"><dir name="Conversify"><dir name="ScriptManager"><dir name="Block"><file name="Conversion.php" hash="a46b1e6741e23938812da9f809bd4d5a"/><file name="Scriptmanager.php" hash="7be5414ac97566736255497c2cce402e"/></dir><dir name="Helper"><file name="Crypt.php" hash="ba27bacdeaabb7879372db9b2423b83a"/><file name="Data.php" hash="afae2a7a305821aa7899d1788dfeee44"/><file name="Orderinfo.php" hash="624b84c2d5249626412bcc0448f00ffb"/><file name="Pagetype.php" hash="cc816b448dec978590fe6c12456b05d1"/><file name="Productinfo.php" hash="89960073f1315988fa3f94875c117c32"/><file name="Shoppingcart.php" hash="f6adbde97caed001de4670dc015baa4e"/><dir name="vendor"><file name="GibberishAES.php" hash="08d3c538a81738a731a0f71f7023ad55"/></dir></dir><dir name="Model"><file name="Observer.php" hash="989a2c1e5f2193ad5e90760786857572"/></dir><dir name="etc"><file name="adminhtml.xml" hash="feff6e703461239de97fed63bd037108"/><file name="config.xml" hash="68be366a1659d021f5b37220be3978c5"/><file name="system.xml" hash="40043c990e0996b045d381d1e56f2fbd"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="conversifyscriptmanager.xml" hash="dcd624da6ab311441bb0b0c33e62db45"/></dir><dir name="template"><dir name="conversifyscriptmanager"><file name="conversion.phtml" hash="8aa1a019bef3c062a7178eb1f83dab68"/><file name="scriptmanager.phtml" hash="46fba5373c4b10b5201e6753366fa5e8"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Conversify_ScriptManager.xml" hash="726343acc86ba73b0a20c6eb50fd0825"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Conversify_ScriptManager.csv" hash="72e9bd05bfc8fb47ae196c2534dee277"/></dir></dir></target></contents>
39
  <compatible/>
40
  <dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php></required></dependencies>
41
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>conversify</name>
4
+ <version>1.1.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://choosealicense.com/licenses/no-license/">Copyright 2014 - Conversify BV</license>
7
  <channel>community</channel>
33
  <notes>Optimized production ready release.&#xD;
34
  </notes>
35
  <authors><author><name>Conversify.com</name><user>conversify</user><email>info@conversify.com</email></author></authors>
36
+ <date>2014-10-21</date>
37
+ <time>12:36:55</time>
38
+ <contents><target name="magecommunity"><dir name="Conversify"><dir name="ScriptManager"><dir name="Block"><file name="Conversion.php" hash="a46b1e6741e23938812da9f809bd4d5a"/><file name="Scriptmanager.php" hash="231b237cf00fcad61f8c14a52bd1a8d4"/></dir><dir name="Helper"><file name="Crypt.php" hash="ba27bacdeaabb7879372db9b2423b83a"/><file name="Data.php" hash="afae2a7a305821aa7899d1788dfeee44"/><file name="Orderinfo.php" hash="624b84c2d5249626412bcc0448f00ffb"/><file name="Pagetype.php" hash="cc816b448dec978590fe6c12456b05d1"/><file name="Productinfo.php" hash="855d668a57e2065185854a3a36c25ef4"/><file name="Shoppingcart.php" hash="f6adbde97caed001de4670dc015baa4e"/><dir name="vendor"><file name="GibberishAES.php" hash="08d3c538a81738a731a0f71f7023ad55"/></dir></dir><dir name="Model"><file name="Observer.php" hash="989a2c1e5f2193ad5e90760786857572"/></dir><dir name="etc"><file name="adminhtml.xml" hash="feff6e703461239de97fed63bd037108"/><file name="config.xml" hash="68be366a1659d021f5b37220be3978c5"/><file name="system.xml" hash="40043c990e0996b045d381d1e56f2fbd"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="conversifyscriptmanager.xml" hash="dcd624da6ab311441bb0b0c33e62db45"/></dir><dir name="template"><dir name="conversifyscriptmanager"><file name="conversion.phtml" hash="8aa1a019bef3c062a7178eb1f83dab68"/><file name="scriptmanager.phtml" hash="d457b614ae6adca97d24649fc4986199"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Conversify_ScriptManager.xml" hash="726343acc86ba73b0a20c6eb50fd0825"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Conversify_ScriptManager.csv" hash="72e9bd05bfc8fb47ae196c2534dee277"/></dir></dir></target></contents>
39
  <compatible/>
40
  <dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php></required></dependencies>
41
  </package>