Bubbleyes_BubblitPlugin - Version 1.0.1

Version Notes

- First release
- Supporting configuration of the module in the settings administration
- Supporting visualization of the BubblitPlugin in the product details page

Download this release

Release Info

Developer Terje Lindstad
Extension Bubbleyes_BubblitPlugin
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Bubbleyes/BubblitPlugin/Block/Button.php CHANGED
@@ -24,7 +24,8 @@ class Bubbleyes_BubblitPlugin_Block_Button
24
  'Type' => $this->_helper->getBubblLayout()
25
  );
26
 
27
- return $this->_helper->CallAPIWithResponse('getProductScript', array('Product' => $productData, 'Settings' => $settings))["Script"];
 
28
  }
29
  }
30
  catch (Exception $ex) { }
24
  'Type' => $this->_helper->getBubblLayout()
25
  );
26
 
27
+ $tmp = $this->_helper->CallAPIWithResponse('getProductScript', array('Product' => $productData, 'Settings' => $settings));
28
+ return $tmp["Script"];
29
  }
30
  }
31
  catch (Exception $ex) { }
app/code/community/Bubbleyes/BubblitPlugin/Helper/Data.php CHANGED
@@ -2,7 +2,7 @@
2
  class Bubbleyes_BubblitPlugin_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
  static $APIAddress = "http://api.bubbleyes.com/client/";
5
- static $ProductsPortionSize = 100;
6
 
7
  public static function getProductPortionSize() {
8
  return self::$ProductsPortionSize;
@@ -39,7 +39,8 @@
39
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
40
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
41
  curl_setopt($curl, CURLOPT_NOSIGNAL, 1);
42
- curl_setopt($curl, CURLOPT_TIMEOUT , 250);
 
43
 
44
  curl_exec($curl);
45
 
2
  class Bubbleyes_BubblitPlugin_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
  static $APIAddress = "http://api.bubbleyes.com/client/";
5
+ static $ProductsPortionSize = 25;
6
 
7
  public static function getProductPortionSize() {
8
  return self::$ProductsPortionSize;
39
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
40
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
41
  curl_setopt($curl, CURLOPT_NOSIGNAL, 1);
42
+ curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
43
+ curl_setopt($curl, CURLOPT_TIMEOUT, 1);
44
 
45
  curl_exec($curl);
46
 
app/code/community/Bubbleyes/BubblitPlugin/Model/Observer.php CHANGED
@@ -62,19 +62,25 @@ class Bubbleyes_BubblitPlugin_Model_Observer
62
  $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect(array('name', 'short_description', 'price', 'special_price', 'currency', 'status', 'image'));
63
 
64
  //do in portions
 
 
65
  foreach($products as $product)
66
  {
67
- $productsPortion = array();
 
68
 
69
- $itt = 0;
70
- while($itt < $this->_helper->getProductPortionSize())
71
  {
72
-
73
- array_push($productsPortion, $product);
74
- $itt++;
 
75
  }
 
76
 
77
- $this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
 
 
78
  }
79
  }
80
  catch (Exception $ex) { }
62
  $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect(array('name', 'short_description', 'price', 'special_price', 'currency', 'status', 'image'));
63
 
64
  //do in portions
65
+ $itt = 0;
66
+ $productsPortion = array();
67
  foreach($products as $product)
68
  {
69
+ array_push($productsPortion, $product);
70
+ $itt++;
71
 
72
+ if($itt == $this->_helper->getProductPortionSize())
 
73
  {
74
+ $this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
75
+
76
+ $itt = 0;
77
+ $productsPortion = array();
78
  }
79
+ }
80
 
81
+ if($itt > 0)
82
+ {
83
+ $this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
84
  }
85
  }
86
  catch (Exception $ex) { }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bubbleyes_BubblitPlugin</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/bsd-license.php">BSDL</license>
7
  <channel>community</channel>
@@ -13,9 +13,9 @@ in a unique and dynamic way: Bubbl!</summary>
13
  - Supporting configuration of the module in the settings administration&#xD;
14
  - Supporting visualization of the BubblitPlugin in the product details page</notes>
15
  <authors><author><name>Terje Lindstad</name><user>tlindstad</user><email>terjelindstad@bubbleyes.com</email></author></authors>
16
- <date>2014-11-04</date>
17
- <time>17:53:07</time>
18
- <contents><target name="magecommunity"><dir><dir name="Bubbleyes"><dir name="BubblitPlugin"><dir name="Block"><file name="Button.php" hash="d67f8f5d61b489598765d35de3afd8ee"/></dir><dir name="Helper"><file name="Data.php" hash="659200e78571aadb5abca0b573953100"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Bubbllayout.php" hash="ea03544f51545df9803dc3fb0d69ce30"/><dir name="Helpinfo"><file name="Comment.php" hash="eaa644af07bf619a06805184e1daffbd"/></dir></dir></dir><file name="Observer.php" hash="93ab085ee6bfee42c019c07bbef2b19b"/></dir><dir name="etc"><file name="config.xml" hash="042fd5e76f03266d2f22e4e7025d06b1"/><file name="system.xml" hash="3b8dde9a695682f52559ee57df8258c2"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Bubbleyes_BubblitPlugin.xml" hash="0691ad097f8ca937d80ad4936607fea5"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="Bubbleyes_BubblitPlugin.xml" hash="2b172171473b55f2c4596f1eacee7e63"/></dir><dir name="template"><dir name="BubblitPlugin"><file name="button.phtml" hash="18199c13f81a042985363824986156c0"/></dir></dir></dir></dir><dir name="Bubbleyes"><dir name="default"><dir name="etc"><file name="theme.xml" hash="5c4fce4eb634014e556a22cec2a76d20"/></dir><dir name="layout"><file name="local.xml" hash="01c78642851f6e17d1057882f893d3c1"/></dir><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="sharing.phtml" hash="5be2544566332d003f3bb16579a96498"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>4.5.0</min><max>10.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bubbleyes_BubblitPlugin</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/bsd-license.php">BSDL</license>
7
  <channel>community</channel>
13
  - Supporting configuration of the module in the settings administration&#xD;
14
  - Supporting visualization of the BubblitPlugin in the product details page</notes>
15
  <authors><author><name>Terje Lindstad</name><user>tlindstad</user><email>terjelindstad@bubbleyes.com</email></author></authors>
16
+ <date>2015-01-22</date>
17
+ <time>14:00:50</time>
18
+ <contents><target name="magecommunity"><dir><dir name="Bubbleyes"><dir name="BubblitPlugin"><dir name="Block"><file name="Button.php" hash="5b9ee082aa8542c2204b1ad86cec1272"/></dir><dir name="Helper"><file name="Data.php" hash="638a8f76ead78a1f84f99b5adc26b2b4"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Bubbllayout.php" hash="ea03544f51545df9803dc3fb0d69ce30"/><dir name="Helpinfo"><file name="Comment.php" hash="eaa644af07bf619a06805184e1daffbd"/></dir></dir></dir><file name="Observer.php" hash="81f04622c37f3f46890bfcc1c28c2b41"/></dir><dir name="etc"><file name="config.xml" hash="042fd5e76f03266d2f22e4e7025d06b1"/><file name="system.xml" hash="3b8dde9a695682f52559ee57df8258c2"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Bubbleyes_BubblitPlugin.xml" hash="0691ad097f8ca937d80ad4936607fea5"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="Bubbleyes_BubblitPlugin.xml" hash="2b172171473b55f2c4596f1eacee7e63"/></dir><dir name="template"><dir name="BubblitPlugin"><file name="button.phtml" hash="18199c13f81a042985363824986156c0"/></dir></dir></dir></dir><dir name="Bubbleyes"><dir name="default"><dir name="etc"><file name="theme.xml" hash="5c4fce4eb634014e556a22cec2a76d20"/></dir><dir name="layout"><file name="local.xml" hash="01c78642851f6e17d1057882f893d3c1"/></dir><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="sharing.phtml" hash="5be2544566332d003f3bb16579a96498"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>4.5.0</min><max>10.0.0</max></php></required></dependencies>
21
  </package>